game: fix Classic 1.12 SMSG_AUCTION_LIST_RESULT enchant slot count

Classic 1.12 auction entries contain only 1 enchant slot (3 uint32s),
while TBC and WotLK expanded this to 3 enchant slots (9 uint32s). Parsing
Classic auction results with the WotLK parser consumed 24 extra bytes per
entry (two extra enchant slots), corrupting randomPropertyId, stackCount,
ownerGuid, pricing and expiry data for every auction item.

- AuctionListResultParser::parse() gains a numEnchantSlots parameter (default 3)
- Classic path reads 1 enchant slot; TBC/WotLK read 3
- handleAuctionListResult/OwnerList/BidderList pass isClassicLikeExpansion()?1:3
This commit is contained in:
Kelsi 2026-03-10 01:25:27 -07:00
parent 8dd4bc80ec
commit 528b796dff
3 changed files with 40 additions and 26 deletions

View file

@ -17576,8 +17576,10 @@ void GameHandler::handleAuctionHello(network::Packet& packet) {
}
void GameHandler::handleAuctionListResult(network::Packet& packet) {
// Classic 1.12 has 1 enchant slot per auction entry; TBC/WotLK have 3.
const int enchSlots = isClassicLikeExpansion() ? 1 : 3;
AuctionListResult result;
if (!AuctionListResultParser::parse(packet, result)) {
if (!AuctionListResultParser::parse(packet, result, enchSlots)) {
LOG_WARNING("Failed to parse SMSG_AUCTION_LIST_RESULT");
return;
}
@ -17594,8 +17596,9 @@ void GameHandler::handleAuctionListResult(network::Packet& packet) {
}
void GameHandler::handleAuctionOwnerListResult(network::Packet& packet) {
const int enchSlots = isClassicLikeExpansion() ? 1 : 3;
AuctionListResult result;
if (!AuctionListResultParser::parse(packet, result)) {
if (!AuctionListResultParser::parse(packet, result, enchSlots)) {
LOG_WARNING("Failed to parse SMSG_AUCTION_OWNER_LIST_RESULT");
return;
}
@ -17607,8 +17610,9 @@ void GameHandler::handleAuctionOwnerListResult(network::Packet& packet) {
}
void GameHandler::handleAuctionBidderListResult(network::Packet& packet) {
const int enchSlots = isClassicLikeExpansion() ? 1 : 3;
AuctionListResult result;
if (!AuctionListResultParser::parse(packet, result)) {
if (!AuctionListResultParser::parse(packet, result, enchSlots)) {
LOG_WARNING("Failed to parse SMSG_AUCTION_BIDDER_LIST_RESULT");
return;
}