This commit is contained in:
shoopea 2020-06-15 12:46:48 +02:00
parent fdd9cdede0
commit c8e3a16554

View File

@ -104,6 +104,11 @@ type PacketAdminUpdateFrequency struct {
UpdateFrequency uint16 UpdateFrequency uint16
} }
type PacketAdminServerDate struct {
Packet
Date uint32
}
func (p *PacketAdminJoin) Bytes() []byte { func (p *PacketAdminJoin) Bytes() []byte {
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
p.PLength = uint16(len(p.Password) + len(p.AppName) + len(p.AppVersion) + 6) 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:]) 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:])
} }