From 88d833945b6bf16958d01aa48c4dc4948fca4eaa Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 30 Apr 2021 10:26:36 -0400 Subject: [PATCH] Core/DataStores: Load LanguageWords.db2 and Languages.db2 for future use Port From (https://github.com/TrinityCore/TrinityCore/commit/cd8edc68951dbd771d437a3824c6d06706242323) --- .../Database/Databases/HotfixDatabase.cs | 12 +++++ Source/Game/DataStorage/CliDB.cs | 4 ++ Source/Game/DataStorage/Structs/L_Records.cs | 13 +++++ .../master/2021_04_29_00_hotfixes.sql | 54 +++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 sql/updates/hotfixes/master/2021_04_29_00_hotfixes.sql diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index ecc4840b6..e1adfe29b 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -668,6 +668,13 @@ namespace Framework.Database PrepareStatement(HotfixStatements.SEL_KEYCHAIN, "SELECT ID, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10, Key11, Key12, Key13, Key14, Key15, " + "Key16, Key17, Key18, Key19, Key20, Key21, Key22, Key23, Key24, Key25, Key26, Key27, Key28, Key29, Key30, Key31, Key32 FROM keychain"); + // LanguageWords.db2 + PrepareStatement(HotfixStatements.SEL_LANGUAGE_WORDS, "SELECT ID, Word, LanguageID FROM language_words"); + + // Languages.db2 + PrepareStatement(HotfixStatements.SEL_LANGUAGES, "SELECT Name, ID FROM languages"); + PrepareStatement(HotfixStatements.SEL_LANGUAGES_LOCALE, "SELECT ID, Name_lang FROM languages_locale WHERE locale = ?"); + // LfgDungeons.db2 PrepareStatement(HotfixStatements.SEL_LFG_DUNGEONS, "SELECT ID, Name, Description, TypeID, Subtype, Faction, IconTextureFileID, RewardsBgTextureFileID, " + "PopupBgTextureFileID, ExpansionLevel, MapID, DifficultyID, MinGear, GroupID, OrderIndex, RequiredPlayerConditionId, RandomID, ScenarioID, " + @@ -1503,6 +1510,11 @@ namespace Framework.Database SEL_KEYCHAIN, + SEL_LANGUAGE_WORDS, + + SEL_LANGUAGES, + SEL_LANGUAGES_LOCALE, + SEL_LFG_DUNGEONS, SEL_LFG_DUNGEONS_LOCALE, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index 1fadf62e8..39cde3c94 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -202,6 +202,8 @@ namespace Game.DataStorage ItemSpecOverrideStorage = ReadDB2("ItemSpecOverride.db2", HotfixStatements.SEL_ITEM_SPEC_OVERRIDE); ItemXBonusTreeStorage = ReadDB2("ItemXBonusTree.db2", HotfixStatements.SEL_ITEM_X_BONUS_TREE); //KeyChainStorage = ReadDB2("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN); + LanguageWordsStorage = ReadDB2("LanguageWords.db2", HotfixStatements.SEL_LANGUAGE_WORDS); + LanguagesStorage = ReadDB2("Languages.db2", HotfixStatements.SEL_LANGUAGES, HotfixStatements.SEL_LANGUAGES_LOCALE); LFGDungeonsStorage = ReadDB2("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE); LightStorage = ReadDB2("Light.db2", HotfixStatements.SEL_LIGHT); LiquidTypeStorage = ReadDB2("LiquidType.db2", HotfixStatements.SEL_LIQUID_TYPE); @@ -563,6 +565,8 @@ namespace Game.DataStorage public static DB6Storage ItemSpecOverrideStorage; public static DB6Storage ItemXBonusTreeStorage; //public static DB6Storage KeyChainStorage; + public static DB6Storage LanguageWordsStorage; + public static DB6Storage LanguagesStorage; public static DB6Storage LFGDungeonsStorage; public static DB6Storage LightStorage; public static DB6Storage LiquidTypeStorage; diff --git a/Source/Game/DataStorage/Structs/L_Records.cs b/Source/Game/DataStorage/Structs/L_Records.cs index 4fd4e18ac..84d3c8510 100644 --- a/Source/Game/DataStorage/Structs/L_Records.cs +++ b/Source/Game/DataStorage/Structs/L_Records.cs @@ -20,6 +20,19 @@ using Framework.GameMath; namespace Game.DataStorage { + public sealed class LanguageWordsRecord + { + public uint Id; + public string Word; + public uint LanguageID; + } + + public sealed class LanguagesRecord + { + public LocalizedString Name; + public uint Id; + } + public sealed class LFGDungeonsRecord { public uint Id; diff --git a/sql/updates/hotfixes/master/2021_04_29_00_hotfixes.sql b/sql/updates/hotfixes/master/2021_04_29_00_hotfixes.sql new file mode 100644 index 000000000..b5f8b6b86 --- /dev/null +++ b/sql/updates/hotfixes/master/2021_04_29_00_hotfixes.sql @@ -0,0 +1,54 @@ +-- +-- Table structure for table `language_words` +-- +DROP TABLE IF EXISTS `language_words`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `language_words` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `Word` text, + `LanguageID` int(10) unsigned NOT NULL DEFAULT '0', + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `languages` +-- +DROP TABLE IF EXISTS `languages`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `languages` ( + `Name` text, + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `languages_locale` +-- +DROP TABLE IF EXISTS `languages_locale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `languages_locale` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `locale` varchar(4) NOT NULL, + `Name_lang` text, + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`locale`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +/*!50500 PARTITION BY LIST COLUMNS(locale) +(PARTITION deDE VALUES IN ('deDE') ENGINE = InnoDB, + PARTITION esES VALUES IN ('esES') ENGINE = InnoDB, + PARTITION esMX VALUES IN ('esMX') ENGINE = InnoDB, + PARTITION frFR VALUES IN ('frFR') ENGINE = InnoDB, + PARTITION itIT VALUES IN ('itIT') ENGINE = InnoDB, + PARTITION koKR VALUES IN ('koKR') ENGINE = InnoDB, + PARTITION ptBR VALUES IN ('ptBR') ENGINE = InnoDB, + PARTITION ruRU VALUES IN ('ruRU') ENGINE = InnoDB, + PARTITION zhCN VALUES IN ('zhCN') ENGINE = InnoDB, + PARTITION zhTW VALUES IN ('zhTW') ENGINE = InnoDB) */; +/*!40101 SET character_set_client = @saved_cs_client */;