aorecomp

Anarchy Online classic in the browser

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


docs/insurance.md (24213B)


Saving a resurrection location

The admitted original faction scanners save a player's resurrection location through native right-click Use. The selected scanner's identity persists in SQLite as resurrection_terminal, also exposed in the control editor. Death returns the player beside that scanner, including after reconnect or server restart. Unsaved characters return to their affiliated training entrance with a usable backyard association, under the provisional policy described in player resurrection.

Four scanners in Omni Entertainment, Tir and Newland are enabled through server/gamedata/insurance.yaml. Saving has no fee; the higher-level price formula has not been recovered. The exact historical arrival transform is also unknown. The first Omni scanner's return is explicitly provisional: playfield 705, XYZ [918, 20.7, 578], facing east, three metres beside the scanner with human ground clearance. It is not presented as the shipped resurrection destination. The street-level scanner 51005:0xc00802c1 uses the same rule at [598, 16.9, 329], facing west. Neither transform is an original server measurement.

Shipped resources

The 14.9.1 resource database supplies these facts:

The scanner inventory is retained in local/insurance-smoke/scanner-placements.json. A bounded scan of non-image world resource types found the values 7051/7052 only in scanner descriptors, without a separate verified arrival record.

Street-level Omni pair

Original resource 1000026/705, statel 263 at offset 42113, is the second Omni-Med scanner 117665: type 51005, instance 0xc00802c1, position [601, 16.400100708007812, 329]. Its complete 104-byte record uses the same descriptor as the first scanner except for stat 362, 7052 instead of 7051. Its original orientation faces west. Statel 264 at offset 42221 places reclaim 37180, type 51059, instance 0xc00a02c1, at [601, 16.400100708007812, 331].

Both complete original item records match the maintained catalog, including Omni affiliation on SaveChar 53032 and every companion descriptor. Full statel bytes, resource offsets, payload hashes and the selected original index digest are independently checked in local/earned-death/terminals/original.json.

The shared data selects each saved arrival, including after cold loading and unrelated profile validation. Generic Use checks the requested typed identity, its own position, the current session and affiliation before saving. Reclaim Use also checks its requested booth's position; proximity to another enabled booth cannot authorize a remote identity. The subsequent identityless private container actions accept proximity to either admitted reclaim placement.

The retained level-seven Enforcer reached the new scanner through ordinary native walking, selected its actual 51005 identity and saved cumulative XP 20875. All 30 owned items, 803 credits and earned skills remained unchanged. The preceding raised-courtyard approach attempts stopped at authored collision faces in both native and server observations; they do not establish that every original approach is blocked. The focused stair check below now resolves courtyard access. Focused Clan/Neutral reachability and recovery are recorded below.

The actual adjacent reclaim accepts native Use, opens an empty private window and closes it again. Both page reconnects retain the same scanner, insured XP, all 37 owned items and full resources. Thug's Delight expires normally during travel; no earned death or level-ten item transfer is claimed by this run.

The snapshot's world-type filter now includes reclaim type 51059. The standalone C regression reproduces the omission and verifies read-only metadata and guest register preservation. After publishing the matching WASM bundle, a fresh server and two fresh clients resolve the real booth through GameTest.pick, open/close its private window and reconnect both pages. Native stat 236 retains 20875. Independent SQL checks retain all 111 physical records, slots, charges, qualities, wallets, skills and mission facts.

The related Go selection passes 46 roots and 163 results normally and under the race detector, plus vet. The new scanner regression fails against the previous routing. All 126 JavaScript harness checks and the C snapshot check pass. The ordinary hot and cold WASM checks pass in 723.23s and 37.17s. Original payloads, packet decoding, ownership reports and cleanup evidence remain in local/earned-death/. The subsequent earned level-seven return verifies fatal combat and recovery at the street scanner. The subsequent earned level-ten run also verifies ordinary saving, fatal retaliation, the level-ten inventory split and cold collection of the same 24 instances. A save request with reclaim remaining fails safely; saving succeeds after collection. Its missing refusal explanation remains a separate TODO.

Original Omni courtyard stair access

The earlier failed west route moved east from [898,572] toward [909,572]. It hit the stair's steep side rather than entering from its bottom. The original invisible collision tree in resource 1000013:46203322 contains a ramp rising from roughly Y16.39 at Z575.95 to Y20.03 at Z567.91, between X900.4 and X904.9. Its side rises about 3.64 metres in 0.8 horizontal metres; the walking entrance rises the same amount over about eight metres. The adjacent landing is Y20.41.

