mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Merge branch 'release/3.4'
This commit is contained in:
commit
652256a109
@ -56,7 +56,7 @@ class ChunkRequestTask extends AsyncTask{
|
||||
$stream = new PacketStream();
|
||||
$stream->putPacket($pk);
|
||||
|
||||
$this->setResult(NetworkCompression::compress($stream->buffer, $this->compressionLevel), false);
|
||||
$this->setResult(NetworkCompression::compress($stream->buffer, $this->compressionLevel));
|
||||
}
|
||||
|
||||
public function onCompletion() : void{
|
||||
|
@ -42,7 +42,7 @@ class CompressBatchTask extends AsyncTask{
|
||||
}
|
||||
|
||||
public function onRun() : void{
|
||||
$this->setResult(NetworkCompression::compress($this->data, $this->level), false);
|
||||
$this->setResult(NetworkCompression::compress($this->data, $this->level));
|
||||
}
|
||||
|
||||
public function onCompletion() : void{
|
||||
|
@ -107,11 +107,9 @@ abstract class AsyncTask extends Collectable{
|
||||
|
||||
/**
|
||||
* @param mixed $result
|
||||
* @param bool $serialize
|
||||
*/
|
||||
public function setResult($result, bool $serialize = true) : void{
|
||||
$this->result = $serialize ? serialize($result) : $result;
|
||||
$this->serialized = $serialize;
|
||||
public function setResult($result) : void{
|
||||
$this->result = ($this->serialized = !is_scalar($result)) ? serialize($result) : $result;
|
||||
}
|
||||
|
||||
public function setSubmitted() : void{
|
||||
|
@ -58,7 +58,7 @@ class UpdateCheckTask extends AsyncTask{
|
||||
isset($response["download_url"])
|
||||
){
|
||||
$response["details_url"] = $response["details_url"] ?? null;
|
||||
$this->setResult($response, true);
|
||||
$this->setResult($response);
|
||||
}elseif(isset($response["error"])){
|
||||
$this->error = $response["error"];
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user