diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-05-30 17:21:44 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:04:09 -0400 |
| commit | 6cd88494662c5c4af2da891926dcc82367596cb9 (patch) | |
| tree | 59f67163abee4e7468a26b25f9cecca270f57b70 /src/core | |
| parent | b8f9116b19eb511c4f5e6a683725f50bf732a7dd (diff) | |
Moved the *Serv help functions to Command, will come in use later with subcommands
Diffstat (limited to 'src/core')
108 files changed, 648 insertions, 720 deletions
diff --git a/src/core/bs_act.cpp b/src/core/bs_act.cpp index da921b47a..d313fd587 100644 --- a/src/core/bs_act.cpp +++ b/src/core/bs_act.cpp @@ -65,6 +65,11 @@ class CommandBSAct : public Command notice_help(Config.s_BotServ, u, BOT_HELP_ACT); return true; } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ACT); + } }; class BSAct : public Module @@ -76,12 +81,6 @@ class BSAct : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSAct()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ACT); } }; diff --git a/src/core/bs_assign.cpp b/src/core/bs_assign.cpp index dc847eb66..d5fa0bdef 100644 --- a/src/core/bs_assign.cpp +++ b/src/core/bs_assign.cpp @@ -75,6 +75,11 @@ class CommandBSAssign : public Command { syntax_error(Config.s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ASSIGN); + } }; class BSAssign : public Module @@ -86,12 +91,6 @@ class BSAssign : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSAssign); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ASSIGN); } }; diff --git a/src/core/bs_badwords.cpp b/src/core/bs_badwords.cpp index 62a9ef665..7a9c6ebdf 100644 --- a/src/core/bs_badwords.cpp +++ b/src/core/bs_badwords.cpp @@ -259,6 +259,11 @@ class CommandBSBadwords : public Command { syntax_error(Config.s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BADWORDS); + } }; class BSBadwords : public Module @@ -270,12 +275,6 @@ class BSBadwords : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSBadwords); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BADWORDS); } }; diff --git a/src/core/bs_bot.cpp b/src/core/bs_bot.cpp index 2c5888554..1d3103e29 100644 --- a/src/core/bs_bot.cpp +++ b/src/core/bs_bot.cpp @@ -409,6 +409,11 @@ class CommandBSBot : public Command { syntax_error(Config.s_BotServ, u, "BOT", BOT_BOT_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOT); + } }; class BSBot : public Module @@ -420,12 +425,6 @@ class BSBot : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSBot()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOT); } }; diff --git a/src/core/bs_botlist.cpp b/src/core/bs_botlist.cpp index 12c90ab8b..ebebf7a71 100644 --- a/src/core/bs_botlist.cpp +++ b/src/core/bs_botlist.cpp @@ -73,6 +73,11 @@ class CommandBSBotList : public Command notice_help(Config.s_BotServ, u, BOT_HELP_BOTLIST); return true; } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOTLIST); + } }; class BSBotList : public Module @@ -84,12 +89,6 @@ class BSBotList : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSBotList()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOTLIST); } }; diff --git a/src/core/bs_help.cpp b/src/core/bs_help.cpp index a3e53df5c..80070c138 100644 --- a/src/core/bs_help.cpp +++ b/src/core/bs_help.cpp @@ -33,7 +33,8 @@ class CommandBSHelp : public Command { // Abuse syntax error to display general list help. notice_help(Config.s_BotServ, u, BOT_HELP); - FOREACH_MOD(I_OnBotServHelp, OnBotServHelp(u)); + for (CommandMap::const_iterator it = BotServ->Commands.begin(); it != BotServ->Commands.end(); ++it) + it->second->OnServHelp(u); notice_help(Config.s_BotServ, u, BOT_HELP_FOOTER, Config.BSMinUsers); } }; diff --git a/src/core/bs_info.cpp b/src/core/bs_info.cpp index f7d6fb46d..4e8cf042f 100644 --- a/src/core/bs_info.cpp +++ b/src/core/bs_info.cpp @@ -240,6 +240,11 @@ class CommandBSInfo : public Command { syntax_error(Config.s_BotServ, u, "INFO", BOT_INFO_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_INFO); + } }; class BSInfo : public Module @@ -251,12 +256,6 @@ class BSInfo : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSInfo()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_INFO); } }; diff --git a/src/core/bs_kick.cpp b/src/core/bs_kick.cpp index ab2782c8d..6c8e020e4 100644 --- a/src/core/bs_kick.cpp +++ b/src/core/bs_kick.cpp @@ -325,6 +325,11 @@ class CommandBSKick : public Command { syntax_error(Config.s_BotServ, u, "KICK", BOT_KICK_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_KICK); + } }; class BSKick : public Module @@ -336,12 +341,6 @@ class BSKick : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSKick()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_KICK); } }; diff --git a/src/core/bs_say.cpp b/src/core/bs_say.cpp index 8dfc55115..a388a1ec9 100644 --- a/src/core/bs_say.cpp +++ b/src/core/bs_say.cpp @@ -71,6 +71,11 @@ class CommandBSSay : public Command { syntax_error(Config.s_BotServ, u, "SAY", BOT_SAY_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_SAY); + } }; class BSSay : public Module @@ -82,12 +87,6 @@ class BSSay : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(BotServ, new CommandBSSay()); - - ModuleManager::Attach(I_OnBotServHelp, this); - } - void OnBotServHelp(User *u) - { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_SAY); } }; diff --git a/src/core/bs_set.cpp b/src/core/bs_set.cpp index 3468198a2..a5fee9d4f 100644 --- a/src/core/bs_set.cpp +++ b/src/core/bs_set.cpp @@ -176,6 +176,11 @@ class CommandBSSet : public Command { syntax_error(Config.s_BotServ, u, "SET", BOT_SET_SYNTAX); } + + void OnServHelp(User *u) + { + notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_SET); + } }; class BSSet : public Module { @@ -186,12 +191,6 @@ class BSSet : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); this->AddCommand(Bo |
