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