added new API key, moved after boolean check, added check that sourceban ban was not unbanned

This commit is contained in:
jenz 2022-04-10 19:03:50 +02:00
parent dfe0323283
commit 25ce1e8faf

View File

@ -1,7 +1,7 @@
#pragma semicolon 1
#define PLUGIN_AUTHOR "jenz but with stuff from neons vpn checker"
#define PLUGIN_VERSION "1.0"
#define APIKEY "30r040-2w8k51-711148-8118n3"
#define APIKEY "mfg242-532328-b34d06-5a8262"
#pragma newdecls optional
#include <SteamWorks>
#pragma newdecls required
@ -201,7 +201,7 @@ public void sql_truncate_sb_bans_shortened(Database db, DBResultSet results, con
if ((client = GetClientFromSerial(data)) == 0)
return;
char sql_statement[512];
Format(sql_statement, sizeof(sql_statement), "select distinct ip, authid from sb_bans where ip is not null and ip != '' and authid is not null and authid != '' and (ends = created or ends > UNIX_TIMESTAMP())");
Format(sql_statement, sizeof(sql_statement), "select distinct ip, authid from sb_bans where ip is not null and ip != '' and authid is not null and authid != '' and (RemoveType != 'U' or RemoveType is NULL) and (ends = created or ends > UNIX_TIMESTAMP())");
g_hDatabase_sourceban.Query(sql_select_sb_bans, sql_statement, GetClientSerial(client), DBPrio_High);
delete results;
}
@ -230,6 +230,7 @@ public void sql_select_sb_bans(Database db, DBResultSet results, const char[] er
results.FetchString(0, sIP, sizeof(sIP));
results.FetchString(1, sAuthID, sizeof(sAuthID));
Format(sql_statement, sizeof(sql_statement), "%s ('%s','%s'),", sql_statement, sAuthID, sIP);
after_result = true;
if (strlen(sql_statement) > 2700)
{
Format(sql_statement, strlen(sql_statement), sql_statement);
@ -237,7 +238,6 @@ public void sql_select_sb_bans(Database db, DBResultSet results, const char[] er
Format(sql_statement, sizeof(sql_statement), "INSERT IGNORE INTO `sb_bans_shortened` (`steam_id`,`ipv4`) VALUES ");
after_result = false;
}
after_result = true;
}
Format(sql_statement, strlen(sql_statement), sql_statement);
if (after_result)