mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
Added offline data saving/loading handling events
This commit is contained in:
parent
46ded9e675
commit
16be7d42a7
1 changed files with 2 additions and 0 deletions
|
|
@ -205,10 +205,12 @@ class PlayerAPI{
|
||||||
}else{
|
}else{
|
||||||
$data = unserialize(file_get_contents(FILE_PATH."data/players/".$name.".dat"));
|
$data = unserialize(file_get_contents(FILE_PATH."data/players/".$name.".dat"));
|
||||||
}
|
}
|
||||||
|
$this->server->handle("api.player.offline.get", $data);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveOffline($name, $data){
|
public function saveOffline($name, $data){
|
||||||
|
$this->server->handle("api.player.offline.save", $data);
|
||||||
file_put_contents(FILE_PATH."data/players/".str_replace("/", "", $name).".dat", serialize($data));
|
file_put_contents(FILE_PATH."data/players/".str_replace("/", "", $name).".dat", serialize($data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue