mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Added offline data saving/loading handling events
This commit is contained in:
parent
46ded9e675
commit
16be7d42a7
@ -205,10 +205,12 @@ class PlayerAPI{
|
||||
}else{
|
||||
$data = unserialize(file_get_contents(FILE_PATH."data/players/".$name.".dat"));
|
||||
}
|
||||
$this->server->handle("api.player.offline.get", $data);
|
||||
return $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));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user