This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-22 14:44:22 +01:00
parent 2a8c72dfc2
commit 8bbd899689
2 changed files with 10 additions and 3 deletions

View File

@ -62,6 +62,7 @@ class BanAPI{
} }
public function isOp($username){ public function isOp($username){
$username = strtolower($username);
if($this->server->api->dhandle("op.check", $username) === true){ if($this->server->api->dhandle("op.check", $username) === true){
return true; return true;
}elseif($this->ops->exists($username)){ }elseif($this->ops->exists($username)){
@ -77,7 +78,7 @@ class BanAPI{
} }
if($data["issuer"] instanceof Player){ 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; return true;
} }
}elseif($data["issuer"] === "console"){ }elseif($data["issuer"] === "console"){

View File

@ -646,9 +646,10 @@ class Player{
if($this->server->whitelist === true and !$this->server->api->ban->inWhitelist($this->iusername)){ 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); $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)){ }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); $this->close("\"\x1b[33m".$this->username."\x1b[0m\" is banned!", false);
return;
} }
$u = $this->server->api->player->get($this->iusername); $u = $this->server->api->player->get($this->iusername);
if($u !== false){ if($u !== false){
@ -657,7 +658,12 @@ class Player{
$this->server->api->player->add($this->CID); $this->server->api->player->add($this->CID);
if($this->server->api->handle("player.join", $this) === false){ 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; return;
} }