data = $batch->payload; $this->level = $batch->getCompressionLevel(); $this->storeLocal($targets); } public function onRun(){ $batch = new BatchPacket(); $batch->payload = $this->data; $this->data = null; $batch->setCompressionLevel($this->level); $batch->encode(); $this->setResult($batch->buffer); } public function onCompletion(Server $server){ $pk = new BatchPacket($this->getResult()); $pk->isEncoded = true; /** @var Player[] $targets */ $targets = $this->fetchLocal(); $server->broadcastPacketsCallback($pk, $targets); } }