aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/research-notes/remote-reload/README.md (6070B)


Remote reload receiver and focused regression

Selected TODO: audit remote reload animation/ammunition state for an initially empty weapon through reload and its first ordinary shot on two clients. Observed implementation gap: handleReload sends its committed ReloadIIR only to the owner. The observer learns loaded rounds from a later attack result.

Completion check: both native holders receive the committed rounds and native category5 reload action before any shot. Partial and depleted owner stacks must preserve the observer's separate seven-round stack in the same ordinary slot and its nine-round gun. The first shot consumes exactly one round, reaches the same native impact, and page/cold recovery retains both owners and quantities. Rejected/failed/ignored/failed-COMMIT writes publish no remote success; a retry publishes once. A lost owner reply must not hide a committed observer update.

Original kkr.dll SHA256: a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. The existing reload-native-evidence.json in ../ranged-research retains reader 10080bf0, apply10080ca0 and holder1007bca0. Apply selects the outer character; the holder's ammo update uses that character's inventory helper at+150. The same holder sets the referenced WeaponItem stat26, creates the category5 timer and restricts reload chat text to the local flag. Original assembly's this adjustment is explicit in client/game/kkr.dll/lifted-0035.c::sub_3607BCA0.

Focused additional original dossiers reuse the matching bank snapshot: -10061800 resolves normal page104 through that inventory helper's+0c field: ev_3508167f80c08bd6458506c75933d0db0ecd76d2807c2b67cbda6fff0b296eb6. -10062320 uses this resolver before updating a slot count: ev_35dacf4466bd27dee52b21cef71d0650358027ec5856815f0e96db965dd1cd4b. -1002d2f0 ignores a missing row instead of creating one: ev_3ea1d72a376f6824171eedbb252194fa74335a2d25b44aecdf853afe6dee461a. -10062440 resolves the receiving character's page before deleting a row: ev_2c342d893e24d599ab9c9ac2d0644d0ae7ca53af1dfd9a8c09aa289a0b13fd6b. Full new evidence and snapshot are evidence.json and kkr.snapshot.json. The owned REA session is closed before client builds and Go/native tests. These are static original-client observations, not historical server execution.

The harness now reads signed loadedAmmo directly from WeaponItem's stat container and includes remote actors' existing action categories. The snapshot unit verifies values/queues/guest registers remain unchanged. Its WASM unit, full client build and publication have passed. This supplies necessary native state evidence without injected game packets or ad hoc heap probes.

Both players, their weapons/ammunition, target placement and target health are controlled fixtures. They are not earned progression or acquisition evidence. All owned browsers, temporary HTTP servers and combat loops close on failure.

The first baseline run did not reach native reload: the newly added observation mistook a Weapon_t controller for WeaponItem_t. Both startup contexts timed out; these are excluded from reload acceptance evidence. The original AttackInfo 1007a660 in retained batch ev_46238f88f89ea87d06fd10ca7b742b2ce2dba8f1eafc6b80dd38b586331e0a79 explicitly selects controller+20 before setting stat26. A corrected-layout unit fixture aborts against that observation bug (snapshot-layout-baseline.log). The corrected snapshot follows+20 and handles the original unbound case, then passes the bound/unbound queue/register preservation fixture. This was an uncommitted instrumentation mistake; no server behavior changed to accommodate the faulty observation. snapshot-fixed-unit.log is the accepted snapshot unit.

The corrected observation plus the original ranged.go overlay reproduces the actual missing remote publication in native-baseline.log. Capture132601/100 takes28.35seconds, loads20 rounds for the owner and leaves its live observer empty through frame756 without a first shot. The original handler is retained verbatim in ranged-before.go.txt and baseline-overlay.json. This is the accepted native before-state, replacing the two excluded startup timeouts in baseline.log.

The server now broadcasts only a committed ReloadIIR to ready clients in the same runtime playfield, excluding its owner, while keeping the GenericCmd ACK private. Observers receive it before attempting owner output, so a lost private reply cannot hide a committed update. Transaction and reload timing are unchanged.

Accepted fixed evidence:

The finite remote-reload TODO is closed. Original server scheduling, automatic reload and stack-selection policy remain outside this receiver/publication fix.