Skip to content

fix: harden Rust gameplay, persistence and protocol flows - #43

Merged
NickMesser merged 32 commits into
rust-rewritefrom
test/test-hardening
Oct 23, 2026
Merged

NickMesser merged 32 commits into
rust-rewritefrom
test/test-hardening

Conversation

@NickMesser

@NickMesser NickMesser commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Character creation could expose or leak starter inventory after persistence failed; gathering and cannon requests could bypass authority; construction could advance without full material payment; and recycled static physics colliders could panic a sleeping ship. This integration fixes those paths and adds regression coverage, alongside the reviewed gameplay/data and 1.2 packet corrections in #34–#42 and #44. All original PR heads remain in the history.

Changes include authenticated internal reconnect ownership, bounded registration decoding, overflow-safe packet reads and frame boundaries, deterministic session recovery tests, Python ratchet tests in the local CI gate, transactional character/inventory cleanup and forced-fresh verification, atomic construction payment and exact consumption callbacks, gathering skill/caster authorization, instance Return visibility, persistent ship equipment and gunner lifecycle fixes, static collider lifetime bookkeeping, Unix writer-lock release, NPC interaction lists, three client packet layouts, empty-slot salon hair creation, and uncached music-note replies.

Validation on 79d3d0c1c1a115505ce0d3d33e1a09833ad2d40a:

  • Full local gate: 3,670 Rust tests passed, 0 failed, 162 ignored, plus 7 Python tests; formatting, Clippy with -D warnings, and packet coverage ratchet passed.
  • All 12 GitHub checks passed, including Linux/Windows tests and Clippy, coverage, CodeQL, packet coverage, formatting, and image builds. Linux coverage includes the Unix cloned-descriptor lock regression.
  • Real compact-data and private-MySQL checks covered ordinary hull defaults, legacy equipment restart/intentional-empty behavior, and character creation rollback/retry. The physics regression first reproduced the exact live entity panic and then passed with the lifetime fix.
  • Prior checked source snapshots passed live fresh-character persistence, reconnect/re-registration, overlapping hulls 14/21/75 and all five hull defaults, cannon permissions/ammunition/detachment, construction with zero/exact/extra materials, ore labor/authorization/cast/regrowth, eight quest trees and five harvests, salon receipts/persistence, and NPC 13640's two advertised skills. The final combined gameplay replay used d0991c0; the subsequent source delta is limited to music code/tests and its porting note.
  • Music live verification on 79d3d0c: 7/7 cases passed with exact note bodies and tooltip flags, missing-note replies, preserved u64 aliasing, requester-only buff targets, and an unchanged seeded MySQL row. The first three replies were delayed/coalesced; offline validation matched their ordered bytes. No new server ERROR/panic occurred; 10 static-data/timing warnings were recorded. All eight production EXE/PDB hashes matched, and all lane-owned processes/listeners were stopped.

Limits: native UI/menu selection, implicit gathering UI dispatch, audio playback and composition, projectile impact, and distant Return presentation were not verified in a real client. Return visibility and the construction interleaving are covered by deterministic packet/flow tests. Gathering skill mappings are documented server compatibility policy; missing rock/sheep item templates are test fixtures only. Tree quest setup used GM progression. Expected restart/setup errors and timing/static-data warnings were audited separately; no unexplained runtime panics remained.

Three CodeQL literal-credential findings were scoped to pure #[cfg(test)] configuration fixtures and dismissed as used in tests with source evidence; no scan or query was disabled.

stsiakal and others added 30 commits October 22, 2026 03:49
DoodadFuncOreMine / RockMine / Shear were log-only stubs, so the phase never advanced and the authored loot / depletion / regrow groups never ran. They now set ToNextPhase like DoodadFuncCutdown; labor stays the gathering skill's consume_lp and the 1.2 server (C# and Rust) does not validate mainhand_tool_id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Exercise live and stale character selection against a closed pool, and verify forced cleanup retains departing financial state without disturbing other sessions.

