mirror of https://github.com/LOOHP/Limbo.git
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:
parent
df47c40998
commit
33dacf02db
|
|
@ -569,14 +569,14 @@ public class ClientConnection extends Thread {
|
||||||
keepAliveTask = new TimerTask() {
|
keepAliveTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (state != ClientState.PLAY || !ready) return;
|
if (state != ClientState.PLAY || !ready) this.cancel(); // oops
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
PacketPlayOutKeepAlive keepAlive = new PacketPlayOutKeepAlive(now);
|
PacketPlayOutKeepAlive keepAlive = new PacketPlayOutKeepAlive(now);
|
||||||
try {
|
try {
|
||||||
sendPacket(keepAlive);
|
sendPacket(keepAlive);
|
||||||
setLastKeepAlivePayLoad(now);
|
setLastKeepAlivePayLoad(now);
|
||||||
} catch (IOException ignored) {}
|
} catch (IOException ignored) {cancel();}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue