diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 17 | ||||
-rw-r--r-- | src/server/game/World/World.cpp | 51 | ||||
-rw-r--r-- | src/server/game/World/World.h | 1 | ||||
-rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 16 |
8 files changed, 80 insertions, 19 deletions
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index c6cf0ba0d5c..a1bcf97cfc8 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -610,7 +610,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul while (db2PathItr != end) { LocaleConstant locale = GetLocaleByName(db2PathItr->path().filename().string()); - if (IsValidLocale(locale)) + if (IsValidLocale(locale) && (sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) || locale == defaultLocale)) foundLocales[locale] = true; ++db2PathItr; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ac1d2375e84..8c20cc793fd 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -162,7 +162,12 @@ CreatureModel const* CreatureTemplate::GetFirstVisibleModel() const void CreatureTemplate::InitializeQueryData() { for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc) + { + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && loc != DEFAULT_LOCALE) + continue; + QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc), DIFFICULTY_NONE); + } } WorldPacket CreatureTemplate::BuildQueryData(LocaleConstant loc, Difficulty difficulty) const diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 84e27d4eceb..a22f60da51f 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -61,7 +61,12 @@ void GameObjectTemplate::InitializeQueryData() { for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc) + { + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && loc != DEFAULT_LOCALE) + continue; + QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc)); + } } WorldPacket GameObjectTemplate::BuildQueryData(LocaleConstant loc) const diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 45604e4ad79..0a71eb8d80a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9412,7 +9412,7 @@ void ObjectMgr::LoadTrainers() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (!IsValidLocale(locale) || locale == LOCALE_enUS) + if (!IsValidLocale(locale) || !sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) || locale == LOCALE_enUS) continue; if (Trainer::Trainer* trainer = Trinity::Containers::MapGetValuePtr(_trainers, trainerId)) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 23403d6acc2..ed7ceb10b6b 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -312,6 +312,9 @@ void Quest::LoadQuestObjectiveVisualEffect(Field* fields) void Quest::LoadConditionalConditionalQuestDescription(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_description_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -332,6 +335,9 @@ void Quest::LoadConditionalConditionalQuestDescription(Field* fields) void Quest::LoadConditionalConditionalRequestItemsText(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_request_items_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -352,6 +358,9 @@ void Quest::LoadConditionalConditionalRequestItemsText(Field* fields) void Quest::LoadConditionalConditionalOfferRewardText(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_offer_reward_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -372,6 +381,9 @@ void Quest::LoadConditionalConditionalOfferRewardText(Field* fields) void Quest::LoadConditionalConditionalQuestCompletionLog(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_completion_log_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -598,7 +610,12 @@ bool Quest::CanIncreaseRewardedQuestCounters() const void Quest::InitializeQueryData() { for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc) + { + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && loc != DEFAULT_LOCALE) + continue; + QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc), nullptr); + } } WorldPacket Quest::BuildQueryData(LocaleConstant loc, Player* player) const diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 40a4f6ad8e2..f492880fb65 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1723,6 +1723,9 @@ void World::LoadConfigSettings(bool reload) // Enable AE loot m_bool_configs[CONFIG_ENABLE_AE_LOOT] = sConfigMgr->GetBoolDefault("Loot.EnableAELoot", false); + // Loading of Locales + m_bool_configs[CONFIG_LOAD_LOCALES] = sConfigMgr->GetBoolDefault("Load.Locales", true); + // call ScriptMgr if we're reloading the configuration if (reload) sScriptMgr->OnConfigLoad(reload); @@ -1904,15 +1907,18 @@ bool World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Localization strings..."); uint32 oldMSTime = getMSTime(); - sObjectMgr->LoadCreatureLocales(); - sObjectMgr->LoadGameObjectLocales(); - sObjectMgr->LoadQuestTemplateLocale(); - sObjectMgr->LoadQuestOfferRewardLocale(); - sObjectMgr->LoadQuestRequestItemsLocale(); - sObjectMgr->LoadQuestObjectivesLocale(); - sObjectMgr->LoadPageTextLocales(); - sObjectMgr->LoadGossipMenuItemsLocales(); - sObjectMgr->LoadPointOfInterestLocales(); + if (m_bool_configs[CONFIG_LOAD_LOCALES]) + { + sObjectMgr->LoadCreatureLocales(); + sObjectMgr->LoadGameObjectLocales(); + sObjectMgr->LoadQuestTemplateLocale(); + sObjectMgr->LoadQuestOfferRewardLocale(); + sObjectMgr->LoadQuestRequestItemsLocale(); + sObjectMgr->LoadQuestObjectivesLocale(); + sObjectMgr->LoadPageTextLocales(); + sObjectMgr->LoadGossipMenuItemsLocales(); + sObjectMgr->LoadPointOfInterestLocales(); + } sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) TC_LOG_INFO("server.loading", ">> Localization strings loaded in {} ms", GetMSTimeDiffToNow(oldMSTime)); @@ -2088,7 +2094,9 @@ bool World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Quest Greetings..."); sObjectMgr->LoadQuestGreetings(); - sObjectMgr->LoadQuestGreetingLocales(); + + if (m_bool_configs[CONFIG_LOAD_LOCALES]) + sObjectMgr->LoadQuestGreetingLocales(); TC_LOG_INFO("server.loading", "Loading Objects Pooling Data..."); sPoolMgr->LoadFromDB(); @@ -2182,9 +2190,11 @@ bool World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Player Choices..."); sObjectMgr->LoadPlayerChoices(); - TC_LOG_INFO("server.loading", "Loading Player Choices Locales..."); - sObjectMgr->LoadPlayerChoicesLocale(); - + if (m_bool_configs[CONFIG_LOAD_LOCALES]) + { + TC_LOG_INFO("server.loading", "Loading Player Choices Locales..."); + sObjectMgr->LoadPlayerChoicesLocale(); + } TC_LOG_INFO("server.loading", "Loading Jump Charge Params..."); sObjectMgr->LoadJumpChargeParams(); @@ -2229,8 +2239,12 @@ bool World::SetInitialWorldSettings() sAchievementMgr->LoadAchievementScripts(); TC_LOG_INFO("server.loading", "Loading Achievement Rewards..."); sAchievementMgr->LoadRewards(); - TC_LOG_INFO("server.loading", "Loading Achievement Reward Locales..."); - sAchievementMgr->LoadRewardLocales(); + + if (m_bool_configs[CONFIG_LOAD_LOCALES]) + { + TC_LOG_INFO("server.loading", "Loading Achievement Reward Locales..."); + sAchievementMgr->LoadRewardLocales(); + } TC_LOG_INFO("server.loading", "Loading Completed Achievements..."); sAchievementMgr->LoadCompletedAchievements(); @@ -2366,8 +2380,11 @@ bool World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); - TC_LOG_INFO("server.loading", "Loading Creature Text Locales..."); - sCreatureTextMgr->LoadCreatureTextLocales(); + if (m_bool_configs[CONFIG_LOAD_LOCALES]) + { + TC_LOG_INFO("server.loading", "Loading Creature Text Locales..."); + sCreatureTextMgr->LoadCreatureTextLocales(); + } TC_LOG_INFO("server.loading", "Loading creature StaticFlags overrides..."); sObjectMgr->LoadCreatureStaticFlagsOverride(); // must be after LoadCreatures diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 80bd856a94a..4d6ef2211f5 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -198,6 +198,7 @@ enum WorldBoolConfigs CONFIG_CHARACTER_CREATING_DISABLE_ALLIED_RACE_ACHIEVEMENT_REQUIREMENT, CONFIG_BATTLEGROUNDMAP_LOAD_GRIDS, CONFIG_ENABLE_AE_LOOT, + CONFIG_LOAD_LOCALES, BOOL_CONFIG_VALUE_COUNT }; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 3be69c4ceba..3197f0e38ec 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -41,6 +41,7 @@ # PACKET SPOOF PROTECTION SETTINGS # METRIC SETTINGS # PVP SETTINGS +# LOAD SETTINGS # ################################################################################################### @@ -4425,3 +4426,18 @@ Pvp.FactionBalance.Pct20 = 0.8 # ################################################################################################### + +################################################################################################### +# LOAD SETTINGS +# +# These settings control content loading +# +# Load.Locales +# Description: Toggles the loading of Locales. +# Default: 0 - (Disabled) +# 1 - (Enabled) + +Load.Locales = 1 + +# +################################################################################################### |