small tweaks

This commit is contained in:
GameHerobrine 2026-11-02 03:36:26 +03:00
parent f377361ff0
commit 8208e4119c
2 changed files with 10 additions and 2 deletions

View file

@ -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(){

View file

@ -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;
}
/**