Fixed kicking players not working properly

This commit is contained in:
Dylan K. Taylor
2017-04-18 16:15:38 +01:00
parent 6828ce66b6
commit 17e4f45e97
2 changed files with 21 additions and 9 deletions

View File

@ -31,11 +31,13 @@ class CompressBatchedTask extends AsyncTask{
public $data;
public $final;
public $targets;
public $immediate = false;
public function __construct(BatchPacket $data, array $targets, $level = 7){
public function __construct(BatchPacket $data, array $targets, $level = 7, bool $sendImmediate = false){
$this->data = serialize($data);
$this->targets = $targets;
$this->level = $level;
$this->immediate = $sendImmediate;
}
public function onRun(){
@ -51,6 +53,6 @@ class CompressBatchedTask extends AsyncTask{
}
public function onCompletion(Server $server){
$server->broadcastPacketsCallback(unserialize($this->final), (array) $this->targets);
$server->broadcastPacketsCallback(unserialize($this->final), (array) $this->targets, $this->immediate);
}
}