TestBrowserCourtyardInsurance starts a controlled level-one Atrox at [902.5,16.41,579], facing decreasing Z. Its race/fatness/breed/sex, height and head match the earlier report's body; stats and health are ordinary breed defaults. It walks through [902.5,565.5], [909,565.5] and [915,575]. Finishing the ascent before turning avoids the side face and the railing/pillar beside the landing. No jump, flight, collision bypass or runtime position edit is used.

The native checkpoints reached Y20.0377, Y20.4211 and Y20.2103. Each agrees with authoritative movement within 0.5 metres in 3D. Actual native picking and right-click Use target 51005:3221357249; CharacterAction79 displays the insured message and the server retains that scanner. Screenshots show the character on the stair/landing and beside the original scanner. No native/page errors occurred. A separate Solitus check also reached and used it.

The Atrox check passed in 65.21 seconds; evidence is under local/courtyard-access/20261102-115634/. Original collision extraction, payload hashes and an independent packet/pose verifier are in local/courtyard-access/. The initial shortened-ramp waypoint turned below the landing and correctly stopped at its higher face; its trace is retained separately. This resolves a specific approach report without changing world geometry or movement behavior. The checkpoint is controlled, not an earned city/faction travel or death run. Other courtyard entrances and the broader movement/lifecycle matrix remain open.

AO_GAME_TEST=1 go test ./server -run '^TestBrowserCourtyardInsurance$' -count=1 -v

Clan and ICC scanners

The selected original Tir scanner is 51005:0xc0020280, template 117650, at [490.9920044, 8.0001211, 399.6037598]. Its nearby reclaim is 51059:0xc0020280 at [485.5439453, 8.0000734, 399.3544922]. Their shared numeric identity does not make their typed identities interchangeable.

Newland's selected ICC scanner is 51005:0xc0020236, template 117651, at [235.8953857, 32.4100380, 313.8017883]. The admitted reclaim is 51059:0xc0010236 at [314.1781006, 32.4001007, 301.3121948]. These are placements in the affiliated starting cities, rather than a scanner invented inside training.

The original Federated template's SaveChar 53032 requires Side 33 equal to 1. The ICC template's SaveChar has no requirements and its description explicitly permits all citizens. Omni-Med retains its authored Side 2 requirement. Each configured scanner now selects its original template; the shared postfix requirement evaluator applies that SaveChar contract. Reclaim remains private and uses its own typed placement and proximity check.

Complete original item records 117650, 117651, 117665 and 37180 match the maintained catalog. The independently reread statels, raw bytes, original resource/index hashes and local wiki search are retained under local/faction-insurance/. The wiki's insurance-technology article is lore; it does not establish this version's placement, faction predicate or fee. The period February 2002 play report describes insurance saving outside training, but its level-five XP protection predates the selected templates' below-level-20 rule. It supplies no arrival transform or price formula for 14.9.1.

Tir's provisional return is three metres north of its scanner, at [490.9920044, 8.5001211, 402.6037598], facing north. Newland's is three metres east, at [238.8953857, 32.9100380, 313.8017883], facing east. Both retain the existing half-metre vertical clearance and free-save policy. These transforms and fees remain reconstruction choices.

server/faction_insurance_test.go reproduces the missing scanner support before the change. It verifies Clan acceptance and Neutral/Omni rejection at the Federated scanner, all three affiliations at ICC, cold death and saved-return precedence, retained equipped/NoDrop items, and exactly-once collection of the same ordinary instance from each faction's reclaim. These are controlled level-ten fixtures, rather than earned progression evidence.

Two fresh WASM clients also save at the actual typed scanners through normal native right-click, displaying the insured message and retaining native stat 236 at cumulative XP 38650. Each controlled level-ten character then starts combat, stops its own attack and dies to the test NPC's retaliation. Native action 152 returns each to its saved city scanner with 1 HP/1 nano, while its original Monster Part moves to private reclaim. The Clan death and pending item additionally survive a cold server/WASM restart before collection.

Ordinary native walking reaches both admitted reclaim booths. Newland's direct line crosses a building; walking around it through [299,320], [320,320] and [318,303] reaches the actual booth. Native picking, right-click Use and left-click collection recover each exact instance once. The rendered private window and subsequent inventory agree with authoritative ownership. Both page reconnects retain those items, saved scanners, skills, XP/IP and wallets. Quiet health regeneration is allowed to advance. No combat-balance or earned level-ten progression claim follows from these fixtures.

The complete Go suite passes 1,744 roots and 17,097 test results. The focused insurance/reclaim/resurrection selection passes 42 roots and 136 results under the race detector; vet and the production build also pass. Final fresh-server and two-client WASM recovery, followed by both page reloads, retains both exact physical item/location rows and saved scanners. The native runs record no native/protocol exceptions. Their console-404 follow-up is identified separately as the optional /favicon.ico request in the earned-checkpoint reproduction.

