mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49: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(){
|
public function process(){
|
||||||
|
$lastLoop = 0;
|
||||||
while($this->stop === false){
|
while($this->stop === false){
|
||||||
$packet = $this->interface->readPacket();
|
$packet = $this->interface->readPacket();
|
||||||
if($packet !== false){
|
if($packet !== false){
|
||||||
$this->packetHandler($packet);
|
$this->packetHandler($packet);
|
||||||
|
$lastLoop = 0;
|
||||||
}else{
|
}else{
|
||||||
usleep(1);
|
++$lastLoop;
|
||||||
|
if($lastLoop >= 16){
|
||||||
|
usleep(5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user