From 1abbbdb9eb8589fa86565b6b5535b416b3dd528a Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 9 Nov 2013 12:20:38 +0100 Subject: [PATCH] started with plugin class --- application/.idea/.name | 1 + application/.idea/application.iml | 9 + application/.idea/dictionaries/Lukas.xml | 3 + application/.idea/encodings.xml | 5 + application/.idea/misc.xml | 36 +++ application/.idea/modules.xml | 9 + application/.idea/scopes/scope_settings.xml | 5 + application/.idea/vagrant.xml | 8 + application/.idea/vcs.xml | 7 + application/.idea/workspace.xml | 329 ++++++++++++++++++++ application/core/database.ManiaControl.php | 8 +- application/core/manialinkIdHandler.php | 25 +- application/core/plugin.php | 10 +- application/core/pluginHandler.php | 2 +- application/plugins/chatlog.plugin.php | 4 +- 15 files changed, 444 insertions(+), 17 deletions(-) create mode 100644 application/.idea/.name create mode 100644 application/.idea/application.iml create mode 100644 application/.idea/dictionaries/Lukas.xml create mode 100644 application/.idea/encodings.xml create mode 100644 application/.idea/misc.xml create mode 100644 application/.idea/modules.xml create mode 100644 application/.idea/scopes/scope_settings.xml create mode 100644 application/.idea/vagrant.xml create mode 100644 application/.idea/vcs.xml create mode 100644 application/.idea/workspace.xml diff --git a/application/.idea/.name b/application/.idea/.name new file mode 100644 index 00000000..e1993483 --- /dev/null +++ b/application/.idea/.name @@ -0,0 +1 @@ +application \ No newline at end of file diff --git a/application/.idea/application.iml b/application/.idea/application.iml new file mode 100644 index 00000000..6b8184f8 --- /dev/null +++ b/application/.idea/application.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/application/.idea/dictionaries/Lukas.xml b/application/.idea/dictionaries/Lukas.xml new file mode 100644 index 00000000..acff9c3f --- /dev/null +++ b/application/.idea/dictionaries/Lukas.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/application/.idea/encodings.xml b/application/.idea/encodings.xml new file mode 100644 index 00000000..e206d70d --- /dev/null +++ b/application/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/application/.idea/misc.xml b/application/.idea/misc.xml new file mode 100644 index 00000000..6b270bab --- /dev/null +++ b/application/.idea/misc.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + SASS/SCSS + + + + + + + + + + + + + + + + + + + diff --git a/application/.idea/modules.xml b/application/.idea/modules.xml new file mode 100644 index 00000000..19cab6b6 --- /dev/null +++ b/application/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/application/.idea/scopes/scope_settings.xml b/application/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/application/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/application/.idea/vagrant.xml b/application/.idea/vagrant.xml new file mode 100644 index 00000000..50398a10 --- /dev/null +++ b/application/.idea/vagrant.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/application/.idea/vcs.xml b/application/.idea/vcs.xml new file mode 100644 index 00000000..def6a6a1 --- /dev/null +++ b/application/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/application/.idea/workspace.xml b/application/.idea/workspace.xml new file mode 100644 index 00000000..22b50d3c --- /dev/null +++ b/application/.idea/workspace.xml @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1383994867593 + 1383994867593 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/core/database.ManiaControl.php b/application/core/database.ManiaControl.php index e10eab0d..57fe8865 100644 --- a/application/core/database.ManiaControl.php +++ b/application/core/database.ManiaControl.php @@ -36,7 +36,7 @@ class Database { // Load config $this->config = Tools::loadConfig('database.ManiaControl.xml'); - $this->iControl->checkConfig($this->config, array("host", "user"), 'database.ManiaControl.xml'); + $this->mControl->checkConfig($this->config, array("host", "user"), 'database.ManiaControl.xml'); // Get mysql server information $host = $this->config->xpath('host'); @@ -73,8 +73,8 @@ class Database { $this->initTables(); // Register for callbacks - $this->iControl->callbacks->registerCallbackHandler(Callbacks::CB_IC_5_SECOND, $this, 'handle5Second'); - $this->iControl->callbacks->registerCallbackHandler(Callbacks::CB_IC_BEGINMAP, $this, 'handleBeginMap'); + $this->mControl->callbacks->registerCallbackHandler(Callbacks::CB_IC_5_SECOND, $this, 'handle5Second'); + $this->mControl->callbacks->registerCallbackHandler(Callbacks::CB_IC_BEGINMAP, $this, 'handleBeginMap'); } /** @@ -227,7 +227,7 @@ class Database { */ public function handle5Second($callback = null) { // Save current players in database - $players = $this->iControl->server->getPlayers(); + $players = $this->mControl->server->getPlayers(); if ($players) { $query = ""; foreach ($players as $player) { diff --git a/application/core/manialinkIdHandler.php b/application/core/manialinkIdHandler.php index e1ab3b67..167a9599 100644 --- a/application/core/manialinkIdHandler.php +++ b/application/core/manialinkIdHandler.php @@ -1,6 +1,6 @@ maniaLinkIdCount; + } + $this->maniaLinkIdCount += $count; + return $mlIds; + } } ?> \ No newline at end of file diff --git a/application/core/plugin.php b/application/core/plugin.php index 4a30f1b7..5e25f90f 100644 --- a/application/core/plugin.php +++ b/application/core/plugin.php @@ -1,6 +1,6 @@ updateUrl = ''; } - /* - public function __construct($mControl, $name, $version, $author, $updateUrl = ''){ - $this->mControl = $mControl; - $this->name = $name; - $this->version = $version; - $this->author = $author; - $this->updateUrl = $updateUrl; - }*/ /** * Reserves manialinks on the ManialinkIdHandler diff --git a/application/core/pluginHandler.php b/application/core/pluginHandler.php index 7bd3bf9b..5b5d0f19 100644 --- a/application/core/pluginHandler.php +++ b/application/core/pluginHandler.php @@ -1,6 +1,6 @@ loadSettings(); - // Register for callbacks + // Register for callbacksc $this->iControl->callbacks->registerCallbackHandler(Callbacks::CB_MP_PLAYERCHAT, $this, 'handlePlayerChatCallback'); error_log('Chatlog Pugin v' . self::VERSION . ' ready!');