diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:23:03 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:23:03 +0000 |
commit | d121c4bd37bdcc1a4d863d6452a33176d1f4bcc6 (patch) | |
tree | 6c60dea832f71a5d949b0b0ebde311415734aecc /include/modules.h | |
parent | 02452a03756197fbdb976bd8bc41ffd69eeb61fe (diff) |
Add CFLAG_ALLOW_UNREGISTERED, commands without this flag will now not run for unregistered users.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2065 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/modules.h')
-rw-r--r-- | include/modules.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/modules.h b/include/modules.h index 56d6aece1..ba0a2bc8f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -146,10 +146,16 @@ struct ModuleLang_ { char **argv; }; +enum CommandFlags +{ + CFLAG_ALLOW_UNREGISTERED +}; + /** Every services command is a class, inheriting from Command. */ class Command { + int flags; public: size_t MaxParams; size_t MinParams; @@ -181,7 +187,21 @@ class Command */ virtual void OnSyntaxError(User *u); - int (*has_priv)(User *u); /* Returns 1 if user may use command, else 0 */ + /** Set a certain flag on this command. + * @param flag The CommandFlag to set on this command. + */ + void SetFlag(CommandFlags flag); + + /** Remove a certain flag from this command. + * @param flag The CommandFlag to unset. + */ + void UnsetFlag(CommandFlags flag); + + /** Check whether a certain flag is set on this command. + * @param flag The CommandFlag to check. + * @return bool True if the flag is set, false else. + */ + bool HasFlag(CommandFlags flag) const; char *help_param1; char *help_param2; |