test
This commit is contained in:
parent
6a615105b1
commit
bc9beea374
25
main.go
25
main.go
@ -61,9 +61,30 @@ func main() {
|
||||
|
||||
}
|
||||
|
||||
logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType)
|
||||
switch p.PType {
|
||||
case AdminPacketServerProtocol:
|
||||
sp := PacketAdminServerProtocol{
|
||||
Packet: p,
|
||||
}
|
||||
sp.Read(b[:p.PLength])
|
||||
logInfoDebug("AdminPacketServerProtocol :\n- ProtocolVersion: %v\n- FurtherData: %v\n- UpdatePacketType: %v\n- FrequenciesAllowed: %b", sp.ProtocolVersion, sp.FurtherData, sp.UpdatePacketType, sp.FrequenciesAllowed)
|
||||
case AdminPacketServerWelcome:
|
||||
sp := PacketAdminServerWelcome{
|
||||
Packet: p,
|
||||
}
|
||||
sp.Read(b[:p.PLength])
|
||||
logInfoDebug("AdminPacketServerWelcome :\n- ServerName: %v\n- OpenTTDVersion: %v\n- Dedicated: %v\n- MapSeed: %x\n- MapLandscape: %v\n- MapStartDate: %v\n- Size: %v x %v", sp.ServerName, sp.OpenTTDVersion, sp.Dedicated, sp.MapSeed, sp.MapLandscape, sp.MapStartDate, sp.MapX, sp.MapY)
|
||||
px := PacketAdminUpdateFrequency{
|
||||
Packet: Packet{PType: AdminPacketAdminUpdateFrequency},
|
||||
UpdateType: AdminUpdateDate,
|
||||
UpdateFrequency: AdminFrequencyDaily,
|
||||
}
|
||||
_, err = conn.Write(p.Bytes())
|
||||
default:
|
||||
logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType)
|
||||
}
|
||||
|
||||
handlePacket(p, b[:p.PLength])
|
||||
readPacket(p, b[:p.PLength])
|
||||
|
||||
c := make([]byte, 0xFFFF)
|
||||
copy(c, b[p.PLength:])
|
||||
|
Loading…
Reference in New Issue
Block a user