mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Datastores: fixed enabling locales for session based locales if available
This commit is contained in:
@@ -63,7 +63,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
|
||||
|
||||
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
|
||||
{
|
||||
if (defaultLocale == i)
|
||||
if (defaultLocale == i || i == LOCALE_NONE)
|
||||
continue;
|
||||
|
||||
if (availableDb2Locales & (1 << i))
|
||||
@@ -92,7 +92,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
|
||||
stores[storage->GetHash()] = storage;
|
||||
}
|
||||
|
||||
void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
uint32 DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -132,6 +132,8 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Initialized %d DB2 data stores in %u ms", DB2FilesCount, GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
return availableDb2Locales;
|
||||
}
|
||||
|
||||
DB2StorageBase const* DB2Manager::GetStorage(uint32 type) const
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
static DB2Manager& Instance();
|
||||
|
||||
void LoadStores(std::string const& dataPath, uint32 defaultLocale);
|
||||
uint32 LoadStores(std::string const& dataPath, uint32 defaultLocale);
|
||||
DB2StorageBase const* GetStorage(uint32 type) const;
|
||||
|
||||
void LoadHotfixData();
|
||||
|
||||
@@ -1656,7 +1656,12 @@ void World::SetInitialWorldSettings()
|
||||
///- Load the DBC/DB2 files
|
||||
TC_LOG_INFO("server.loading", "Initialize data stores...");
|
||||
sDBCManager.LoadStores(m_dataPath, m_defaultDbcLocale);
|
||||
sDB2Manager.LoadStores(m_dataPath, m_defaultDbcLocale);
|
||||
m_availableDbcLocaleMask = sDB2Manager.LoadStores(m_dataPath, m_defaultDbcLocale);
|
||||
if (!(m_availableDbcLocaleMask & (1 << m_defaultDbcLocale)))
|
||||
{
|
||||
TC_LOG_FATAL("server.loading", "Unable to load db2/dbc files for %s locale specified in DBC.Locale config!", localeNames[m_defaultDbcLocale]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
TC_LOG_INFO("misc", "Loading hotfix info...");
|
||||
sDB2Manager.LoadHotfixData();
|
||||
|
||||
Reference in New Issue
Block a user