mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 10:49:10 +00:00
Player: move max players check to somewhere that makes sense
This commit is contained in:
parent
3cd105ff33
commit
7633136a86
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user