From 0012cb8ab95159133b7ffc2f2cda7f8137242265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sun, 22 Jun 2014 18:37:56 +0200 Subject: [PATCH] improved error handling --- application/core/Server/ScriptManager.php | 12 ++---------- .../plugins/MCTeam/DynamicPointLimitPlugin.php | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/application/core/Server/ScriptManager.php b/application/core/Server/ScriptManager.php index 965f3deb..1ee88543 100644 --- a/application/core/Server/ScriptManager.php +++ b/application/core/Server/ScriptManager.php @@ -3,7 +3,6 @@ namespace ManiaControl\Server; use ManiaControl\ManiaControl; -use Maniaplanet\DedicatedServer\Xmlrpc\Exception; /** * Manager for Game Mode Script related Stuff @@ -51,14 +50,7 @@ class ScriptManager { $scriptSettings['S_UseScriptCallbacks'] = (bool)$enable; $actionName = ($enable ? 'en' : 'dis'); - try { - $this->maniaControl->client->setModeScriptSettings($scriptSettings); - } catch (Exception $e) { - // TODO temp added 19.04.2014 - $this->maniaControl->errorHandler->handleException($e, false); - trigger_error("Couldn't set Mode Script Settings to {$actionName}able Script Callbacks. " . $e->getMessage()); - return false; - } + $this->maniaControl->client->setModeScriptSettings($scriptSettings); $this->maniaControl->log("Script Callbacks successfully {$actionName}abled!"); return true; } @@ -69,7 +61,7 @@ class ScriptManager { * @return bool */ public function isScriptMode() { - if ($this->isScriptMode === null) { + if (is_null($this->isScriptMode)) { $gameMode = $this->maniaControl->client->getGameMode(); $this->isScriptMode = ($gameMode === 0); } diff --git a/application/plugins/MCTeam/DynamicPointLimitPlugin.php b/application/plugins/MCTeam/DynamicPointLimitPlugin.php index 8ed9696c..8562a16a 100644 --- a/application/plugins/MCTeam/DynamicPointLimitPlugin.php +++ b/application/plugins/MCTeam/DynamicPointLimitPlugin.php @@ -149,6 +149,7 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug $this->maniaControl->chat->sendInformation($message); $this->lastPointLimit = $pointLimit; } catch (GameModeException $exception) { + $this->maniaControl->chat->sendExceptionToAdmins($exception); } } }