The evidence and independent packet/state verifier are under local/faction-insurance/. An initial canal placement and a temporary driver's empty-inventory logging error are retained with their limits; the driver error occurs after the successful Clan return, and its saved database is used for the continuation. All test-owned browsers and servers are closed between runs.

Focused level-ten reachability and recovery

Controlled level-ten characters now walk from the original Tir Backyard 1 complex exit (3100 to 640) and Newland Backyard 1 exit (3060 to 566) to their selected city scanners. Native walking, twelve street waypoints and actual typed scanner Use pass, with native/server positions agreeing within 0.5 metres. Tir's route goes around the buildings and crosses the bridge at Z446; earlier approaches hit a building or the bridge railing. Another candidate entered an apartment: each accepted street waypoint checks its destination and city, because GameTest.walk deliberately returns on field changes. No collision, door, placement or production routing change was needed. The route capture and independent verifier are under local/faction-route/20261103-071814/ and local/faction-route/.

The route capture also completes Clan fatal retaliation and saved return. It stops before Neutral combat because the small encounter is below the viewport; this is not a complete combined recovery run. The maintained TestBrowserFactionInsuranceCheckpoint instead starts at controlled scanner checkpoints, using real turning and camera input to expose the encounter. It holds regeneration at 1HP/1nano and uses stationary level-one Leets with 100HP and landed rolls to isolate fatal retaliation. These are test encounters, not city spawn or combat-balance evidence.

Both characters save, initiate combat, die and return through exactly one native action99/action152/Resurrect sequence. Their worn Kinetic Axe remains equipped; each original Monster Part, 50-charge Treatment Laboratory and 100-round Energy Ammunition stack moves to private reclaim. Native walking reaches both original booths and collection restores those same six carried instances once, using ordinary availability deadlines. Both page reloads and a fresh server/two fresh WASM clients retain all eight physical instances, qualities, charges, raw skills, XP0/IP1500, 37-credit wallets and saved scanner IDs with cumulative insured XP38650. Independent SQL checks find exactly eight item rows and eight unique locations in both phase snapshots.

The focused WASM check passes in 242.26 seconds (189.46 warm, 52.80 cold), with ten error-free captures. The bounded transport ring rolls over in some traces; its separate lifecycle history retains all three critical packets per owner without drops. Evidence and SQLite snapshots are under local/faction-checkpoint/20261103-073313/, with the independent report at local/faction-checkpoint/verification.json. A cold-only input follow-up uses that actual warm database, opens both retained inventories and captures the rendered cities with their 50/100-charge icons. It passes in 36.83 seconds; evidence is under local/faction-cold-inventory/20261103-074437/. This resolves an initial cold capture taken while the loading overlay was still visible, without replaying travel or combat. The matching Go selection passes 17 roots and 74 results normally and under the race detector; vet also passes. Together with the existing Omni run and authored affiliation checks, these separate controlled route/recovery proofs establish reachable coverage for all three factions. They do not earn levels or supplies, establish a continuous Neutral playthrough, or resolve original fees, return transforms, resurrection resources or reclaim timing.

AO_GAME_TEST=1 go test ./server -run '^TestBrowserFactionInsuranceCheckpoint$' -count=1 -v

Native contract and server handling

The target is original anarchy-vanilla-14.9.1/kkr.dll, SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0.

Native SaveChar handler 0x100c1da0 calls the return-only 0x1010ba00; it does not itself establish a server save. Evidence: ev_11a25ebb03c8b0852645cbb663f0676bf07fd77593ef189a1571b25fa20f06ca. CharacterAction receiver 0x1007d640 routes to 0x1006fa30. Action 79 displays the native insured message for the local character and assigns stats 49 and 236 from identity B's two integers. Evidence: ev_a72f5fcc86874822b1b63307e5a87629672d3ba8de1270fbeb43fe2e0bf7cd44. The export is local/reports/insurance-1491-evidence.json; REA was closed before browser tests.

The server validates the current session, loaded/alive state, both player identities, Use command, target identity, playfield, authored SaveChar requirements and five-metre three-dimensional range. It uses the same GenericCmd sequence watermark as corpse use, so repeated or older commands cannot repeat an acknowledgement. The profile is saved atomically before live state changes or success packets. A failed write leaves the saved point unchanged and sends no success. Socket writes occur outside the shared state mutex.

A successful use completes GenericCmd and sends CharacterAction 79. Its last word now carries the saved cumulative XP into native stat 236. The preceding stat-49 word remains zero; its original time representation has not been recovered. Fees remain open; resurrection shock now applies the recovered native calculation. Private reclaim now handles ordinary inventory items from level 10 and prevents saving until all reclaim items are collected. Ordinary profile edits and teleports preserve the saved scanner. Unknown scanner identities in saved profiles fail loading rather than silently selecting another location.

