resolved error on fakeplayer connecting

This commit is contained in:
kremsy 2014-07-04 09:58:49 +02:00
parent 8b3667b252
commit ba2acca2c5

View File

@ -11,6 +11,7 @@ use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Server\Server; use ManiaControl\Server\Server;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
use Maniaplanet\DedicatedServer\Xmlrpc\UnavailableFeatureException;
/** /**
* Class offering various Admin Commands related to Players * 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])) { if (isset($messageParts[1]) && is_numeric($messageParts[1])) {
$amount = intval($messageParts[1]); $amount = intval($messageParts[1]);
} }
try {
for ($i = 0; $i < $amount; $i++) { for ($i = 0; $i < $amount; $i++) {
$this->maniaControl->client->connectFakePlayer(); $this->maniaControl->client->connectFakePlayer();
} }
$this->maniaControl->chat->sendSuccess('Fake players connected!', $player->login); $this->maniaControl->chat->sendSuccess('Fake players connected!', $player->login);
} catch (UnavailableFeatureException $e) {
$this->maniaControl->chat->sendSuccess('Error while connecting a Fake-Player.', $player->login);
}
} }
/** /**