aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-04-14 21:30:50 +0100
committerGravatar Sadie Powell2020-04-14 21:30:50 +0100
commit9ec5126eeb7fde18547bd9e0e4cb69cc1e3b2f5e (patch)
tree81951879b7af3bbcbf2fb8fb6e9b00b3f5084fb9 /include
parentMerge branch 'insp3' into master. (diff)
Replace the flags_required field with an enum.
Diffstat (limited to 'include')
-rw-r--r--include/ctables.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/include/ctables.h b/include/ctables.h
index e2af2fa05..c2b2382f5 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -26,6 +26,19 @@
#pragma once
+/** Used to indicate the type of a command. */
+enum class CmdAccess : uint8_t
+{
+ /* The command has no special attributes. */
+ NORMAL = 0,
+
+ /** Only server operators can use the command. */
+ OPERATOR = 1,
+
+ /** Only servers can use the command. */
+ SERVER = 2,
+};
+
/** Used to indicate the result of trying to execute a command. */
enum CmdResult
{
@@ -39,9 +52,6 @@ enum CmdResult
CMD_INVALID = 2
};
-/** Flag for commands that are only allowed from servers */
-const char FLAG_SERVERONLY = 7; // technically anything nonzero below 'A' works
-
/** Translation types for translation of parameters to UIDs.
* This allows the core commands to not have to be aware of how UIDs
* work (making it still possible to write other linking modules which
@@ -208,8 +218,8 @@ class CoreExport Command : public CommandBase
/** Unregisters this command from the command parser. */
~Command() override;
- /** The user modes required to be able to execute this command. */
- unsigned char flags_needed = 0;
+ /** Who can access this command? */
+ CmdAccess access_needed = CmdAccess::NORMAL;
/** Whether the command will not be forwarded by the linking module even if it comes via ENCAP. */
bool force_manual_route = false;