diff options
-rw-r--r-- | sql/updates/hotfixes/master/2021_04_29_00_hotfixes.sql | 54 | ||||
-rw-r--r-- | src/server/database/Database/Implementation/HotfixDatabase.cpp | 9 | ||||
-rw-r--r-- | src/server/database/Database/Implementation/HotfixDatabase.h | 7 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2LoadInfo.h | 29 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 4 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.h | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 13 |
7 files changed, 118 insertions, 0 deletions
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 00000000000..b5f8b6b8656 --- /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 */; diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index d88740249e3..f21bd71baa4 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -910,6 +910,15 @@ void HotfixDatabaseConnection::DoPrepareStatements() " WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_KEYCHAIN, "SELECT MAX(ID) + 1 FROM keychain", CONNECTION_SYNCH); + // LanguageWords.db2 + PrepareStatement(HOTFIX_SEL_LANGUAGE_WORDS, "SELECT ID, Word, LanguageID FROM language_words WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PREPARE_MAX_ID_STMT(HOTFIX_SEL_LANGUAGE_WORDS, "SELECT MAX(ID) + 1 FROM language_words", CONNECTION_SYNCH); + + // Languages.db2 + PrepareStatement(HOTFIX_SEL_LANGUAGES, "SELECT Name, ID FROM languages WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PREPARE_MAX_ID_STMT(HOTFIX_SEL_LANGUAGES, "SELECT MAX(ID) + 1 FROM languages", CONNECTION_SYNCH); + PREPARE_LOCALE_STMT(HOTFIX_SEL_LANGUAGES, "SELECT ID, Name_lang FROM languages_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?", CONNECTION_SYNCH); + // LfgDungeons.db2 PrepareStatement(HOTFIX_SEL_LFG_DUNGEONS, "SELECT ID, Name, Description, TypeID, Subtype, Faction, IconTextureFileID, RewardsBgTextureFileID, " "PopupBgTextureFileID, ExpansionLevel, MapID, DifficultyID, MinGear, GroupID, OrderIndex, RequiredPlayerConditionId, RandomID, ScenarioID, " diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h index c3071db7754..443ad2ae744 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.h +++ b/src/server/database/Database/Implementation/HotfixDatabase.h @@ -528,6 +528,13 @@ enum HotfixDatabaseStatements : uint32 HOTFIX_SEL_KEYCHAIN, HOTFIX_SEL_KEYCHAIN_MAX_ID, + HOTFIX_SEL_LANGUAGE_WORDS, + HOTFIX_SEL_LANGUAGE_WORDS_MAX_ID, + + HOTFIX_SEL_LANGUAGES, + HOTFIX_SEL_LANGUAGES_MAX_ID, + HOTFIX_SEL_LANGUAGES_LOCALE, + HOTFIX_SEL_LFG_DUNGEONS, HOTFIX_SEL_LFG_DUNGEONS_MAX_ID, HOTFIX_SEL_LFG_DUNGEONS_LOCALE, diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h index 8db5938725f..ee9ccc26255 100644 --- a/src/server/game/DataStores/DB2LoadInfo.h +++ b/src/server/game/DataStores/DB2LoadInfo.h @@ -3398,6 +3398,35 @@ struct KeychainLoadInfo } }; +struct LanguageWordsLoadInfo +{ + static DB2LoadInfo const* Instance() + { + static DB2FieldMeta const fields[] = + { + { false, FT_INT, "ID" }, + { false, FT_STRING_NOT_LOCALIZED, "Word" }, + { false, FT_INT, "LanguageID" }, + }; + static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, LanguageWordsMeta::Instance(), HOTFIX_SEL_LANGUAGE_WORDS); + return &loadInfo; + } +}; + +struct LanguagesLoadInfo +{ + static DB2LoadInfo const* Instance() + { + static DB2FieldMeta const fields[] = + { + { false, FT_STRING, "Name" }, + { false, FT_INT, "ID" }, + }; + static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, LanguagesMeta::Instance(), HOTFIX_SEL_LANGUAGES); + return &loadInfo; + } +}; + struct LfgDungeonsLoadInfo { static DB2LoadInfo const* Instance() diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 584070d1dac..81e848bb87d 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -193,6 +193,8 @@ DB2Storage<ItemSpecEntry> sItemSpecStore("ItemSpec.db2", I DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore("ItemSpecOverride.db2", ItemSpecOverrideLoadInfo::Instance()); DB2Storage<ItemXBonusTreeEntry> sItemXBonusTreeStore("ItemXBonusTree.db2", ItemXBonusTreeLoadInfo::Instance()); DB2Storage<KeychainEntry> sKeychainStore("Keychain.db2", KeychainLoadInfo::Instance()); +DB2Storage<LanguageWordsEntry> sLanguageWordsStore("LanguageWords.db2", LanguageWordsLoadInfo::Instance()); +DB2Storage<LanguagesEntry> sLanguagesStore("Languages.db2", LanguagesLoadInfo::Instance()); DB2Storage<LFGDungeonsEntry> sLFGDungeonsStore("LFGDungeons.db2", LfgDungeonsLoadInfo::Instance()); DB2Storage<LightEntry> sLightStore("Light.db2", LightLoadInfo::Instance()); DB2Storage<LiquidTypeEntry> sLiquidTypeStore("LiquidType.db2", LiquidTypeLoadInfo::Instance()); @@ -729,6 +731,8 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul LOAD_DB2(sItemSpecOverrideStore); LOAD_DB2(sItemXBonusTreeStore); LOAD_DB2(sKeychainStore); + LOAD_DB2(sLanguageWordsStore); + LOAD_DB2(sLanguagesStore); LOAD_DB2(sLFGDungeonsStore); LOAD_DB2(sLightStore); LOAD_DB2(sLiquidTypeStore); diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 9563257b501..47ff813c03d 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -147,6 +147,8 @@ TC_GAME_API extern DB2Storage<ItemSetSpellEntry> sItemSetSpel TC_GAME_API extern DB2Storage<ItemSparseEntry> sItemSparseStore; TC_GAME_API extern DB2Storage<ItemSpecEntry> sItemSpecStore; TC_GAME_API extern DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore; +TC_GAME_API extern DB2Storage<LanguageWordsEntry> sLanguageWordsStore; +TC_GAME_API extern DB2Storage<LanguagesEntry> sLanguagesStore; TC_GAME_API extern DB2Storage<LFGDungeonsEntry> sLFGDungeonsStore; TC_GAME_API extern DB2Storage<LiquidTypeEntry> sLiquidTypeStore; TC_GAME_API extern DB2Storage<LockEntry> sLockStore; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index ea90e59d02c..5322e12cb2b 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -2110,6 +2110,19 @@ struct KeychainEntry uint8 Key[KEYCHAIN_SIZE]; }; +struct LanguageWordsEntry +{ + uint32 ID; + char const* Word; + uint32 LanguageID; +}; + +struct LanguagesEntry +{ + LocalizedString Name; + uint32 ID; +}; + struct LFGDungeonsEntry { uint32 ID; |