mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
fix: suppress false-positive maskBlockCount warnings for VALUES updates
VALUES update blocks don't carry an objectType field (it defaults to 0), so the sanity check incorrectly used the non-PLAYER threshold (10) for player character updates that legitimately need 42-46 mask blocks. Allow up to 55 blocks for VALUES updates (could be any entity type including PLAYER). Only enforce strict limits on CREATE_OBJECT blocks where the objectType is known.
This commit is contained in:
parent
2e136e9fdc
commit
d083ac11fa
1 changed files with 8 additions and 2 deletions
|
|
@ -1248,8 +1248,14 @@ bool UpdateObjectParser::parseUpdateFields(network::Packet& packet, UpdateBlock&
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sanity check: UNIT_END=148 needs 5 mask blocks, PLAYER_END=1472 needs 46.
|
// Sanity check: UNIT_END=148 needs 5 mask blocks, PLAYER_END=1472 needs 46.
|
||||||
// Values significantly above these indicate the movement block was misparsed.
|
// VALUES updates don't carry objectType (defaults to 0), so allow up to 55
|
||||||
uint8_t maxExpectedBlocks = (block.objectType == ObjectType::PLAYER) ? 55 : 10;
|
// for any VALUES update (could be a PLAYER). Only flag CREATE_OBJECT blocks
|
||||||
|
// with genuinely excessive block counts.
|
||||||
|
bool isCreateBlock = (block.updateType == UpdateType::CREATE_OBJECT ||
|
||||||
|
block.updateType == UpdateType::CREATE_OBJECT2);
|
||||||
|
uint8_t maxExpectedBlocks = isCreateBlock
|
||||||
|
? ((block.objectType == ObjectType::PLAYER) ? 55 : 10)
|
||||||
|
: 55; // VALUES: allow PLAYER-sized masks
|
||||||
if (blockCount > maxExpectedBlocks) {
|
if (blockCount > maxExpectedBlocks) {
|
||||||
LOG_WARNING("UpdateObjectParser: suspicious maskBlockCount=", (int)blockCount,
|
LOG_WARNING("UpdateObjectParser: suspicious maskBlockCount=", (int)blockCount,
|
||||||
" for objectType=", (int)block.objectType,
|
" for objectType=", (int)block.objectType,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue