From fc7b1bdadea8910bb80b2c92e26a47733d2aa4c0 Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 18 Jun 2015 15:52:30 +0200 Subject: [PATCH] player action weired exception fix --- core/Players/PlayerActions.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/Players/PlayerActions.php b/core/Players/PlayerActions.php index 3f52a771..eb319f5d 100644 --- a/core/Players/PlayerActions.php +++ b/core/Players/PlayerActions.php @@ -385,15 +385,21 @@ class PlayerActions { return; } - try { - if ($target->isFakePlayer()) { + + if ($target->isFakePlayer()) { + try { $this->maniaControl->getClient()->disconnectFakePlayer($target->login); - } else { - $this->maniaControl->getClient()->kick($target->login, $message); + } catch (PlayerStateException $e) { + $this->maniaControl->getChat()->sendException($e, $admin); + return; + } + } else { + try { + $this->maniaControl->getClient()->kick($target->login, $message); + } catch (UnknownPlayerException $e) { + $this->maniaControl->getChat()->sendException($e, $admin); + return; } - } catch (UnknownPlayerException $e) { - $this->maniaControl->getChat()->sendException($e, $admin); - return; } // Announce kick @@ -560,5 +566,5 @@ class PlayerActions { return $player->isMuted(); } return false; + } } -}