mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-26 21:13:51 +00:00
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:
parent
4309c8c69b
commit
0d9aac2656
3 changed files with 187 additions and 186 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue