Merge remote-tracking branch 'upstream/master' into fix-issue-54

This commit is contained in:
Tad Hunt 2022-09-29 16:15:32 -06:00
commit 4d1fade2e7
1 changed files with 4 additions and 1 deletions

View File

@ -672,8 +672,11 @@ public class ClientConnection extends Thread {
processMoveEvent.consume(event, to); processMoveEvent.consume(event, to);
} }
} else if (packetIn instanceof PacketPlayInKeepAlive) { } else if (packetIn instanceof PacketPlayInKeepAlive) {
long lastPayload = getLastKeepAlivePayLoad();
PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn; PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn;
if (alive.getPayload() != getLastKeepAlivePayLoad()) { if (lastPayload == -1) {
Limbo.getInstance().getConsole().sendMessage("Unsolicited KeepAlive packet for player " + player.getName());
} else if (alive.getPayload() != lastPayload) {
Limbo.getInstance().getConsole().sendMessage("Incorrect Payload received in KeepAlive packet for player " + player.getName()); Limbo.getInstance().getConsole().sendMessage("Incorrect Payload received in KeepAlive packet for player " + player.getName());
break; break;
} }