aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/hotfixes/master/2021_06_03_00_hotfixes.sql41
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.cpp6
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.h4
-rw-r--r--src/server/game/DataStores/DB2LoadInfo.h16
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp2
-rw-r--r--src/server/game/DataStores/DB2Stores.h1
-rw-r--r--src/server/game/DataStores/DB2Structure.h8
7 files changed, 78 insertions, 0 deletions
diff --git a/sql/updates/hotfixes/master/2021_06_03_00_hotfixes.sql b/sql/updates/hotfixes/master/2021_06_03_00_hotfixes.sql
new file mode 100644
index 00000000000..22f4606c274
--- /dev/null
+++ b/sql/updates/hotfixes/master/2021_06_03_00_hotfixes.sql
@@ -0,0 +1,41 @@
+--
+-- Table structure for table `achievement_category`
+--
+DROP TABLE IF EXISTS `achievement_category`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!50503 SET character_set_client = utf8mb4 */;
+CREATE TABLE `achievement_category` (
+ `Name` text,
+ `ID` int(10) unsigned NOT NULL DEFAULT '0',
+ `Parent` smallint(6) NOT NULL DEFAULT '0',
+ `UiOrder` tinyint(4) 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 `achievement_category_locale`
+--
+DROP TABLE IF EXISTS `achievement_category_locale`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!50503 SET character_set_client = utf8mb4 */;
+CREATE TABLE `achievement_category_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 f21bd71baa4..1eba397e46e 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.cpp
+++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp
@@ -43,6 +43,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PREPARE_LOCALE_STMT(HOTFIX_SEL_ACHIEVEMENT, "SELECT ID, Description_lang, Title_lang, Reward_lang FROM achievement_locale"
" WHERE (`VerifiedBuild` > 0) = ? AND locale = ?", CONNECTION_SYNCH);
+ // AchievementCategory.db2
+ PrepareStatement(HOTFIX_SEL_ACHIEVEMENT_CATEGORY, "SELECT Name, ID, Parent, UiOrder FROM achievement_category WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH);
+ PREPARE_MAX_ID_STMT(HOTFIX_SEL_ACHIEVEMENT_CATEGORY, "SELECT MAX(ID) + 1 FROM achievement_category", CONNECTION_SYNCH);
+ PREPARE_LOCALE_STMT(HOTFIX_SEL_ACHIEVEMENT_CATEGORY, "SELECT ID, Name_lang FROM achievement_category_locale WHERE (`VerifiedBuild` > 0) = ?"
+ " AND locale = ?", CONNECTION_SYNCH);
+
// AdventureJournal.db2
PrepareStatement(HOTFIX_SEL_ADVENTURE_JOURNAL, "SELECT ID, Name, Description, ButtonText, RewardDescription, ContinueDescription, Type, "
"PlayerConditionID, Flags, ButtonActionType, TextureFileDataID, LfgDungeonID, QuestID, BattleMasterListID, PriorityMin, PriorityMax, ItemID, "
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h
index 443ad2ae744..4acb89a35bf 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.h
+++ b/src/server/database/Database/Implementation/HotfixDatabase.h
@@ -35,6 +35,10 @@ enum HotfixDatabaseStatements : uint32
HOTFIX_SEL_ACHIEVEMENT_MAX_ID,
HOTFIX_SEL_ACHIEVEMENT_LOCALE,
+ HOTFIX_SEL_ACHIEVEMENT_CATEGORY,
+ HOTFIX_SEL_ACHIEVEMENT_CATEGORY_MAX_ID,
+ HOTFIX_SEL_ACHIEVEMENT_CATEGORY_LOCALE,
+
HOTFIX_SEL_ADVENTURE_JOURNAL,
HOTFIX_SEL_ADVENTURE_JOURNAL_MAX_ID,
HOTFIX_SEL_ADVENTURE_JOURNAL_LOCALE,
diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h
index ee9ccc26255..9f55b36f2fe 100644
--- a/src/server/game/DataStores/DB2LoadInfo.h
+++ b/src/server/game/DataStores/DB2LoadInfo.h
@@ -53,6 +53,22 @@ struct AchievementLoadInfo
}
};
+struct AchievementCategoryLoadInfo
+{
+ static DB2LoadInfo const* Instance()
+ {
+ static DB2FieldMeta const fields[] =
+ {
+ { false, FT_STRING, "Name" },
+ { false, FT_INT, "ID" },
+ { true, FT_SHORT, "Parent" },
+ { true, FT_BYTE, "UiOrder" },
+ };
+ static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, Achievement_CategoryMeta::Instance(), HOTFIX_SEL_ACHIEVEMENT_CATEGORY);
+ return &loadInfo;
+ }
+};
+
struct AdventureJournalLoadInfo
{
static DB2LoadInfo const* Instance()
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index 81e848bb87d..865afd679d4 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -42,6 +42,7 @@
#endif
DB2Storage<AchievementEntry> sAchievementStore("Achievement.db2", AchievementLoadInfo::Instance());
+DB2Storage<Achievement_CategoryEntry> sAchievementCategoryStore("Achievement_Category.db2", AchievementCategoryLoadInfo::Instance());
DB2Storage<AdventureJournalEntry> sAdventureJournalStore("AdventureJournal.db2", AdventureJournalLoadInfo::Instance());
DB2Storage<AdventureMapPOIEntry> sAdventureMapPOIStore("AdventureMapPOI.db2", AdventureMapPoiLoadInfo::Instance());
DB2Storage<AnimationDataEntry> sAnimationDataStore("AnimationData.db2", AnimationDataLoadInfo::Instance());
@@ -581,6 +582,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
#define LOAD_DB2(store) LoadDB2(availableDb2Locales, loadErrors, _stores, &store, db2Path, defaultLocale, GetCppRecordSize(store))
LOAD_DB2(sAchievementStore);
+ LOAD_DB2(sAchievementCategoryStore);
LOAD_DB2(sAdventureJournalStore);
LOAD_DB2(sAdventureMapPOIStore);
LOAD_DB2(sAnimationDataStore);
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 47ff813c03d..c39479ee847 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -36,6 +36,7 @@
class DB2HotfixGeneratorBase;
TC_GAME_API extern DB2Storage<AchievementEntry> sAchievementStore;
+TC_GAME_API extern DB2Storage<Achievement_CategoryEntry> sAchievementCategoryStore;
TC_GAME_API extern DB2Storage<AdventureJournalEntry> sAdventureJournalStore;
TC_GAME_API extern DB2Storage<AdventureMapPOIEntry> sAdventureMapPOIStore;
TC_GAME_API extern DB2Storage<AnimationDataEntry> sAnimationDataStore;
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index 47017fc2ed2..dcc563884b2 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -46,6 +46,14 @@ struct AchievementEntry
int32 CovenantID;
};
+struct Achievement_CategoryEntry
+{
+ LocalizedString Name;
+ uint32 ID;
+ int16 Parent;
+ int8 UiOrder;
+};
+
struct AdventureJournalEntry
{
uint32 ID;