From 7633136a86235eec507581fb6e6e4230f170e5e5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Jul 2018 13:22:08 +0100 Subject: [PATCH] Player: move max players check to somewhere that makes sense --- src/pocketmine/Player.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 17997d025..493c70bca 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1846,10 +1846,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->locale = $packet->locale; } - if(count($this->server->getOnlinePlayers()) >= $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){ - return true; - } - $this->randomClientId = $packet->clientId; $this->uuid = UUID::fromString($packet->clientUUID); @@ -1878,6 +1874,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ return true; } + if(count($this->server->getOnlinePlayers()) >= $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){ + return true; + } + if(!$this->server->isWhitelisted($this->iusername) and $this->kick("Server is white-listed", false)){ return true; }