fixed sourceban sql query

This commit is contained in:
jenz 2023-02-03 12:57:30 +01:00
parent 2d3ef46f86
commit a8fac665c9

View File

@ -140,8 +140,10 @@ public void SQL_checkSourcebans(Database db, DBResultSet results, const char[] e
results.FetchString(0, sSID, sizeof(sSID));
results.FetchString(1, sIP, sizeof(sIP));
char sql_statement[512];
//PrintToChatAll(sSID);
//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' or authid = '%s') and (RemoveType != 'U' or RemoveType is NULL) and (ends > UNIX_TIMESTAMP() + 3600 or ends = created) order by created desc limit 1", sIP, sSID);
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);
}
delete results;