fixed forcespec exception
This commit is contained in:
parent
9898009a82
commit
7ba4aa0b7b
@ -184,7 +184,17 @@ class PlayerActions {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$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);
|
||||
$chatMessage = $title . ' $<' . $admin->nickname . '$> forced $<' . $target->nickname . '$> to Spectator!';
|
||||
@ -371,7 +381,7 @@ class PlayerActions {
|
||||
$this->maniaControl->client->kick($target->login, $message);
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
if($e == "Login unknown."){
|
||||
if ($e == "Login unknown.") {
|
||||
return;
|
||||
}
|
||||
// TODO: only possible valid exception should be "wrong login" - throw others (like connection error)
|
||||
|
Loading…
Reference in New Issue
Block a user