mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Correct call of destruct chain to release PMF file locks at unload
This commit is contained in:
@ -45,6 +45,10 @@ class Level{
|
||||
$this->changedCount = array();
|
||||
}
|
||||
|
||||
public function close(){
|
||||
$this->__destruct();
|
||||
}
|
||||
|
||||
public function useChunk($X, $Z, Player $player){
|
||||
if(!isset($this->usedChunks[$X.".".$Z])){
|
||||
$this->usedChunks[$X.".".$Z] = array();
|
||||
@ -118,6 +122,7 @@ class Level{
|
||||
|
||||
public function __destruct(){
|
||||
$this->save();
|
||||
$this->level->close();
|
||||
unset($this->level);
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,12 @@ class LevelImport{
|
||||
}
|
||||
|
||||
public function import(){
|
||||
if(file_exists($this->path."tiles.dat")){ //OldPM
|
||||
if(file_exists($this->path."tileEntities.dat")){ //OldPM
|
||||
$level = unserialize(file_get_contents($this->path."level.dat"));
|
||||
console("[INFO] Importing OldPM level \"".$level["LevelName"]."\" to PMF format");
|
||||
$entities = new Config($this->path."entities.yml", CONFIG_YAML, unserialize(file_get_contents($this->path."entities.dat")));
|
||||
$entities->save();
|
||||
$tiles = new Config($this->path."tiles.yml", CONFIG_YAML, unserialize(file_get_contents($this->path."tiles.dat")));
|
||||
$tiles = new Config($this->path."tiles.yml", CONFIG_YAML, unserialize(file_get_contents($this->path."tileEntities.dat")));
|
||||
$tiles->save();
|
||||
}elseif(file_exists($this->path."chunks.dat") and file_exists($this->path."level.dat")){ //Pocket
|
||||
$nbt = new NBT();
|
||||
|
Reference in New Issue
Block a user