Files

3.5 KiB
Raw Permalink Blame History

Level-up complete payload coverage — 2026-11-27

Supported source0x1d4 was listed by the saved opcode audit but had no direct integrated payload assertion. Added58 assertions in the existing combat fixture; 415 total assertions PASS against the accepted pinned75d0ba65 library snapshot, with source/header base6dc6e75a. No runtime defect was demonstrated and no runtime code changed. Result, receipt, library hashes.

Independent producer/writer contract

Source /mnt/Games/@project/build/source-server-main-20261124/source/src/game/Objects/Player.cpp:3965–3986, GiveLevel, calculates signed health/mana differences, writes their uint32 bit patterns, emits mana delta only for a mana-using player and zero for the other four source powers, then writes five signed stat differences. Thus source payload is12 words/48 bytes. Synthetic negative delta vectors exercise the signed-difference wire representation; they are not claimed to be a captured actual level gain.

Maintained native /mnt/Games/@project/servers/trinity-forever/src/server/game/Server/Packets/MiscPackets.cpp:395, LevelUpInfo::Write, writes int32 Level/HealthDelta, PowerDelta, StatDelta, NumNewTalents and NumNewPvpTalentSlots in order. MiscPackets.h:520 defines the arrays; Miscellaneous/SharedDefines.h defines10 powers per class and5 stats (including spirit). The tested native payload is19 words/76 bytes. The expected test bytes are explicitly constructed in writer order, not by invoking the serializer under test.

Source CalculateTalentsPoints atPlayer.cpp:22627 includes extra bonuses and a configurable rate. This unit deliberately stays at levels2 and9 with ordinary/no-new-talent cases. It does not bless the gateway’s high-level talent heuristic or test custom bonus/rate configurations. No policy alteration is inferred from the packet, which has no explicit talent-count field.

Meaningful assertions

Integrated fixture additions use actual NativeWorldTranslation::translate and complete output-envelope parsing. Eight full-payload cases vary level2/9, health17/-3 and mana0/23; distinct STR11/AGI-7/STA13/INT0/SPI19 detect field shifts, sign loss and wrong padding. They require exactly one native0x470194 event with the complete expected payload. Source non-mana powers are zero as in the real producer; the test does not invent happiness-to-combo-point mapping.

All48 truncated lengths and a trailing byte must be rejected. One final valid packet proves recovery. Totals:8 exact cases +48 truncations +1 tail +1 recovery =58 added assertions. Existing357 assertions remain in the changed fixture. There is no claimed failing-before regression: the new contract tests pass the unchanged runtime.

Only the changed fixture was compiled with C++20, -Wall -Wextra -Wpedantic -Werror, and linked against the previously pinned native/protocol snapshot. No full gate, native rebuild, codec rebuild, client or database action. The fixture addition is near its end, separate from the accepted duel-countdown addition near its start; this result does not include that later23-check block.

Remaining boundary

The existing native opcode is retained, and maintained writer/source proof is reused without a new binary scan. Actual70334 reader/display acceptance, higher-level/custom talent policy, and arbitrary non-source power vectors remain outside this result. Mail0x239, duel0x2b7, queue39 and42 were not edited or retested. Parent owns integration.