aorecomp

Anarchy Online classic in the browser

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


docs/scene-reentry.md (5744B)


Scene section reentry

The native client can retire a world vending object without a playfield change when its scene section unloads. Publishing the machine only during world login therefore leaves a missing shop when the player walks back. Reloading the page restores it because the world-login sequence publishes the machine again.

Reproduction

An ordinary fresh Omni Atrox Enforcer rendered and opened the training shop. The retained level-3 earned Enforcer also rendered, picked, opened and cancelled it after walking back from the city. Both native Use messages addressed 51035:3221226422, template 100035, at [60,14,50].

In the same returning session, walking toward the boss removed this vending identity from the native directory before any attack. The last sampled present pose was [159.5005,14.0538,129.7659]; the first missing sample was [162.0813,14.8148,134.0132]. On return, the shop remained absent. The nearby static tutorial object was reconstructed at a different native address, while the vending identity was still missing. A page reload restored the vending object and preserved all owned items.

This separates scene lifecycle from character level, combat, a rejected wear, camera orientation, WebSocket buffering and the vending packet's fields. The original and current vending bodies were already byte-identical. The observed boundary is not a recovered universal distance-based removal formula.

Static 51005:3221226422 is a different object: template 100280, "About the Guard", at [59.26055,15.99995,55.73878]. Its original Use effect prints a Shift-left-click instruction. Equal numeric IDs do not establish that it is a vending alias. The separate static-Use alias audit remains open.

Native protocol

CharZoneMoveIIR_t, key 0x2d2b2169, contains the ordinary compact pose with action 20, without the DC-movement yaw tail or MouseMove's eight floats. The normalized handler prefix is 16 bytes and its pose is 15 bytes; its original wire packet is 44 bytes including the outer header. Coordinates use X/Z eighths and signed Y sixteenths; the signed quaternion is normalized by the common decoder.

The original KKR constructor at 0x10047510 selects action 20. Reader 0x10047630 delegates to the common pose reader 0x10043dc0; writer 0x10047650 delegates to 0x10044010. Its activation thunk at 0x10047620 jumps to common movement activation 0x10043c50. Controlled-character Run 0x1006ea50 compares GetZoneInstanceID() with actor field +0x1b8, sends this message when the nonzero prior section changes, then records the new ID. The original KKR SHA-256 is a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0.

The server now accepts this message through its shared pose path, preserves held controls, relays the compact pose to other players and keeps ordinary position checkpoints. Only authenticated, ready, living target clients can submit a non-correction action 20 with a nonzero quaternion and the exact length. MouseMove retains its separate tail validation.

An accepted scene transition replays the same authored passage doors, placed world items and vending machines used by world login. This reads current instances; it allocates no loot, rewards or resources and does not reapply worn effects. Native vending activation ignores an already-present typed identity. The replay uses the current playfield, without a guessed visibility radius, periodic resend timer or species/terminal exception. This is a reconstruction policy supported by the native lifecycle, not a recovered historical server interest algorithm.

Verification

The captured native packet fails the original handler with a short-movement error. New tests check direct native socket dispatch, repeated shop replay, owner/observer separation, unchanged inventory, no per-message database writes and a later pose checkpoint. Invalid lengths, subjects, pass-on, action, correction, quaternion and session state cannot publish scene objects. Further cases replay an existing Carbonrich Rock instance and a real entered mission's passage/objective without reallocating items or leaking public vending machines into the private world.

The full go test ./server/... ./tools/data/... run passes 1,701 top-level tests and 16,659 results including subtests. The five focused scene-transition tests pass all 18 results; the related movement, shop, resource and mission-door race run passes 23 top-level tests and 79 results. go vet passes for both trees.

The fresh/returning native captures, exact transition samples, complete source evidence, packet comparisons and test results are retained in local/startup-shop-visibility/.

The GPU WASM candidate completed two section round trips without reloading and picked/opened the same starter vending identity after each. Offering the newly earned QL 5 gloves 155 and walking out of range cancelled the draft, restoring that exact item and leaving all item records/locations and 73 credits unchanged. A later native acceptance sold only those gloves for 17 credits. The character retained 90 credits, 1,825 current-level XP (5,875 cumulative), QL 5 gloves 145 for later training, worn boots 147 and 48 laboratory charges. All 23 remaining owned items, native armor totals and the vending machine survived both page reload and a cold restart of the same candidate. SQLite integrity/foreign-key checks pass; the instrumented native runs captured no page errors. Both owned browser profiles are closed.

The current replay covers the three authored scene-object paths above. It does not establish original interest radii, every large-world streaming policy, or the separate corpse/NPC retirement contracts; those remain explicit TODOs.