Core/Databases: Add hotfix database to world config and prepared statement for it.

Closes #13533
This commit is contained in:
devil1234
2014-11-11 13:14:36 +00:00
committed by DDuarte
parent e876201ac4
commit b978f0286c
5 changed files with 106 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ uint32 _maxCoreStuckTimeInMs(0);
WorldDatabaseWorkerPool WorldDatabase; ///< Accessor to the world database
CharacterDatabaseWorkerPool CharacterDatabase; ///< Accessor to the character database
HotfixDatabaseWorkerPool HotfixDatabase; ///< Accessor to the hotfix database
LoginDatabaseWorkerPool LoginDatabase; ///< Accessor to the realm/login database
Battlenet::RealmHandle realmHandle; ///< Id of the realm
Realm realm;
@@ -570,6 +571,31 @@ bool StartDB()
return false;
}
///- Get hotfix database info from configuration file
dbString = sConfigMgr->GetStringDefault("HotfixDatabaseInfo", "");
if (dbString.empty())
{
TC_LOG_ERROR("server.worldserver", "Hotfix database not specified in configuration file");
return false;
}
asyncThreads = uint8(sConfigMgr->GetIntDefault("HotfixDatabase.WorkerThreads", 1));
if (asyncThreads < 1 || asyncThreads > 32)
{
TC_LOG_ERROR("server.worldserver", "Hotfix database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
synchThreads = uint8(sConfigMgr->GetIntDefault("HotfixDatabase.SynchThreads", 2));
///- Initialize the Hotfix database
if (!HotfixDatabase.Open(dbString, asyncThreads, synchThreads))
{
TC_LOG_ERROR("server.worldserver", "Cannot connect to Hotfix database %s", dbString.c_str());
return false;
}
///- Get login database info from configuration file
dbString = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbString.empty())