From 5d18f26b6bfb7a575b50dc2e3ad909131b9f75da Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 16 Jul 2006 13:02:38 +0000 Subject: 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 --- include/ctables.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/ctables.h') 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 = ""; @@ -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() {} }; -- cgit v1.2.3