mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Added PocketMinecraftServer::process() limit based on #436
This commit is contained in:
parent
55cfc2895d
commit
26ce2e9e13
@ -553,12 +553,17 @@ class PocketMinecraftServer{
|
||||
}
|
||||
|
||||
public function process(){
|
||||
$lastLoop = 0;
|
||||
while($this->stop === false){
|
||||
$packet = $this->interface->readPacket();
|
||||
if($packet !== false){
|
||||
$this->packetHandler($packet);
|
||||
$lastLoop = 0;
|
||||
}else{
|
||||
usleep(1);
|
||||
++$lastLoop;
|
||||
if($lastLoop >= 16){
|
||||
usleep(5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user