test
This commit is contained in:
parent
c027fd458b
commit
eb39d757f4
20
main.go
20
main.go
@ -87,6 +87,20 @@ func main() {
|
|||||||
UpdateFrequency: AdminFrequencyAutomatic,
|
UpdateFrequency: AdminFrequencyAutomatic,
|
||||||
}
|
}
|
||||||
_, err = conn.Write(px.Bytes())
|
_, err = conn.Write(px.Bytes())
|
||||||
|
|
||||||
|
px = PacketAdminUpdateFrequency{
|
||||||
|
Packet: Packet{PType: AdminPacketAdminUpdateFrequency},
|
||||||
|
UpdateType: AdminUpdateChat,
|
||||||
|
UpdateFrequency: AdminFrequencyAutomatic,
|
||||||
|
}
|
||||||
|
_, err = conn.Write(px.Bytes())
|
||||||
|
|
||||||
|
px = PacketAdminUpdateFrequency{
|
||||||
|
Packet: Packet{PType: AdminPacketAdminUpdateFrequency},
|
||||||
|
UpdateType: AdminUpdateConsole,
|
||||||
|
UpdateFrequency: AdminFrequencyAutomatic,
|
||||||
|
}
|
||||||
|
_, err = conn.Write(px.Bytes())
|
||||||
case AdminPacketServerDate:
|
case AdminPacketServerDate:
|
||||||
sp := PacketAdminServerDate{
|
sp := PacketAdminServerDate{
|
||||||
Packet: p,
|
Packet: p,
|
||||||
@ -111,6 +125,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
sp.Read(b[:p.PLength])
|
sp.Read(b[:p.PLength])
|
||||||
logInfoDebug("AdminPacketServerClientError :\n- ClientID: %d\n- ErrorID: %d", sp.ClientID, sp.ErrorID)
|
logInfoDebug("AdminPacketServerClientError :\n- ClientID: %d\n- ErrorID: %d", sp.ClientID, sp.ErrorID)
|
||||||
|
case AdminPacketServerClientQuit:
|
||||||
|
sp := PacketAdminServerClientQuit{
|
||||||
|
Packet: p,
|
||||||
|
}
|
||||||
|
sp.Read(b[:p.PLength])
|
||||||
|
logInfoDebug("AdminPacketServerClientError :\n- ClientID: %d", sp.ClientID)
|
||||||
default:
|
default:
|
||||||
logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType)
|
logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType)
|
||||||
}
|
}
|
||||||
|
@ -240,3 +240,11 @@ func (p *PacketAdminServerClientError) Read(b []byte) {
|
|||||||
c, _ := r.ReadByte()
|
c, _ := r.ReadByte()
|
||||||
p.ErrorID = uint8(c)
|
p.ErrorID = uint8(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PacketAdminServerClientQuit) Read(b []byte) {
|
||||||
|
r := bufio.NewReader(bytes.NewReader(b))
|
||||||
|
r.Discard(3)
|
||||||
|
bs := make([]byte, 4)
|
||||||
|
_, _ = r.Read(bs)
|
||||||
|
p.ClientID = binary.LittleEndian.Uint32(bs[0:])
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user