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
/
packet_helo_autogen.go
98 lines (93 loc) · 1.91 KB
/
packet_helo_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
// This file is automatically generated. DO NOT MODIFY!
package lumina
func (*HeloPacket) getType() PacketType {
return PKT_HELO
}
func (*HeloPacket) getResponseType() PacketType {
return PKT_RPC_OK
}
func (this *HeloPacket) readFrom(r Reader) (err error) {
// Field this.ClientVersion
// Basic int32
if this.ClientVersion, err = readInt32(r); err != nil {
return
}
// Field this.Key
// Slice []byte
var v1 uint32
if v1, err = readUint32(r); err != nil {
return
}
this.Key = make([]byte, v1)
if err = readBytes(r, this.Key); err != nil {
return
}
// Field this.LicenseId
// Array [6]byte
if err = readBytes(r, this.LicenseId[:]); err != nil {
return
}
// Field this.RecordConv
// Basic bool
if this.RecordConv, err = readBool(r); err != nil {
return
}
if this.ClientVersion < 3 {
return
}
// Field this.Username
// Basic string
if this.Username, err = readString(r); err != nil {
return
}
// Field this.Password
// Basic string
if this.Password, err = readString(r); err != nil {
return
}
return
}
func (this *HeloPacket) writeTo(w Writer) (err error) {
// Field this.ClientVersion
// Basic int32
if err = writeInt32(w, this.ClientVersion); err != nil {
return
}
// Field this.Key
// Slice []byte
if len(this.Key) > 0x7FFFFFFF {
err = errTooLong
return
}
var v1 = uint32(len(this.Key))
if err = writeUint32(w, v1); err != nil {
return
}
if err = writeBytes(w, this.Key); err != nil {
return
}
// Field this.LicenseId
// Array [6]byte
if err = writeBytes(w, this.LicenseId[:]); err != nil {
return
}
// Field this.RecordConv
// Basic bool
if err = writeBool(w, this.RecordConv); err != nil {
return
}
if this.ClientVersion < 3 {
return
}
// Field this.Username
// Basic string
if err = writeString(w, this.Username); err != nil {
return
}
// Field this.Password
// Basic string
if err = writeString(w, this.Password); err != nil {
return
}
return
}