Just cut the adapter loose instead of needing extra fields for this

This commit is contained in:
Dylan K. Taylor
2017-07-12 12:26:37 +01:00
parent 650afe2d94
commit e485999218
2 changed files with 4 additions and 9 deletions

View File

@ -3165,7 +3165,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
* @param DataPacket $packet
*/
public function handleDataPacket(DataPacket $packet){
$this->sessionAdapter->handleDataPacket($packet);
if($this->sessionAdapter !== null){
$this->sessionAdapter->handleDataPacket($packet);
}
}
/**
@ -3389,7 +3391,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->directDataPacket($pk);
}
$this->sessionAdapter->connected = false;
$this->sessionAdapter = null;
$this->connected = false;
$this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_USERS, $this);