diff --git a/core/Chat.php b/core/Chat.php index 4cc808d5..c7f38ff1 100644 --- a/core/Chat.php +++ b/core/Chat.php @@ -72,11 +72,12 @@ class Chat implements CallbackListener, CommunicationListener, UsageInformationA * @param string $message * @param string $login * @param string|bool $prefix + * @param bool $multiCall * @return bool */ - public function sendInformation($message, $login = null, $prefix = true) { + public function sendInformation($message, $login = null, $prefix = true, $multiCall = true) { $format = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_FORMAT_INFORMATION); - return $this->sendChat($format . $message, $login, $prefix); + return $this->sendChat($format . $message, $login, $prefix, $multiCall); } /** @@ -85,9 +86,10 @@ class Chat implements CallbackListener, CommunicationListener, UsageInformationA * @param string $message * @param string $login * @param string|bool $prefix + * @param bool $multiCall * @return bool */ - public function sendChat($message, $login = null, $prefix = true) { + public function sendChat($message, $login = null, $prefix = true, $multiCall = true) { if (!$this->maniaControl->getClient()) { return false; } @@ -100,13 +102,13 @@ class Chat implements CallbackListener, CommunicationListener, UsageInformationA $login = Player::parseLogin($login); } try { - return $this->maniaControl->getClient()->chatSendServerMessage($chatMessage, $login, true); + return $this->maniaControl->getClient()->chatSendServerMessage($chatMessage, $login, $multiCall); } catch (UnknownPlayerException $e) { return false; } } - return $this->maniaControl->getClient()->chatSendServerMessage($chatMessage, null, true); + return $this->maniaControl->getClient()->chatSendServerMessage($chatMessage, null, $multiCall); } /** @@ -252,7 +254,7 @@ class Chat implements CallbackListener, CommunicationListener, UsageInformationA * Handles SendChat Communication Request * * @param $data - * @return array + * @return CommunicationAnswer */ public function communcationSendChat($data) { if (!is_object($data) || !property_exists($data, "message")) { diff --git a/core/ManiaControl.php b/core/ManiaControl.php index 8ff82a47..57b49d22 100644 --- a/core/ManiaControl.php +++ b/core/ManiaControl.php @@ -221,8 +221,9 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener, $this->getTimerManager()->registerOneTimeListening($this, function () use ($data) { if (is_object($data) && property_exists($data, "message")) { $this->restart($data->message); + } else { + $this->restart(); } - $this->restart(); }, 3000); return new CommunicationAnswer(); }); @@ -514,7 +515,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener, // Announce restart try { - $this->getChat()->sendInformation('Restarting ManiaControl...'); + $this->getChat()->sendInformation('Restarting ManiaControl...', null, true, false); } catch (TransportException $e) { } Logger::log('Restarting ManiaControl... ' . $message); diff --git a/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php b/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php index 6a8e7434..7a26f681 100644 --- a/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php +++ b/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php @@ -110,7 +110,7 @@ class DedimaniaWebHandler implements TimerListener { if (!$serverInfo || !$playerInfo || !$mapInfo || !$gameMode) { $data = array($this->dedimaniaData->sessionId, $mapInfo, $gameMode, $serverInfo, $playerInfo); - if(!$serverInfo){ // No Players + if($serverInfo){ // No Players Logger::logError("Dedimania Records could not be fetched, debuginfo:" . json_encode($data)); } return false;