mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
fix: correct WotLK packed guid format in SMSG_PROCRESIST and SMSG_TOTEM_CREATED
Both opcodes use packed GUIDs in WotLK 3.3.5a but were reading full uint64, causing incorrect GUID parsing and potentially matching wrong player entities. SMSG_PROCRESIST: caster + victim guids (packed in WotLK, uint64 in TBC/Classic) SMSG_TOTEM_CREATED: totem guid (packed in WotLK, uint64 in TBC/Classic)
This commit is contained in:
parent
9cd7e7978d
commit
0a17683545
1 changed files with 30 additions and 16 deletions
|
|
@ -1935,14 +1935,23 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
|
|
||||||
// ---- Spell proc resist log ----
|
// ---- Spell proc resist log ----
|
||||||
case Opcode::SMSG_PROCRESIST: {
|
case Opcode::SMSG_PROCRESIST: {
|
||||||
// casterGuid(8) + victimGuid(8) + uint32 spellId + uint8 logSchoolMask
|
// WotLK: packed_guid caster + packed_guid victim + uint32 spellId + ...
|
||||||
if (packet.getSize() - packet.getReadPos() >= 17) {
|
// TBC/Classic: uint64 caster + uint64 victim + uint32 spellId + ...
|
||||||
/*uint64_t caster =*/ packet.readUInt64();
|
const bool prTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc");
|
||||||
uint64_t victim = packet.readUInt64();
|
auto readPrGuid = [&]() -> uint64_t {
|
||||||
uint32_t spellId = packet.readUInt32();
|
if (prTbcLike)
|
||||||
if (victim == playerGuid)
|
return (packet.getSize() - packet.getReadPos() >= 8) ? packet.readUInt64() : 0;
|
||||||
addCombatText(CombatTextEntry::MISS, 0, spellId, false);
|
return UpdateObjectParser::readPackedGuid(packet);
|
||||||
}
|
};
|
||||||
|
if (packet.getSize() - packet.getReadPos() < (prTbcLike ? 8u : 1u)) break;
|
||||||
|
/*uint64_t caster =*/ readPrGuid();
|
||||||
|
if (packet.getSize() - packet.getReadPos() < (prTbcLike ? 8u : 1u)) break;
|
||||||
|
uint64_t victim = readPrGuid();
|
||||||
|
if (packet.getSize() - packet.getReadPos() < 4) break;
|
||||||
|
uint32_t spellId = packet.readUInt32();
|
||||||
|
if (victim == playerGuid)
|
||||||
|
addCombatText(CombatTextEntry::MISS, 0, spellId, false);
|
||||||
|
packet.setReadPos(packet.getSize());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2896,15 +2905,20 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Opcode::SMSG_TOTEM_CREATED: {
|
case Opcode::SMSG_TOTEM_CREATED: {
|
||||||
// uint8 slot + uint64 guid + uint32 duration + uint32 spellId
|
// WotLK: uint8 slot + packed_guid + uint32 duration + uint32 spellId
|
||||||
if (packet.getSize() - packet.getReadPos() >= 17) {
|
// TBC/Classic: uint8 slot + uint64 guid + uint32 duration + uint32 spellId
|
||||||
uint8_t slot = packet.readUInt8();
|
const bool totemTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc");
|
||||||
|
if (packet.getSize() - packet.getReadPos() < (totemTbcLike ? 17u : 9u)) break;
|
||||||
|
uint8_t slot = packet.readUInt8();
|
||||||
|
if (totemTbcLike)
|
||||||
/*uint64_t guid =*/ packet.readUInt64();
|
/*uint64_t guid =*/ packet.readUInt64();
|
||||||
uint32_t duration = packet.readUInt32();
|
else
|
||||||
uint32_t spellId = packet.readUInt32();
|
/*uint64_t guid =*/ UpdateObjectParser::readPackedGuid(packet);
|
||||||
LOG_DEBUG("SMSG_TOTEM_CREATED: slot=", (int)slot,
|
if (packet.getSize() - packet.getReadPos() < 8) break;
|
||||||
" spellId=", spellId, " duration=", duration, "ms");
|
uint32_t duration = packet.readUInt32();
|
||||||
}
|
uint32_t spellId = packet.readUInt32();
|
||||||
|
LOG_DEBUG("SMSG_TOTEM_CREATED: slot=", (int)slot,
|
||||||
|
" spellId=", spellId, " duration=", duration, "ms");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Opcode::SMSG_AREA_SPIRIT_HEALER_TIME: {
|
case Opcode::SMSG_AREA_SPIRIT_HEALER_TIME: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue