Хэндшейк, сервисы, аннотационные блокировки в протоколе, репозитории

This commit is contained in:
RoyceDa
2026-02-03 05:42:46 +02:00
parent 4c290a01ac
commit 9b715df09d
12 changed files with 457 additions and 20 deletions

View File

@@ -46,7 +46,7 @@ public class Client {
this.eciTags = new HashMap<Class<? extends ECITag>, ECITag>();
this.heartbeatInterval = heartbeatInterval;
this.lastHeartbeatTime = System.currentTimeMillis();
this.packetManager = new PacketManager();
this.packetManager = packetManager;
}
/**
@@ -57,7 +57,7 @@ public class Client {
* @return
*/
public boolean isAlive() {
return (System.currentTimeMillis() - this.lastHeartbeatTime) * 2 <= this.heartbeatInterval * 1000;
return (System.currentTimeMillis() - this.lastHeartbeatTime) <= ((this.heartbeatInterval * 1000) * 2);
}
/**