diff options
Diffstat (limited to 'src/CmdFunctionRef.hpp')
| -rw-r--r-- | src/CmdFunctionRef.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/CmdFunctionRef.hpp b/src/CmdFunctionRef.hpp index b57dd8d..ff63951 100644 --- a/src/CmdFunctionRef.hpp +++ b/src/CmdFunctionRef.hpp @@ -6,8 +6,8 @@ class CRSM; -#define CMD_FUNCTION(name) void name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) -#define CMD_FUNCTION_IMPL(name) void CRSM::name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) { (void)cmd; (void)args; (void)client; (void)userType; +#define CMD_FUNCTION(name) CmdResult name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) +#define CMD_FUNCTION_IMPL(name) CmdResult CRSM::name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) { (void)cmd; (void)args; (void)client; (void)userType; enum UserType { User = 0, @@ -16,7 +16,14 @@ enum UserType { Max = Moderator }; -using CmdFunction = void (CRSM::*)(const QString&, const QString&, const ClientInfo&, UserType); +enum CmdResult { + Success = 0, + SyntaxFail = 1, + RightsFail = 2, + UnknownCommand = 3 +}; + +using CmdFunction = CmdResult (CRSM::*)(const QString&, const QString&, const ClientInfo&, UserType); const QMap<UserType, QString> userTypeStrings { {User, "Benutzer"}, |
