From 25ce1e8fafb4344a1865feef31ef7ee8ff50a4bc Mon Sep 17 00:00:00 2001
From: jenz <unlozehq@gmail.com>
Date: Sun, 10 Apr 2022 19:03:50 +0200
Subject: [PATCH] added new API key, moved after boolean check, added check
 that sourceban ban was not unbanned

---
 nosteam_verificiation/scripting/nosteam_verifier.sp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nosteam_verificiation/scripting/nosteam_verifier.sp b/nosteam_verificiation/scripting/nosteam_verifier.sp
index 0f4d6fab..64e5d55d 100644
--- a/nosteam_verificiation/scripting/nosteam_verifier.sp
+++ b/nosteam_verificiation/scripting/nosteam_verifier.sp
@@ -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)