mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/Databases: Add hotfix database to world config and prepared statement for it.
Closes #13533
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user