Skip to content

fix(game): enforce audited 1.2 protocol and gameplay rules - #46

Merged
NickMesser merged 98 commits into
rust-rewritefrom
fix/audit-final
Oct 26, 2026
Merged

NickMesser merged 98 commits into
rust-rewritefrom
fix/audit-final

Conversation

@NickMesser

@NickMesser NickMesser commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Several 1.2 rules were loaded without being enforced, and some packet layouts did not match the protocol. This batch adds the missing enforcement and regression coverage:

  • Route Return Mail on 0xa3 and serialize loot failures as i16.
  • Preserve merchant grades, parse crafting flags, check house-bench recipes and permissions, and expire ordinary mail with return-once escrow.
  • Authenticate Web API administration and enforce closed-zone destinations, unconditional banned tags, and character creation/deletion rules.
  • Apply audited damage/modifier rules, raw attribute caps, shared cooldowns, and buff-breaker lifecycle cleanup.
  • Recover vehicle attachment transforms and make cargo deposit/recovery transactional. Original doodad metadata constrains cleanup so stale references cannot delete foreign or recycled items; ambiguous cargo and saved containers are retained.
  • Serialize lane allocation and add bounded JSONL testclient control with exact-character reconnect, hard socket closure, filtered incremental capture, bounded compression, and deadline/EOF handling.

The hull/reconnect repair uses root-only owner lookup, owner/item reservations, session-aware publication, failure-before-replacement handling, prefetched attachments and cargo-receipt freshness checks. Intentional 600-second offline retention and portal rendering remain. Ship diagnostics are supporting temporal observations; diagnostic, authority and retirement consistency flags remain false. Queued/HP/world-removal/phase sampling and guardless quest/direct writes remain outside that proof boundary.

Validation of executed source 198b7d4821df6d930c14c8a5d38c64846a43efe1:

  • Official lane.sh check passed: workspace formatting, all-target Clippy with warnings denied, workspace tests and the packet coverage ratchet. Game library: 2,878 passed, 0 failed, 149 ignored; testclient: 57 library + 16 binary tests passed. All 12 hosted checks passed at this source head.
  • 20 selected ignored checks passed, with no environment skips: twelve compact-data checks and eight private-MySQL checks. They cover Merchant twenty-rack cycles, saved aliases and recycled GUIDs, ship query-failure/retry/save-fencing/restart, intentional-empty equipment, lobby policy and mail expiry rollback/reload. SQL fixtures used connection-local temporary tables on the lane's private MySQL instance. Other ignored tests remain unexecuted.
  • The ambient-teleport regression verifies sustained received framed traffic, exact acknowledgments, decoded position and bounded completion. Twenty repeated Windows runs passed, split between default scheduling and one test thread.
  • Production builds passed; all four EXE/PDB pairs matched native GUID/age and SHA-256 pins. External supporting harnesses passed 191 helper tests, and the grid preflight's three mock suites passed 75 + 50 + 84 tests. These are external Python/PowerShell evidence, separate from the Rust tests.
  • A bounded preflight observed 20 spaced water nodes and one fresh spare-pack drop/recovery with the same item ID. It does not establish static-obstacle absence or open water beyond the sampled nodes.
  • One fresh-owner headless run completed 40 loads, 40 unloads, 40 drops and 20 pickups in 362.078 seconds. Independent raw-capture and SQL review verified all 80 positive rack operations, all twenty original item identities through both cycles, and the persisted final state: twenty original System items, twenty matching ground doodads and twenty empty saved racks. No original was destroyed or regranted; only the 45 recorded filler items were destroyed. Labor had one natural +10 credit and no debit.
  • The same run verified the glider/full-bag 207 negative without an inventory/rack/phase mutation, one hard Game/Stream close without LeaveWorld, and exact-character reselect. Ninety post-summon diagnostic samples showed one current hull root. The second same-item 15802 skill executed, then loaded-hull replacement was refused with error 801 (SLAVE_EQUIPMENT_LOADED_ITEM). The existing hull, racks, cargo and phases were preserved; only the initial SCSlaveCreated appears in the captures. This validates the attempted operation and loaded-hull preservation, not a new hull, unloaded/retired replacement, or completion of the 600-second timer.
  • All 2,892 control requests returned within their deadlines. There were no retries, cooldown clearing or cap increases. Independent STOP0 confirmed no owned Login/Game/testclient or lane listener, with artifact and helper pins unchanged. The stop was forced, Login before Game: logs contain 138 WARN, one shutdown Login-link ERROR and zero panics, excluding startup. This is not a warning-free or graceful-shutdown claim.

The bounded cargo and qualified controls are accepted as observations for this run, not a full-scenario pass, retail-client parity or global atomicity. Captures are sanitized, normalized and expanded Rust-server events rather than original compressed wire bytes. Doodad-to-item identity is correlated with the final persisted SQL; SQL proves the current end state, not exact save time or ordering. Documentation-only commits do not change which source was executed live.

