mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: show random suffix names in auction owner sold/expired notifications
Parse randomPropertyId from SMSG_AUCTION_OWNER_NOTIFICATION to display full item names in sold/bid/expired messages like "Your auction of Gloves of the Monkey has sold!" Completes suffix resolution across all 9 item display contexts.
This commit is contained in:
parent
9f49f543f6
commit
3dcd489e81
1 changed files with 8 additions and 1 deletions
|
|
@ -6205,16 +6205,23 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
handleAuctionCommandResult(packet);
|
handleAuctionCommandResult(packet);
|
||||||
break;
|
break;
|
||||||
case Opcode::SMSG_AUCTION_OWNER_NOTIFICATION: {
|
case Opcode::SMSG_AUCTION_OWNER_NOTIFICATION: {
|
||||||
// auctionId(u32) + action(u32) + error(u32) + itemEntry(u32) + ...
|
// auctionId(u32) + action(u32) + error(u32) + itemEntry(u32) + randomPropertyId(u32) + ...
|
||||||
// action: 0=sold/won, 1=expired, 2=bid placed on your auction
|
// action: 0=sold/won, 1=expired, 2=bid placed on your auction
|
||||||
if (packet.getSize() - packet.getReadPos() >= 16) {
|
if (packet.getSize() - packet.getReadPos() >= 16) {
|
||||||
/*uint32_t auctionId =*/ packet.readUInt32();
|
/*uint32_t auctionId =*/ packet.readUInt32();
|
||||||
uint32_t action = packet.readUInt32();
|
uint32_t action = packet.readUInt32();
|
||||||
/*uint32_t error =*/ packet.readUInt32();
|
/*uint32_t error =*/ packet.readUInt32();
|
||||||
uint32_t itemEntry = packet.readUInt32();
|
uint32_t itemEntry = packet.readUInt32();
|
||||||
|
int32_t ownerRandProp = 0;
|
||||||
|
if (packet.getSize() - packet.getReadPos() >= 4)
|
||||||
|
ownerRandProp = static_cast<int32_t>(packet.readUInt32());
|
||||||
ensureItemInfo(itemEntry);
|
ensureItemInfo(itemEntry);
|
||||||
auto* info = getItemInfo(itemEntry);
|
auto* info = getItemInfo(itemEntry);
|
||||||
std::string rawName = info && !info->name.empty() ? info->name : ("Item #" + std::to_string(itemEntry));
|
std::string rawName = info && !info->name.empty() ? info->name : ("Item #" + std::to_string(itemEntry));
|
||||||
|
if (ownerRandProp != 0) {
|
||||||
|
std::string suffix = getRandomPropertyName(ownerRandProp);
|
||||||
|
if (!suffix.empty()) rawName += " " + suffix;
|
||||||
|
}
|
||||||
uint32_t aucQuality = info ? info->quality : 1u;
|
uint32_t aucQuality = info ? info->quality : 1u;
|
||||||
std::string itemLink = buildItemLink(itemEntry, aucQuality, rawName);
|
std::string itemLink = buildItemLink(itemEntry, aucQuality, rawName);
|
||||||
if (action == 1)
|
if (action == 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue