mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Fixed array progress crashing
Forgot to serialize them. They would be converted to Volatile, which is Threaded. Threaded objects still crash with progressUpdates.
This commit is contained in:
parent
d5881dbe83
commit
75fa2f1132
@ -178,7 +178,7 @@ abstract class AsyncTask extends Collectable{
|
|||||||
* @param mixed $progress A value that can be safely serialize()'ed.
|
* @param mixed $progress A value that can be safely serialize()'ed.
|
||||||
*/
|
*/
|
||||||
public function publishProgress($progress){
|
public function publishProgress($progress){
|
||||||
$this->progressUpdates[] = $progress;
|
$this->progressUpdates[] = serialize($progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,9 +187,9 @@ abstract class AsyncTask extends Collectable{
|
|||||||
* @param Server $server
|
* @param Server $server
|
||||||
*/
|
*/
|
||||||
public function checkProgressUpdates(Server $server){
|
public function checkProgressUpdates(Server $server){
|
||||||
if($this->progressUpdates->count() !== 0){
|
while($this->progressUpdates->count() !== 0){
|
||||||
$progress = $this->progressUpdates->shift();
|
$progress = $this->progressUpdates->shift();
|
||||||
$this->onProgressUpdate($server, $progress);
|
$this->onProgressUpdate($server, unserialize($progress));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user