PORTING.md and rust/docs/audit-repair-status.json retain the wider limits: nine timed zone bans, permanent pStat contribution storage, 41 missing attachment points, and orphan reconciliation/GC remain open. AoE rank/reset behavior and immediate buff-breaker timing remain explicit compatibility policies. The wider missing-feature audit remains in progress.

Documentation commit 87be9290006c75bd414c38474f7506c5c1d66d5a is pushed and clean. Its official jobs=1 lane.sh check passed in 84.625 seconds (minimum free RAM 12.272 GiB), and CHECKED equals that commit. Only the two validation documents differ from the executed source above.

NickMesser and others added 30 commits October 25, 2026 16:23
Dispatch native 1.2 mailbox returns on 0xa3 using the preserved legacy ReportSpam constant, remove the competing no-op handler, and write the loot failure error as i16.

Add literal native packet fixtures and a GameServer frame flow covering recipient authorization, return, attachments and repeat refusal. Preserve the historical C# fixture with an explicit native correction in its comparison test.

Validation: cargo fmt --all --check and git diff --check passed. Cargo tests and Clippy are intentionally pending parent validation; no Cargo target was populated.

Co-Authored-By: Codex <[email protected]>
Keep catalog item/grade variants, validate the native 1.2 normalized purchase grade, and acquire only matching-grade stacks. Preserve configured prices and fixed-grade rules. Read use_grade/main_grade as SQLite text flags while retaining the existing craft inheritance and free-regrade behavior.

Add NPC purchase/inventory regressions for gold, honor, grades, fixed/basic templates and rollback; load real SQLite t/f flags and craft the loaded recipes. Formatting and diff checks pass. Compilation, focused tests and Clippy are explicitly pending parent validation in audit-final; no lane Cargo target was populated.

Co-Authored-By: Codex <[email protected]>
Default the HTTP listener to loopback, reject unauthenticated non-loopback binds, and keep only read-only status anonymous. Add credential, mutation-side-effect, legacy configuration, disabled API, and redaction regressions with migration instructions.

Validation: cargo fmt --all --check, git diff --cached --check, and shipped WebAPI JSON defaults passed. Builds, tests, Clippy, full CI, and live verification remain pending for the parent audit-final lane under the resource plan; this lane has no Cargo target.

Co-Authored-By: OpenAI Codex <[email protected]>
Allow private plaque visitors to craft recipes offered with Any permission. Validate authored pack membership, current function permissions, station identity, house existence, instance and range at craft start and product commit. Preserve portable crafts and legacy authored CraftStart lists.

Add native 1.2 based packet/skill flow regressions and a read-only compact assertion for all 23 tax plaque crafting phases. Validation is source-only per parent resource restriction; rustfmt and git diff checks pass, with Cargo and live checks deferred to parent.

Co-Authored-By: Codex <[email protected]>
Reject known closed portal and Return destinations before costs for access below 100. Restore the bounded historical warning and return flow with cancellation, live-session checks, verified destinations, and visibility and instance membership updates. Keep unknown mapping keys neutral and preserve the GM exemption.

Add 12 focused flow regressions, including paused-clock timer, departure, disconnect, fallback, visibility and resource checks. Source-only validation: rustfmt and git diff --check passed. Cargo compilation/tests/clippy remain reserved for parent integration.

Co-Authored-By: OpenAI Codex <[email protected]>
Apply native 1.2 XP percentage and attack haste conventions, direct skill radius/channel upgrades, heal upgrades, and buff damage modifiers. Snapshot channel duration for packet and timers and saturate newly scaled arithmetic.

Add nine focused modifier regressions using applied buffs, authoritative effects, outgoing packets, and repeat delays. Source-only validation: rustfmt and diff checks; Cargo compilation, tests, Clippy, and live validation are reserved for parent allocation.

Plot-only radius and channel upgrades remain unresolved pending native plot shape/delay evidence.

Co-Authored-By: Codex <[email protected]>
Recover 87 missing transforms for 15 models from native CGF helpers, CHR absolute bind poses and prefab helpers. Add bounded extraction tooling, per-node asset provenance and literal/real-data coverage tests. Keep 41 unsupported nonzero points and None bindings explicit instead of fabricating transforms.

Validation: eight lightweight Python tests pass against the native 1.2 game_pak and read-only compact; rustfmt and diff checks pass. Cargo and live validation intentionally deferred to the parent build slot.

Co-Authored-By: Codex <[email protected]>
Load aoe_diminishings by authored id as floating-point percentages. Native 1.2 sub_39620E90 (x2game12.c:1321108-1321129) and reference 10.x sub_39BDC250 establish this loader. Add shuffled-id, fractional-rate, event-flag and read-only real-compact regressions.

