mirror of https://github.com/LOOHP/Limbo.git
This commit fixes https://github.com/LOOHP/Limbo/issues/51
"Incorrect Payload Received in KeepAlive packet for player" The problem is that in my setup (described in the issue linked above) the loohp-limbo server is receiving an unsolicited PacketInKeepAlive message prior to sending any out. This causes the payload validation check to fail, resulting in the connection then being closed. This commit changes the PacketInKeepAlive handler to ignore (other than logging) unsolicited KeepAlive messages rather than act on them. Possibly the logging is a bad idea unless it's limited to being suppressed via a debug flag...
This commit is contained in:
parent
c40a48b7ba
commit
d29279285e
|
|
@ -613,8 +613,11 @@ public class ClientConnection extends Thread {
|
|||
processMoveEvent.consume(event, to);
|
||||
}
|
||||
} else if (packetIn instanceof PacketPlayInKeepAlive) {
|
||||
long lastPayload = getLastKeepAlivePayLoad();
|
||||
PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn;
|
||||
if (alive.getPayload() != getLastKeepAlivePayLoad()) {
|
||||
if (lastPayload == -1) {
|
||||
Limbo.getInstance().getConsole().sendMessage("Unsolicited KeepAlive packet for player " + player.getName() + " (payload " + String.valueOf(alive.getPayload()) + ")");
|
||||
} else if (alive.getPayload() != lastPayload) {
|
||||
Limbo.getInstance().getConsole().sendMessage("Incorrect Payload received in KeepAlive packet for player " + player.getName());
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue