* GET g_ban_sync_uri?action=unban&hostname=...&ip=xxx.xxx.xxx
* - Querying the ban list
* GET g_ban_sync_uri?action=list&hostname=...&servers=xxx.xxx.xxx.xxx;xxx.xxx.xxx.xxx;...
- *
+ *
* shows the bans from the listed servers, and possibly others.
* Format of a ban is ASCII plain text, four lines per ban, delimited by
* newline ONLY (no carriage return):
}
if(syncinterval > 0)
syncinterval *= 60;
-
+
if(status != 0)
{
print("error: status is ", ftos(status), "\n");
float argc;
string uri;
float i, n;
-
+
if(autocvar_g_ban_sync_uri == "")
goto killme;
if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only"
for(i = 1; i < argc; ++i)
OnlineBanList_Servers = strcat(OnlineBanList_Servers, ";", argv(i));
OnlineBanList_Servers = strzone(OnlineBanList_Servers);
-
+
uri = strcat( "action=list&hostname=", uri_escape(autocvar_hostname));
uri = strcat(uri, "&servers=", uri_escape(OnlineBanList_Servers));
else
uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target
}
-
+
if(autocvar_g_ban_sync_interval > 0)
self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
else
{
float i, n;
string msg;
-
+
print("^2Listing all existing active bans:\n");
-
+
n = 0;
for(i = 0; i < ban_count; ++i)
{
if(time > ban_expire[i])
continue;
-
+
++n; // total number of existing bans
-
+
msg = strcat("#", ftos(i), ": ");
msg = strcat(msg, ban_ip[i], " is still banned for ");
msg = strcat(msg, ftos(ban_expire[i] - time), " seconds");
-
+
print(" ", msg, "\n");
}
-
+
print("^2Done listing all active (", ftos(n), ") bans.\n");
}
i4 = strstrofs(s, ".", i3 + 1);
if(i4 >= 0)
s = substring(s, 0, i4);
-
+
ban_ip1 = substring(s, 0, i1); // 8
ban_ip2 = substring(s, 0, i2); // 16
ban_ip3 = substring(s, 0, i3); // 24
{
if(!autocvar_g_banned_list_idmode)
return TRUE;
- if not(ban_idfp)
+ if (!ban_idfp)
return TRUE;
}
return FALSE;