public function chunkRequestCallback($x, $z, $payload) { $index = PHP_INT_SIZE === 8 ? ($x & 4294967295.0) << 32 | $z & 4294967295.0 : $x . ":" . $z; if (isset($this->chunkSendTasks[$index])) { if (ADVANCED_CACHE == true) { Cache::add("world:" . $this->getId() . ":" . $index, $payload, 60); } foreach ($this->chunkSendQueue[$index] as $player) { /** @var Player $player */ if ($player->isConnected() and isset($player->usedChunks[$index])) { $player->sendChunk($x, $z, $payload); } } unset($this->chunkSendQueue[$index]); unset($this->chunkSendTasks[$index]); } }
public function chunkRequestCallback($x, $z, $payload) { $index = Level::chunkHash($x, $z); if (isset($this->chunkSendTasks[$index])) { if (ADVANCED_CACHE == true) { Cache::add("world:" . $this->getID() . ":" . $index, $payload, 60); } foreach ($this->chunkSendQueue[$index] as $player) { /** @var Player $player */ if (isset($player->usedChunks[$index])) { $player->sendChunk($x, $z, $payload); } } unset($this->chunkSendQueue[$index]); unset($this->chunkSendTasks[$index]); } }