diff --git a/sql/updates/hotfixes/master/2026_08_22_02_hotfixes.sql b/sql/updates/hotfixes/master/2026_08_22_02_hotfixes.sql new file mode 100644 index 00000000..82280d1d --- /dev/null +++ b/sql/updates/hotfixes/master/2026_08_22_02_hotfixes.sql @@ -0,0 +1,70 @@ +DROP TABLE IF EXISTS `exterior_component`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `exterior_component` ( + `Name` text, + `Position1` float NOT NULL DEFAULT '0', + `Position2` float NOT NULL DEFAULT '0', + `Position3` float NOT NULL DEFAULT '0', + `ID` int unsigned NOT NULL DEFAULT '0', + `Size` tinyint unsigned NOT NULL DEFAULT '0', + `HouseExteriorWmoDataID` int NOT NULL DEFAULT '0', + `ParentComponentID` int NOT NULL DEFAULT '0', + `ModelFileDataID` int NOT NULL DEFAULT '0', + `Flags` int NOT NULL DEFAULT '0', + `Field_12_0_0_63534_007` tinyint unsigned NOT NULL DEFAULT '0', + `Type` tinyint unsigned NOT NULL DEFAULT '0', + `Field_12_0_0_63534_009` int NOT NULL DEFAULT '0', + `GameObjectID` int NOT NULL DEFAULT '0', + `Field_11_2_7_64044_011` int NOT NULL DEFAULT '0', + `ItemID` int NOT NULL DEFAULT '0', + `VerifiedBuild` int 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 */; + +-- +-- Dumping data for table `exterior_component` +-- + +LOCK TABLES `exterior_component` WRITE; +/*!40000 ALTER TABLE `exterior_component` DISABLE KEYS */; +/*!40000 ALTER TABLE `exterior_component` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `exterior_component_locale` +-- + +DROP TABLE IF EXISTS `exterior_component_locale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `exterior_component_locale` ( + `ID` int unsigned NOT NULL DEFAULT '0', + `locale` varchar(4) NOT NULL, + `Name_lang` text, + `VerifiedBuild` int 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 */; + +-- +-- Dumping data for table `exterior_component_locale` +-- + +LOCK TABLES `exterior_component_locale` WRITE; +/*!40000 ALTER TABLE `exterior_component_locale` DISABLE KEYS */; +/*!40000 ALTER TABLE `exterior_component_locale` ENABLE KEYS */; +UNLOCK TABLES; + diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index a07cb051..90bc38db 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -684,18 +684,13 @@ void HotfixDatabaseConnection::DoPrepareStatements() " WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_EXPECTED_STAT_MOD, "SELECT MAX(ID) + 1 FROM expected_stat_mod", CONNECTION_SYNCH); - // ExteriorComponent.db2 ? 12.0.5 layout (LayoutHash 0x53EA0925, 14 fields). - // Column order matches DB2LoadInfo::ExteriorComponentLoadInfo. The previous - // SELECT used the older WoW-build column set (FileDataID/ConditionID/HookID/ - // Slot/SortOrder/ComponentGroupID/UiTextureKitID/ExteriorComponentTypeID), - // which mysql_stmt_prepare() rejected once the SQL schema was refreshed in - // 2026_04_29_00_hotfixes.sql ("Unknown column 'FileDataID' in 'field list'"). - PrepareStatement(HOTFIX_SEL_EXTERIOR_COMPONENT, "SELECT Name, PositionX, PositionY, PositionZ, ID, Size, " - "ParentComponentID, ModelFileDataID, Flags, Field_7, Type, Field_9, GameObjectID, Field_11, ItemID, " - "HouseExteriorWmoDataID FROM exterior_component" - " WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + // ExteriorComponent.db2 + PrepareStatement(HOTFIX_SEL_EXTERIOR_COMPONENT, "SELECT Name, Position1, Position2, Position3, ID, Size, HouseExteriorWmoDataID, " + "ParentComponentID, ModelFileDataID, Flags, Field_12_0_0_63534_007, Type, Field_12_0_0_63534_009, GameObjectID, Field_11_2_7_64044_011, " + "ItemID FROM exterior_component WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_EXTERIOR_COMPONENT, "SELECT MAX(ID) + 1 FROM exterior_component", CONNECTION_SYNCH); - PREPARE_LOCALE_STMT(HOTFIX_SEL_EXTERIOR_COMPONENT, "SELECT ID, Name_lang FROM exterior_component_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?", CONNECTION_SYNCH); + PREPARE_LOCALE_STMT(HOTFIX_SEL_EXTERIOR_COMPONENT, "SELECT ID, Name_lang FROM exterior_component_locale WHERE (`VerifiedBuild` > 0) = ?" + " AND locale = ?", CONNECTION_SYNCH); // ExteriorComponentExitPoint.db2 PrepareStatement(HOTFIX_SEL_EXTERIOR_COMPONENT_EXIT_POINT, "SELECT PositionX, PositionY, PositionZ, RotationX, RotationY, RotationZ, ID, " diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h index 60a0781a..8bf85ad0 100644 --- a/src/server/game/DataStores/DB2LoadInfo.h +++ b/src/server/game/DataStores/DB2LoadInfo.h @@ -2042,27 +2042,24 @@ struct ExpectedStatModLoadInfo struct ExteriorComponentLoadInfo { - // Field order must match metadata (IndexField=2, ID is 3rd meta field). - // 12.0.5 added Field_12 (signed INT) ? Meta grew from 13 to 14 entries, - // FileFieldCount 12?13, ParentIndexField 12?13, LayoutHash 0x027A2F44?0x53EA0925. static constexpr DB2FieldMeta Fields[16] = { - { .IsSigned = false, .Type = FT_STRING, .Name = "Name" }, - { .IsSigned = false, .Type = FT_FLOAT, .Name = "PositionX" }, - { .IsSigned = false, .Type = FT_FLOAT, .Name = "PositionY" }, - { .IsSigned = false, .Type = FT_FLOAT, .Name = "PositionZ" }, - { .IsSigned = false, .Type = FT_INT, .Name = "ID" }, - { .IsSigned = false, .Type = FT_BYTE, .Name = "Size" }, - { .IsSigned = true, .Type = FT_INT, .Name = "ParentComponentID" }, - { .IsSigned = true, .Type = FT_INT, .Name = "ModelFileDataID" }, - { .IsSigned = true, .Type = FT_INT, .Name = "Flags" }, - { .IsSigned = false, .Type = FT_BYTE, .Name = "Field_7" }, - { .IsSigned = false, .Type = FT_BYTE, .Name = "Type" }, - { .IsSigned = true, .Type = FT_INT, .Name = "Field_9" }, - { .IsSigned = true, .Type = FT_INT, .Name = "GameObjectID" }, - { .IsSigned = true, .Type = FT_INT, .Name = "Field_11" }, - { .IsSigned = true, .Type = FT_INT, .Name = "ItemID" }, // NEW in 12.0.5 ? per WoWDBDefs: references Item.ID - { .IsSigned = false, .Type = FT_INT, .Name = "HouseExteriorWmoDataID" }, // ParentIndexField - must be unsigned + {.IsSigned = false, .Type = FT_STRING, .Name = "Name" }, + {.IsSigned = false, .Type = FT_FLOAT, .Name = "Position1" }, + {.IsSigned = false, .Type = FT_FLOAT, .Name = "Position2" }, + {.IsSigned = false, .Type = FT_FLOAT, .Name = "Position3" }, + {.IsSigned = false, .Type = FT_INT, .Name = "ID" }, + {.IsSigned = false, .Type = FT_BYTE, .Name = "Size" }, + {.IsSigned = false, .Type = FT_INT, .Name = "HouseExteriorWmoDataID" }, + {.IsSigned = true, .Type = FT_INT, .Name = "ParentComponentID" }, + {.IsSigned = true, .Type = FT_INT, .Name = "ModelFileDataID" }, + {.IsSigned = true, .Type = FT_INT, .Name = "Flags" }, + {.IsSigned = false, .Type = FT_BYTE, .Name = "Field_12_0_0_63534_007" }, + {.IsSigned = false, .Type = FT_BYTE, .Name = "Type" }, + {.IsSigned = true, .Type = FT_INT, .Name = "Field_12_0_0_63534_009" }, + {.IsSigned = true, .Type = FT_INT, .Name = "GameObjectID" }, + {.IsSigned = true, .Type = FT_INT, .Name = "Field_11_2_7_64044_011" }, + {.IsSigned = true, .Type = FT_INT, .Name = "ItemID" }, }; static constexpr DB2LoadInfo Instance{ Fields, 16, &ExteriorComponentMeta::Instance, HOTFIX_SEL_EXTERIOR_COMPONENT }; diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 2833ac16..fcd1a538 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -964,7 +964,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul LOAD_DB2(sEmotesTextSoundStore); LOAD_DB2(sExpectedStatStore); LOAD_DB2(sExpectedStatModStore); - //LOAD_DB2(sExteriorComponentStore); todo + LOAD_DB2(sExteriorComponentStore); LOAD_DB2(sExteriorComponentExitPointStore); LOAD_DB2(sExteriorComponentGroupStore); LOAD_DB2(sExteriorComponentGroupXHookStore); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 584563ec..d8fd5fe3 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -1747,17 +1747,17 @@ struct ExteriorComponentEntry LocalizedString Name; std::array Position; uint32 ID; - uint8 Size; // Meta[3] BYTE: WoWDBDefs "Size" - int32 ParentComponentID; // Meta[4] INT: references another ExteriorComponent (0 for defaults) - int32 ModelFileDataID; // Meta[5] INT: model FileDataID - int32 Flags; // Meta[6] INT: 0x1=IsDefaultFixture, 0x2=UnlockedByDefault - uint8 Field_7; // Meta[7] BYTE: unknown (always 1) - uint8 Type; // Meta[8] BYTE: references ExteriorComponentType - int32 Field_9; // Meta[9] INT: unknown - int32 GameObjectID; // Meta[10] INT: references GameObjects - int32 Field_11; // Meta[11] INT: unknown (WoWDBDefs name: Field_11_2_7_64044_011) - int32 ItemID; // Meta[12] INT: NEW in 12.0.5 ? references Item.ID (allows the exterior component to be sold/earned as an item, like HouseDecor.ItemID) - uint32 HouseExteriorWmoDataID; // ParentIndexField - must be unsigned + uint8 Size; + int32 HouseExteriorWmoDataID; + int32 ParentComponentID; + int32 ModelFileDataID; + int32 Flags; + uint8 Field_12_0_0_63534_007; + uint8 Type; + int32 Field_12_0_0_63534_009; + int32 GameObjectID; + int32 Field_11_2_7_64044_011; + int32 ItemID; // ParentIndexField - must be unsigned }; struct ExteriorComponentExitPointEntry