Merge pull request #162 from alliedmodders/steam3-bans
Allow Steam IDs in Steam3 format for sm_addban (r=asherkin).
This commit is contained in:
commit
f8ffe23c6e
@ -301,7 +301,13 @@ public Action:Command_AddBan(client, args)
|
||||
}
|
||||
|
||||
/* 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");
|
||||
return Plugin_Handled;
|
||||
@ -342,13 +348,13 @@ public Action:Command_Unban(client, args)
|
||||
ReplaceString(arg, sizeof(arg), "\"", "");
|
||||
|
||||
new ban_flags;
|
||||
if (strncmp(arg, "STEAM_", 6) == 0 && arg[7] == ':')
|
||||
if (IsCharNumeric(arg[0]))
|
||||
{
|
||||
ban_flags |= BANFLAG_AUTHID;
|
||||
ban_flags |= BANFLAG_IP;
|
||||
}
|
||||
else
|
||||
{
|
||||
ban_flags |= BANFLAG_IP;
|
||||
ban_flags |= BANFLAG_AUTHID;
|
||||
}
|
||||
|
||||
LogAction(client, -1, "\"%L\" removed ban (filter \"%s\")", client, arg);
|
||||
|
Loading…
Reference in New Issue
Block a user