mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
add shavit_core_log_sql & remove Database2/Transaction2 methmodmaps
This commit is contained in:
parent
fa6ccdbded
commit
0f44dd1710
@ -157,6 +157,17 @@ enum struct timer_snapshot_t
|
||||
stock void Shavit_LogQuery(const char[] query)
|
||||
{
|
||||
static File hLogFile;
|
||||
static ConVar shavit_core_log_sql = null;
|
||||
|
||||
if (shavit_core_log_sql == null)
|
||||
{
|
||||
shavit_core_log_sql = FindConVar("shavit_core_log_sql");
|
||||
}
|
||||
|
||||
if (!shavit_core_log_sql || !shavit_core_log_sql.BoolValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hLogFile == null)
|
||||
{
|
||||
@ -179,35 +190,20 @@ stock void Shavit_LogQuery(const char[] query)
|
||||
}
|
||||
}
|
||||
|
||||
methodmap Database2 < Database
|
||||
stock void QueryLog(Database db, SQLQueryCallback callback, const char[] query, any data = 0, DBPriority prio = DBPrio_Normal)
|
||||
{
|
||||
public void Query2(SQLQueryCallback callback, const char[] query, any data = 0, DBPriority prio = DBPrio_Normal)
|
||||
{
|
||||
#if SHAVIT_LOG_QUERIES
|
||||
Shavit_LogQuery(query);
|
||||
#endif
|
||||
this.Query(callback, query, data, prio);
|
||||
}
|
||||
Shavit_LogQuery(query);
|
||||
db.Query(callback, query, data, prio);
|
||||
}
|
||||
|
||||
methodmap Transaction2 < Transaction
|
||||
stock int AddQueryLog(Transaction trans, const char[] query, any data = 0)
|
||||
{
|
||||
public Transaction2()
|
||||
{
|
||||
return view_as<Transaction2>(new Transaction());
|
||||
}
|
||||
|
||||
public int AddQuery2(const char[] query, any data = 0)
|
||||
{
|
||||
#if SHAVIT_LOG_QUERIES
|
||||
Shavit_LogQuery(query);
|
||||
#endif
|
||||
return this.AddQuery(query, data);
|
||||
}
|
||||
Shavit_LogQuery(query);
|
||||
return trans.AddQuery(query, data);
|
||||
}
|
||||
|
||||
// connects synchronously to the bhoptimer database
|
||||
// calls errors if needed
|
||||
// call errors if needed
|
||||
stock Database GetTimerDatabaseHandle(bool reuse_persistent_connection=true)
|
||||
{
|
||||
Database db = null;
|
||||
@ -234,11 +230,6 @@ stock Database GetTimerDatabaseHandle(bool reuse_persistent_connection=true)
|
||||
return db;
|
||||
}
|
||||
|
||||
stock Database2 GetTimerDatabaseHandle2(bool reuse_persistent_connection=true)
|
||||
{
|
||||
return view_as<Database2>(GetTimerDatabaseHandle(reuse_persistent_connection));
|
||||
}
|
||||
|
||||
// figures out if the database is a mysql database
|
||||
stock bool IsMySQLDatabase(Database db)
|
||||
{
|
||||
|
||||
@ -52,7 +52,7 @@ enum
|
||||
MIGRATIONS_END
|
||||
};
|
||||
|
||||
static Database2 gH_SQL;
|
||||
static Database gH_SQL;
|
||||
static bool gB_MySQL;
|
||||
static char gS_SQLPrefix[32];
|
||||
|
||||
@ -72,13 +72,13 @@ public void RunOnDatabaseLoadedForward()
|
||||
Call_Finish(hOnDatabasedLoaded);
|
||||
}
|
||||
|
||||
public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
public void SQL_CreateTables(Database hSQL, const char[] prefix, bool mysql)
|
||||
{
|
||||
gH_SQL = hSQL;
|
||||
gB_MySQL = mysql;
|
||||
strcopy(gS_SQLPrefix, sizeof(gS_SQLPrefix), prefix);
|
||||
|
||||
Transaction2 hTrans = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
|
||||
char sQuery[2048];
|
||||
char sOptionalINNODB[16];
|
||||
@ -105,12 +105,12 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
gS_SQLPrefix);
|
||||
}
|
||||
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%smigrations` (`code` TINYINT NOT NULL, PRIMARY KEY (`code`));",
|
||||
gS_SQLPrefix);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
//
|
||||
//// shavit-chat
|
||||
@ -129,7 +129,7 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
gS_SQLPrefix, gS_SQLPrefix, gS_SQLPrefix);
|
||||
}
|
||||
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
//
|
||||
//// shavit-rankings
|
||||
@ -138,7 +138,7 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%smaptiers` (`map` VARCHAR(255) NOT NULL, `tier` INT NOT NULL DEFAULT 1, PRIMARY KEY (`map`)) %s;",
|
||||
gS_SQLPrefix, sOptionalINNODB);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
//
|
||||
//// shavit-stats
|
||||
@ -147,7 +147,7 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%sstyleplaytime` (`auth` INT NOT NULL, `style` TINYINT NOT NULL, `playtime` FLOAT NOT NULL, PRIMARY KEY (`auth`, `style`));",
|
||||
gS_SQLPrefix);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
//
|
||||
//// shavit-wr
|
||||
@ -167,29 +167,29 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
gS_SQLPrefix);
|
||||
}
|
||||
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%sstagetimeswr` (`style` TINYINT NOT NULL, `track` TINYINT NOT NULL DEFAULT 0, `map` VARCHAR(255) NOT NULL, `stage` TINYINT NOT NULL, `auth` INT NOT NULL, `time` FLOAT NOT NULL, PRIMARY KEY (`style`, `track`, `map`, `stage`)) %s;",
|
||||
gS_SQLPrefix, sOptionalINNODB);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%sstagetimespb` (`style` TINYINT NOT NULL, `track` TINYINT NOT NULL DEFAULT 0, `map` VARCHAR(255) NOT NULL, `stage` TINYINT NOT NULL, `auth` INT NOT NULL, `time` FLOAT NOT NULL, PRIMARY KEY (`style`, `track`, `auth`, `map`, `stage`)) %s;",
|
||||
gS_SQLPrefix, sOptionalINNODB);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"%s %swrs_min AS SELECT MIN(time) time, map, track, style FROM %splayertimes GROUP BY map, track, style;",
|
||||
gB_MySQL ? "CREATE OR REPLACE VIEW" : "CREATE VIEW IF NOT EXISTS",
|
||||
gS_SQLPrefix, gS_SQLPrefix);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"%s %swrs AS SELECT a.* FROM %splayertimes a JOIN %swrs_min b ON a.time = b.time AND a.map = b.map AND a.track = b.track AND a.style = b.style;",
|
||||
gB_MySQL ? "CREATE OR REPLACE VIEW" : "CREATE VIEW IF NOT EXISTS",
|
||||
gS_SQLPrefix, gS_SQLPrefix, gS_SQLPrefix);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
//
|
||||
//// shavit-wr
|
||||
@ -198,14 +198,14 @@ public void SQL_CreateTables(Database2 hSQL, const char[] prefix, bool mysql)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%smapzones` (`id` INT AUTO_INCREMENT, `map` VARCHAR(255) NOT NULL, `type` INT, `corner1_x` FLOAT, `corner1_y` FLOAT, `corner1_z` FLOAT, `corner2_x` FLOAT, `corner2_y` FLOAT, `corner2_z` FLOAT, `destination_x` FLOAT NOT NULL DEFAULT 0, `destination_y` FLOAT NOT NULL DEFAULT 0, `destination_z` FLOAT NOT NULL DEFAULT 0, `track` INT NOT NULL DEFAULT 0, `flags` INT NOT NULL DEFAULT 0, `data` INT NOT NULL DEFAULT 0, `form` TINYINT, `target` VARCHAR(63), PRIMARY KEY (`id`)) %s;",
|
||||
gS_SQLPrefix, sOptionalINNODB);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"CREATE TABLE IF NOT EXISTS `%sstartpositions` (`auth` INTEGER NOT NULL, `track` TINYINT NOT NULL, `map` VARCHAR(255) NOT NULL, `pos_x` FLOAT, `pos_y` FLOAT, `pos_z` FLOAT, `ang_x` FLOAT, `ang_y` FLOAT, `ang_z` FLOAT, `angles_only` BOOL, PRIMARY KEY (`auth`, `track`, `map`)) %s;",
|
||||
gS_SQLPrefix, sOptionalINNODB);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
hSQL.Execute(hTrans, Trans_CreateTables_Success, Trans_CreateTables_Error, 0, DBPrio_High);
|
||||
hSQL.Execute(trans, Trans_CreateTables_Success, Trans_CreateTables_Error, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void Trans_CreateTables_Error(Database db, any data, int numQueries, const char[] error, int failIndex, any[] queryData)
|
||||
@ -239,7 +239,7 @@ public void Trans_CreateTables_Success(Database db, any data, int numQueries, DB
|
||||
{
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "SELECT code FROM %smigrations;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_SelectMigrations_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_SelectMigrations_Callback, sQuery, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_SelectMigrations_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -309,56 +309,56 @@ void ApplyMigration_LastLoginIndex()
|
||||
{
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%susers` ADD INDEX `lastlogin` (`lastlogin`);", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_LastLoginIndex, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_LastLoginIndex, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_RemoveCountry()
|
||||
{
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%susers` DROP COLUMN `country`;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_RemoveCountry, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_RemoveCountry, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_PlayertimesDateToInt()
|
||||
{
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%splayertimes` CHANGE COLUMN `date` `date` INT;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_PlayertimesDateToInt, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_PlayertimesDateToInt, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddZonesFlagsAndData()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%smapzones` ADD COLUMN `flags` INT NULL AFTER `track`, ADD COLUMN `data` INT NULL AFTER `flags`;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddZonesFlagsAndData, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddZonesFlagsAndData, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddPlayertimesCompletions()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%splayertimes` ADD COLUMN `completions` SMALLINT DEFAULT 1 AFTER `perfs`;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesCompletions, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesCompletions, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddCustomChatAccess()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%schat` ADD COLUMN `ccaccess` INT NOT NULL DEFAULT 0 %s;", gS_SQLPrefix, gB_MySQL ? "AFTER `ccmessage`" : "");
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddCustomChatAccess, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddCustomChatAccess, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddPlayertimesExactTimeInt()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%splayertimes` ADD COLUMN `exact_time_int` INT NOT NULL DEFAULT 0 %s;", gS_SQLPrefix, gB_MySQL ? "AFTER `completions`" : "");
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesExactTimeInt, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesExactTimeInt, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_FixOldCompletionCounts()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "UPDATE `%splayertimes` SET completions = completions - 1 WHERE completions > 1;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_FixOldCompletionCounts, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_FixOldCompletionCounts, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddPrebuiltToMapZonesTable()
|
||||
@ -366,7 +366,7 @@ void ApplyMigration_AddPrebuiltToMapZonesTable()
|
||||
#if 0
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%smapzones` ADD COLUMN `prebuilt` BOOL;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPrebuiltToMapZonesTable, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPrebuiltToMapZonesTable, DBPrio_High);
|
||||
#else
|
||||
SQL_TableMigrationSingleQuery_Callback(null, null, "", Migration_AddPrebuiltToMapZonesTable);
|
||||
#endif
|
||||
@ -377,21 +377,21 @@ void ApplyMigration_AddPlaytime()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%susers` MODIFY COLUMN `playtime` FLOAT NOT NULL DEFAULT 0;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_Migration_AddPlaytime2222222_Callback, sQuery, Migration_AddPlaytime, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_Migration_AddPlaytime2222222_Callback, sQuery, Migration_AddPlaytime, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_Migration_AddPlaytime2222222_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%susers` ADD COLUMN `playtime` FLOAT NOT NULL DEFAULT 0 %s;", gS_SQLPrefix, gB_MySQL ? "AFTER `points`" : "");
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlaytime, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlaytime, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_LowercaseMaps(const char[] table, int migration)
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "UPDATE `%s%s` SET map = LOWER(map);", gS_SQLPrefix, table);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, migration, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, migration, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddPlayertimesPointsCalcedFrom()
|
||||
@ -399,7 +399,7 @@ void ApplyMigration_AddPlayertimesPointsCalcedFrom()
|
||||
#if 0
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%splayertimes` ADD COLUMN `points_calced_from` FLOAT NOT NULL DEFAULT 0 %s;", gS_SQLPrefix, gB_MySQL ? "AFTER `points`" : "");
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesPointsCalcedFrom, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddPlayertimesPointsCalcedFrom, DBPrio_High);
|
||||
#else
|
||||
SQL_TableMigrationSingleQuery_Callback(null, null, "", Migration_AddPlayertimesPointsCalcedFrom);
|
||||
#endif
|
||||
@ -409,7 +409,7 @@ void ApplyMigration_RemovePlayertimesPointsCalcedFrom()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "ALTER TABLE `%splayertimes` DROP COLUMN `points_calced_from`;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_RemovePlayertimesPointsCalcedFrom, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_RemovePlayertimesPointsCalcedFrom, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_NormalizeMapzonePoints() // TODO: test with sqlite lol
|
||||
@ -434,14 +434,14 @@ void ApplyMigration_NormalizeMapzonePoints() // TODO: test with sqlite lol
|
||||
id, id
|
||||
);
|
||||
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_NormalizeMapzonePoints, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_NormalizeMapzonePoints, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddMapzonesFormAndTarget()
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, sizeof(sQuery), "ALTER TABLE `%smapzones` ADD COLUMN `form` TINYINT, ADD COLUMN `target` VARCHAR(63);", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddMapzonesFormAndTarget, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddMapzonesFormAndTarget, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_TableMigrationSingleQuery_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -456,25 +456,25 @@ public void SQL_TableMigrationSingleQuery_Callback(Database db, DBResultSet resu
|
||||
FormatEx(sQuery, 256,
|
||||
"DELETE t1 FROM %splayertimes t1 LEFT JOIN %susers t2 ON t1.auth = t2.auth WHERE t2.auth IS NULL;",
|
||||
gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
#if 0
|
||||
FormatEx(sQuery, 256,
|
||||
"ALTER TABLE `%splayertimes` ADD CONSTRAINT `%spt_auth` FOREIGN KEY (`auth`) REFERENCES `%susers` (`auth`) ON UPDATE CASCADE ON DELETE CASCADE;",
|
||||
gS_SQLPrefix, gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery);
|
||||
#endif
|
||||
|
||||
FormatEx(sQuery, 256,
|
||||
"DELETE t1 FROM %schat t1 LEFT JOIN %susers t2 ON t1.auth = t2.auth WHERE t2.auth IS NULL;",
|
||||
gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
#if 0
|
||||
FormatEx(sQuery, 256,
|
||||
"ALTER TABLE `%schat` ADD CONSTRAINT `%sch_auth` FOREIGN KEY (`auth`) REFERENCES `%susers` (`auth`) ON UPDATE CASCADE ON DELETE CASCADE;",
|
||||
gS_SQLPrefix, gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -486,11 +486,11 @@ void ApplyMigration_ConvertIPAddresses(bool index = true)
|
||||
if (index)
|
||||
{
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%susers` ADD INDEX `ip` (`ip`);", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
FormatEx(sQuery, 128, "SELECT DISTINCT ip FROM %susers WHERE ip LIKE '%%.%%';", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIPAddresses_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIPAddresses_Callback, sQuery);
|
||||
}
|
||||
|
||||
public void SQL_TableMigrationIPAddresses_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -502,7 +502,7 @@ public void SQL_TableMigrationIPAddresses_Callback(Database db, DBResultSet resu
|
||||
return;
|
||||
}
|
||||
|
||||
Transaction2 hTransaction = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
int iQueries = 0;
|
||||
|
||||
while (results.FetchRow())
|
||||
@ -513,7 +513,7 @@ public void SQL_TableMigrationIPAddresses_Callback(Database db, DBResultSet resu
|
||||
char sQuery[256];
|
||||
FormatEx(sQuery, 256, "UPDATE %susers SET ip = %d WHERE ip = '%s';", gS_SQLPrefix, IPStringToAddress(sIPAddress), sIPAddress);
|
||||
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
if (++iQueries >= 10000)
|
||||
{
|
||||
@ -521,7 +521,7 @@ public void SQL_TableMigrationIPAddresses_Callback(Database db, DBResultSet resu
|
||||
}
|
||||
}
|
||||
|
||||
gH_SQL.Execute(hTransaction, Trans_IPAddressMigrationSuccess, Trans_IPAddressMigrationFailed, iQueries);
|
||||
gH_SQL.Execute(trans, Trans_IPAddressMigrationSuccess, Trans_IPAddressMigrationFailed, iQueries);
|
||||
}
|
||||
|
||||
public void Trans_IPAddressMigrationSuccess(Database db, any data, int numQueries, DBResultSet[] results, any[] queryData)
|
||||
@ -536,10 +536,10 @@ public void Trans_IPAddressMigrationSuccess(Database db, any data, int numQuerie
|
||||
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%susers` DROP INDEX `ip`;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%susers` CHANGE COLUMN `ip` `ip` INT;", gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_ConvertIPAddresses, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_ConvertIPAddresses, DBPrio_High);
|
||||
}
|
||||
|
||||
public void Trans_IPAddressMigrationFailed(Database db, any data, int numQueries, const char[] error, int failIndex, any[] queryData)
|
||||
@ -558,10 +558,10 @@ void ApplyMigration_ConvertSteamIDs()
|
||||
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%splayertimes` DROP CONSTRAINT `%spt_auth`;", gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%schat` DROP CONSTRAINT `%sch_auth`;", gS_SQLPrefix, gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationIndexing_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
for (int i = 0; i < sizeof(sTables); i++)
|
||||
{
|
||||
@ -570,7 +570,7 @@ void ApplyMigration_ConvertSteamIDs()
|
||||
hPack.WriteString(sTables[i]);
|
||||
|
||||
FormatEx(sQuery, 128, "UPDATE %s%s SET auth = REPLACE(REPLACE(auth, \"[U:1:\", \"\"), \"]\", \"\") WHERE auth LIKE '[%%';", sTables[i], gS_SQLPrefix);
|
||||
gH_SQL.Query2(SQL_TableMigrationSteamIDs_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSteamIDs_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,7 +589,7 @@ public void SQL_TableMigrationSteamIDs_Callback(Database db, DBResultSet results
|
||||
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "ALTER TABLE `%s%s` CHANGE COLUMN `auth` `auth` INT;", gS_SQLPrefix, sTable);
|
||||
gH_SQL.Query2(SQL_TableMigrationSingleQuery_Callback, sQuery, iMigration, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, iMigration, DBPrio_High);
|
||||
}
|
||||
|
||||
void ApplyMigration_RemoveWorkshopPath(int migration)
|
||||
@ -607,7 +607,7 @@ void ApplyMigration_RemoveWorkshopPath(int migration)
|
||||
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, 192, "SELECT map FROM %s%s WHERE map LIKE 'workshop%%' GROUP BY map;", gS_SQLPrefix, sTables[migration]);
|
||||
gH_SQL.Query2(SQL_TableMigrationWorkshop_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationWorkshop_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_TableMigrationWorkshop_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -626,7 +626,7 @@ public void SQL_TableMigrationWorkshop_Callback(Database db, DBResultSet results
|
||||
return;
|
||||
}
|
||||
|
||||
Transaction2 hTransaction = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
|
||||
while (results.FetchRow())
|
||||
{
|
||||
@ -639,10 +639,10 @@ public void SQL_TableMigrationWorkshop_Callback(Database db, DBResultSet results
|
||||
char sQuery[256];
|
||||
FormatEx(sQuery, 256, "UPDATE %s%s SET map = '%s' WHERE map = '%s';", gS_SQLPrefix, sTable, sDisplayMap, sMap);
|
||||
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
|
||||
gH_SQL.Execute(hTransaction, Trans_WorkshopMigration, INVALID_FUNCTION, iMigration);
|
||||
gH_SQL.Execute(trans, Trans_WorkshopMigration, INVALID_FUNCTION, iMigration);
|
||||
}
|
||||
|
||||
public void Trans_WorkshopMigration(Database db, any data, int numQueries, DBResultSet[] results, any[] queryData)
|
||||
@ -654,7 +654,7 @@ void InsertMigration(int migration)
|
||||
{
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, 128, "INSERT INTO %smigrations (code) VALUES (%d);", gS_SQLPrefix, migration);
|
||||
gH_SQL.Query2(SQL_MigrationApplied_Callback, sQuery, migration);
|
||||
QueryLog(gH_SQL, SQL_MigrationApplied_Callback, sQuery, migration);
|
||||
}
|
||||
|
||||
public void SQL_MigrationApplied_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
|
||||
@ -73,7 +73,7 @@ enum
|
||||
#pragma semicolon 1
|
||||
|
||||
// database
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
char gS_MySQLPrefix[32];
|
||||
|
||||
// modules
|
||||
@ -1251,7 +1251,7 @@ public Action Command_CCAdd(int client, int args)
|
||||
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, sizeof(sQuery), "REPLACE INTO %schat (auth, ccaccess) VALUES (%d, 1);", gS_MySQLPrefix, iSteamID);
|
||||
gH_SQL.Query2(SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
@ -1289,7 +1289,7 @@ public Action Command_CCDelete(int client, int args)
|
||||
|
||||
char sQuery[128];
|
||||
FormatEx(sQuery, sizeof(sQuery), "UPDATE %schat SET ccaccess = 0 WHERE auth = %d;", gS_MySQLPrefix, iSteamID);
|
||||
gH_SQL.Query2(SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
@ -1406,7 +1406,7 @@ void FormatChat(int client, char[] buffer, int size)
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = view_as<Database2>(Shavit_GetDatabase());
|
||||
gH_SQL = Shavit_GetDatabase();
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
@ -1444,7 +1444,7 @@ void SaveToDatabase(int client)
|
||||
"REPLACE INTO %schat (auth, name, ccname, message, ccmessage) VALUES (%d, %d, '%s', %d, '%s');",
|
||||
gS_MySQLPrefix, iSteamID, 1, sEscapedName, 1, sEscapedMessage);
|
||||
|
||||
gH_SQL.Query2(SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_UpdateUser_Callback, sQuery, 0, DBPrio_Low);
|
||||
}
|
||||
|
||||
public void SQL_UpdateUser_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1474,7 +1474,7 @@ void LoadFromDatabase(int client)
|
||||
char sQuery[256];
|
||||
FormatEx(sQuery, 256, "SELECT name, ccname, message, ccmessage, ccaccess FROM %schat WHERE auth = %d;", gS_MySQLPrefix, iSteamID);
|
||||
|
||||
gH_SQL.Query2(SQL_GetChat_Callback, sQuery, GetClientSerial(client), DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_GetChat_Callback, sQuery, GetClientSerial(client), DBPrio_Low);
|
||||
}
|
||||
|
||||
public void SQL_GetChat_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
|
||||
@ -60,7 +60,7 @@ DynamicHook gH_AcceptInput; // used for hooking player_speedmod's AcceptInput
|
||||
DynamicHook gH_TeleportDhook = null;
|
||||
|
||||
// database handle
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
bool gB_MySQL = false;
|
||||
|
||||
// forwards
|
||||
@ -189,6 +189,8 @@ public Plugin myinfo =
|
||||
|
||||
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
|
||||
{
|
||||
new Convar("shavit_core_log_sql", "0", "Whether to log SQL queries from the timer.", 0, true, 0.0, true, 1.0);
|
||||
|
||||
Bhopstats_CreateNatives();
|
||||
Shavit_Style_Settings_Natives();
|
||||
|
||||
@ -1208,15 +1210,15 @@ public void Trans_DeleteRestOfUserFailed(Database db, DataPack hPack, int numQue
|
||||
|
||||
void DeleteRestOfUser(int iSteamID, DataPack hPack)
|
||||
{
|
||||
Transaction2 hTransaction = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
char sQuery[256];
|
||||
|
||||
FormatEx(sQuery, 256, "DELETE FROM %splayertimes WHERE auth = %d;", gS_MySQLPrefix, iSteamID);
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
FormatEx(sQuery, 256, "DELETE FROM %susers WHERE auth = %d;", gS_MySQLPrefix, iSteamID);
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
gH_SQL.Execute(hTransaction, Trans_DeleteRestOfUserSuccess, Trans_DeleteRestOfUserFailed, hPack);
|
||||
gH_SQL.Execute(trans, Trans_DeleteRestOfUserSuccess, Trans_DeleteRestOfUserFailed, hPack);
|
||||
}
|
||||
|
||||
void DeleteUserData(int client, const int iSteamID)
|
||||
@ -1230,7 +1232,7 @@ void DeleteUserData(int client, const int iSteamID)
|
||||
"SELECT id, style, track, map FROM %swrs WHERE auth = %d;",
|
||||
gS_MySQLPrefix, iSteamID);
|
||||
|
||||
gH_SQL.Query2(SQL_DeleteUserData_GetRecords_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_DeleteUserData_GetRecords_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_DeleteUserData_GetRecords_Callback(Database db, DBResultSet results, const char[] error, DataPack hPack)
|
||||
@ -2702,7 +2704,7 @@ public void OnClientPutInServer(int client)
|
||||
gS_MySQLPrefix, iSteamID, sEscapedName, iIPAddress, iTime);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_InsertUser_Callback, sQuery, GetClientSerial(client));
|
||||
QueryLog(gH_SQL, SQL_InsertUser_Callback, sQuery, GetClientSerial(client));
|
||||
}
|
||||
|
||||
public void SQL_InsertUser_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -2803,7 +2805,7 @@ bool LoadMessages()
|
||||
void SQL_DBConnect()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = GetTimerDatabaseHandle2();
|
||||
gH_SQL = GetTimerDatabaseHandle();
|
||||
gB_MySQL = IsMySQLDatabase(gH_SQL);
|
||||
|
||||
SQL_CreateTables(gH_SQL, gS_MySQLPrefix, gB_MySQL);
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
#undef REQUIRE_EXTENSIONS
|
||||
#include <cstrike>
|
||||
|
||||
Database2 g_hDatabase;
|
||||
Database g_hDatabase;
|
||||
char g_cSQLPrefix[32];
|
||||
|
||||
bool g_bDebug;
|
||||
@ -1044,7 +1044,7 @@ public int Handler_MapVoteMenu(Menu menu, MenuAction action, int param1, int par
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(g_cSQLPrefix, sizeof(g_cSQLPrefix));
|
||||
g_hDatabase = view_as<Database2>(Shavit_GetDatabase());
|
||||
g_hDatabase = Shavit_GetDatabase();
|
||||
}
|
||||
|
||||
void RemoveExcludesFromArrayList(ArrayList list, bool lowercase, char[][] exclude_prefixes, int exclude_count)
|
||||
@ -1085,13 +1085,13 @@ void LoadMapList()
|
||||
{
|
||||
if (g_hDatabase == null)
|
||||
{
|
||||
g_hDatabase = GetTimerDatabaseHandle2();
|
||||
g_hDatabase = GetTimerDatabaseHandle();
|
||||
}
|
||||
|
||||
char buffer[512];
|
||||
|
||||
FormatEx(buffer, sizeof(buffer), "SELECT `map` FROM `%smapzones` WHERE `type` = 1 AND `track` = 0 ORDER BY `map`", g_cSQLPrefix);
|
||||
g_hDatabase.Query2(LoadZonedMapsCallback, buffer, _, DBPrio_High);
|
||||
QueryLog(g_hDatabase, LoadZonedMapsCallback, buffer, _, DBPrio_High);
|
||||
}
|
||||
case MapListFolder:
|
||||
{
|
||||
@ -1108,7 +1108,7 @@ void LoadMapList()
|
||||
{
|
||||
if (g_hDatabase == null)
|
||||
{
|
||||
g_hDatabase = GetTimerDatabaseHandle2();
|
||||
g_hDatabase = GetTimerDatabaseHandle();
|
||||
}
|
||||
|
||||
if (g_cvMapListType.IntValue == MapListMixed)
|
||||
@ -1123,7 +1123,7 @@ void LoadMapList()
|
||||
|
||||
char buffer[512];
|
||||
FormatEx(buffer, sizeof(buffer), "SELECT `map` FROM `%smapzones` WHERE `type` = 1 AND `track` = 0 ORDER BY `map`", g_cSQLPrefix);
|
||||
g_hDatabase.Query2(LoadZonedMapsCallbackMixed, buffer, _, DBPrio_High);
|
||||
QueryLog(g_hDatabase, LoadZonedMapsCallbackMixed, buffer, _, DBPrio_High);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2014,7 +2014,7 @@ public Action Command_LoadUnzonedMap(int client, int args)
|
||||
{
|
||||
char sQuery[256];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT DISTINCT map FROM %smapzones;", g_cSQLPrefix);
|
||||
g_hDatabase.Query2(FindUnzonedMapCallback, sQuery, 0, DBPrio_Normal);
|
||||
QueryLog(g_hDatabase, FindUnzonedMapCallback, sQuery, 0, DBPrio_Normal);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ enum struct ranking_t
|
||||
}
|
||||
|
||||
char gS_MySQLPrefix[32];
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
bool gB_HasSQLRANK = false; // whether the sql driver supports RANK()
|
||||
|
||||
bool gB_Stats = false;
|
||||
@ -222,7 +222,7 @@ public void OnLibraryRemoved(const char[] name)
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = view_as<Database2>(Shavit_GetDatabase());
|
||||
gH_SQL = Shavit_GetDatabase();
|
||||
|
||||
if(!IsMySQLDatabase(gH_SQL))
|
||||
{
|
||||
@ -237,7 +237,7 @@ public void Shavit_OnDatabaseLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_Version_Callback, "SELECT VERSION();");
|
||||
QueryLog(gH_SQL, SQL_Version_Callback, "SELECT VERSION();");
|
||||
|
||||
if (gCV_WeightingMultiplier.FloatValue == 1.0)
|
||||
{
|
||||
@ -246,11 +246,11 @@ public void Shavit_OnDatabaseLoaded()
|
||||
}
|
||||
|
||||
char sQuery[2048];
|
||||
Transaction2 hTrans = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
|
||||
hTrans.AddQuery2("DROP PROCEDURE IF EXISTS UpdateAllPoints;;"); // old (and very slow) deprecated method
|
||||
hTrans.AddQuery2("DROP FUNCTION IF EXISTS GetWeightedPoints;;"); // this is here, just in case we ever choose to modify or optimize the calculation
|
||||
hTrans.AddQuery2("DROP FUNCTION IF EXISTS GetRecordPoints;;");
|
||||
AddQueryLog(trans, "DROP PROCEDURE IF EXISTS UpdateAllPoints;;"); // old (and very slow) deprecated method
|
||||
AddQueryLog(trans, "DROP FUNCTION IF EXISTS GetWeightedPoints;;"); // this is here, just in case we ever choose to modify or optimize the calculation
|
||||
AddQueryLog(trans, "DROP FUNCTION IF EXISTS GetRecordPoints;;");
|
||||
|
||||
char sWeightingLimit[30];
|
||||
|
||||
@ -297,11 +297,11 @@ public void Shavit_OnDatabaseLoaded()
|
||||
"END;;", gS_MySQLPrefix);
|
||||
}
|
||||
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
#else
|
||||
if (gCV_WeightingMultiplier.FloatValue != 1.0)
|
||||
{
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -321,10 +321,10 @@ public void Shavit_OnDatabaseLoaded()
|
||||
"IF rtrack > 0 THEN SET ppoints = ppoints * 0.25; END IF; " ...
|
||||
"RETURN ppoints; " ...
|
||||
"END;;", gS_MySQLPrefix, gS_MySQLPrefix, gS_MySQLPrefix);
|
||||
hTrans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
#endif
|
||||
|
||||
gH_SQL.Execute(hTrans, Trans_RankingsSetupSuccess, Trans_RankingsSetupError, 0, DBPrio_High);
|
||||
gH_SQL.Execute(trans, Trans_RankingsSetupSuccess, Trans_RankingsSetupError, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void Trans_RankingsSetupError(Database db, any data, int numQueries, const char[] error, int failIndex, any[] queryData)
|
||||
@ -392,7 +392,7 @@ public void OnMapStart()
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT map, tier FROM %smaptiers ORDER BY map ASC;", gS_MySQLPrefix);
|
||||
gH_SQL.Query2(SQL_FillTierCache_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_FillTierCache_Callback, sQuery, 0, DBPrio_High);
|
||||
|
||||
gB_TierQueried = true;
|
||||
}
|
||||
@ -435,7 +435,7 @@ public void SQL_FillTierCache_Callback(Database db, DBResultSet results, const c
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "REPLACE INTO %smaptiers (map, tier) VALUES ('%s', %d);", gS_MySQLPrefix, gS_Map, gI_Tier);
|
||||
gH_SQL.Query2(SQL_SetMapTier_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_SetMapTier_Callback, sQuery, 0, DBPrio_High);
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ public void Shavit_OnWRDeleted(int style, int id, int track, int accountid, cons
|
||||
char sQuery[1024];
|
||||
// bUseCurrentMap=true because shavit-wr should maybe have updated the wr even through the updatewrcache query hasn't run yet
|
||||
FormatRecalculate(true, track, style, sQuery, sizeof(sQuery));
|
||||
gH_SQL.Query2(SQL_Recalculate_Callback, sQuery, (style << 8) | track, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_Recalculate_Callback, sQuery, (style << 8) | track, DBPrio_High);
|
||||
|
||||
UpdateAllPoints(true);
|
||||
}
|
||||
@ -516,7 +516,7 @@ void UpdateWRs(int client)
|
||||
);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_GetWRs_Callback, sQuery, GetClientSerial(client));
|
||||
QueryLog(gH_SQL, SQL_GetWRs_Callback, sQuery, GetClientSerial(client));
|
||||
}
|
||||
|
||||
public void SQL_GetWRs_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -698,7 +698,7 @@ public Action Command_SetTier(int client, int args)
|
||||
data.WriteCell(client ? GetClientSerial(client) : 0);
|
||||
data.WriteString(map);
|
||||
|
||||
gH_SQL.Query2(SQL_SetMapTier_Callback, sQuery, data);
|
||||
QueryLog(gH_SQL, SQL_SetMapTier_Callback, sQuery, data);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -849,22 +849,22 @@ public Action Command_RecalcAll(int client, int args)
|
||||
{
|
||||
ReplyToCommand(client, "- Started recalculating points for all maps. Check console for output.");
|
||||
|
||||
Transaction2 trans = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
char sQuery[1024];
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery), "UPDATE %splayertimes SET points = 0;", gS_MySQLPrefix);
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
FormatEx(sQuery, sizeof(sQuery), "UPDATE %susers SET points = 0;", gS_MySQLPrefix);
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
for(int i = 0; i < gI_Styles; i++)
|
||||
{
|
||||
if (!Shavit_GetStyleSettingBool(i, "unranked") && Shavit_GetStyleSettingFloat(i, "rankingmultiplier") != 0.0)
|
||||
{
|
||||
FormatRecalculate(false, Track_Main, i, sQuery, sizeof(sQuery));
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
FormatRecalculate(false, Track_Bonus, i, sQuery, sizeof(sQuery));
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@ -894,19 +894,19 @@ public void Trans_OnRecalcFail(Database db, any data, int numQueries, const char
|
||||
|
||||
void RecalculateSpecificMap(const char[] map, int serial)
|
||||
{
|
||||
Transaction2 trans = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
char sQuery[1024];
|
||||
|
||||
// Only maintrack times because bonus times aren't tiered.
|
||||
FormatEx(sQuery, sizeof(sQuery), "UPDATE %splayertimes SET points = 0 WHERE map = '%s' AND track = 0;", gS_MySQLPrefix, map);
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
for(int i = 0; i < gI_Styles; i++)
|
||||
{
|
||||
if (!Shavit_GetStyleSettingBool(i, "unranked") && Shavit_GetStyleSettingFloat(i, "rankingmultiplier") != 0.0)
|
||||
{
|
||||
FormatRecalculate(false, Track_Main, i, sQuery, sizeof(sQuery), map);
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@ -919,20 +919,20 @@ void ReallyRecalculateCurrentMap()
|
||||
LogError("DEBUG: 5xxx (ReallyRecalculateCurrentMap)");
|
||||
#endif
|
||||
|
||||
Transaction2 trans = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
char sQuery[1024];
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery), "UPDATE %splayertimes SET points = 0 WHERE map = '%s';", gS_MySQLPrefix, gS_Map);
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
for (int i = 0; i < gI_Styles; i++)
|
||||
{
|
||||
if (!Shavit_GetStyleSettingBool(i, "unranked") && Shavit_GetStyleSettingFloat(i, "rankingmultiplier") != 0.0)
|
||||
{
|
||||
FormatRecalculate(true, Track_Main, i, sQuery, sizeof(sQuery));
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
FormatRecalculate(true, Track_Bonus, i, sQuery, sizeof(sQuery));
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@ -969,7 +969,7 @@ public void Shavit_OnFinish_Post(int client, int style, float time, int jumps, i
|
||||
char sQuery[1024];
|
||||
FormatRecalculate(true, track, style, sQuery, sizeof(sQuery));
|
||||
|
||||
gH_SQL.Query2(SQL_Recalculate_Callback, sQuery, (style << 8) | track, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_Recalculate_Callback, sQuery, (style << 8) | track, DBPrio_High);
|
||||
UpdateAllPoints(true, gS_Map, track);
|
||||
}
|
||||
|
||||
@ -1009,7 +1009,7 @@ void UpdatePointsForSinglePlayer(int client)
|
||||
gS_MySQLPrefix, auth);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_UpdateAllPoints_Callback, sQuery, GetClientSerial(client));
|
||||
QueryLog(gH_SQL, SQL_UpdateAllPoints_Callback, sQuery, GetClientSerial(client));
|
||||
}
|
||||
|
||||
void UpdateAllPoints(bool recalcall=false, char[] map="", int track=-1)
|
||||
@ -1060,7 +1060,7 @@ void UpdateAllPoints(bool recalcall=false, char[] map="", int track=-1)
|
||||
sTrackWhere);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_UpdateAllPoints_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_UpdateAllPoints_Callback, sQuery);
|
||||
}
|
||||
|
||||
public void SQL_UpdateAllPoints_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1099,7 +1099,7 @@ void UpdatePlayerRank(int client, bool first)
|
||||
hPack.WriteCell(GetClientSerial(client));
|
||||
hPack.WriteCell(first);
|
||||
|
||||
gH_SQL.Query2(SQL_UpdatePlayerRank_Callback, sQuery, hPack, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_UpdatePlayerRank_Callback, sQuery, hPack, DBPrio_Low);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1149,7 +1149,7 @@ void UpdateTop100()
|
||||
SELECT * FROM (SELECT -1 as c, auth, name, points FROM %susers WHERE points > 0 ORDER BY points DESC LIMIT 100) b;",
|
||||
gS_MySQLPrefix, gS_MySQLPrefix);
|
||||
|
||||
gH_SQL.Query2(SQL_UpdateTop100_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_UpdateTop100_Callback, sQuery, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_UpdateTop100_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1257,22 +1257,22 @@ public void SQL_Version_Callback(Database db, DBResultSet results, const char[]
|
||||
FROM %swrs %s %s %s %s GROUP BY auth;";
|
||||
|
||||
char sQuery[800];
|
||||
Transaction2 hTransaction = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
!gB_HasSQLRANK ? sWRHolderRankTrackQueryYuck : sWRHolderRankTrackQueryRANK,
|
||||
gS_MySQLPrefix, "wrhrankmain", gS_MySQLPrefix, '=');
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
!gB_HasSQLRANK ? sWRHolderRankTrackQueryYuck : sWRHolderRankTrackQueryRANK,
|
||||
gS_MySQLPrefix, "wrhrankbonus", gS_MySQLPrefix, '>');
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
!gB_HasSQLRANK ? sWRHolderRankOtherQueryYuck : sWRHolderRankOtherQueryRANK,
|
||||
gS_MySQLPrefix, "wrhrankall", gS_MySQLPrefix, "", "", "", "");
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
!gB_HasSQLRANK ? sWRHolderRankOtherQueryYuck : sWRHolderRankOtherQueryRANK,
|
||||
@ -1281,9 +1281,9 @@ public void SQL_Version_Callback(Database db, DBResultSet results, const char[]
|
||||
(gCV_MVPRankOnes.IntValue == 2) ? "style = 0" : "",
|
||||
(gCV_MVPRankOnes.IntValue == 2 && gCV_MVPRankOnes_Main.BoolValue) ? "AND" : "",
|
||||
(gCV_MVPRankOnes_Main.BoolValue) ? "track = 0" : "");
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
|
||||
gH_SQL.Execute(hTransaction, Trans_WRHolderRankTablesSuccess, Trans_WRHolderRankTablesError, 0, DBPrio_High);
|
||||
gH_SQL.Execute(trans, Trans_WRHolderRankTablesSuccess, Trans_WRHolderRankTablesError, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void Trans_WRHolderRankTablesSuccess(Database db, any data, int numQueries, DBResultSet[] results, any[] queryData)
|
||||
@ -1343,7 +1343,7 @@ void RefreshWRHoldersActually()
|
||||
);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_GetWRHolders_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_GetWRHolders_Callback, sQuery);
|
||||
|
||||
gB_WRHoldersRefreshed = true;
|
||||
}
|
||||
@ -1498,7 +1498,7 @@ public int Native_Rankings_DeleteMap(Handle handler, int numParams)
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "DELETE FROM %smaptiers WHERE map = '%s';", gS_MySQLPrefix, sMap);
|
||||
gH_SQL.Query2(SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -238,7 +238,7 @@ TopMenu gH_AdminMenu = null;
|
||||
TopMenuObject gH_TimerCommands = INVALID_TOPMENUOBJECT;
|
||||
|
||||
// database related things
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
char gS_MySQLPrefix[32];
|
||||
|
||||
bool gB_ClosestPos;
|
||||
@ -447,7 +447,7 @@ public void OnPluginStart()
|
||||
|
||||
// database
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = GetTimerDatabaseHandle2();
|
||||
gH_SQL = GetTimerDatabaseHandle();
|
||||
|
||||
LoadDHooks();
|
||||
|
||||
@ -793,7 +793,7 @@ bool LoadReplay(frame_cache_t cache, int style, int track, const char[] path, co
|
||||
hPack.WriteCell(style);
|
||||
hPack.WriteCell(track);
|
||||
|
||||
gH_SQL.Query2(SQL_GetUserName_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_GetUserName_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -1108,7 +1108,7 @@ public int Native_StartReplayFromFile(Handle handler, int numParams)
|
||||
{
|
||||
char sQuery[192];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT name FROM %susers WHERE auth = %d;", gS_MySQLPrefix, cache.iSteamID);
|
||||
gH_SQL.Query2(SQL_GetUserName_Botref_Callback, sQuery, EntIndexToEntRef(bot), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_GetUserName_Botref_Callback, sQuery, EntIndexToEntRef(bot), DBPrio_High);
|
||||
}
|
||||
|
||||
return bot;
|
||||
|
||||
@ -47,7 +47,7 @@ bool gB_Mapchooser = false;
|
||||
bool gB_Rankings = false;
|
||||
|
||||
// database handle
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
char gS_MySQLPrefix[32];
|
||||
|
||||
// cache
|
||||
@ -148,7 +148,7 @@ public void OnPluginStart()
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = view_as<Database2>(Shavit_GetDatabase());
|
||||
gH_SQL = Shavit_GetDatabase();
|
||||
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
@ -273,7 +273,7 @@ void QueryPlaytime(int client)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"SELECT style, playtime FROM %sstyleplaytime WHERE auth = %d;",
|
||||
gS_MySQLPrefix, iSteamID);
|
||||
gH_SQL.Query2(SQL_QueryStylePlaytime_Callback, sQuery, GetClientSerial(client), DBPrio_Normal);
|
||||
QueryLog(gH_SQL, SQL_QueryStylePlaytime_Callback, sQuery, GetClientSerial(client), DBPrio_Normal);
|
||||
}
|
||||
|
||||
public void SQL_QueryStylePlaytime_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -308,7 +308,7 @@ public void OnClientDisconnect(int client)
|
||||
return;
|
||||
}
|
||||
|
||||
Transaction2 trans = null;
|
||||
Transaction trans = null;
|
||||
SavePlaytime(client, GetEngineTime(), trans);
|
||||
|
||||
if (trans != null)
|
||||
@ -372,7 +372,7 @@ public void OnLibraryRemoved(const char[] name)
|
||||
}
|
||||
}
|
||||
|
||||
void SavePlaytime222(int client, float now, Transaction2 &trans, int style, int iSteamID)
|
||||
void SavePlaytime222(int client, float now, Transaction&trans, int style, int iSteamID)
|
||||
{
|
||||
char sQuery[512];
|
||||
|
||||
@ -429,10 +429,10 @@ void SavePlaytime222(int client, float now, Transaction2 &trans, int style, int
|
||||
|
||||
if (trans == null)
|
||||
{
|
||||
trans = view_as<Transaction2>(new Transaction());
|
||||
trans = new Transaction();
|
||||
}
|
||||
|
||||
trans.AddQuery2(sQuery);
|
||||
AddQueryLog(trans, sQuery);
|
||||
}
|
||||
|
||||
public void Trans_SavePlaytime_Success(Database db, any data, int numQueries, DBResultSet[] results, any[] queryData)
|
||||
@ -444,7 +444,7 @@ public void Trans_SavePlaytime_Failure(Database db, any data, int numQueries, co
|
||||
LogError("Timer (stats save playtime) SQL query %d/%d failed. Reason: %s", failIndex, numQueries, error);
|
||||
}
|
||||
|
||||
void SavePlaytime(int client, float now, Transaction2 &trans)
|
||||
void SavePlaytime(int client, float now, Transaction&trans)
|
||||
{
|
||||
int iSteamID = GetSteamAccountID(client);
|
||||
|
||||
@ -472,7 +472,7 @@ public Action Timer_SavePlaytime(Handle timer, any data)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
Transaction2 trans = null;
|
||||
Transaction trans = null;
|
||||
float now = GetEngineTime();
|
||||
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
@ -513,7 +513,7 @@ public Action Command_Playtime(int client, int args)
|
||||
"UNION " ...
|
||||
"(SELECT -1, '', u2.playtime, COUNT(*) as ownrank FROM %susers u1 JOIN (SELECT playtime FROM %susers WHERE auth = %d) u2 WHERE u1.playtime >= u2.playtime);",
|
||||
gS_MySQLPrefix, gS_MySQLPrefix, gS_MySQLPrefix, GetSteamAccountID(client));
|
||||
gH_SQL.Query2(SQL_TopPlaytime_Callback, sQuery, GetClientSerial(client), DBPrio_Normal);
|
||||
QueryLog(gH_SQL, SQL_TopPlaytime_Callback, sQuery, GetClientSerial(client), DBPrio_Normal);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -781,7 +781,7 @@ Action OpenStatsMenu(int client, int steamid, int style = 0, int item = 0)
|
||||
gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, gS_MySQLPrefix, steamid, style
|
||||
);
|
||||
|
||||
gH_SQL.Query2(OpenStatsMenu_Mapchooser_Callback, sQuery, data, DBPrio_Low);
|
||||
QueryLog(gH_SQL, OpenStatsMenu_Mapchooser_Callback, sQuery, data, DBPrio_Low);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -872,7 +872,7 @@ Action OpenStatsMenu_Main(int steamid, int style, DataPack data)
|
||||
|
||||
StrCat(sQuery, sizeof(sQuery), ";");
|
||||
|
||||
gH_SQL.Query2(OpenStatsMenuCallback, sQuery, data, DBPrio_Low);
|
||||
QueryLog(gH_SQL, OpenStatsMenuCallback, sQuery, data, DBPrio_Low);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -1181,7 +1181,7 @@ void ShowMaps(int client)
|
||||
|
||||
gB_CanOpenMenu[client] = false;
|
||||
|
||||
gH_SQL.Query2(ShowMapsCallback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
QueryLog(gH_SQL, ShowMapsCallback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
}
|
||||
|
||||
public void ShowMapsCallback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1316,7 +1316,7 @@ public int MenuHandler_ShowMaps(Menu menu, MenuAction action, int param1, int pa
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, 512, "SELECT u.name, p.time, p.jumps, p.style, u.auth, p.date, p.map, p.strafes, p.sync, p.points FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE p.id = '%s' LIMIT 1;", gS_MySQLPrefix, gS_MySQLPrefix, sInfo);
|
||||
|
||||
gH_SQL.Query2(SQL_SubMenu_Callback, sQuery, GetClientSerial(param1));
|
||||
QueryLog(gH_SQL, SQL_SubMenu_Callback, sQuery, GetClientSerial(param1));
|
||||
}
|
||||
else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
||||
{
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
// #define DEBUG
|
||||
|
||||
// database handle
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
|
||||
// base cvars
|
||||
ConVar mp_do_warmup_period = null;
|
||||
@ -131,7 +131,7 @@ public void OnPluginStart()
|
||||
HookEvent("round_end", round_end, EventHookMode_Pre);
|
||||
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = GetTimerDatabaseHandle2();
|
||||
gH_SQL = GetTimerDatabaseHandle();
|
||||
}
|
||||
|
||||
public void OnMapStart()
|
||||
@ -221,7 +221,7 @@ void StartCalculating()
|
||||
PrintToServer("%s", sQuery);
|
||||
#endif
|
||||
|
||||
gH_SQL.Query2(SQL_GetMapTimes, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_GetMapTimes, sQuery, 0, DBPrio_Low);
|
||||
}
|
||||
|
||||
public void SQL_GetMapTimes(Database db, DBResultSet results, const char[] error, any data)
|
||||
|
||||
@ -68,7 +68,7 @@ Handle gH_OnFinishMessage = null;
|
||||
Handle gH_OnWorldRecordsCached = null;
|
||||
|
||||
// database handle
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
bool gB_Connected = false;
|
||||
|
||||
// cache
|
||||
@ -363,7 +363,7 @@ public void OnMapStart()
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT map FROM %smapzones GROUP BY map UNION SELECT map FROM %splayertimes GROUP BY map ORDER BY map ASC;", gS_MySQLPrefix, gS_MySQLPrefix);
|
||||
gH_SQL.Query2(SQL_UpdateMaps_Callback, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_UpdateMaps_Callback, sQuery, 0, DBPrio_Low);
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
@ -508,7 +508,7 @@ void UpdateClientCache(int client)
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT time, style, track, completions, exact_time_int FROM %splayertimes WHERE map = '%s' AND auth = %d;", gS_MySQLPrefix, gS_Map, iSteamID);
|
||||
gH_SQL.Query2(SQL_UpdateCache_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_UpdateCache_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_UpdateCache_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -577,7 +577,7 @@ void UpdateWRCache(int client = -1)
|
||||
"SELECT style, track, auth, stage, time FROM `%sstagetimeswr` WHERE map = '%s';",
|
||||
gS_MySQLPrefix, gS_Map);
|
||||
|
||||
gH_SQL.Query2(SQL_UpdateWRStageTimes_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_UpdateWRStageTimes_Callback, sQuery);
|
||||
}
|
||||
|
||||
public void SQL_UpdateWRStageTimes_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -724,7 +724,7 @@ public int Native_WR_DeleteMap(Handle handler, int numParams)
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "DELETE FROM %splayertimes WHERE map = '%s';", gS_MySQLPrefix, sMap);
|
||||
gH_SQL.Query2(SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -783,7 +783,7 @@ void DeleteWRInner(int recordid, int steamid, DataPack hPack)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"DELETE FROM %splayertimes WHERE id = %d;",
|
||||
gS_MySQLPrefix, recordid);
|
||||
gH_SQL.Query2(DeleteWR_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, DeleteWR_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
|
||||
public void DeleteWRGetID_Callback(Database db, DBResultSet results, const char[] error, DataPack hPack)
|
||||
@ -815,7 +815,7 @@ void DeleteWR(int style, int track, const char[] map, int steamid, int recordid,
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"SELECT id, auth FROM %swrs WHERE map = '%s' AND style = %d AND track = %d;",
|
||||
gS_MySQLPrefix, map, style, track, gS_MySQLPrefix, map, style, track);
|
||||
gH_SQL.Query2(DeleteWRGetID_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, DeleteWRGetID_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1185,7 +1185,7 @@ public int MenuHandler_DeleteAll(Menu menu, MenuAction action, int param1, int p
|
||||
hPack.WriteCell(gA_WRCache[param1].iLastStyle);
|
||||
hPack.WriteCell(gA_WRCache[param1].iLastTrack);
|
||||
|
||||
gH_SQL.Query2(DeleteAll_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, DeleteAll_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
else if(action == MenuAction_End)
|
||||
{
|
||||
@ -1219,7 +1219,7 @@ void OpenDelete(int client)
|
||||
FormatEx(sQuery, 512, "SELECT p.id, u.name, p.time, p.jumps FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE map = '%s' AND style = %d AND track = %d ORDER BY time ASC, date ASC LIMIT 1000;",
|
||||
gS_MySQLPrefix, gS_MySQLPrefix, gS_Map, gA_WRCache[client].iLastStyle, gA_WRCache[client].iLastTrack);
|
||||
|
||||
gH_SQL.Query2(SQL_OpenDelete_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_OpenDelete_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_OpenDelete_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1358,7 +1358,7 @@ public int DeleteConfirm_Handler(Menu menu, MenuAction action, int param1, int p
|
||||
"FROM %susers u LEFT JOIN %splayertimes p ON u.auth = p.auth WHERE p.id = %d;",
|
||||
gS_MySQLPrefix, gA_WRCache[param1].iLastStyle, gA_WRCache[param1].iLastTrack, gS_MySQLPrefix, gS_MySQLPrefix, iRecordID);
|
||||
|
||||
gH_SQL.Query2(GetRecordDetails_Callback, sQuery, GetSteamAccountID(param1), DBPrio_High);
|
||||
QueryLog(gH_SQL, GetRecordDetails_Callback, sQuery, GetSteamAccountID(param1), DBPrio_High);
|
||||
}
|
||||
else if(action == MenuAction_End)
|
||||
{
|
||||
@ -1431,7 +1431,7 @@ public void GetRecordDetails_Callback(Database db, DBResultSet results, const ch
|
||||
FormatEx(sQuery, 256, "DELETE FROM %splayertimes WHERE id = %d;",
|
||||
gS_MySQLPrefix, iRecordID);
|
||||
|
||||
gH_SQL.Query2(DeleteConfirm_Callback, sQuery, hPack, DBPrio_High);
|
||||
QueryLog(gH_SQL, DeleteConfirm_Callback, sQuery, hPack, DBPrio_High);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1687,7 +1687,7 @@ void RetrieveWRMenu(int client, int track)
|
||||
FormatEx(sQuery, sizeof(sQuery),
|
||||
"SELECT style, time FROM %swrs WHERE map = '%s' AND track = %d AND style < %d ORDER BY style;",
|
||||
gS_MySQLPrefix, gA_WRCache[client].sClientMap, track, gI_Styles);
|
||||
gH_SQL.Query2(SQL_RetrieveWRMenu_Callback, sQuery, GetClientSerial(client));
|
||||
QueryLog(gH_SQL, SQL_RetrieveWRMenu_Callback, sQuery, GetClientSerial(client));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1828,7 +1828,7 @@ void StartWRMenu(int client)
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, 512, "SELECT p.id, u.name, p.time, p.jumps, p.auth FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE map = '%s' AND style = %d AND track = %d ORDER BY time ASC, date ASC;", gS_MySQLPrefix, gS_MySQLPrefix, sEscapedMap, gA_WRCache[client].iLastStyle, gA_WRCache[client].iLastTrack);
|
||||
gH_SQL.Query2(SQL_WR_Callback, sQuery, dp);
|
||||
QueryLog(gH_SQL, SQL_WR_Callback, sQuery, dp);
|
||||
}
|
||||
|
||||
public void SQL_WR_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -1978,7 +1978,7 @@ public Action Command_RecentRecords(int client, int args)
|
||||
"SELECT a.id, a.map, u.name, a.time, a.style, a.track FROM %swrs a JOIN %susers u on a.auth = u.auth ORDER BY a.date DESC LIMIT %d;",
|
||||
gS_MySQLPrefix, gS_MySQLPrefix, gCV_RecentLimit.IntValue);
|
||||
|
||||
gH_SQL.Query2(SQL_RR_Callback, sQuery, GetClientSerial(client), DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_RR_Callback, sQuery, GetClientSerial(client), DBPrio_Low);
|
||||
|
||||
gA_WRCache[client].bPendingMenu = true;
|
||||
|
||||
@ -2194,7 +2194,7 @@ public Action Command_PersonalBest(int client, int args)
|
||||
char query[512];
|
||||
FormatEx(query, sizeof(query), "SELECT p.id, p.style, p.track, p.time, p.date, u.name FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE p.auth = %d AND p.map = '%s' ORDER BY p.track, p.style;", gS_MySQLPrefix, gS_MySQLPrefix, steamid, validmap);
|
||||
|
||||
gH_SQL.Query2(SQL_PersonalBest_Callback, query, pack, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_PersonalBest_Callback, query, pack, DBPrio_Low);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -2305,7 +2305,7 @@ void OpenSubMenu(int client, int id)
|
||||
datapack.WriteCell(GetClientSerial(client));
|
||||
datapack.WriteCell(id);
|
||||
|
||||
gH_SQL.Query2(SQL_SubMenu_Callback, sQuery, datapack, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_SubMenu_Callback, sQuery, datapack, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_SubMenu_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -2504,7 +2504,7 @@ public int SubMenu_Handler(Menu menu, MenuAction action, int param1, int param2)
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = view_as<Database2>(Shavit_GetDatabase());
|
||||
gH_SQL = Shavit_GetDatabase();
|
||||
|
||||
gB_Connected = true;
|
||||
OnMapStart();
|
||||
@ -2590,7 +2590,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
||||
Shavit_PrintToChat(client, "old: %.01f new: %.01f", fOldWR, time);
|
||||
#endif
|
||||
|
||||
Transaction2 hTransaction = new Transaction2();
|
||||
Transaction trans = new Transaction();
|
||||
char query[512];
|
||||
|
||||
FormatEx(query, sizeof(query),
|
||||
@ -2598,7 +2598,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
||||
gS_MySQLPrefix, style, track, gS_Map
|
||||
);
|
||||
|
||||
hTransaction.AddQuery2(query);
|
||||
AddQueryLog(trans, query);
|
||||
|
||||
for (int i = 0; i < MAX_STAGES; i++)
|
||||
{
|
||||
@ -2615,10 +2615,10 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
||||
gS_MySQLPrefix, style, track, gS_Map, iSteamID, fTime, i
|
||||
);
|
||||
|
||||
hTransaction.AddQuery2(query);
|
||||
AddQueryLog(trans, query);
|
||||
}
|
||||
|
||||
gH_SQL.Execute(hTransaction, Trans_ReplaceStageTimes_Success, Trans_ReplaceStageTimes_Error, 0, DBPrio_High);
|
||||
gH_SQL.Execute(trans, Trans_ReplaceStageTimes_Success, Trans_ReplaceStageTimes_Error, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
int iRank = GetRankForTime(style, time, track);
|
||||
@ -2679,7 +2679,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
||||
gS_MySQLPrefix, time, jumps, timestamp, strafes, sync, fPoints, perfs, view_as<int>(time), gS_Map, iSteamID, style, track);
|
||||
}
|
||||
|
||||
gH_SQL.Query2(SQL_OnFinish_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_OnFinish_Callback, sQuery, GetClientSerial(client), DBPrio_High);
|
||||
|
||||
Call_StartForward(gH_OnFinish_Post);
|
||||
Call_PushCell(client);
|
||||
@ -2708,7 +2708,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
||||
"UPDATE %splayertimes SET completions = completions + 1 WHERE map = '%s' AND auth = %d AND style = %d AND track = %d;",
|
||||
gS_MySQLPrefix, gS_Map, iSteamID, style, track);
|
||||
|
||||
gH_SQL.Query2(SQL_OnIncrementCompletions_Callback, sQuery, 0, DBPrio_Low);
|
||||
QueryLog(gH_SQL, SQL_OnIncrementCompletions_Callback, sQuery, 0, DBPrio_Low);
|
||||
}
|
||||
|
||||
gI_PlayerCompletion[client][style][track]++;
|
||||
@ -2828,7 +2828,7 @@ void UpdateLeaderboards()
|
||||
{
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "SELECT p.style, p.track, p.time, p.exact_time_int, p.id, p.auth, u.name FROM %splayertimes p LEFT JOIN %susers u ON p.auth = u.auth WHERE p.map = '%s' ORDER BY p.time ASC, p.date ASC;", gS_MySQLPrefix, gS_MySQLPrefix, gS_Map);
|
||||
gH_SQL.Query2(SQL_UpdateLeaderboards_Callback, sQuery);
|
||||
QueryLog(gH_SQL, SQL_UpdateLeaderboards_Callback, sQuery);
|
||||
}
|
||||
|
||||
public void SQL_UpdateLeaderboards_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
EngineVersion gEV_Type = Engine_Unknown;
|
||||
|
||||
Database2 gH_SQL = null;
|
||||
Database gH_SQL = null;
|
||||
bool gB_MySQL = false;
|
||||
|
||||
bool gB_YouCanLoadZonesNow = false;
|
||||
@ -760,7 +760,7 @@ public int Native_Zones_DeleteMap(Handle handler, int numParams)
|
||||
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "DELETE FROM %smapzones WHERE map = '%s';", gS_MySQLPrefix, sMap);
|
||||
gH_SQL.Query2(SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1592,7 +1592,7 @@ void RefreshZones()
|
||||
"SELECT type, corner1_x, corner1_y, corner1_z, corner2_x, corner2_y, corner2_z, destination_x, destination_y, destination_z, track, %s, flags, data, form, target FROM %smapzones WHERE map = '%s';",
|
||||
(gB_MySQL)? "id":"rowid", gS_MySQLPrefix, gS_Map);
|
||||
|
||||
gH_SQL.Query2(SQL_RefreshZones_Callback, sQuery, 0, DBPrio_High);
|
||||
QueryLog(gH_SQL, SQL_RefreshZones_Callback, sQuery, 0, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_RefreshZones_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1659,25 +1659,25 @@ public void SQL_RefreshZones_Callback(Database db, DBResultSet results, const ch
|
||||
gB_InsertedPrebuiltZones = true;
|
||||
|
||||
char sQuery[1024];
|
||||
Transaction2 hTransaction;
|
||||
Transaction trans;
|
||||
|
||||
for (int i = 0; i < gI_MapZones; i++)
|
||||
{
|
||||
if (gA_ZoneCache[i].bPrebuilt)
|
||||
{
|
||||
if (hTransaction == null)
|
||||
if (trans == null)
|
||||
{
|
||||
hTransaction = new Transaction2();
|
||||
trans = new Transaction();
|
||||
}
|
||||
|
||||
InsertPrebuiltZone(i, false, sQuery, sizeof(sQuery));
|
||||
hTransaction.AddQuery2(sQuery);
|
||||
AddQueryLog(hTransaction, sQuery);
|
||||
}
|
||||
}
|
||||
|
||||
if (hTransaction != null)
|
||||
if (trans != null)
|
||||
{
|
||||
gH_SQL.Execute(hTransaction);
|
||||
gH_SQL.Execute(trans);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1786,7 +1786,7 @@ void GetStartPosition(int client)
|
||||
"SELECT track, pos_x, pos_y, pos_z, ang_x, ang_y, ang_z, angles_only FROM %sstartpositions WHERE auth = %d AND map = '%s'",
|
||||
gS_MySQLPrefix, steamID, gS_Map);
|
||||
|
||||
gH_SQL.Query2(SQL_GetStartPosition_Callback, query, GetClientSerial(client));
|
||||
QueryLog(gH_SQL, SQL_GetStartPosition_Callback, query, GetClientSerial(client));
|
||||
}
|
||||
|
||||
public void SQL_GetStartPosition_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
@ -1863,7 +1863,7 @@ void SetStart(int client, int track, bool anglesonly)
|
||||
gF_StartPos[client][track][0], gF_StartPos[client][track][1], gF_StartPos[client][track][2],
|
||||
gF_StartAng[client][track][0], gF_StartAng[client][track][1], gF_StartAng[client][track][2], anglesonly);
|
||||
|
||||
gH_SQL.Query2(SQL_InsertStartPosition_Callback, query);
|
||||
QueryLog(gH_SQL, SQL_InsertStartPosition_Callback, query);
|
||||
}
|
||||
|
||||
public void SQL_InsertStartPosition_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -1902,7 +1902,7 @@ void DeleteSetStart(int client, int track)
|
||||
"DELETE FROM %sstartpositions WHERE auth = %d AND track = %d AND map = '%s';",
|
||||
gS_MySQLPrefix, GetSteamAccountID(client), track, gS_Map);
|
||||
|
||||
gH_SQL.Query2(SQL_DeleteSetStart_Callback, query);
|
||||
QueryLog(gH_SQL, SQL_DeleteSetStart_Callback, query);
|
||||
}
|
||||
|
||||
public void SQL_DeleteSetStart_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -2106,7 +2106,7 @@ public int MenuHandler_DeleteCustomSpawn(Menu menu, MenuAction action, int param
|
||||
"DELETE FROM %smapzones WHERE type = %d AND map = '%s' AND track = %d;",
|
||||
gS_MySQLPrefix, Zone_CustomSpawn, gS_Map, iTrack);
|
||||
|
||||
gH_SQL.Query2(SQL_DeleteCustom_Spawn_Callback, sQuery, GetClientSerial(param1));
|
||||
QueryLog(gH_SQL, SQL_DeleteCustom_Spawn_Callback, sQuery, GetClientSerial(param1));
|
||||
}
|
||||
else if(action == MenuAction_End)
|
||||
{
|
||||
@ -3428,7 +3428,7 @@ public int MenuHandler_DeleteZone(Menu menu, MenuAction action, int param1, int
|
||||
hDatapack.WriteCell(GetClientSerial(param1));
|
||||
hDatapack.WriteCell(gA_ZoneCache[id].iType);
|
||||
|
||||
gH_SQL.Query2(SQL_DeleteZone_Callback, sQuery, hDatapack);
|
||||
QueryLog(gH_SQL, SQL_DeleteZone_Callback, sQuery, hDatapack);
|
||||
|
||||
Shavit_RemoveZone(id);
|
||||
}
|
||||
@ -3530,7 +3530,7 @@ public int MenuHandler_DeleteAllZones(Menu menu, MenuAction action, int param1,
|
||||
char sQuery[512];
|
||||
FormatEx(sQuery, sizeof(sQuery), "DELETE FROM %smapzones WHERE map = '%s';", gS_MySQLPrefix, gS_Map);
|
||||
|
||||
gH_SQL.Query2(SQL_DeleteAllZones_Callback, sQuery, GetClientSerial(param1));
|
||||
QueryLog(gH_SQL, SQL_DeleteAllZones_Callback, sQuery, GetClientSerial(param1));
|
||||
}
|
||||
else if (action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
||||
{
|
||||
@ -4392,7 +4392,7 @@ void InsertZone(int client)
|
||||
|
||||
Reset(client);
|
||||
|
||||
gH_SQL.Query2(SQL_InsertZone_Callback, sQuery, 0);
|
||||
QueryLog(gH_SQL, SQL_InsertZone_Callback, sQuery, 0);
|
||||
}
|
||||
|
||||
public void SQL_InsertZone_Callback(Database db, DBResultSet results, const char[] error, DataPack data)
|
||||
@ -4702,7 +4702,7 @@ void CreateZonePoints(float point[8][3], bool prebuilt)
|
||||
public void Shavit_OnDatabaseLoaded()
|
||||
{
|
||||
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
|
||||
gH_SQL = view_as<Database2>(Shavit_GetDatabase());
|
||||
gH_SQL = Shavit_GetDatabase();
|
||||
gB_MySQL = IsMySQLDatabase(gH_SQL);
|
||||
|
||||
if (gB_YouCanLoadZonesNow && gCV_SQLZones.BoolValue)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user