Command parse compound

This commit is contained in:
Tnze
2022-01-03 15:57:54 +08:00
parent 9433dd98de
commit be3a834696
13 changed files with 250 additions and 114 deletions

View File

@ -121,14 +121,10 @@ func (k *KeepAlive) pingPlayer(now time.Time) {
if elem := k.pingList.Front(); elem != nil {
p := k.pingList.Remove(elem).(keepAliveItem).player
// Send Clientbound KeepAlive packet.
err := p.WritePacket(Packet757(pk.Marshal(
p.WritePacket(Packet757(pk.Marshal(
packetid.ClientboundKeepAlive,
pk.Long(k.keepAliveID),
)))
if err != nil {
p.PutErr(err)
return
}
k.keepAliveID++
// Clientbound KeepAlive packet is sent, move the player to waiting list.
k.listIndex[p.UUID] = k.waitList.PushBack(