From 5e2eb7d67ae933b7566f1944d0bb7744da03d586 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 23:42:09 +0100 Subject: move source stuff to its own folder --- .../scripting/gokz-localranks/db/cache_pbs.sp | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100644 sourcemod/scripting/gokz-localranks/db/cache_pbs.sp (limited to 'sourcemod/scripting/gokz-localranks/db/cache_pbs.sp') diff --git a/sourcemod/scripting/gokz-localranks/db/cache_pbs.sp b/sourcemod/scripting/gokz-localranks/db/cache_pbs.sp deleted file mode 100644 index 12c3ed2..0000000 --- a/sourcemod/scripting/gokz-localranks/db/cache_pbs.sp +++ /dev/null @@ -1,62 +0,0 @@ -/* - Caches the player's personal best times on the map. -*/ - - - -void DB_CachePBs(int client, int steamID) -{ - char query[1024]; - - Transaction txn = SQL_CreateTransaction(); - - // Reset PB exists array - for (int course = 0; course < GOKZ_MAX_COURSES; course++) - { - for (int mode = 0; mode < MODE_COUNT; mode++) - { - for (int timeType = 0; timeType < TIMETYPE_COUNT; timeType++) - { - gB_PBExistsCache[client][course][mode][timeType] = false; - } - } - } - - int mapID = GOKZ_DB_GetCurrentMapID(); - - // Get Map PBs - FormatEx(query, sizeof(query), sql_getpbs, steamID, mapID); - txn.AddQuery(query); - // Get PRO PBs - FormatEx(query, sizeof(query), sql_getpbspro, steamID, mapID); - txn.AddQuery(query); - - SQL_ExecuteTransaction(gH_DB, txn, DB_TxnSuccess_CachePBs, DB_TxnFailure_Generic, GetClientUserId(client), DBPrio_High); -} - -public void DB_TxnSuccess_CachePBs(Handle db, int userID, int numQueries, Handle[] results, any[] queryData) -{ - int client = GetClientOfUserId(userID); - if (client < 1 || client > MaxClients || !IsClientAuthorized(client) || IsFakeClient(client)) - { - return; - } - - int course, mode; - - while (SQL_FetchRow(results[0])) - { - course = SQL_FetchInt(results[0], 1); - mode = SQL_FetchInt(results[0], 2); - gB_PBExistsCache[client][course][mode][TimeType_Nub] = true; - gF_PBTimesCache[client][course][mode][TimeType_Nub] = GOKZ_DB_TimeIntToFloat(SQL_FetchInt(results[0], 0)); - } - - while (SQL_FetchRow(results[1])) - { - course = SQL_FetchInt(results[1], 1); - mode = SQL_FetchInt(results[1], 2); - gB_PBExistsCache[client][course][mode][TimeType_Pro] = true; - gF_PBTimesCache[client][course][mode][TimeType_Pro] = GOKZ_DB_TimeIntToFloat(SQL_FetchInt(results[1], 0)); - } -} \ No newline at end of file -- cgit v1.2.3