mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Undo my -100IQ fuckup with chunk sending precondition
the commit I reverted put the preconditions in the completion handler,
which is executed AFTER THE CHUNK IS SENT.
Revert "NetworkSession: allow Player to handle its own business in chunk sending"
This reverts commit a223d1cbf3
.
This commit is contained in:
@ -914,10 +914,15 @@ class NetworkSession{
|
||||
ChunkCache::getInstance($world, $this->compressor)->request($chunkX, $chunkZ)->onResolve(
|
||||
|
||||
//this callback may be called synchronously or asynchronously, depending on whether the promise is resolved yet
|
||||
function(CompressBatchPromise $promise) use ($world, $onCompletion) : void{
|
||||
function(CompressBatchPromise $promise) use ($world, $onCompletion, $chunkX, $chunkZ) : void{
|
||||
if(!$this->isConnected()){
|
||||
return;
|
||||
}
|
||||
$currentWorld = $this->player->getLocation()->getWorld();
|
||||
if($world !== $currentWorld or !$this->player->isUsingChunk($chunkX, $chunkZ)){
|
||||
$this->logger->debug("Tried to send no-longer-active chunk $chunkX $chunkZ in world " . $world->getFolderName());
|
||||
return;
|
||||
}
|
||||
$world->timings->syncChunkSend->startTiming();
|
||||
try{
|
||||
$this->queueCompressed($promise);
|
||||
|
Reference in New Issue
Block a user