mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +00:00
Fix player timeouts crashing the server
This commit is contained in:
parent
f32e880542
commit
6ff92f2adf
@ -3462,7 +3462,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
$this->interface->close($this, $notify ? $reason : "");
|
||||
|
||||
$this->loggedIn = false;
|
||||
if($this->loggedIn){
|
||||
$this->loggedIn = false;
|
||||
$this->server->removeOnlinePlayer($this);
|
||||
}
|
||||
|
||||
$this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logOut", [
|
||||
TextFormat::AQUA . $this->getName() . TextFormat::WHITE,
|
||||
@ -3486,7 +3489,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}catch(\Throwable $e){
|
||||
$this->server->getLogger()->logException($e);
|
||||
}finally{
|
||||
$this->server->removeOnlinePlayer($this);
|
||||
$this->server->removePlayer($this);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user