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 | |
| parent | b8f9116b19eb511c4f5e6a683725f50bf732a7dd (diff) | |
Moved the *Serv help functions to Command, will come in use later with subcommands
117 files changed, 707 insertions, 801 deletions
diff --git a/include/commands.h b/include/commands.h index 5d381084e..9e597204e 100644 --- a/include/commands.h +++ b/include/commands.h @@ -78,6 +78,11 @@ class CoreExport Command : public Flags<CommandFlag> */ virtual CommandReturn Execute(User *u, const std::vector<ci::string> &); + /** Called when HELP is requsted for the client this command is on. + * @param u The user requesting help + */ + virtual void OnServHelp(User *u); + /** Requested when the user is requesting help on this command. Help on this command should be sent to the user. * @param u The user requesting help * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of diff --git a/include/modules.h b/include/modules.h index 0acd041f9..8e6711b3b 100644 --- a/include/modules.h +++ b/include/modules.h @@ -334,36 +334,6 @@ class CoreExport Module */ int DelCommand(BotInfo *bi, Command *c); - /** Called on NickServ HELP - * @param u The user requesting help - */ - virtual void OnNickServHelp(User *u) { } - - /** Called on ChanServ HELP - * @param u The user requesting help - */ - virtual void OnChanServHelp(User *u) { } - - /** Called on Botserv HELP - * @param u The user requesting help - */ - virtual void OnBotServHelp(User *u) { } - - /** Called on HostServ HELP - * @param u The user requesting help - */ - virtual void OnHostServHelp(User *u) { } - - /** Called on OperServ HELP - * @param u The user requesting help - */ - virtual void OnOperServHelp(User *u) { } - - /** Called on MemoServ HELP - * @param u The user requesting help - */ - virtual void OnMemoServHelp(User *u) { } - /** Called when the ircd notifies that a user has been kicked from a channel. * @param c The channel the user has been kicked from. * @param target The user that has been kicked. @@ -1091,34 +1061,34 @@ enum Implementation { I_BEGIN, /* NickServ */ - I_OnNickServHelp, I_OnPreNickExpire, I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop, + I_OnPreNickExpire, I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop, I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended, I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay, I_OnDelNickRequest, I_OnMakeNickRequest, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickInfo, /* ChanServ */ - I_OnChanServHelp, I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange, + I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange, I_OnAccessDel, I_OnAccessClear, I_OnLevelChange, I_OnChanRegistered, I_OnChanUnsuspend, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnChanInfo, /* BotServ */ - I_OnBotServHelp, I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign, + I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign, I_OnUserKicked, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan, I_OnBadWordAdd, I_OnBadWordDel, /* HostServ */ - I_OnHostServHelp, I_OnSetVhost, I_OnDeleteVhost, + I_OnSetVhost, I_OnDeleteVhost, /* MemoServ */ - I_OnMemoServHelp, I_OnMemoSend, I_OnMemoDel, + I_OnMemoSend, I_OnMemoDel, /* Users */ I_OnPreUserConnect, I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnUserLogoff, I_OnPreJoinChannel, I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, /* OperServ */ - I_OnOperServHelp, I_OnDefconLevel, I_OnAddAkill, I_OnDelAkill, I_OnExceptionAdd, I_OnExceptionDel, + I_OnDefconLevel, I_OnAddAkill, I_OnDelAkill, I_OnExceptionAdd, I_OnExceptionDel, I_OnAddXLine, I_OnDelXLine, /* Database */ 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); + } |
