From 5d166776f876559202023b97efd95c8e7f574b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 9 Nov 2013 11:19:21 +0100 Subject: [PATCH] Changed mControl to ManiaControl --- application/ManiaControl.bat | 6 +++ application/ManiaControl.php | 26 ++++++++++ application/ManiaControl.sh | 3 ++ ...ol.xml => authentication.ManiaControl.xml} | 0 ...hat.mControl.xml => chat.ManiaControl.xml} | 2 +- ...mControl.xml => commands.ManiaControl.xml} | 0 ...ore.mControl.xml => core.ManiaControl.xml} | 2 +- ...mControl.xml => database.ManiaControl.xml} | 2 +- ....mControl.xml => plugins.ManiaControl.xml} | 0 ...r.mControl.xml => server.ManiaControl.xml} | 0 ...ts.mControl.xml => stats.ManiaControl.xml} | 0 application/configs/united.plugin.xml | 2 +- ...ol.php => authentication.ManiaControl.php} | 4 +- ...Control.php => callbacks.ManiaControl.php} | 22 ++++----- ...hat.mControl.php => chat.ManiaControl.php} | 8 ++-- ...mControl.php => commands.ManiaControl.php} | 22 ++++----- ...ore.mControl.php => core.ManiaControl.php} | 48 +++++++++---------- ...mControl.php => database.ManiaControl.php} | 6 +-- ...r.mControl.php => server.ManiaControl.php} | 6 +-- ...ts.mControl.php => stats.ManiaControl.php} | 4 +- ...ls.mControl.php => tools.ManiaControl.php} | 6 +-- application/mControl.bat | 2 - application/mControl.php | 26 ---------- application/mControl.sh | 3 -- application/plugins/chatlog.plugin.php | 8 ++-- application/plugins/karma.plugin.php | 8 ++-- application/plugins/obstacle.plugin.php | 4 +- ...n.mControl.php => plugin.ManiaControl.php} | 4 +- application/plugins/records.plugin.php | 12 ++--- application/plugins/united.plugin.php | 12 ++--- 30 files changed, 126 insertions(+), 122 deletions(-) create mode 100644 application/ManiaControl.bat create mode 100644 application/ManiaControl.php create mode 100644 application/ManiaControl.sh rename application/configs/{authentication.mControl.xml => authentication.ManiaControl.xml} (100%) rename application/configs/{chat.mControl.xml => chat.ManiaControl.xml} (81%) rename application/configs/{commands.mControl.xml => commands.ManiaControl.xml} (100%) rename application/configs/{core.mControl.xml => core.ManiaControl.xml} (90%) rename application/configs/{database.mControl.xml => database.ManiaControl.xml} (82%) rename application/configs/{plugins.mControl.xml => plugins.ManiaControl.xml} (100%) rename application/configs/{server.mControl.xml => server.ManiaControl.xml} (100%) rename application/configs/{stats.mControl.xml => stats.ManiaControl.xml} (100%) rename application/core/{authentication.mControl.php => authentication.ManiaControl.php} (96%) rename application/core/{callbacks.mControl.php => callbacks.ManiaControl.php} (91%) rename application/core/{chat.mControl.php => chat.ManiaControl.php} (92%) rename application/core/{commands.mControl.php => commands.ManiaControl.php} (96%) rename application/core/{core.mControl.php => core.ManiaControl.php} (87%) rename application/core/{database.mControl.php => database.ManiaControl.php} (98%) rename application/core/{server.mControl.php => server.ManiaControl.php} (98%) rename application/core/{stats.mControl.php => stats.ManiaControl.php} (98%) rename application/core/{tools.mControl.php => tools.ManiaControl.php} (97%) delete mode 100644 application/mControl.bat delete mode 100644 application/mControl.php delete mode 100644 application/mControl.sh rename application/plugins/{plugin.mControl.php => plugin.ManiaControl.php} (87%) diff --git a/application/ManiaControl.bat b/application/ManiaControl.bat new file mode 100644 index 00000000..1938a7d8 --- /dev/null +++ b/application/ManiaControl.bat @@ -0,0 +1,6 @@ + +REM Set the path to your php.exe here +set phpPath="D:\Programme\xampp\php\php.exe" + +REM Start ManiaControl +START "" /B %phpPath% -f "ManiaControl.php" 2>&1 diff --git a/application/ManiaControl.php b/application/ManiaControl.php new file mode 100644 index 00000000..227202a2 --- /dev/null +++ b/application/ManiaControl.php @@ -0,0 +1,26 @@ +run(true); + +?> diff --git a/application/ManiaControl.sh b/application/ManiaControl.sh new file mode 100644 index 00000000..c73f84c7 --- /dev/null +++ b/application/ManiaControl.sh @@ -0,0 +1,3 @@ +#!/bin/sh +php ManiaControl.php 2>&1 & +echo $! > ManiaControl.pid diff --git a/application/configs/authentication.mControl.xml b/application/configs/authentication.ManiaControl.xml similarity index 100% rename from application/configs/authentication.mControl.xml rename to application/configs/authentication.ManiaControl.xml diff --git a/application/configs/chat.mControl.xml b/application/configs/chat.ManiaControl.xml similarity index 81% rename from application/configs/chat.mControl.xml rename to application/configs/chat.ManiaControl.xml index 2f1fc9f2..7f4c556a 100644 --- a/application/configs/chat.mControl.xml +++ b/application/configs/chat.ManiaControl.xml @@ -1,5 +1,5 @@ - + diff --git a/application/configs/commands.mControl.xml b/application/configs/commands.ManiaControl.xml similarity index 100% rename from application/configs/commands.mControl.xml rename to application/configs/commands.ManiaControl.xml diff --git a/application/configs/core.mControl.xml b/application/configs/core.ManiaControl.xml similarity index 90% rename from application/configs/core.mControl.xml rename to application/configs/core.ManiaControl.xml index ddf27ebb..da62f13c 100644 --- a/application/configs/core.mControl.xml +++ b/application/configs/core.ManiaControl.xml @@ -1,5 +1,5 @@ - + diff --git a/application/configs/database.mControl.xml b/application/configs/database.ManiaControl.xml similarity index 82% rename from application/configs/database.mControl.xml rename to application/configs/database.ManiaControl.xml index 39097388..10b48976 100644 --- a/application/configs/database.mControl.xml +++ b/application/configs/database.ManiaControl.xml @@ -1,5 +1,5 @@ - + diff --git a/application/configs/plugins.mControl.xml b/application/configs/plugins.ManiaControl.xml similarity index 100% rename from application/configs/plugins.mControl.xml rename to application/configs/plugins.ManiaControl.xml diff --git a/application/configs/server.mControl.xml b/application/configs/server.ManiaControl.xml similarity index 100% rename from application/configs/server.mControl.xml rename to application/configs/server.ManiaControl.xml diff --git a/application/configs/stats.mControl.xml b/application/configs/stats.ManiaControl.xml similarity index 100% rename from application/configs/stats.mControl.xml rename to application/configs/stats.ManiaControl.xml diff --git a/application/configs/united.plugin.xml b/application/configs/united.plugin.xml index 0256ed90..f8b89e79 100644 --- a/application/configs/united.plugin.xml +++ b/application/configs/united.plugin.xml @@ -1,6 +1,6 @@ - + diff --git a/application/core/authentication.mControl.php b/application/core/authentication.ManiaControl.php similarity index 96% rename from application/core/authentication.mControl.php rename to application/core/authentication.ManiaControl.php index 7d9823be..a083b215 100644 --- a/application/core/authentication.mControl.php +++ b/application/core/authentication.ManiaControl.php @@ -1,6 +1,6 @@ mControl = $mControl; // Load config - $this->config = Tools::loadConfig('authentication.mControl.xml'); + $this->config = Tools::loadConfig('authentication.ManiaControl.xml'); } /** diff --git a/application/core/callbacks.mControl.php b/application/core/callbacks.ManiaControl.php similarity index 91% rename from application/core/callbacks.mControl.php rename to application/core/callbacks.ManiaControl.php index 18e7a59a..6a6d7a0f 100644 --- a/application/core/callbacks.mControl.php +++ b/application/core/callbacks.ManiaControl.php @@ -1,6 +1,6 @@ last1Second <= time() - 1) { $this->last1Second = time(); diff --git a/application/core/chat.mControl.php b/application/core/chat.ManiaControl.php similarity index 92% rename from application/core/chat.mControl.php rename to application/core/chat.ManiaControl.php index 8b9aced2..1e4895ae 100644 --- a/application/core/chat.mControl.php +++ b/application/core/chat.ManiaControl.php @@ -1,6 +1,6 @@ '; + private $prefix = 'ManiaControl>'; /** - * Construct mControl chat + * Construct ManiaControl chat */ public function __construct($mControl) { $this->mControl = $mControl; // Load config - $this->config = Tools::loadConfig('chat.mControl.xml'); + $this->config = Tools::loadConfig('chat.ManiaControl.xml'); } /** diff --git a/application/core/commands.mControl.php b/application/core/commands.ManiaControl.php similarity index 96% rename from application/core/commands.mControl.php rename to application/core/commands.ManiaControl.php index 983dd45f..2ac5bb22 100644 --- a/application/core/commands.mControl.php +++ b/application/core/commands.ManiaControl.php @@ -1,6 +1,6 @@ mControl = $mControl; // Load config - $this->config = Tools::loadConfig('commands.mControl.xml'); + $this->config = Tools::loadConfig('commands.ManiaControl.xml'); // Register for callbacks $this->iControl->callbacks->registerCallbackHandler(Callbacks::CB_IC_5_SECOND, $this, 'each5Seconds'); @@ -148,7 +148,7 @@ class Commands { } /** - * Send mControl version + * Send ManiaControl version */ private function command_version($chat) { $login = $chat[1][1]; @@ -157,7 +157,7 @@ class Commands { $this->iControl->authentication->sendNotAllowed($login); return; } - if (!$this->iControl->chat->sendInformation('This server is using mControl v' . mControl::VERSION . '!', $login)) { + if (!$this->iControl->chat->sendInformation('This server is using ManiaControl v' . ManiaControl::VERSION . '!', $login)) { trigger_error("Couldn't send version to '" . $login . "'. " . $this->iControl->getClientErrorText()); } } @@ -345,7 +345,7 @@ class Commands { $this->iControl->authentication->sendNotAllowed($login); return; } - $this->iControl->quit("mControl shutdown requested by '" . $login . "'"); + $this->iControl->quit("ManiaControl shutdown requested by '" . $login . "'"); } /** @@ -504,24 +504,24 @@ class Commands { // TODO: show usage return; } - // Check if mControl can even write to the maps dir + // Check if ManiaControl can even write to the maps dir if (!$this->iControl->client->query('GetMapsDirectory')) { trigger_error("Couldn't get map directory. " . $this->iControl->getClientErrorText()); - $this->iControl->chat->sendError("mControl couldn't retrieve the maps directory.", $login); + $this->iControl->chat->sendError("ManiaControl couldn't retrieve the maps directory.", $login); return; } else { $mapDir = $this->iControl->client->getResponse(); if (!is_dir($mapDir)) { - trigger_error("mControl doesn't have have access to the maps directory in '" . $mapDir . "'."); - $this->iControl->chat->sendError("mControl doesn't have access to the maps directory.", $login); + trigger_error("ManiaControl doesn't have have access to the maps directory in '" . $mapDir . "'."); + $this->iControl->chat->sendError("ManiaControl doesn't have access to the maps directory.", $login); return; } $dlDir = (string) $this->iControl->config->maps_dir; // Create mx directory if necessary if (!is_dir($mapDir . $dlDir) && !mkdir($mapDir . $dlDir)) { - trigger_error("mControl doesn't have to rights to save maps in'" . $mapDir . $dlDir, "'."); - $this->iControl->chat->sendError("mControl doesn't have to rights to save maps.", $login); + trigger_error("ManiaControl doesn't have to rights to save maps in'" . $mapDir . $dlDir, "'."); + $this->iControl->chat->sendError("ManiaControl doesn't have to rights to save maps.", $login); return; } $mapDir .= $dlDir . '/'; diff --git a/application/core/core.mControl.php b/application/core/core.ManiaControl.php similarity index 87% rename from application/core/core.mControl.php rename to application/core/core.ManiaControl.php index 23c57aa3..8b781b0a 100644 --- a/application/core/core.mControl.php +++ b/application/core/core.ManiaControl.php @@ -1,18 +1,18 @@ config = Tools::loadConfig('core.mControl.xml'); + $this->config = Tools::loadConfig('core.ManiaControl.xml'); $this->startTime = time(); // Load chat tool @@ -113,14 +113,14 @@ class mControl { } /** - * Quit mControl and log the given message + * Quit ManiaControl and log the given message */ public function quit($message = false) { if ($this->shutdownRequested) return; if ($this->client) { // Announce quit - $this->chat->sendInformation('mControl shutting down.'); + $this->chat->sendInformation('ManiaControl shutting down.'); // Hide manialinks $this->client->query('SendHideManialinkPage'); @@ -134,15 +134,15 @@ class mControl { // Shutdown if ($this->client) $this->client->Terminate(); - error_log("Quitting mControl!"); + error_log("Quitting ManiaControl!"); exit(); } /** - * Run mControl + * Run ManiaControl */ public function run($debug = false) { - error_log('Starting mControl v' . self::VERSION . '!'); + error_log('Starting ManiaControl v' . self::VERSION . '!'); $this->debug = (bool) $debug; // Load plugins @@ -154,9 +154,9 @@ class mControl { // Loading finished error_log("Loading completed!"); - // Announce mControl - if (!$this->chat->sendInformation('mControl v' . self::VERSION . ' successfully started!')) { - trigger_error("Couldn't announce mControl. " . $this->iControl->getClientErrorText()); + // Announce ManiaControl + if (!$this->chat->sendInformation('ManiaControl v' . self::VERSION . ' successfully started!')) { + trigger_error("Couldn't announce ManiaControl. " . $this->iControl->getClientErrorText()); } // OnInit @@ -284,10 +284,10 @@ class mControl { } /** - * Load mControl plugins + * Load ManiaControl plugins */ private function loadPlugins() { - $pluginsConfig = Tools::loadConfig('plugins.mControl.xml'); + $pluginsConfig = Tools::loadConfig('plugins.ManiaControl.xml'); if (!$pluginsConfig || !isset($pluginsConfig->plugin)) { trigger_error('Invalid plugins config.'); return; @@ -296,7 +296,7 @@ class mControl { // Load plugin classes $classes = get_declared_classes(); foreach ($pluginsConfig->xpath('plugin') as $plugin) { - $fileName = mControl . '/plugins/' . $plugin; + $fileName = ManiaControlDir . '/plugins/' . $plugin; if (!file_exists($fileName)) { trigger_error("Couldn't load plugin '" . $plugin . "'! File doesn't exist. (/plugins/" . $plugin . ")"); } diff --git a/application/core/database.mControl.php b/application/core/database.ManiaControl.php similarity index 98% rename from application/core/database.mControl.php rename to application/core/database.ManiaControl.php index 40d2ee78..e10eab0d 100644 --- a/application/core/database.mControl.php +++ b/application/core/database.ManiaControl.php @@ -1,6 +1,6 @@ mControl = $mControl; // Load config - $this->config = Tools::loadConfig('database.mControl.xml'); - $this->iControl->checkConfig($this->config, array("host", "user"), 'database.mControl.xml'); + $this->config = Tools::loadConfig('database.ManiaControl.xml'); + $this->iControl->checkConfig($this->config, array("host", "user"), 'database.ManiaControl.xml'); // Get mysql server information $host = $this->config->xpath('host'); diff --git a/application/core/server.mControl.php b/application/core/server.ManiaControl.php similarity index 98% rename from application/core/server.mControl.php rename to application/core/server.ManiaControl.php index 5e87f1da..3018bd0e 100644 --- a/application/core/server.mControl.php +++ b/application/core/server.ManiaControl.php @@ -1,6 +1,6 @@ mControl = $mControl; // Load config - $this->config = Tools::loadConfig('server.mControl.xml'); + $this->config = Tools::loadConfig('server.ManiaControl.xml'); $this->iControl->checkConfig($this->config, array('host', 'port', 'login', 'pass'), 'server'); // Register for callbacks @@ -60,7 +60,7 @@ class Server { } /** - * Checks if mControl has access to the given directory (server data directory if no param) + * Checks if ManiaControl has access to the given directory (server data directory if no param) * * @param string $directory * @return bool diff --git a/application/core/stats.mControl.php b/application/core/stats.ManiaControl.php similarity index 98% rename from application/core/stats.mControl.php rename to application/core/stats.ManiaControl.php index f7d4faae..8a5e7c52 100644 --- a/application/core/stats.mControl.php +++ b/application/core/stats.ManiaControl.php @@ -1,6 +1,6 @@ mControl = $mControl; // Load config - $this->config = Tools::loadConfig('stats.mControl.xml'); + $this->config = Tools::loadConfig('stats.ManiaControl.xml'); $this->loadSettings(); // Init database tables diff --git a/application/core/tools.mControl.php b/application/core/tools.ManiaControl.php similarity index 97% rename from application/core/tools.mControl.php rename to application/core/tools.ManiaControl.php index 9490a1d0..76d959b7 100644 --- a/application/core/tools.mControl.php +++ b/application/core/tools.ManiaControl.php @@ -1,6 +1,6 @@ &1 diff --git a/application/mControl.php b/application/mControl.php deleted file mode 100644 index 983ac3cf..00000000 --- a/application/mControl.php +++ /dev/null @@ -1,26 +0,0 @@ -run(true); - -?> diff --git a/application/mControl.sh b/application/mControl.sh deleted file mode 100644 index 90a61ecb..00000000 --- a/application/mControl.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -php mControl.php 2>&1 & -echo $! > mControl.pid diff --git a/application/plugins/chatlog.plugin.php b/application/plugins/chatlog.plugin.php index 405176d8..b47ae2ec 100644 --- a/application/plugins/chatlog.plugin.php +++ b/application/plugins/chatlog.plugin.php @@ -1,9 +1,9 @@ config->filename; - $this->settings->fileName = mControl . '/' . $fileName; + $this->settings->fileName = ManiaControlDir . '/' . $fileName; // log_server_messages $log_server_messages = $this->config->xpath('log_server_messages'); @@ -77,7 +77,7 @@ class Plugin_Chatlog { * @param string $login */ private function logText($text, $login = null) { - $message = date(mControl::DATE) . '>> ' . ($login ? $login . ': ' : '') . $text . PHP_EOL; + $message = date(ManiaControl::DATE) . '>> ' . ($login ? $login . ': ' : '') . $text . PHP_EOL; file_put_contents($this->settings->fileName, $message, FILE_APPEND); } } diff --git a/application/plugins/karma.plugin.php b/application/plugins/karma.plugin.php index a08c7d85..26b5cf91 100644 --- a/application/plugins/karma.plugin.php +++ b/application/plugins/karma.plugin.php @@ -1,9 +1,9 @@ iControl->server->getVersion(); $serverData['ServerVersion'] = $serverVersion['Version']; $serverData['ServerBuild'] = $serverVersion['Build']; - $serverData['Tool'] = 'mControl'; - $serverData['Version'] = mControl::VERSION; + $serverData['Tool'] = 'ManiaControl'; + $serverData['Version'] = ManiaControl::VERSION; $this->dedimaniaData['serverData'] = $serverData; } @@ -267,7 +267,7 @@ class Plugin_Records { $header .= 'Accept-Encoding: gzip;' . PHP_EOL; $header .= 'Content-Type: text/xml; charset=utf-8;' . PHP_EOL; $header .= 'Keep-Alive: 300;' . PHP_EOL; - $header .= 'User-Agent: mControl v' . mControl::VERSION . ';' . PHP_EOL; + $header .= 'User-Agent: ManiaControl v' . ManiaControl::VERSION . ';' . PHP_EOL; $this->dedimaniaData['header'] = $header; } diff --git a/application/plugins/united.plugin.php b/application/plugins/united.plugin.php index 90c2dda2..f4cdb774 100644 --- a/application/plugins/united.plugin.php +++ b/application/plugins/united.plugin.php @@ -1,6 +1,6 @@ query('SetApiVersion', mControl::API_VERSION)) { + if (!$client->query('SetApiVersion', ManiaControl::API_VERSION)) { trigger_error( - "Couldn't set API version '" . mControl::API_VERSION . "'! This might cause problems. " . + "Couldn't set API version '" . ManiaControl::API_VERSION . "'! This might cause problems. " . $this->iControl->getClientErrorText($client)); }