mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Fixed #142 Server crash while using whitelist
This commit is contained in:
parent
6763e93a8d
commit
6fb8e754d6
@ -258,7 +258,7 @@ class PlayerAPI{
|
|||||||
$this->server->clients[$CID] = null;
|
$this->server->clients[$CID] = null;
|
||||||
unset($this->server->clients[$CID]);
|
unset($this->server->clients[$CID]);
|
||||||
$player->close();
|
$player->close();
|
||||||
if($player->username != ""){
|
if($player->username != "" and ($player->data instanceof Config)){
|
||||||
$this->saveOffline($player->data);
|
$this->saveOffline($player->data);
|
||||||
}
|
}
|
||||||
$this->server->query("DELETE FROM players WHERE name = '".$player->username."';");
|
$this->server->query("DELETE FROM players WHERE name = '".$player->username."';");
|
||||||
|
@ -635,7 +635,9 @@ class Player{
|
|||||||
$this->data->set("lastIP", $this->ip);
|
$this->data->set("lastIP", $this->ip);
|
||||||
$this->data->set("lastID", $this->clientID);
|
$this->data->set("lastID", $this->clientID);
|
||||||
|
|
||||||
|
if($this->data instanceof Config){
|
||||||
$this->server->api->player->saveOffline($this->data);
|
$this->server->api->player->saveOffline($this->data);
|
||||||
|
}
|
||||||
$this->dataPacket(MC_LOGIN_STATUS, array(
|
$this->dataPacket(MC_LOGIN_STATUS, array(
|
||||||
"status" => 0,
|
"status" => 0,
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user