mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 18:04:07 +00:00
Added extra chunk sending timings
This commit is contained in:
parent
d57e37896d
commit
c4c374e3fa
@ -56,6 +56,11 @@ class LevelTimings{
|
|||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
public $tickEntities;
|
public $tickEntities;
|
||||||
|
|
||||||
|
/** @var TimingsHandler */
|
||||||
|
public $syncChunkSendTimer;
|
||||||
|
/** @var TimingsHandler */
|
||||||
|
public $syncChunkSendPrepareTimer;
|
||||||
|
|
||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
public $syncChunkLoadTimer;
|
public $syncChunkLoadTimer;
|
||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
@ -87,6 +92,9 @@ class LevelTimings{
|
|||||||
$this->tileEntityTick = new TimingsHandler("** " . $name . "tileEntityTick");
|
$this->tileEntityTick = new TimingsHandler("** " . $name . "tileEntityTick");
|
||||||
$this->tileEntityPending = new TimingsHandler("** " . $name . "tileEntityPending");
|
$this->tileEntityPending = new TimingsHandler("** " . $name . "tileEntityPending");
|
||||||
|
|
||||||
|
$this->syncChunkSendTimer = new TimingsHandler("** " . $name . "syncChunkSend");
|
||||||
|
$this->syncChunkSendPrepareTimer = new TimingsHandler("** " . $name . "syncChunkSendPrepare");
|
||||||
|
|
||||||
$this->syncChunkLoadTimer = new TimingsHandler("** " . $name . "syncChunkLoad");
|
$this->syncChunkLoadTimer = new TimingsHandler("** " . $name . "syncChunkLoad");
|
||||||
$this->syncChunkLoadDataTimer = new TimingsHandler("** " . $name . "syncChunkLoad - Data");
|
$this->syncChunkLoadDataTimer = new TimingsHandler("** " . $name . "syncChunkLoad - Data");
|
||||||
$this->syncChunkLoadStructuresTimer = new TimingsHandler("** " . $name . "syncChunkLoad - Structures");
|
$this->syncChunkLoadStructuresTimer = new TimingsHandler("** " . $name . "syncChunkLoad - Structures");
|
||||||
|
@ -1694,6 +1694,8 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
protected function processChunkRequest(){
|
protected function processChunkRequest(){
|
||||||
if(count($this->chunkSendQueue) > 0){
|
if(count($this->chunkSendQueue) > 0){
|
||||||
|
$this->timings->syncChunkSendTimer->startTiming();
|
||||||
|
|
||||||
$x = null;
|
$x = null;
|
||||||
$z = null;
|
$z = null;
|
||||||
foreach($this->chunkSendQueue as $index => $players){
|
foreach($this->chunkSendQueue as $index => $players){
|
||||||
@ -1711,12 +1713,16 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
unset($this->chunkSendQueue[$index]);
|
unset($this->chunkSendQueue[$index]);
|
||||||
}else{
|
}else{
|
||||||
$this->chunkSendTasks[$index] = true;
|
$this->chunkSendTasks[$index] = true;
|
||||||
|
$this->timings->syncChunkSendPrepareTimer->startTiming();
|
||||||
$task = $this->provider->requestChunkTask($x, $z);
|
$task = $this->provider->requestChunkTask($x, $z);
|
||||||
if($task instanceof AsyncTask){
|
if($task instanceof AsyncTask){
|
||||||
$this->server->getScheduler()->scheduleAsyncTask($task);
|
$this->server->getScheduler()->scheduleAsyncTask($task);
|
||||||
}
|
}
|
||||||
|
$this->timings->syncChunkSendPrepareTimer->stopTiming();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->timings->syncChunkSendTimer->stopTiming();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user