From 6068ed1ec11fcb454d7252c6820d77b92612df6b Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 12 Jan 2015 13:20:21 +0100 Subject: [PATCH] exception add on player ban --- core/Players/PlayerActions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/Players/PlayerActions.php b/core/Players/PlayerActions.php index 754ec195..7f21beda 100644 --- a/core/Players/PlayerActions.php +++ b/core/Players/PlayerActions.php @@ -427,7 +427,13 @@ class PlayerActions { return; } - $this->maniaControl->getClient()->ban($target->login, $message); + try { + $this->maniaControl->getClient()->ban($target->login, $message); + } catch (UnknownPlayerException $e) { + $this->maniaControl->getChat()->sendError('Unknown player!', $admin); + return; + } + // Announce ban $title = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($admin->authLevel);