summaryrefslogtreecommitdiff
path: root/include/ctables.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-16 13:02:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-16 13:02:38 +0000
commit5d18f26b6bfb7a575b50dc2e3ad909131b9f75da (patch)
tree661cc9bedf6c71c6e232d1cb6e18a4a43bfbc606 /include/ctables.h
parent0757a4a495daabf661ac3b7ab79f0a5ee423abe8 (diff)
Fix case sensitive commands issue due to new std::string based parser, improve the craq disabled commands check that was potentially O(n) where n is the number of disabled commands (erk)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4404 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/ctables.h')
-rw-r--r--include/ctables.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/ctables.h b/include/ctables.h
index e6ae76015..828fafd00 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -48,8 +48,11 @@ class command_t : public Extensible
/** used for resource tracking between modules
*/
std::string source;
+ /** True if the command is disabled to non-opers
+ */
+ bool disabled;
- command_t(const std::string &cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara)
+ command_t(const std::string &cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara), disabled(false)
{
use_count = total_bytes = 0;
source = "<core>";
@@ -57,6 +60,16 @@ class command_t : public Extensible
virtual void Handle(const char** parameters, int pcnt, userrec* user) = 0;
+ void Disable(bool setting)
+ {
+ disabled = setting;
+ }
+
+ bool IsDisabled()
+ {
+ return disabled;
+ }
+
virtual ~command_t() {}
};