exception fix

This commit is contained in:
kremsy 2014-04-24 10:38:50 +02:00 committed by Steffen Schröder
parent 594694368b
commit 157a4347a4

View File

@ -15,6 +15,7 @@ use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\NotInTeamModeException; use Maniaplanet\DedicatedServer\Xmlrpc\NotInTeamModeException;
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerAlreadyIgnoredException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerAlreadyIgnoredException;
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerIsNotSpectatorException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerIsNotSpectatorException;
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerNotIgnoredException;
/** /**
* Player Actions Class * Player Actions Class
@ -215,7 +216,12 @@ class PlayerActions {
return; return;
} }
$this->maniaControl->client->unIgnore($targetLogin); try{
$this->maniaControl->client->unIgnore($targetLogin);
}catch(PlayerNotIgnoredException $e){
$this->maniaControl->chat->sendError("Player is not ignored!");
return;
}
$title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel); $title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel);
$chatMessage = $title . ' $<' . $admin->nickname . '$> un-muted $<' . $target->nickname . '$>!'; $chatMessage = $title . ' $<' . $admin->nickname . '$> un-muted $<' . $target->nickname . '$>!';
@ -246,6 +252,8 @@ class PlayerActions {
try{ try{
$this->maniaControl->client->ignore($targetLogin); $this->maniaControl->client->ignore($targetLogin);
}catch(PlayerAlreadyIgnoredException $e){ }catch(PlayerAlreadyIgnoredException $e){
$this->maniaControl->chat->sendError("Player already ignored!");
return;
} }
$title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel); $title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel);