fixed exceptions

This commit is contained in:
kremsy
2014-03-13 18:25:29 +01:00
committed by Steffen Schröder
parent 689e572c62
commit d3cc9db29c
5 changed files with 44 additions and 11 deletions

View File

@ -132,7 +132,16 @@ class PlayerActions {
$this->forcePlayerToPlay($adminLogin, $targetLogin, true, false);
}
$this->maniaControl->client->forcePlayerTeam($target->login, $teamId);
try {
$this->maniaControl->client->forcePlayerTeam($target->login, $teamId);
} catch(Exception $e) {
if ($e->getMessage() == "Not in Team mode.") {
$this->forcePlayerToPlay($adminLogin, $targetLogin);
return;
} else {
throw $e;
}
}
$chatMessage = false;
$title = $this->maniaControl->authenticationManager->getAuthLevelName($admin->authLevel);