refactor: derive turtle opcodes from classic

This commit is contained in:
Kelsi 2026-03-15 02:55:05 -07:00
parent 0b6265bc55
commit 6ede9a2968
12 changed files with 428 additions and 394 deletions

View file

@ -2007,13 +2007,20 @@ bool TurtlePacketParsers::parseUpdateObject(network::Packet& packet, UpdateObjec
}
bool TurtlePacketParsers::parseMonsterMove(network::Packet& packet, MonsterMoveData& data) {
// Turtle realms can emit both vanilla-like and WotLK-like monster move bodies.
// Try the canonical Turtle/vanilla parser first, then fall back to WotLK layout.
// Turtle realms can emit vanilla-like, TBC-like, and WotLK-like monster move
// bodies. Try the lower-expansion layouts first before the WotLK parser that
// expects an extra unk byte after the packed GUID.
size_t start = packet.getReadPos();
if (MonsterMoveParser::parseVanilla(packet, data)) {
return true;
}
packet.setReadPos(start);
if (TbcPacketParsers::parseMonsterMove(packet, data)) {
LOG_DEBUG("[Turtle] SMSG_MONSTER_MOVE parsed via TBC fallback layout");
return true;
}
auto looksLikeWotlkMonsterMove = [&](network::Packet& probe) -> bool {
const size_t probeStart = probe.getReadPos();
uint64_t guid = UpdateObjectParser::readPackedGuid(probe);