reducing DB queries from high priority to low or normal, also removed obsolete repository
This commit is contained in:
@@ -62,7 +62,7 @@ public void SQL_addEntry(int client)
|
||||
g_dDatabase.Escape(sName, sEscapedName, size2 + 1);
|
||||
GetClientIP(client, sIP, sizeof(sIP));
|
||||
Format(sQuery, sizeof(sQuery), "insert into `ban_detector_steamids` (`steamid`, `name`, `ID`) SELECT '%s', '%s', bd.ID from `ban_detector` bd where bd.ip = '%s' and not exists (select bds.ID from `ban_detector_steamids` bds where bds.ID = bd.ID and bds.steamid = '%s')", sSID, sEscapedName, sIP, sSID);
|
||||
g_dDatabase.Query(SQL_UpdateEntry, sQuery, client, DBPrio_High);
|
||||
g_dDatabase.Query(SQL_UpdateEntry, sQuery, client, DBPrio_Low);
|
||||
}
|
||||
|
||||
public void SQL_OnDatabaseConnect(Database db, const char[] error, any data)
|
||||
@@ -102,7 +102,7 @@ public void SQL_UpdateEntry(Database db, DBResultSet results, const char[] error
|
||||
GetClientAuthId(client, AuthId_Steam2, sSID, sizeof(sSID));
|
||||
Format(sQuery, sizeof(sQuery), "SELECT bd.fingerprint FROM `ban_detector` bd inner join `ban_detector_steamids` bds on bd.ID = bds.ID where bds.steamid = '%s' or bd.ip = '%s'", sSID, sIP);
|
||||
//PrintToChatAll("sQuery: %s", sQuery);
|
||||
g_dDatabase.Query(SQL_FindFingerPrints, sQuery, client, DBPrio_High);
|
||||
g_dDatabase.Query(SQL_FindFingerPrints, sQuery, client, DBPrio_Low);
|
||||
}
|
||||
delete results;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public void SQL_FindFingerPrints(Database db, DBResultSet results, const char[]
|
||||
g_dDatabase.Escape(fingerprint, sEscapedFingerPrint, 1024);
|
||||
Format(sQuery, sizeof(sQuery), "select steamid, ip from ban_detector bd inner join ban_detector_steamids bds on bd.ID = bds.ID where fingerprint = '%s'", sEscapedFingerPrint);
|
||||
//PrintToChatAll("sQuery: %s", sQuery);
|
||||
g_dDatabase.Query(SQL_checkSourcebans, sQuery, client, DBPrio_High);
|
||||
g_dDatabase.Query(SQL_checkSourcebans, sQuery, client, DBPrio_Low);
|
||||
if (IsValidClient(client) && g_bReportedClientBanAvoiding[client])
|
||||
{
|
||||
break;
|
||||
@@ -151,7 +151,7 @@ public void SQL_checkSourcebans(Database db, DBResultSet results, const char[] e
|
||||
//PrintToChatAll(sIP);
|
||||
// + 3600 for one hour to accomdate timezone difference
|
||||
Format(sql_statement, sizeof(sql_statement), "select authid, ip from sb_bans where ((ip = '%s' and ip is not null and ip != '') or (authid = '%s' and authid is not null and authid =! '')) and (RemoveType != 'U' or RemoveType is NULL) and (ends > UNIX_TIMESTAMP() + 3600 or ends = created) order by created desc limit 1", sIP, sSID);
|
||||
g_hDatabase_sourceban.Query(sql_select_sb_bans, sql_statement, client, DBPrio_High);
|
||||
g_hDatabase_sourceban.Query(sql_select_sb_bans, sql_statement, client, DBPrio_Low);
|
||||
if (IsValidClient(client) && g_bReportedClientBanAvoiding[client])
|
||||
{
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user