mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-05 16:43:52 +00:00
docs: add why-comments to rendering, packets, and UI code
- charge_effect: explain inversesqrt guard (prevents NaN on stationary character) and dust accumulator rate (30 particles/sec * 16ms) - swim_effects: explain why insect pipeline disables depth test (screen-space sprites must render above water geometry) - packet_parsers_classic: explain spline waypoint cap (DoS prevention) and packed GUID compression format (non-zero bytes only, mask byte) - talent_screen: explain class ID to bitmask conversion (1-indexed WoW class IDs → power-of-2 mask for TalentTab.classMask matching) - auth_screen: explain login music volume reduction (80% so UI sounds remain audible over background track)
This commit is contained in:
parent
e8a4a7402f
commit
92369c1cec
5 changed files with 14 additions and 3 deletions
|
|
@ -282,6 +282,7 @@ bool ClassicPacketParsers::parseMovementBlock(network::Packet& packet, UpdateBlo
|
|||
/*uint32_t splineId =*/ packet.readUInt32();
|
||||
|
||||
uint32_t pointCount = packet.readUInt32();
|
||||
// Cap waypoints to prevent DoS from malformed packets allocating huge arrays
|
||||
if (pointCount > 256) return false;
|
||||
|
||||
// points + endPoint (no splineMode in Classic)
|
||||
|
|
@ -362,7 +363,9 @@ void ClassicPacketParsers::writeMovementPayload(network::Packet& packet, const M
|
|||
|
||||
// Transport data (Classic ONTRANSPORT = 0x02000000, no timestamp)
|
||||
if (wireFlags & ClassicMoveFlags::ONTRANSPORT) {
|
||||
// Packed transport GUID
|
||||
// Packed GUID compression: only transmit non-zero bytes of the 8-byte GUID.
|
||||
// The mask byte indicates which positions are present (bit N = byte N included).
|
||||
// This is the standard WoW packed GUID wire format across all expansions.
|
||||
uint8_t transMask = 0;
|
||||
uint8_t transGuidBytes[8];
|
||||
int transGuidByteCount = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue