refactor: add Packet::skipAll() to replace 186 setReadPos(getSize()) calls

Add skipAll() convenience method and replace 186 instances of the
verbose 'discard remaining packet data' idiom across game_handler
and world_packets.
This commit is contained in:
Kelsi 2026-03-25 14:27:26 -07:00
parent 4309c8c69b
commit 0d9aac2656
3 changed files with 187 additions and 186 deletions

View file

@ -651,7 +651,7 @@ bool AccountDataTimesParser::parse(network::Packet& packet, AccountDataTimesData
}
if (packet.getReadPos() != packet.getSize()) {
LOG_DEBUG(" AccountDataTimes trailing bytes: ", packet.getRemainingSize());
packet.setReadPos(packet.getSize());
packet.skipAll();
}
return true;
@ -3912,7 +3912,7 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
// we just need the hit list for UI feedback (combat text, health bars).
if (truncatedTargets) {
LOG_DEBUG("Spell go: salvaging ", static_cast<int>(data.hitCount), " hits despite miss truncation");
packet.setReadPos(packet.getSize()); // consume remaining bytes
packet.skipAll(); // consume remaining bytes
return true;
}