Runtime diminishing and ResetAoeDiminishing remain deferred: the available native evidence does not establish counter lifetime, miss/immunity consumption, reset scope or lookup beyond id 10. Do not infer those policies from the diagnostic multiplier reader sub_39CECDB0.

Validation: cargo fmt --all and cargo fmt --all --check; git diff --check; native 1.2 compact opened mode=ro to verify all ten rates and thirteen flagged events. No compilation, tests, clippy or servers run because the parent retains the build slot. Parent selectors: systems::skills::data::plots::tests and real_compact_db_aoe_diminishings -- --ignored with AAEMU_COMPACT_DB.

Co-Authored-By: Codex <[email protected]>
Serialize persisted six-slot enforcement with character creation, honor creatable templates and blocked name rules, and guard online and expedition-owner deletion using current server state. Use native 1.2 lobby failure codes and add handler regressions.

Validation: cargo fmt --all --check and git diff --check. Build and test execution deferred to the parent under the memory/disk build gate.

Co-Authored-By: Codex <[email protected]>
Load buff_breakers and reconcile accepted buff events through normal dispel cleanup, including matching channel cancellation and stale event/timer handling. Add song, glider, stance, rejection, timer, and native removal-body regressions plus an ignored compact data gate.

Native relation and packet evidence is recorded in the regression module. Native apply-versus-tick timing remains unconfirmed; the accepted-event boundary is an explicit implementation choice pending parent review. Cargo validation is deferred under the parent's build-slot restriction.

Co-Authored-By: OpenAI Codex <[email protected]>
…ll use

Load all authored zone-group restrictions and item tags, retaining unresolved period rules separately. Validate the actual instance sector and server-owned item template before costs, summons or direct doodad placement; recheck pending skill and item casts.

Add native 1.2 result/error body fixtures and regression coverage for tags, instance mapping, attachments, GM casts, placement and pending timers. Formatting, staged diff and read-only authored-fixture verification passed; Cargo builds, tests and clippy are deferred under the parent build-slot restriction. Period 24 semantics and Library index membership remain unresolved data limits.

Co-Authored-By: OpenAI Codex <[email protected]>
NickMesser and others added 29 commits October 25, 2026 18:27
Track summon futures before detached launch and reservation waits. Observe retained retirement references without extending gameplay lifetimes, expose item/root/rack state through the GM slave root, and frame bounded JSON chunks with an explicit completeness checksum and terminator.

Report consistent:false because spawn queue retained references and direct world removals lack a shared audit boundary. Source tests are authored but intentionally unexecuted; parent owns all Cargo and live validation.

Co-Authored-By: OpenAI Codex <[email protected]>
Enter the reentrant item scope before auction and housing operation locks at financial capture and callback-bearing mutation boundaries. Preserve existing manager order, deferred callbacks and synchronous guard lifetimes.

Add bounded contention regressions for financial capture, auction listing/bidding, a real housing sale payment and construction refusal. Validation is source-only: scoped rustfmt and git diff checks; runtime checks remain with the parent.

Co-Authored-By: Codex <[email protected]>
Discover current racks only for the registered hull allocation and a matching transform parent and instance. Preserve captured weak references as explicit historical evidence, exclude them from current rack summaries, and prevent retirement capture from resolving recycled cached IDs into another allocation.

Add deterministic source regressions for reused hull/rack IDs, stale cached child IDs, stale model parents and wrong instances. Keep the observational consistency flags false and disclose queue, HP and world-removal limits. Scoped rustfmt and diff checks pass; tests intentionally remain unexecuted for parent validation.

Co-Authored-By: OpenAI Codex <[email protected]>
Explicitly return authority_consistent:false alongside consistent:false when the audit exceeds its transport limit. Assert both flags after reassembling the oversized-response regression.

Co-Authored-By: OpenAI Codex <[email protected]>
Acquire the item operation scope before callback-bearing spawn locks and their outer instance/command entries. Keep pure spawn bookkeeping bare and quest NPC components deferred until character and ops guards are released.

Validate prepared cargo receipts against the exact live hull and actual unique System escrow before item metadata or prior hull replacement. Reject recovered or aliased references while allowing a different inactive saved hull to restore valid cargo belonging to another player.

Add bounded source regressions for real craft-to-quest NPC spawning versus expired-item doodad cleanup, the exact-item and exact-pack recovery ABA, and inactive-hull restoration. Validation here is limited to scoped rustfmt and git diff checks; no Cargo, runtime or DB execution.

Co-Authored-By: Codex <[email protected]>
Guard every action poll and input parse with synchronous EOF and deadline checks. Recompute output deadlines when starting a write and retain all earlier queued and in-flight budgets. Add deterministic ready-action, EOF, output-ack, and serve regressions without changing protocol or timeout reserves.
@NickMesser
NickMesser merged commit c6befb5 into rust-rewrite Oct 26, 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