mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-02 00:02:57 +00:00
shut
This commit is contained in:
parent
8e37f86480
commit
527e975fa9
@ -537,8 +537,12 @@ class Server{
|
|||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
Timings::$syncPlayerDataSave->time(function() use ($name, $ev) : void{
|
Timings::$syncPlayerDataSave->time(function() use ($name, $ev) : void{
|
||||||
$nbt = new BigEndianNbtSerializer();
|
$nbt = new BigEndianNbtSerializer();
|
||||||
|
$contents = zlib_encode($nbt->write(new TreeRoot($ev->getSaveData())), ZLIB_ENCODING_GZIP);
|
||||||
|
if($contents === false){
|
||||||
|
throw new AssumptionFailedError("zlib_encode() failed unexpectedly");
|
||||||
|
}
|
||||||
try{
|
try{
|
||||||
Filesystem::safeFilePutContents($this->getPlayerDataPath($name), zlib_encode($nbt->write(new TreeRoot($ev->getSaveData())), ZLIB_ENCODING_GZIP));
|
Filesystem::safeFilePutContents($this->getPlayerDataPath($name), $contents);
|
||||||
}catch(\RuntimeException | \ErrorException $e){
|
}catch(\RuntimeException | \ErrorException $e){
|
||||||
$this->logger->critical($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_data_saveError($name, $e->getMessage())));
|
$this->logger->critical($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_data_saveError($name, $e->getMessage())));
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user