Skip to content

fix(game): SC layouts the 1.2 client reads differently (criminal arrested, tower def list, play sound) - #41

Merged
NickMesser merged 1 commit into
rust-rewritefrom
fix/net-wire-layouts
Oct 23, 2026
Merged

NickMesser merged 1 commit into
rust-rewritefrom
fix/net-wire-layouts

Conversation

@NickMesser

Copy link
Copy Markdown
Owner

Three SC packets the lane writes with a layout the 1.2 client reads differently (checked against the client's readers in x2game.dll):

packet lane wrote client reads
SCCriminalArrested u32 criminalObjId 3-byte bc (397b6870)
SCTowerDefList i32 count u8 count, at most 100 entries (397caad0)
SCPlaySound (kind 2) u32 npcObjId 3-byte bc (397bea30)

The extra bytes shifted the fields after them, so the client showed garbage names / ids. Byte tests updated; cargo test -p aaemu-game tower_def trial play_sound passes.

Found while decoding these packets in the Bevy client (AABevy1.2, aa-net notice.rs).

🤖 Generated with Claude Code

…sted, tower def list, play sound)

- SCCriminalArrested: the criminal's obj id is a 3-byte bc (x2game 397b6870), not a u32.
- SCTowerDefList: the count is a u8 and the client reads at most 100 entries (397caad0).
- SCPlaySound: the NPC of a kind-2 (bubble) cue is a bc (397bea30), not a u32.

Each extra byte shifted the following fields, so the client read garbage names / ids.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 39980529139

Warning

No base build found for commit 180b4fd on rust-rewrite.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 76.698%

Details

  • Patch coverage: 7 of 7 lines across 3 files are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 258994
Covered Lines: 198642
Line Coverage: 76.7%
Coverage Strength: 29382.67 hits per line

💛 - Coveralls

@NickMesser
NickMesser merged commit cb2470e into rust-rewrite Oct 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants