packet sending is not handled by tickerFunction anymore

This commit is contained in:
GameHerobrine 2024-02-15 05:25:54 +03:00
parent fc334e7c99
commit 19a66be51a
2 changed files with 6 additions and 2 deletions

View file

@ -111,7 +111,6 @@ class Player{
$this->blockUpdateQueue->data = [];
//$this->server->schedule(20 * 60, [$this, "clearQueue"], [], true);
$this->server->schedule(1, [$this, "handlePacketQueues"], [], true);
$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);
@ -1066,8 +1065,8 @@ class Player{
if($this->connected === false){
return false;
}
ksort($this->received);
if(($cnt = count($this->received)) > PLAYER_MAX_QUEUE){
ksort($this->received);
foreach($this->received as $c => $t){
unset($this->received[$c]);
--$cnt;

View file

@ -595,6 +595,11 @@ class PocketMinecraftServer{
$this->tickMeasure[] = $this->lastTick = $time;
unset($this->tickMeasure[key($this->tickMeasure)]);
++$this->ticks;
foreach($this->clients as $client){
$client->handlePacketQueues();
}
foreach($this->api->level->levels as $l){
$l->onTick($this, $time);
}