Made clientprefs attempt to reconnect to the database on map change (bug 4745, r=dvander).

This commit is contained in:
Asher Baker 2012-05-24 16:07:28 +01:00
parent afe5425163
commit 997c7ebbcf
2 changed files with 15 additions and 0 deletions

View File

@ -202,6 +202,19 @@ void ClientPrefs::SDK_OnUnload()
cookieMutex->DestroyThis();
}
void ClientPrefs::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
{
if (Database == NULL && !databaseLoading)
{
g_pSM->LogMessage(myself, "Attempting to reconnect to database...");
databaseLoading = true;
TQueryOp *op = new TQueryOp(Query_Connect, 0);
dbi->AddToThreadQueue(op, PrioQueue_High);
}
}
void ClientPrefs::DatabaseConnect()
{
char error[256];

View File

@ -87,6 +87,8 @@ public:
const char *GetExtensionVerString();
const char *GetExtensionDateString();
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
void DatabaseConnect();
bool AddQueryToQueue(TQueryOp *query);