From e57b470e83fac205a354138b1daccec654214e39 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 8 Oct 2012 04:16:23 -0400 Subject: Made fantasy commands configurable --- include/config.h | 4 ++++ include/modules.h | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'include') 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 MyOperTypes; /* List of pairs of opers and their opertype from the config */ std::vector Opers; + + /* Map of fantasy commands */ + typedef Anope::insensitive_map 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 ¶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 ¶ms) { return EVENT_CONTINUE; } /** Called after a bot joins a channel * @param c The channel -- cgit