forked from BLOCKFANTASY/LOOHP-Limbo
Fixed player getting "Timed out" while standing still due to Keep-Alive not being sent correctly \\ Replaced return with canceling the task (oops).
This commit is contained in:
1 parent
df47c40998
commit
33dacf02db
1 file changed
+2
-2
@@ -569,14 +569,14 @@ public class ClientConnection extends Thread {
|
||||
keepAliveTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (state != ClientState.PLAY || !ready) return;
|
||||
if (state != ClientState.PLAY || !ready) this.cancel(); // oops
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
PacketPlayOutKeepAlive keepAlive = new PacketPlayOutKeepAlive(now);
|
||||
try {
|
||||
sendPacket(keepAlive);
|
||||
setLastKeepAlivePayLoad(now);
|
||||
} catch (IOException ignored) {}
|
||||
} catch (IOException ignored) {cancel();}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user