From 5f24ccd723477f902acfd36536700e41ecc0da64 Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 17 Feb 2024 16:02:45 +0100 Subject: [PATCH] fixed sql syntax errors --- jenz_ban_detector/scripting/jenz_ban_detector.sp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jenz_ban_detector/scripting/jenz_ban_detector.sp b/jenz_ban_detector/scripting/jenz_ban_detector.sp index 1ea9ce57..25114288 100644 --- a/jenz_ban_detector/scripting/jenz_ban_detector.sp +++ b/jenz_ban_detector/scripting/jenz_ban_detector.sp @@ -184,7 +184,7 @@ public Action SQL_Select_fingerprints(Handle hTimer, int Serial) GetClientIP(client, sIP, sizeof(sIP)); GetClientAuthId(client, AuthId_Steam2, sSID, sizeof(sSID)); //steamID is unique but fingerprint might occur multiple times. - Format(sQuery, sizeof(sQuery), "select steamid from ban_detector.ban_detector where fingerprint = (select fingerprint from ban_detector.ban_detector where steamid = '%s'", sSID); + Format(sQuery, sizeof(sQuery), "select steamid from ban_detector.ban_detector where fingerprint = (select fingerprint from ban_detector.ban_detector where steamid = '%s')", sSID); //PrintToChatAll("sQuery: %s", sQuery); g_dDatabase.Query(SQL_FindFingerPrints, sQuery, Serial, DBPrio_Low); } @@ -213,7 +213,7 @@ public void SQL_FindFingerPrints(Database db, DBResultSet results, const char[] //god knows how big this might need to be char sQuery[4344]; - Format(sQuery, sizeof(sQuery), "select sb.authid from unloze_sourceban.sb_bans where sb.authid in ("); + Format(sQuery, sizeof(sQuery), "select authid from unloze_sourceban.sb_bans where authid in ("); //cant rely on IP cause several chinese players share VPN and end up with same IP despite clearly being different people. //now instead of fingerprint returns all steam IDs related to the specific fingerprint. @@ -224,6 +224,7 @@ public void SQL_FindFingerPrints(Database db, DBResultSet results, const char[] results.FetchString(0, steamid, sizeof(steamid)); if (first) { + Format(steamid, sizeof(steamid), "'%s'", steamid); StrCat(sQuery, sizeof(sQuery), steamid); first = false; }