Core/DataStores: Load PvpTier.db2

This commit is contained in:
Shauren
2021-06-06 19:06:08 +02:00
parent b607bb0a93
commit 8d5356cdea
7 changed files with 93 additions and 0 deletions

View File

@@ -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 */;

View File

@@ -1134,6 +1134,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
" FROM pvp_talent_slot_unlock WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH);
PREPARE_MAX_ID_STMT(HOTFIX_SEL_PVP_TALENT_SLOT_UNLOCK, "SELECT MAX(ID) + 1 FROM pvp_talent_slot_unlock", CONNECTION_SYNCH);
// PvpTier.db2
PrepareStatement(HOTFIX_SEL_PVP_TIER, "SELECT Name, ID, MinRating, MaxRating, PrevTier, NextTier, BracketID, `Rank`, RankIconFileDataID"
" FROM pvp_tier WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH);
PREPARE_MAX_ID_STMT(HOTFIX_SEL_PVP_TIER, "SELECT MAX(ID) + 1 FROM pvp_tier", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_PVP_TIER, "SELECT ID, Name_lang FROM pvp_tier_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?", CONNECTION_SYNCH);
// QuestFactionReward.db2
PrepareStatement(HOTFIX_SEL_QUEST_FACTION_REWARD, "SELECT ID, Difficulty1, Difficulty2, Difficulty3, Difficulty4, Difficulty5, Difficulty6, "
"Difficulty7, Difficulty8, Difficulty9, Difficulty10 FROM quest_faction_reward WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH);

View File

@@ -655,6 +655,10 @@ enum HotfixDatabaseStatements : uint32
HOTFIX_SEL_PVP_TALENT_SLOT_UNLOCK,
HOTFIX_SEL_PVP_TALENT_SLOT_UNLOCK_MAX_ID,
HOTFIX_SEL_PVP_TIER,
HOTFIX_SEL_PVP_TIER_MAX_ID,
HOTFIX_SEL_PVP_TIER_LOCALE,
HOTFIX_SEL_QUEST_FACTION_REWARD,
HOTFIX_SEL_QUEST_FACTION_REWARD_MAX_ID,

View File

@@ -4338,6 +4338,27 @@ struct PvpTalentSlotUnlockLoadInfo
}
};
struct PvpTierLoadInfo
{
static DB2LoadInfo const* Instance()
{
static DB2FieldMeta const fields[] =
{
{ false, FT_STRING, "Name" },
{ false, FT_INT, "ID" },
{ true, FT_SHORT, "MinRating" },
{ true, FT_SHORT, "MaxRating" },
{ true, FT_INT, "PrevTier" },
{ true, FT_INT, "NextTier" },
{ true, FT_BYTE, "BracketID" },
{ true, FT_BYTE, "Rank" },
{ true, FT_INT, "RankIconFileDataID" },
};
static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, PvpTierMeta::Instance(), HOTFIX_SEL_PVP_TIER);
return &loadInfo;
}
};
struct QuestFactionRewardLoadInfo
{
static DB2LoadInfo const* Instance()

View File

@@ -231,6 +231,7 @@ DB2Storage<PVPItemEntry> sPVPItemStore("PVPItem.db2", Pvp
DB2Storage<PvpTalentEntry> sPvpTalentStore("PvpTalent.db2", PvpTalentLoadInfo::Instance());
DB2Storage<PvpTalentCategoryEntry> sPvpTalentCategoryStore("PvpTalentCategory.db2", PvpTalentCategoryLoadInfo::Instance());
DB2Storage<PvpTalentSlotUnlockEntry> sPvpTalentSlotUnlockStore("PvpTalentSlotUnlock.db2", PvpTalentSlotUnlockLoadInfo::Instance());
DB2Storage<PvpTierEntry> sPvpTierStore("PvpTier.db2", PvpTierLoadInfo::Instance());
DB2Storage<QuestFactionRewardEntry> sQuestFactionRewardStore("QuestFactionReward.db2", QuestFactionRewardLoadInfo::Instance());
DB2Storage<QuestInfoEntry> sQuestInfoStore("QuestInfo.db2", QuestInfoLoadInfo::Instance());
DB2Storage<QuestMoneyRewardEntry> sQuestMoneyRewardStore("QuestMoneyReward.db2", QuestMoneyRewardLoadInfo::Instance());
@@ -777,6 +778,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
LOAD_DB2(sPvpTalentStore);
LOAD_DB2(sPvpTalentCategoryStore);
LOAD_DB2(sPvpTalentSlotUnlockStore);
LOAD_DB2(sPvpTierStore);
LOAD_DB2(sQuestFactionRewardStore);
LOAD_DB2(sQuestInfoStore);
LOAD_DB2(sQuestMoneyRewardStore);

View File

@@ -170,6 +170,7 @@ TC_GAME_API extern DB2Storage<PowerDisplayEntry> sPowerDispla
TC_GAME_API extern DB2Storage<PvpTalentEntry> sPvpTalentStore;
TC_GAME_API extern DB2Storage<PvpTalentCategoryEntry> sPvpTalentCategoryStore;
TC_GAME_API extern DB2Storage<PvpTalentSlotUnlockEntry> sPvpTalentSlotUnlockStore;
TC_GAME_API extern DB2Storage<PvpTierEntry> sPvpTierStore;
TC_GAME_API extern DB2Storage<QuestFactionRewardEntry> sQuestFactionRewardStore;
TC_GAME_API extern DB2Storage<QuestInfoEntry> sQuestInfoStore;
TC_GAME_API extern DB2Storage<QuestMoneyRewardEntry> sQuestMoneyRewardStore;

View File

@@ -2655,6 +2655,19 @@ struct PvpTalentSlotUnlockEntry
int32 DemonHunterLevelRequired;
};
struct PvpTierEntry
{
LocalizedString Name;
uint32 ID;
int16 MinRating;
int16 MaxRating;
int32 PrevTier;
int32 NextTier;
int8 BracketID;
int8 Rank;
int32 RankIconFileDataID;
};
struct QuestFactionRewardEntry
{
uint32 ID;