From 157a4347a475e455b8a3c691d09ff15c8ae266de Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 24 Apr 2014 10:38:50 +0200 Subject: [PATCH] exception fix --- application/core/Players/PlayerActions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index 0579f612..af9d6319 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -15,6 +15,7 @@ use Maniaplanet\DedicatedServer\Xmlrpc\Exception; use Maniaplanet\DedicatedServer\Xmlrpc\NotInTeamModeException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerAlreadyIgnoredException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerIsNotSpectatorException; +use Maniaplanet\DedicatedServer\Xmlrpc\PlayerNotIgnoredException; /** * Player Actions Class @@ -215,7 +216,12 @@ class PlayerActions { 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); $chatMessage = $title . ' $<' . $admin->nickname . '$> un-muted $<' . $target->nickname . '$>!'; @@ -246,6 +252,8 @@ class PlayerActions { try{ $this->maniaControl->client->ignore($targetLogin); }catch(PlayerAlreadyIgnoredException $e){ + $this->maniaControl->chat->sendError("Player already ignored!"); + return; } $title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel);