This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpacket_pull_md_autogen.go
99 lines (94 loc) · 2 KB
/
packet_pull_md_autogen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// This file is automatically generated. DO NOT MODIFY!
package lumina
func (*PullMdPacket) getType() PacketType {
return PKT_PULL_MD
}
func (*PullMdPacket) getResponseType() PacketType {
return PKT_PULL_MD_RESULT
}
func (this *PullMdPacket) readFrom(r Reader) (err error) {
// Field this.Flags
// Basic uint32
// Typed MdKeyFlag
var v1 uint32
if v1, err = readUint32(r); err != nil {
return
}
this.Flags = MdKeyFlag(v1)
// Field this.Keys
// Slice []MdKey
var v2 uint32
if v2, err = readUint32(r); err != nil {
return
}
this.Keys = make([]MdKey, v2)
for v3 := uint32(0); v3 < v2; v3++ {
// Field this.Keys[v3]
// Basic uint32
// Typed MdKey
var v4 uint32
if v4, err = readUint32(r); err != nil {
return
}
this.Keys[v3] = MdKey(v4)
}
// Field this.PatternIds
// Slice []PatternId
var v5 uint32
if v5, err = readUint32(r); err != nil {
return
}
this.PatternIds = make([]PatternId, v5)
for v6 := uint32(0); v6 < v5; v6++ {
// Field this.PatternIds[v6]
// Struct PatternId
if err = this.PatternIds[v6].readFrom(r); err != nil {
return
}
}
return
}
func (this *PullMdPacket) writeTo(w Writer) (err error) {
// Field this.Flags
// Basic uint32
// Typed MdKeyFlag
if err = writeUint32(w, uint32(this.Flags)); err != nil {
return
}
// Field this.Keys
// Slice []MdKey
if len(this.Keys) > 0x7FFFFFFF {
err = errTooLong
return
}
var v2 = uint32(len(this.Keys))
if err = writeUint32(w, v2); err != nil {
return
}
for v3 := uint32(0); v3 < v2; v3++ {
// Field this.Keys[v3]
// Basic uint32
// Typed MdKey
if err = writeUint32(w, uint32(this.Keys[v3])); err != nil {
return
}
}
// Field this.PatternIds
// Slice []PatternId
if len(this.PatternIds) > 0x7FFFFFFF {
err = errTooLong
return
}
var v5 = uint32(len(this.PatternIds))
if err = writeUint32(w, v5); err != nil {
return
}
for v6 := uint32(0); v6 < v5; v6++ {
// Field this.PatternIds[v6]
// Struct PatternId
if err = this.PatternIds[v6].writeTo(w); err != nil {
return
}
}
return
}