From 56ca076bec6928510adf551c76aa0485af0ddb43 Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 13 Feb 2014 18:18:14 +0100 Subject: [PATCH] small fix --- application/core/Manialinks/ManialinkManager.php | 14 ++++++++++++-- application/core/Server/RankingManager.php | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/application/core/Manialinks/ManialinkManager.php b/application/core/Manialinks/ManialinkManager.php index b7608888..ca6ea575 100644 --- a/application/core/Manialinks/ManialinkManager.php +++ b/application/core/Manialinks/ManialinkManager.php @@ -164,7 +164,12 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener * @return bool */ public function enableAltMenu(Player $player) { - return $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_EnableAltMenu', $player->login); + try { + $success = $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_EnableAltMenu', $player->login); + } catch(\Exception $e) { + return false; + } + return $success; } /** @@ -174,7 +179,12 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener * @return bool */ public function disableAltMenu(Player $player) { - return $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_DisableAltMenu', $player->login); + try { + $success = $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_DisableAltMenu', $player->login); + } catch(\Exception $e) { + return false; + } + return $success; } /** diff --git a/application/core/Server/RankingManager.php b/application/core/Server/RankingManager.php index 2244c267..efe8b485 100644 --- a/application/core/Server/RankingManager.php +++ b/application/core/Server/RankingManager.php @@ -43,7 +43,11 @@ class RankingManager implements CallbackListener { * Initialize the Rankings */ public function onInit() { - $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_GetRankings', ''); + try { + $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_GetRankings', ''); + } catch(\Exception $e) { + //do nothing + } }