diff options
| author | Adam <Adam@anope.org> | 2012-10-08 04:16:23 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-10-08 04:16:23 -0400 |
| commit | e57b470e83fac205a354138b1daccec654214e39 (patch) | |
| tree | 4574a088eda4bc5fa141f7bcbda07e141eae260a /include | |
| parent | b8b63ff115f0daddf479b0da507a2f731255a06d (diff) | |
Made fantasy commands configurable
Diffstat (limited to 'include')
| -rw-r--r-- | include/config.h | 4 | ||||
| -rw-r--r-- | include/modules.h | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/config.h b/include/config.h index de68d3105..f4f164b37 100644 --- a/include/config.h +++ b/include/config.h @@ -688,6 +688,10 @@ class CoreExport ServerConfig std::list<OperType *> MyOperTypes; /* List of pairs of opers and their opertype from the config */ std::vector<Oper *> Opers; + + /* Map of fantasy commands */ + typedef Anope::insensitive_map<CommandInfo> fantasy_map; + fantasy_map Fantasy; }; /** This class can be used on its own to represent an exception, or derived to represent a module-specific exception. diff --git a/include/modules.h b/include/modules.h index 14fdff066..627bbab59 100644 --- a/include/modules.h +++ b/include/modules.h @@ -348,20 +348,22 @@ class CoreExport Module : public Extensible virtual EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) { return EVENT_CONTINUE; } /** Called on fantasy command - * @param command The command - * @param u The user using the command + * @param source The source of the command + * @param c The command * @param ci The channel it's being used in * @param params The params + * @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed */ - virtual void OnBotFantasy(const Anope::string &command, User *u, ChannelInfo *ci, const Anope::string ¶ms) { } + virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } /** Called on fantasy command without access - * @param command The command - * @param u The user using the command + * @param source The source of the command + * @param c The command * @param ci The channel it's being used in * @param params The params + * @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed */ - virtual void OnBotNoFantasyAccess(const Anope::string &command, User *u, ChannelInfo *ci, const Anope::string ¶ms) { } + virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } /** Called after a bot joins a channel * @param c The channel |