Co-Authored-By: GPT-6.1 Sol <[email protected]>
…tion set

CSStartInteraction answered 0 for an NPC without a function flag, so the
client never offered what npc_interactions gives it (the beauty salon
helper's 'Enter the beauty salon', skill 22780). npc_interactions is loaded
per npc_interaction_set_id; when no function applies the answer lists the
set's skills in table order, and the function still wins when there is one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Commit each selected building effect only after a checked full material debit, then flush item callbacks after releasing the housing lock. Preserve optional consumption for other effects.

Report actual container consumption exactly once, including depleted preferred stacks, while preserving item tasks and callback order. Add deterministic race, payment, callback and compatibility regressions.

Validation: 204 focused library tests passed; 15 housing tests ignored. Game all-target clippy with -D warnings and cargo fmt --all -- --check passed.

Co-Authored-By: Codex <[email protected]>
…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]>
Authorize gathering before cast mutations and phase execution. Preserve explicit Use/FakeUse bindings and automatic loot, and define the scoped legacy server compatibility mapping with normal labor and quest requirements. Prevent an owned mate from advancing a paid gathering phase for a free character loot retry.

Add packet-flow regressions and compact coverage. Ore uses its real item definition; removed rock/sheep loot definitions are explicit test-only stand-ins. Native UI dispatch remains unverified.

Co-Authored-By: GPT-6.1 Sol <[email protected]>
# Conflicts:
#	rust/crates/aaemu-game/PORTING.md
# Conflicts:
#	rust/crates/aaemu-game/PORTING.md
Treat missing hair as template 0 when checking whether a salon hairstyle needs replacement. Keep receipts authoritative and preserve existing certificate settlement and failure behavior.

Co-Authored-By: Codex <[email protected]>
Decode the native tooltip and buff-only flags independently and echo the tooltip flag when loading notes. Preserve legacy missing-song replies, buff-only behavior, and note ID widths; cover all flag combinations with actual packet and buff flow tests.

Co-Authored-By: OpenAI Codex <[email protected]>
@coveralls

coveralls commented Oct 23, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 40009891755

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: 77.012%

Details

  • Patch coverage: 497 uncovered changes across 22 files (2373 of 2870 lines covered, 82.68%).

Uncovered Changes

Top 10 Files by Coverage Impact Changed Covered %
rust/crates/aaemu-game/src/systems/vehicles/slaves.rs 832 676 81.25%
rust/crates/aaemu-tool-aipaths/src/returnpoints.rs 190 97 51.05%
rust/crates/aaemu-game/src/db_character.rs 104 13 12.5%
rust/crates/aaemu-game/src/systems/vehicles/data.rs 101 45 44.55%
rust/crates/aaemu-game/src/managers/character.rs 95 78 82.11%
rust/crates/aaemu-game/src/models/item.rs 26 13 50.0%
rust/crates/aaemu-testclient/src/verify.rs 56 44 78.57%
rust/crates/aaemu-game/src/managers/item.rs 92 83 90.22%
rust/crates/aaemu-game/src/systems/skills/ext.rs 17 9 52.94%
rust/crates/aaemu-game/src/systems/ai/collision/mod.rs 16 9 56.25%
Total (48 files) 2870 2373 82.68%

Coverage Regressions

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


Coverage Stats

Coverage Status
Relevant Lines: 261602
Covered Lines: 201466
Line Coverage: 77.01%
Coverage Strength: 29625.83 hits per line

💛 - Coveralls

# Conflicts:
#	rust/crates/aaemu-game/PORTING.md
@NickMesser NickMesser changed the title test: integrate reviewed Rust fixes and regression coverage fix: harden Rust gameplay, persistence and protocol flows Oct 23, 2026
@NickMesser
NickMesser marked this pull request as ready for review October 23, 2026 19:46
@NickMesser
NickMesser merged commit 3d6ec02 into rust-rewrite Oct 23, 2026
12 checks passed
@NickMesser
NickMesser deleted the test/test-hardening branch October 23, 2026 19:47
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.

4 participants