From e9af48245f98ec9c52f750172b1ea9219709a5c0 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 8 Jul 2014 22:11:44 +0200 Subject: [PATCH] queue fix --- application/plugins/TheM/QueuePlugin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/plugins/TheM/QueuePlugin.php b/application/plugins/TheM/QueuePlugin.php index 8f4aeb4a..389c941c 100644 --- a/application/plugins/TheM/QueuePlugin.php +++ b/application/plugins/TheM/QueuePlugin.php @@ -350,6 +350,11 @@ class QueuePlugin implements CallbackListener, ManialinkPageAnswerListener, Time } $teams = array(); + + //Initialize at least two teams with 0 players + $teams[0] = 0; + $teams[1] = 0; + /** @var Player $playerObj */ foreach ($this->maniaControl->playerManager->getPlayers() as $playerObj) { if($playerObj->isSpectator) @@ -376,7 +381,7 @@ class QueuePlugin implements CallbackListener, ManialinkPageAnswerListener, Time $this->maniaControl->client->forcePlayerTeam($player->login, $smallestTeam); } } catch (Exception $e) { - // TODO: only possible valid exceptions should be "wrong login" or "not in team mode" - throw others (like connection error) + $this->maniaControl->errorHandler->triggerDebugNotice("QueuePlugin line 383 Exception"); } if (isset($this->spectators[$player->login])) {