From ba2acca2c54c2ccae8d3c268aeaa44858c26a5ca Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 4 Jul 2014 09:58:49 +0200 Subject: [PATCH] resolved error on fakeplayer connecting --- application/core/Players/PlayerCommands.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/core/Players/PlayerCommands.php b/application/core/Players/PlayerCommands.php index f12f8012..32981272 100644 --- a/application/core/Players/PlayerCommands.php +++ b/application/core/Players/PlayerCommands.php @@ -11,6 +11,7 @@ use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Server\Server; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; +use Maniaplanet\DedicatedServer\Xmlrpc\UnavailableFeatureException; /** * Class offering various Admin Commands related to Players @@ -286,10 +287,15 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca if (isset($messageParts[1]) && is_numeric($messageParts[1])) { $amount = intval($messageParts[1]); } - for ($i = 0; $i < $amount; $i++) { - $this->maniaControl->client->connectFakePlayer(); + + try { + for ($i = 0; $i < $amount; $i++) { + $this->maniaControl->client->connectFakePlayer(); + } + $this->maniaControl->chat->sendSuccess('Fake players connected!', $player->login); + } catch (UnavailableFeatureException $e) { + $this->maniaControl->chat->sendSuccess('Error while connecting a Fake-Player.', $player->login); } - $this->maniaControl->chat->sendSuccess('Fake players connected!', $player->login); } /**