fixed forcespec exception

This commit is contained in:
kremsy 2014-04-13 12:25:39 +02:00 committed by Steffen Schröder
parent 9898009a82
commit 7ba4aa0b7b

View File

@ -184,7 +184,17 @@ class PlayerActions {
return; return;
} }
try {
$this->maniaControl->client->forceSpectator($target->login, $spectatorState); $this->maniaControl->client->forceSpectator($target->login, $spectatorState);
} catch(Exception $e) {
if ($e->getMessage() == "There are too many spectators") {
$this->maniaControl->chat->sendError($e->getMessage(), $adminLogin);
return;
}
throw $e;
}
$title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel); $title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel);
$chatMessage = $title . ' $<' . $admin->nickname . '$> forced $<' . $target->nickname . '$> to Spectator!'; $chatMessage = $title . ' $<' . $admin->nickname . '$> forced $<' . $target->nickname . '$> to Spectator!';