mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Added #1142 OP players can bypass the player limit
This commit is contained in:
parent
8b23568fe7
commit
c09bc259fc
@ -1291,8 +1291,10 @@ class Player{
|
|||||||
if($this->loggedIn === true){
|
if($this->loggedIn === true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->username = $packet->username;
|
||||||
|
$this->iusername = strtolower($this->username);
|
||||||
$this->loginData = array("clientId" => $packet->clientId, "loginData" => $packet->loginData);
|
$this->loginData = array("clientId" => $packet->clientId, "loginData" => $packet->loginData);
|
||||||
if(count($this->server->clients) > $this->server->maxClients){
|
if(count($this->server->clients) > $this->server->maxClients and !$this->server->api->ban->isOp($this->iusername)){
|
||||||
$this->close("server is full!", false);
|
$this->close("server is full!", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1307,16 +1309,11 @@ class Player{
|
|||||||
$this->directDataPacket($pk);
|
$this->directDataPacket($pk);
|
||||||
}
|
}
|
||||||
$this->close("Incorrect protocol #".$packet->protocol1, false);
|
$this->close("Incorrect protocol #".$packet->protocol1, false);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
if(preg_match('#[^a-zA-Z0-9_]#', $packet->username) == 0 and $packet->username != ""){
|
if(preg_match('#[^a-zA-Z0-9_]#', $packet->username) > 0 or $packet->username === ""){
|
||||||
$this->username = $packet->username;
|
|
||||||
$this->iusername = strtolower($this->username);
|
|
||||||
}else{
|
|
||||||
$this->username = $packet->username;
|
|
||||||
$this->iusername = strtolower($this->username);
|
|
||||||
$this->close("Bad username", false);
|
$this->close("Bad username", false);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
if($this->server->api->handle("player.connect", $this) === false){
|
if($this->server->api->handle("player.connect", $this) === false){
|
||||||
$this->close("Unknown reason", false);
|
$this->close("Unknown reason", false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user