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 | |
| parent | b8f9116b19eb511c4f5e6a683725f50bf732a7dd (diff) | |
Moved the *Serv help functions to Command, will come in use later with subcommands
Diffstat (limited to 'src')
115 files changed, 696 insertions, 765 deletions
diff --git a/src/command.cpp b/src/command.cpp index b440c741f..7fd5975ef 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -22,6 +22,8 @@ Command::~Command() CommandReturn Command::Execute(User *u, const std::vector<ci::string> &) { return MOD_CONT; } +void Command::OnServHelp(User *u) { } + bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; } void Command::OnSyntaxError(User *u, const ci::string &subcommand) { } 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 |
