forked from UNLOZE/sm-plugins
further fixes to queries and timers
This commit is contained in:
@@ -161,13 +161,20 @@ public void sql_select_hiding_unavailable_maps(int client)
|
||||
GetClientAuthId(client, AuthId_Steam2, steam_auth, sizeof(steam_auth));
|
||||
//we have way too many dbs, just adding this to unloze_race_timer
|
||||
Format(query, sizeof(query), "SELECT is_ignoring FROM `mapchooser_hide_unavailable` where steam_auth = '%s'", steam_auth);
|
||||
g_dDatabase.Query(SQL_OnQueryCompleted_ignoring, query, client);
|
||||
g_dDatabase.Query(SQL_OnQueryCompleted_ignoring, query, GetClientSerial(client));
|
||||
}
|
||||
|
||||
public void SQL_OnQueryCompleted_ignoring(Database db, DBResultSet results, const char[] error, int client)
|
||||
public void SQL_OnQueryCompleted_ignoring(Database db, DBResultSet results, const char[] error, int Serial)
|
||||
{
|
||||
if (!db)
|
||||
{
|
||||
delete results;
|
||||
return;
|
||||
}
|
||||
int client;
|
||||
if ((client = GetClientFromSerial(Serial)) == 0)
|
||||
{
|
||||
delete results;
|
||||
return;
|
||||
}
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
@@ -180,6 +187,7 @@ public void SQL_OnQueryCompleted_ignoring(Database db, DBResultSet results, cons
|
||||
g_bClientsIgnoring[client] = true;
|
||||
}
|
||||
}
|
||||
delete results;
|
||||
}
|
||||
|
||||
public void sql_insert_update_hiding_unavailable(int client)
|
||||
@@ -216,15 +224,16 @@ public void sql_insert_update_hiding_unavailable(int client)
|
||||
|
||||
public void SQL_FinishedQuery(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
{
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
char sQuery[256];
|
||||
ResetPack(data);
|
||||
data.ReadString(sQuery, sizeof(sQuery));
|
||||
LogError("Query error 3: %s", error);
|
||||
LogError("actual query: %s", sQuery);
|
||||
}
|
||||
delete data;
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
char sQuery[256];
|
||||
ResetPack(data);
|
||||
data.ReadString(sQuery, sizeof(sQuery));
|
||||
LogError("Query error 3: %s", error);
|
||||
LogError("actual query: %s", sQuery);
|
||||
}
|
||||
delete results;
|
||||
delete data;
|
||||
}
|
||||
|
||||
public void OnClientDisconnect(int client)
|
||||
|
||||
Reference in New Issue
Block a user