Classic XP protection

insured_experience stores the cumulative XP protected by the last scanner save. It differs from experience, which stores progress within the current level. The editor and profile loader reject an insured total above current cumulative XP. Ordinary movement checkpoints do not write either progression field. Teleports, unrelated profile edits and reconnects preserve the snapshot.

The selected template 117665 explicitly protects characters below level 20. At level 20 and above, a death retains the greater of the scanner snapshot and the current level's lower cumulative boundary. The latter follows the shipped help's no-level-loss rule. IP and trained skills are retained. This implements classic XP loss without importing Shadowlands' recoverable XP pool.

The lower boundary protects a newly reached level even when the last scanner save was earlier. It does not automatically insure the kill's remainder above that boundary. Whether the original server also saved that remainder needs independent confirmation. The level-up and initial-state packets supply the effective saved-XP marker at or above the current level's lower boundary.

XP loss commits in the same death transaction as health, canceled nano reservations, removed temporary nanos and reclaim placements. Ignored writes and failed commits leave the complete outcome unchanged. Live XP and its saved-profile cache change only after commit. The owner then receives an absolute stat-52 update, producing the native loss feedback once; observers receive no private XP update. Resurrection and initialization do not replay it.

Verification

server/insurance_experience_test.go and server/insurance_experience_failure_test.go add 30 cases for scanner snapshots, level-19/20 protection, no-level-loss boundaries, native saved markers, private feedback, resurrection, output failure, concurrent uses, invalid editor values, checkpoint cadence, ignored/failed SQL writes, failed commits and retries. The death cases retain or remove their temporary nanos and reclaim items atomically with the XP outcome. The full Go suite, repeated focused race run and vet pass; logs are retained under local/insurance-xp-research/.

Two headed Chromium clients using the GPU tested the same published WASM against the single shared HTTPS preview. Native right-click insured 1000 of level 20's 15400 required XP. An administrative fixture then supplied 1500 progress; an actual Leet attack killed the player, and the native UI displayed one 500-XP loss before returning to the saved scanner with 1000 progress. An uninsured level-20 death removed 1500 progress without losing the level. A level-19 death retained all 1500 progress without a loss update. These are controlled XP/resource fixtures, not historical creature reward measurements.

The packet and SQLite comparisons, native snapshots, screenshots and owned fixture cleanup are retained under local/insurance-xp-smoke/. The independent observer received no private XP loss. Page reconnect retained the first saved outcome. The native insurance packet's stat-49 word stays zero throughout. After another real scanner save, a cold restart retained 1500 current-level progress and cumulative insured XP 140850. The restarted native Stats window showed EXP 1500/15400, without an award, loss or insurance replay. Twelve native and SQLite comparisons covered three actual deaths and three automatic native resurrection requests. Both browser error captures were empty. The two owned visitors and their encounter contributions were removed, with unrelated database rows preserved and foreign-key/integrity checks passing. The shared preview continues on the normal ports.

server/insurance_test.go covers native use followed by restart and death, preservation through ordinary teleport/profile updates, faction and range checks, invalid sessions/identities/actions, repeated concurrent uses, shared Use sequencing, failed persistence and unknown saved identities.

Two published WASM clients exercised the actual scanner. Right-click produced the expected GenericCmd target and native insured message; the profile retained the scanner through page reconnect and server restart. The fixture then moved both clients to [960.375, 16.5, 511.5] (observer one metre north) for a real encounter. The full-health 37 HP player hit the 100 HP profiled Leet once, stopped attacking and died to its retaliation. Native action 152 returned the player to the saved scanner at [918, 20.7, 578] with 1 HP/1 nano, without a page reload. The observer saw the old body disappear; the surviving Leet had 90 HP and no fight state. The observer's saved scanner remained unset.

After return, native walking reached [919.75, 20.1875, 578]; the client settled onto the local ground. The equipped axe and owned Monster Parts remained visible with the same identities. There were zero page errors and 15 expected connection-refused messages during intentional restart. No client adapter change was required. Test-owned browsers and the server were closed afterward.

local/insurance-smoke/verification.json and tmp_verify.py retain the packet, state and ownership checks. scanner-use-packets.log, encounter-packets.log, the saved/returned profile snapshots and per-step PNG/JSON files retain the native use, persistence, encounter and arrival evidence.

The full maintained suite, go test ./server/..., passed after these changes. Focused race checks also passed for TestInsurance, TestResurrection and TestLoot, including concurrent and shared-sequence requests.