moved DB connection validity to onmapstart instead of inside timer
This commit is contained in:
parent
b7ae4e5f40
commit
fcb88886c9
@ -239,28 +239,27 @@ public void sql_select_sb_bans(Database db, DBResultSet results, const char[] er
|
||||
}
|
||||
|
||||
public Action start_checks(Handle hTimer)
|
||||
{
|
||||
for (int i = 0; i < MaxClients; i++)
|
||||
{
|
||||
if (IsValidClient(i) && validate_state[i] == 0)
|
||||
{
|
||||
validate_state[i] = -1;
|
||||
SQL_addEntry(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMapStart()
|
||||
{
|
||||
if (!g_dDatabase)
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect, "jenz_ban_detector");
|
||||
}
|
||||
else
|
||||
|
||||
if (!g_hDatabase_sourceban)
|
||||
{
|
||||
if (!g_hDatabase_sourceban)
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect_sb, "sourcebans");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < MaxClients; i++)
|
||||
{
|
||||
if (IsValidClient(i) && validate_state[i] == 0)
|
||||
{
|
||||
validate_state[i] = -1;
|
||||
SQL_addEntry(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Database.Connect(SQL_OnDatabaseConnect_sb, "sourcebans");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user