diff --git a/src/API/BanAPI.php b/src/API/BanAPI.php index ce0e65a30..bc32ced8a 100644 --- a/src/API/BanAPI.php +++ b/src/API/BanAPI.php @@ -62,6 +62,7 @@ class BanAPI{ } public function isOp($username){ + $username = strtolower($username); if($this->server->api->dhandle("op.check", $username) === true){ return true; }elseif($this->ops->exists($username)){ @@ -77,7 +78,7 @@ class BanAPI{ } if($data["issuer"] instanceof Player){ - if($this->server->api->handle("console.check", $data) === true or $this->isOp($data["issuer"]->username)){ + if($this->server->api->handle("console.check", $data) === true or $this->isOp($data["issuer"]->iusername)){ return true; } }elseif($data["issuer"] === "console"){ diff --git a/src/Player.php b/src/Player.php index 4d5ef9568..3a76856f7 100644 --- a/src/Player.php +++ b/src/Player.php @@ -646,9 +646,10 @@ class Player{ if($this->server->whitelist === true and !$this->server->api->ban->inWhitelist($this->iusername)){ $this->close("\"\x1b[33m".$this->username."\x1b[0m\" not being on white-list", false); - break; + return; }elseif($this->server->api->ban->isBanned($this->iusername) or $this->server->api->ban->isIPBanned($this->ip)){ $this->close("\"\x1b[33m".$this->username."\x1b[0m\" is banned!", false); + return; } $u = $this->server->api->player->get($this->iusername); if($u !== false){ @@ -657,7 +658,12 @@ class Player{ $this->server->api->player->add($this->CID); if($this->server->api->handle("player.join", $this) === false){ - $this->close(); + $this->close("join cancelled", false); + return; + } + + if(!($this->data instanceof Config)){ + $u->close("no config created", false); return; }