diff --git a/src/Player.php b/src/Player.php index bfaad696..6c90cb8d 100755 --- a/src/Player.php +++ b/src/Player.php @@ -226,7 +226,7 @@ class Player{ $this->chatMessagesQueue->data = []; $this->server->schedule(20 * 60, [$this, "clearQueue"], [], true); - $this->server->interface->maxACKsAllowed["{$this->ip}:{$this->port}"] = 0; + $this->server->interface->init($this->ip, $this->port); $this->evid[] = $this->server->event("server.close", [$this, "close"]); console("[DEBUG] New Session started with $ip:$port. MTU {$this->MTU}, Client ID {$this->clientID}", true, true, 2); } @@ -2032,7 +2032,8 @@ class Player{ } public function __destruct(){ //pwease dont leak memory >_< - $this->server->interface->clear($this->ip, $this->port); + $server = ServerAPI::request(); + $server->interface->clear($this->ip, $this->port); } public function save(){ diff --git a/src/network/MinecraftInterface.php b/src/network/MinecraftInterface.php index a1bbaef5..a76ef623 100644 --- a/src/network/MinecraftInterface.php +++ b/src/network/MinecraftInterface.php @@ -42,6 +42,13 @@ class MinecraftInterface{ unset($this->maxRecordedSeq[$id]); unset($this->maxNACKsAllowed[$id]); } + public function init($ip, $port){ + $id = "$ip:$port"; + $this->maxACKsAllowed[$id] = 0; + unset($this->maxRecordedSeq[$id]); + $this->maxNACKsAllowed[$id] = 0; + } + /**