summaryrefslogtreecommitdiff
path: root/include/commands.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
committerAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
commitddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch)
tree0364a76606ac6e2881ebd663601ce260f7c1101e /include/commands.h
parent51c049e1a738e9124bab3961f35b830906517421 (diff)
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'include/commands.h')
-rw-r--r--include/commands.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/commands.h b/include/commands.h
index 9f7782102..207d2c444 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -16,15 +16,6 @@
#include "anope.h"
#include "channels.h"
-enum CommandFlag
-{
- /* Command allow unidentified users to use it */
- CFLAG_ALLOW_UNREGISTERED,
-
- /* Command requires a user to execute */
- CFLAG_REQUIRE_USER
-};
-
struct CommandGroup
{
Anope::string name, description;
@@ -98,10 +89,14 @@ class CoreExport CommandSource
/** Every services command is a class, inheriting from Command.
*/
-class CoreExport Command : public Service, public Flags<CommandFlag>
+class CoreExport Command : public Service
{
Anope::string desc;
std::vector<Anope::string> syntax;
+ /* Allow unregistered users to use this command */
+ bool allow_unregistered;
+ /* Command requires that a user is executing it */
+ bool require_user;
public:
/* Maximum paramaters accepted by this command */
@@ -112,6 +107,7 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
/* Module which owns us */
Module *module;
+ protected:
/** Create a new command.
* @param owner The owner of the command
* @param sname The command name
@@ -121,6 +117,7 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
*/
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
+ public:
virtual ~Command();
protected:
@@ -130,7 +127,14 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
void SetSyntax(const Anope::string &s);
void SendSyntax(CommandSource &);
void SendSyntax(CommandSource &, const Anope::string &syntax);
+
+ void AllowUnregistered(bool b);
+ void RequireUser(bool b);
+
public:
+ bool AllowUnregistered() const;
+ bool RequireUser() const;
+
/** Get the command description
* @return The commands description
*/