Merge pull request #162 from alliedmodders/steam3-bans

Allow Steam IDs in Steam3 format for sm_addban (r=asherkin).
This commit is contained in:
Nicholas Hastings 2014-10-20 21:14:54 -04:00
commit f8ffe23c6e

View File

@ -301,7 +301,13 @@ public Action:Command_AddBan(client, args)
} }
/* Verify steamid */ /* Verify steamid */
if (strncmp(authid, "STEAM_", 6) != 0 || authid[7] != ':') new bool:idValid = false;
if (!strncmp(authid, "STEAM_", 6) && authid[7] == ':')
idValid = true;
else if (!strncmp(authid, "[U:", 3))
idValid = true;
if (!idValid)
{ {
ReplyToCommand(client, "[SM] %t", "Invalid SteamID specified"); ReplyToCommand(client, "[SM] %t", "Invalid SteamID specified");
return Plugin_Handled; return Plugin_Handled;
@ -342,13 +348,13 @@ public Action:Command_Unban(client, args)
ReplaceString(arg, sizeof(arg), "\"", ""); ReplaceString(arg, sizeof(arg), "\"", "");
new ban_flags; new ban_flags;
if (strncmp(arg, "STEAM_", 6) == 0 && arg[7] == ':') if (IsCharNumeric(arg[0]))
{ {
ban_flags |= BANFLAG_AUTHID; ban_flags |= BANFLAG_IP;
} }
else else
{ {
ban_flags |= BANFLAG_IP; ban_flags |= BANFLAG_AUTHID;
} }
LogAction(client, -1, "\"%L\" removed ban (filter \"%s\")", client, arg); LogAction(client, -1, "\"%L\" removed ban (filter \"%s\")", client, arg);