From 9653658f06b709ba69515da5f34d375ad269c693 Mon Sep 17 00:00:00 2001 From: Max Klaversma Date: Thu, 1 May 2014 01:50:52 +0200 Subject: [PATCH] Added commanddescriptions to plugins. --- application/plugins/ChatMessagePlugin.php | 36 ++++++++++----------- application/plugins/CustomVotes.php | 2 +- application/plugins/Dedimania/Dedimania.php | 2 +- application/plugins/Donations.php | 6 ++-- application/plugins/LocalRecords.php | 4 +-- application/plugins/ServerRanking.php | 4 +-- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/application/plugins/ChatMessagePlugin.php b/application/plugins/ChatMessagePlugin.php index f4889bad..84ae71fb 100644 --- a/application/plugins/ChatMessagePlugin.php +++ b/application/plugins/ChatMessagePlugin.php @@ -51,25 +51,23 @@ class ChatMessagePlugin implements CommandListener, Plugin { public function load(ManiaControl $maniaControl) { $this->maniaControl = $maniaControl; - $this->maniaControl->commandManager->registerCommandListener('me', $this, 'chat_me'); - $this->maniaControl->commandManager->registerCommandListener('hi', $this, 'chat_hi'); - $this->maniaControl->commandManager->registerCommandListener('bye', $this, 'chat_bye'); - $this->maniaControl->commandManager->registerCommandListener('bb', $this, 'chat_bye'); - $this->maniaControl->commandManager->registerCommandListener('thx', $this, 'chat_thx'); - $this->maniaControl->commandManager->registerCommandListener('gg', $this, 'chat_gg'); - $this->maniaControl->commandManager->registerCommandListener('gl', $this, 'chat_gl'); - $this->maniaControl->commandManager->registerCommandListener('hf', $this, 'chat_hf'); - $this->maniaControl->commandManager->registerCommandListener('glhf', $this, 'chat_glhf'); - $this->maniaControl->commandManager->registerCommandListener('ns', $this, 'chat_ns'); - $this->maniaControl->commandManager->registerCommandListener('n1', $this, 'chat_n1'); - $this->maniaControl->commandManager->registerCommandListener('lol', $this, 'chat_lol'); - $this->maniaControl->commandManager->registerCommandListener('lool', $this, 'chat_lool'); - $this->maniaControl->commandManager->registerCommandListener('brb', $this, 'chat_brb'); - $this->maniaControl->commandManager->registerCommandListener('bgm', $this, 'chat_bgm'); - $this->maniaControl->commandManager->registerCommandListener('afk', $this, 'chat_afk'); - $this->maniaControl->commandManager->registerCommandListener('bootme', $this, 'chat_bootme'); - $this->maniaControl->commandManager->registerCommandListener('ragequit', $this, 'chat_ragequit'); - $this->maniaControl->commandManager->registerCommandListener('rq', $this, 'chat_ragequit'); + $this->maniaControl->commandManager->registerCommandListener('me', $this, 'chat_me', false, 'Can be used to express your feelings/ideas.'); + $this->maniaControl->commandManager->registerCommandListener('hi', $this, 'chat_hi', false, 'Writes an hello message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener(array('bb', 'bye'), $this, 'chat_bye', false, 'Writes a goodbye message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('thx', $this, 'chat_thx', false, 'Writes a thanks message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('gg', $this, 'chat_gg', false, 'Writes a good game message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('gl', $this, 'chat_gl', false, 'Writes a good luck message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('hf', $this, 'chat_hf', false, 'Writes an have fun message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('glhf', $this, 'chat_glhf', false, 'Writes a good luck, have fun message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('ns', $this, 'chat_ns', false, 'Writes a nice shot message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('n1', $this, 'chat_n1', false, 'Writes a nice one message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('lol', $this, 'chat_lol', false, 'Writes a lol message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('lool', $this, 'chat_lool', false, 'Writes a lool message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('brb', $this, 'chat_brb', false, 'Writes a be right back message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('bgm', $this, 'chat_bgm', false, 'Writes a bad game for me message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener('afk', $this, 'chat_afk', false, 'Writes an away from keyboard message to the chat.'); + $this->maniaControl->commandManager->registerCommandListener(array('bm', 'bootme'), $this, 'chat_bootme', false, 'Gets you away from this server quickly!'); + $this->maniaControl->commandManager->registerCommandListener(array('rq', 'ragequit'), $this, 'chat_ragequit', false, 'Gets you away from this server in rage!'); //TODO block commandlistener for muted people $this->maniaControl->settingManager->initSetting($this, self::SETTING_AFK_FORCE_SPEC, true); diff --git a/application/plugins/CustomVotes.php b/application/plugins/CustomVotes.php index 2a4b8f1e..8a8ca3e9 100644 --- a/application/plugins/CustomVotes.php +++ b/application/plugins/CustomVotes.php @@ -102,7 +102,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP public function load(ManiaControl $maniaControl) { $this->maniaControl = $maniaControl; - $this->maniaControl->commandManager->registerCommandListener('vote', $this, 'chat_vote'); + $this->maniaControl->commandManager->registerCommandListener('vote', $this, 'chat_vote', false, 'Votes for the current vote.'); $this->maniaControl->timerManager->registerTimerListening($this, 'handle1Second', 1000); $this->maniaControl->callbackManager->registerCallbackListener(ServerCommands::CB_VOTE_CANCELED, $this, 'handleVoteCanceled'); $this->maniaControl->manialinkManager->registerManialinkPageAnswerListener(self::ACTION_POSITIVE_VOTE, $this, 'handlePositiveVote'); diff --git a/application/plugins/Dedimania/Dedimania.php b/application/plugins/Dedimania/Dedimania.php index 5c8c34e3..a3ef602d 100644 --- a/application/plugins/Dedimania/Dedimania.php +++ b/application/plugins/Dedimania/Dedimania.php @@ -111,7 +111,7 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu $this->maniaControl->timerManager->registerTimerListening($this, 'updateEverySecond', 1000); $this->maniaControl->timerManager->registerTimerListening($this, 'handleEveryMinute', 1000 * 60); $this->maniaControl->timerManager->registerTimerListening($this, 'updatePlayerList', 1000 * 60 * 3); - $this->maniaControl->commandManager->registerCommandListener('dedirecs', $this, 'showDediRecordsList'); + $this->maniaControl->commandManager->registerCommandListener(array('dedirecs', 'dedirecords'), $this, 'showDediRecordsList', false, 'Shows a list of Dedimania records of the current map.'); // Open session $serverInfo = $this->maniaControl->server->getInfo(); diff --git a/application/plugins/Donations.php b/application/plugins/Donations.php index feaa4ad9..697f1280 100644 --- a/application/plugins/Donations.php +++ b/application/plugins/Donations.php @@ -72,9 +72,9 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { $this->maniaControl = $maniaControl; // Register for commands - $this->maniaControl->commandManager->registerCommandListener('donate', $this, 'command_Donate'); - $this->maniaControl->commandManager->registerCommandListener('pay', $this, 'command_Pay', true); - $this->maniaControl->commandManager->registerCommandListener('planets', $this, 'command_GetPlanets', true); + $this->maniaControl->commandManager->registerCommandListener('donate', $this, 'command_Donate', false, 'Donate some planets to the server.'); + $this->maniaControl->commandManager->registerCommandListener('pay', $this, 'command_Pay', true, 'Pays planets from the server to a player.'); + $this->maniaControl->commandManager->registerCommandListener('planets', $this, 'command_GetPlanets', true, 'Checks the planets-balance of the server.'); // Register for callbacks $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerConnect'); diff --git a/application/plugins/LocalRecords.php b/application/plugins/LocalRecords.php index c766c477..7749da7c 100644 --- a/application/plugins/LocalRecords.php +++ b/application/plugins/LocalRecords.php @@ -103,8 +103,8 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_TM_PLAYERCHECKPOINT, $this, 'handlePlayerCheckpoint'); $this->maniaControl->callbackManager->registerCallbackListener(SettingManager::CB_SETTINGS_CHANGED, $this, 'handleSettingsChanged'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer'); - $this->maniaControl->commandManager->registerCommandListener('records', $this, 'showRecordsList'); - $this->maniaControl->commandManager->registerCommandListener('delrec', $this, 'deleteRecord', true); + $this->maniaControl->commandManager->registerCommandListener(array('recs', 'records'), $this, 'showRecordsList', false, 'Shows a list of Local Records on the current map.'); + $this->maniaControl->commandManager->registerCommandListener('delrec', $this, 'deleteRecord', true, 'Removes a record from the database.'); return true; } diff --git a/application/plugins/ServerRanking.php b/application/plugins/ServerRanking.php index 27e310f7..db624403 100644 --- a/application/plugins/ServerRanking.php +++ b/application/plugins/ServerRanking.php @@ -98,8 +98,8 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener { $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'handleEndMap'); //Register CommandListener - $this->maniaControl->commandManager->registerCommandListener('rank', $this, 'command_showRank', false); - $this->maniaControl->commandManager->registerCommandListener('nextrank', $this, 'command_nextRank', false); + $this->maniaControl->commandManager->registerCommandListener('rank', $this, 'command_showRank', false, 'Shows your current serverrank.'); + $this->maniaControl->commandManager->registerCommandListener('nextrank', $this, 'command_nextRank', false, 'Shows the person in front of you in the serverranking.'); $this->resetRanks(); //TODO only update records count }