test
This commit is contained in:
parent
fdd9cdede0
commit
c8e3a16554
12
packet.go
12
packet.go
@ -104,6 +104,11 @@ type PacketAdminUpdateFrequency struct {
|
||||
UpdateFrequency uint16
|
||||
}
|
||||
|
||||
type PacketAdminServerDate struct {
|
||||
Packet
|
||||
Date uint32
|
||||
}
|
||||
|
||||
func (p *PacketAdminJoin) Bytes() []byte {
|
||||
buf := new(bytes.Buffer)
|
||||
p.PLength = uint16(len(p.Password) + len(p.AppName) + len(p.AppVersion) + 6)
|
||||
@ -171,6 +176,11 @@ func (p *PacketAdminServerProtocol) Read(b []byte) {
|
||||
p.FrequenciesAllowed = binary.LittleEndian.Uint16(bs[2:])
|
||||
}
|
||||
|
||||
func readPacket(p Packet, b []byte) {
|
||||
func (p *PacketAdminServerDate) Read(b []byte) {
|
||||
r := bufio.NewReader(bytes.NewReader(b))
|
||||
r.Discard(3)
|
||||
bs := make([]byte, 4)
|
||||
_, _ = r.Read(bs)
|
||||
p.Date = binary.LittleEndian.Uint32(bs[0:])
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user