From 24731c63b6320be22f7b3220236271fa7476b975 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:48:48 +0000 Subject: Add Module* creator to Command and ModeHandler git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11631 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/mode.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'include/mode.h') diff --git a/include/mode.h b/include/mode.h index da202c236..0f43d6db4 100644 --- a/include/mode.h +++ b/include/mode.h @@ -150,6 +150,9 @@ class CoreExport ModeHandler : public classbase char prefixneeded; public: + /** Module that created this mode. NULL for core modes */ + Module* creator; + /** * The constructor for ModeHandler initalizes the mode handler. * The constructor of any class you derive from ModeHandler should @@ -165,9 +168,12 @@ class CoreExport ModeHandler : public classbase * In the core, the only modes to implement prefixes are +ovh (ops, voice, halfop) which define the prefix characters @, % and + * and the rank values OP_VALUE, HALFOP_VALUE and VOICE_VALUE respectively. Any prefixes you define should have unique values proportional * to these three defaults or proportional to another mode in a module you depend on. See src/cmode_o.cpp as an example. + * @param prefixrequired The prefix required to change this mode + * @param translate The translation type for the argument(s) of this mode */ - ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, - char mprefix = 0, char prefixrequired = '%', TranslateType translate = TR_TEXT); + ModeHandler(InspIRCd* Instance, Module* me, char modeletter, int parameters_on, int parameters_off, + bool listmode, ModeType type, bool operonly, char mprefix = 0, + char prefixrequired = '%', TranslateType translate = TR_TEXT); /** * The default destructor does nothing */ @@ -321,8 +327,9 @@ class CoreExport ModeHandler : public classbase class CoreExport SimpleUserModeHandler : public ModeHandler { public: - SimpleUserModeHandler(InspIRCd* Instance, char modeletter); - virtual ~SimpleUserModeHandler(); + SimpleUserModeHandler(InspIRCd* Instance, Module* Creator, char modeletter) + : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_USER, false) {} + virtual ~SimpleUserModeHandler() {} virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode = false); }; @@ -334,8 +341,9 @@ class CoreExport SimpleUserModeHandler : public ModeHandler class CoreExport SimpleChannelModeHandler : public ModeHandler { public: - SimpleChannelModeHandler(InspIRCd* Instance, char modeletter); - virtual ~SimpleChannelModeHandler(); + SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter) + : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) {} + virtual ~SimpleChannelModeHandler() {} virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode = false); }; -- cgit v1.2.3