From: John Hodge Date: Thu, 6 Jan 2011 05:25:30 +0000 (+0800) Subject: Added coke group check to ADD X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;ds=sidebyside;h=3946b731ccdc2a4718e77fbc76aa93608bc81648;p=tpg%2Fopendispense2.git Added coke group check to ADD - Also fixed a place where a newline was not sent to the client - Added a "door" flag --- diff --git a/src/cokebank.h b/src/cokebank.h index 729d586..2771462 100644 --- a/src/cokebank.h +++ b/src/cokebank.h @@ -20,7 +20,8 @@ enum eCokebank_Flags { USER_TYPE_WHEEL = 0x02, USER_TYPE_GOD = 0x03, - USER_FLAG_DISABLED = 0x80 + USER_FLAG_DOORGROUP = 0x40, + USER_FLAG_DISABLED = 0x80 }; // --- Cokebank Functions --- diff --git a/src/server/server.c b/src/server/server.c index b072652..9cdee83 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -516,7 +516,7 @@ void Server_Cmd_GIVE(tClient *Client, char *Args) // Get recipient uid = GetUserID(recipient); if( uid == -1 ) { - sendf(Client->Socket, "404 Invalid target user"); + sendf(Client->Socket, "404 Invalid target user\n"); return ; } @@ -571,11 +571,15 @@ void Server_Cmd_ADD(tClient *Client, char *Args) reason ++; // TODO: Check if the current user is in coke/higher + if( (GetFlags(Client->UID) & USER_FLAG_TYPEMASK) < USER_TYPE_COKE ) { + sendf(Client->Socket, "403 Not in coke\n"); + return ; + } // Get recipient uid = GetUserID(user); if( uid == -1 ) { - sendf(Client->Socket, "404 Invalid user"); + sendf(Client->Socket, "404 Invalid user\n"); return ; }