mirror of https://github.com/LOOHP/Limbo.git
Refactor
This commit is contained in:
parent
952adcfe87
commit
8ec2d34a60
|
|
@ -155,7 +155,6 @@ public class ClientConnection extends Thread {
|
||||||
|
|
||||||
private static final Key DEFAULT_HANDLER_NAMESPACE = Key.key("default");
|
private static final Key DEFAULT_HANDLER_NAMESPACE = Key.key("default");
|
||||||
private static final String BRAND_ANNOUNCE_CHANNEL = Key.key("brand").toString();
|
private static final String BRAND_ANNOUNCE_CHANNEL = Key.key("brand").toString();
|
||||||
private final AtomicLong lastKeepAliveResponse = new AtomicLong(System.currentTimeMillis());
|
|
||||||
|
|
||||||
private final Random random = new Random();
|
private final Random random = new Random();
|
||||||
private final Socket clientSocket;
|
private final Socket clientSocket;
|
||||||
|
|
@ -163,10 +162,12 @@ public class ClientConnection extends Thread {
|
||||||
private boolean running;
|
private boolean running;
|
||||||
private volatile ClientState state;
|
private volatile ClientState state;
|
||||||
|
|
||||||
|
private final AtomicLong lastPacketTimestamp;
|
||||||
|
private final AtomicLong lastKeepAlivePayLoad;
|
||||||
|
private final AtomicLong lastKeepAliveResponse;
|
||||||
|
|
||||||
private Player player;
|
private Player player;
|
||||||
private TimerTask keepAliveTask;
|
private TimerTask keepAliveTask;
|
||||||
private AtomicLong lastPacketTimestamp;
|
|
||||||
private AtomicLong lastKeepAlivePayLoad;
|
|
||||||
private InetAddress inetAddress;
|
private InetAddress inetAddress;
|
||||||
private boolean ready;
|
private boolean ready;
|
||||||
|
|
||||||
|
|
@ -175,6 +176,7 @@ public class ClientConnection extends Thread {
|
||||||
this.inetAddress = clientSocket.getInetAddress();
|
this.inetAddress = clientSocket.getInetAddress();
|
||||||
this.lastPacketTimestamp = new AtomicLong(-1);
|
this.lastPacketTimestamp = new AtomicLong(-1);
|
||||||
this.lastKeepAlivePayLoad = new AtomicLong(-1);
|
this.lastKeepAlivePayLoad = new AtomicLong(-1);
|
||||||
|
this.lastKeepAliveResponse = new AtomicLong(-1);
|
||||||
this.channel = null;
|
this.channel = null;
|
||||||
this.running = false;
|
this.running = false;
|
||||||
this.ready = false;
|
this.ready = false;
|
||||||
|
|
@ -192,6 +194,10 @@ public class ClientConnection extends Thread {
|
||||||
this.lastKeepAlivePayLoad.set(payLoad);
|
this.lastKeepAlivePayLoad.set(payLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getLastKeepAliveResponse() {
|
||||||
|
return lastKeepAliveResponse.get();
|
||||||
|
}
|
||||||
|
|
||||||
public long getLastPacketTimestamp() {
|
public long getLastPacketTimestamp() {
|
||||||
return lastPacketTimestamp.get();
|
return lastPacketTimestamp.get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue