mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Better Player queue completion limited by time
This commit is contained in:
parent
949ab34b42
commit
f7a12b09f7
@ -156,14 +156,11 @@ class Player{
|
||||
}
|
||||
if($time > $this->timeout){
|
||||
$this->close("timeout");
|
||||
}else{
|
||||
if($this->nextBuffer <= $time and strlen($this->buffer) > 0){
|
||||
$this->sendBuffer();
|
||||
}
|
||||
|
||||
}else{
|
||||
if(!empty($this->queue)){
|
||||
$cnt = 0;
|
||||
while($cnt < 4){
|
||||
$maxtime = $time + 0.025;
|
||||
while(microtime(true) < $maxtime){
|
||||
$p = array_shift($this->queue);
|
||||
if($p === null){
|
||||
break;
|
||||
@ -179,6 +176,10 @@ class Player{
|
||||
++$cnt;
|
||||
}
|
||||
}
|
||||
|
||||
if($this->nextBuffer <= $time and strlen($this->buffer) > 0){
|
||||
$this->sendBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user