From 4e30841039bb7c3efe5558e40cba8375baad30f7 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 27 Oct 2015 12:42:19 +0100 Subject: Begin adding basic stats --- src/CmdFunctionRef.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/CmdFunctionRef.hpp') 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 userTypeStrings { {User, "Benutzer"}, -- cgit v1.2.3-54-g00ecf