From db0d46c9d1c9cc3f8c1d8e5072fea155fa4ff57f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 7 Jun 2021 10:57:57 -0400 Subject: [PATCH] Core/DataStores: Load PvpTier.db2 Port From (https://github.com/TrinityCore/TrinityCore/commit/8d5356cdeaeaae7dc20bfca71ca24b8134a8e80c) --- .../Database/Databases/HotfixDatabase.cs | 7 +++ Source/Game/DataStorage/CliDB.cs | 2 + Source/Game/DataStorage/Structs/P_Records.cs | 13 ++++++ .../master/2021_06_06_02_hotfixes.sql | 46 +++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 sql/updates/hotfixes/master/2021_06_06_02_hotfixes.sql diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index 4f58bf651..b9cf6258a 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -836,6 +836,10 @@ namespace Framework.Database PrepareStatement(HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK, "SELECT ID, Slot, LevelRequired, DeathKnightLevelRequired, DemonHunterLevelRequired" + " FROM pvp_talent_slot_unlock"); + // PvpTier.db2 + PrepareStatement(HotfixStatements.SEL_PVP_TIER, "SELECT Name, ID, MinRating, MaxRating, PrevTier, NextTier, BracketID, `Rank`, RankIconFileDataID FROM pvp_tier"); + PrepareStatement(HotfixStatements.SEL_PVP_TIER_LOCALE, "SELECT ID, Name_lang FROM pvp_tier_locale WHERE locale = ?"); + // QuestFactionReward.db2 PrepareStatement(HotfixStatements.SEL_QUEST_FACTION_REWARD, "SELECT ID, Difficulty1, Difficulty2, Difficulty3, Difficulty4, Difficulty5, Difficulty6, " + "Difficulty7, Difficulty8, Difficulty9, Difficulty10 FROM quest_faction_reward"); @@ -1624,6 +1628,9 @@ namespace Framework.Database SEL_PVP_TALENT_SLOT_UNLOCK, + SEL_PVP_TIER, + SEL_PVP_TIER_LOCALE, + SEL_QUEST_FACTION_REWARD, SEL_QUEST_INFO, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index 65ee7941a..1ab306311 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -240,6 +240,7 @@ namespace Game.DataStorage PvpTalentStorage = ReadDB2("PvpTalent.db2", HotfixStatements.SEL_PVP_TALENT, HotfixStatements.SEL_PVP_TALENT_LOCALE); PvpTalentCategoryStorage = ReadDB2("PvpTalentCategory.db2", HotfixStatements.SEL_PVP_TALENT_CATEGORY); PvpTalentSlotUnlockStorage = ReadDB2("PvpTalentSlotUnlock.db2", HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK); + PvpTierStorage = ReadDB2("PvpTier.db2", HotfixStatements.SEL_PVP_TIER, HotfixStatements.SEL_PVP_TIER_LOCALE); QuestFactionRewardStorage = ReadDB2("QuestFactionReward.db2", HotfixStatements.SEL_QUEST_FACTION_REWARD); QuestInfoStorage = ReadDB2("QuestInfo.db2", HotfixStatements.SEL_QUEST_INFO, HotfixStatements.SEL_QUEST_INFO_LOCALE); QuestLineXQuestStorage = ReadDB2("QuestLineXQuest.db2", HotfixStatements.SEL_QUEST_LINE_X_QUEST); @@ -610,6 +611,7 @@ namespace Game.DataStorage public static DB6Storage PvpTalentStorage; public static DB6Storage PvpTalentCategoryStorage; public static DB6Storage PvpTalentSlotUnlockStorage; + public static DB6Storage PvpTierStorage; public static DB6Storage QuestFactionRewardStorage; public static DB6Storage QuestInfoStorage; public static DB6Storage QuestLineXQuestStorage; diff --git a/Source/Game/DataStorage/Structs/P_Records.cs b/Source/Game/DataStorage/Structs/P_Records.cs index 409471eb4..18af4cc72 100644 --- a/Source/Game/DataStorage/Structs/P_Records.cs +++ b/Source/Game/DataStorage/Structs/P_Records.cs @@ -213,4 +213,17 @@ namespace Game.DataStorage public uint DeathKnightLevelRequired; public uint DemonHunterLevelRequired; } + + public sealed class PvpTierRecord + { + public LocalizedString Name; + public uint Id; + public short MinRating; + public short MaxRating; + public int PrevTier; + public int NextTier; + public sbyte BracketID; + public sbyte Rank; + public int RankIconFileDataID; + } } diff --git a/sql/updates/hotfixes/master/2021_06_06_02_hotfixes.sql b/sql/updates/hotfixes/master/2021_06_06_02_hotfixes.sql new file mode 100644 index 000000000..05e18ed4c --- /dev/null +++ b/sql/updates/hotfixes/master/2021_06_06_02_hotfixes.sql @@ -0,0 +1,46 @@ +-- +-- Table structure for table `pvp_tier` +-- +DROP TABLE IF EXISTS `pvp_tier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `pvp_tier` ( + `Name` text, + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `MinRating` smallint(6) NOT NULL DEFAULT '0', + `MaxRating` smallint(6) NOT NULL DEFAULT '0', + `PrevTier` int(11) NOT NULL DEFAULT '0', + `NextTier` int(11) NOT NULL DEFAULT '0', + `BracketID` tinyint(4) NOT NULL DEFAULT '0', + `Rank` tinyint(4) NOT NULL DEFAULT '0', + `RankIconFileDataID` int(11) 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 `pvp_tier_locale` +-- +DROP TABLE IF EXISTS `pvp_tier_locale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `pvp_tier_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 */;