From 9c61d7ecad62d6a00abd5d9e4c81ceb5c7b51e1d Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Feb 2026 15:16:26 -0800 Subject: [PATCH] Fix SMSG_TALENTS_INFO spam by checking talentType field Opcode 0x3F4 is SMSG_TALENTS_INFO, sent both for the player's own talents (type=0, on login/respec) and inspect results (type=1). The handler was missing the type byte read, treating all packets as inspect results and spamming "Inspecting target" messages. --- src/game/game_handler.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 519d3b57..d2cea8ca 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -5273,19 +5273,30 @@ void GameHandler::handleItemQueryResponse(network::Packet& packet) { } void GameHandler::handleInspectResults(network::Packet& packet) { - // SMSG_INSPECT_TALENT (WotLK 3.3.5a) format: - // PackedGUID, uint32 unspentTalents, uint8 talentGroupCount, uint8 activeTalentGroup + // SMSG_TALENTS_INFO (0x3F4) format: + // uint8 talentType: 0 = own talents (sent on login/respec), 1 = inspect result + // If type==1: PackedGUID of inspected player + // Then: uint32 unspentTalents, uint8 talentGroupCount, uint8 activeTalentGroup // Per talent group: uint8 talentCount, [talentId(u32) + rank(u8)]..., uint8 glyphCount, [glyphId(u16)]... - // Then enchantment bitmask + enchant IDs - if (packet.getSize() - packet.getReadPos() < 4) return; + if (packet.getSize() - packet.getReadPos() < 1) return; + + uint8_t talentType = packet.readUInt8(); + + if (talentType == 0) { + // Own talent info — silently consume (sent on login, talent changes, respecs) + LOG_DEBUG("SMSG_TALENTS_INFO: received own talent data, ignoring"); + return; + } + + // talentType == 1: inspect result + if (packet.getSize() - packet.getReadPos() < 2) return; uint64_t guid = UpdateObjectParser::readPackedGuid(packet); if (guid == 0) return; size_t bytesLeft = packet.getSize() - packet.getReadPos(); if (bytesLeft < 6) { - LOG_WARNING("SMSG_INSPECT_TALENT: too short after guid, ", bytesLeft, " bytes"); - // Show basic inspect message even without talent data + LOG_WARNING("SMSG_TALENTS_INFO: too short after guid, ", bytesLeft, " bytes"); auto entity = entityManager.getEntity(guid); std::string name = "Target"; if (entity) {