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