player action weired exception fix

This commit is contained in:
kremsy 2015-06-18 15:52:30 +02:00
parent e5278e6987
commit fc7b1bdade

View File

@ -385,16 +385,22 @@ class PlayerActions {
return; return;
} }
try {
if ($target->isFakePlayer()) { if ($target->isFakePlayer()) {
try {
$this->maniaControl->getClient()->disconnectFakePlayer($target->login); $this->maniaControl->getClient()->disconnectFakePlayer($target->login);
} else { } catch (PlayerStateException $e) {
$this->maniaControl->getClient()->kick($target->login, $message); $this->maniaControl->getChat()->sendException($e, $admin);
return;
} }
} else {
try {
$this->maniaControl->getClient()->kick($target->login, $message);
} catch (UnknownPlayerException $e) { } catch (UnknownPlayerException $e) {
$this->maniaControl->getChat()->sendException($e, $admin); $this->maniaControl->getChat()->sendException($e, $admin);
return; return;
} }
}
// Announce kick // Announce kick
$title = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($admin->authLevel); $title = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($admin->authLevel);
@ -561,4 +567,4 @@ class PlayerActions {
} }
return false; return false;
} }
} }