Fixed broadcasting quit messages to quitting player, fixed accessing permission of closed players on quit

This commit is contained in:
Dylan K. Taylor 2017-02-28 10:43:11 +00:00
parent cfb6856634
commit c3fb2e9f23

View File

@ -3124,12 +3124,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->loggedIn = false;
$this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_USERS, $this);
$this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
if(isset($ev) and $this->username != "" and $this->spawned !== false and $ev->getQuitMessage() != ""){
$this->server->broadcastMessage($ev->getQuitMessage());
}
$this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_USERS, $this);
$this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
$this->spawned = false;
$this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logOut", [
TextFormat::AQUA . $this->getName() . TextFormat::WHITE,