aorecomp

Anarchy Online classic in the browser

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


docs/reclaim.md (18046B)


Reclaim after death

Level 10 and higher players now send ordinary inventory items to private reclaim storage when defeated in PvE. Equipment and NoDrop items stay with the player. Four selected original reclaim booths in Omni Entertainment, Tir and Newland support native use, contents, close/reopen and collection into the next free inventory slot. Ownership and availability survive reconnect and server restart.

Unsaved resurrection uses the affiliated training entrance. This does not add reclaim to training: the admitted booths are in the cities. Original Clan/ICC scanner and reclaim placements now share the same rules. The earned level-ten run verifies ordinary Omni travel, saved return and collection of all 24 exact bag instances, including charged supplies and the interrupted mission's bound key. The original street-level pair and its typed placement checks are described in street insurance. The Tir/Newland placements and authored scanner affiliation rules are recorded under Clan and ICC scanners.

The collection delay is provisionally 75 seconds from the killing blow. This uses the native DeadTimer fallback, not a recovered historical server timer. Uncollected items accumulate across deaths without expiry; each keeps its own availability time. Those repeated-death and retention policies are also provisional. XP insurance, uninsured/PvP corpse loot and backpacks are separate work. Resurrection shock applies the recovered native penalty and online recovery calculation.

Shipped rules and placement

The target is original anarchy-vanilla-14.9.1/kkr.dll, SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. Original addresses use base 0x10000000; generated C uses 0x36000000.

Fresh native evidence is exported in local/reports/reclaim-1491-evidence.json. Important records are:

Observation Evidence
Inventory cleanup ev_87f71e020ce431375897aaf4b4252a4941b273a5a0903c88c7dcafbbb5bc204d
NoDrop drop check ev_547b11d20dc910631449b1fb5632aae40248137f1549a6288d68d549f407dc9f
Level boundary ev_1b21acc396ea4989a9ac1e27ebab5fb938fd43da7c23b1a2356a09892e2d2de3
Booth Use ev_06f39d9fd1879e171e9c2d604df319f9c7708fa05d2892d92c23c979ecc06f39
Private inventory reader ev_78bdaa1170c391535fdb4e71f7ba9506978fd5044a6a8efd6b7c827eb342d9e4
Private inventory activation ev_2ee904fa8143419f5ef800199e974fc3ff4c69b8298f34bc7b530c86b22408b2
Native capacity bound ev_8a79ec83e7157a3eb923b942f4e96cff697bd171a48122cc9e4804e5dfccb3db
Close receiver ev_2246a9df35b3d8df1881e1e0f5dfff95176879777cac8b7bef8d0caed53fe059

Native wire contract

Right-click first sends GenericCmd Use (0x52526858) for the booth. Its successful acknowledgement schedules native Use through 0x10087a70, 0x1004ccc0 and 0x1004d780. Booth implementation 0x1009b260 then emits CharacterAction 109 with zero identity arguments. Closing an existing window follows the same Use path and emits CharacterAction 110. These actions carry no booth identity, so the server checks proximity to an admitted booth.

BankCorpseIIR_t, key 0x52213420, opens the private container. Reader 0x1007d1a0 delegates to proxy reader 0x101516d0 and inventory reader 0x1002dba0. Its payload starts with (entryCount + 1) * 1009, followed by 32-byte entries: slot, uint16 flags, uint16 count, item identity, low/high templates, quality and auxiliary value. Entries use flags 3, the actual item stack count and zero auxiliary value, as in the native corpse template-proxy transfer. A final uint32 supplies the private proxy instance, currently the owner's character ID. The envelope identifies that owner as type 50000.

Activation 0x1007d210 installs the proxy of type 57006 and opens its native window through 0x100530c0. The proxy constructor creates 100 slots; 0x1002db10 discards entries outside that bound. Each opening therefore shows at most 100 currently available items. Further items remain durable and can appear after collection and reopening. This bounds the native packet without claiming the original server's storage limit or overflow policy.

Left-clicking a displayed item sends ContainerAddItem, key 0x47537a24: source (106, windowSlot), destination owner (50000, playerID), and slot sentinel 111. The successful reply substitutes the chosen empty inventory slot, translated into the native 48..77 range. This removes the reclaim icon and adds the same item to inventory. CharacterAction 110 closes and unregisters the private window via 0x1005dc40 and 0x10053160.

Persistence and validation

The world database contains item records and each player's slot references and reclaim entries. Each reclaim entry references an item ID and records available_at. Properties live in the shared item record. The global last_id covers all locations, and loading rejects duplicate assignments within or across players. The item's old inventory slot is retained as metadata; collection selects a currently free slot. Repeated deaths can therefore retain items that occupied the same old slot without treating them as duplicates.

A lethal hit commits zero health, the inventory/reclaim transfer, ability-buff removal and any pending nano reservation refund together before publishing death. Instance ownership and original slot stay intact; reclaim changes only the placement's availability. Failed persistence logs the error, cancels the fight and leaves the player alive with the original items. Retrieval saves both sides in one SQLite transaction before its move reply. Full inventory, failed writes, repeated pickups and stale sessions keep the source unchanged. Ordinary grants, moves, deletion, equipment changes and corpse loot preserve pending reclaim entries.

Each open window retains a fixed mapping from its native slots to owned item IDs. Taking an item clears its mapping entry rather than shifting another item into the same slot. Duplicate opens do not replace that mapping. The server checks current loaded/alive session, actor and destination ownership, readiness, availability, open window and five-metre three-dimensional booth range. Reclaim messages are private to the requesting owner. State changes use the normal update/state lock order; packet sends occur after releasing the state mutex.

An otherwise eligible pickup refused for full inventory, pending equipment or active player trade sends CharacterAction 146 with page106 and the snapshot source slot. This cancels the pending native move and restores its source icon without reopening or replacing the window. The source is the fixed window index, including after an earlier slot has been collected; it is not the item's old inventory slot. No item or mapping changes on refusal, and a later pickup can retry the same source once space is available or the original equipment move or trade has ended. Refusal preserves the equipment move's identity, destination and deadline, or both participants' trade offers and acceptance state.

If an otherwise valid open-source pickup arrives after leaving booth range or changing playfield, the server clears its snapshot mapping, cancels the pending page106 move with146 and closes the native window with110. Ownership remains unchanged. Returning to a booth can open a fresh mapping of the same items.

Stale collected sources

A pickup for an already-collected snapshot slot previously received no reply, leaving its native source hidden. The server now sends source cancellation146 before current ReclaimIIR contents. The encoder omits cleared entries while retaining every remaining entry's original window slot. The stale refusal does not write ownership, allocate an item or report another successful transfer. Requests outside the authenticated open snapshot remain ignored.

TestReclaimStaleWithdrawalCancelsAndRefreshesWithoutWrites covers both a cleared slot and a still-mapped missing identity, with empty and nonempty remaining contents. Repeated requests preserve byte-identical storage, zero checkpoint writes, exact cold ownership and the remaining slot/flags/identity. TestBrowserStaleReclaimWithdrawal uses a controlled earlier collection into bank storage without refreshing the native reclaim view. Its real stale pickup is cancelled, the ghost disappears, and the original slot1 remains usable for same-window collection. Native page replay and cold loading retain banked1 and carried2 without duplication or cash changes. The fixture controls location, available reclaim and the missed refresh; it is not earned-death evidence. Captures are in local/stale-reclaim/, including the failing baseline and the 21-second passing check 20261103-193314/.

Verification

TestBrowserReclaimDuringPlayerTrade opens reclaim and then receives a normal trade request from a controlled nearby peer. Both native windows remain usable; reclaim pickup previously received no reply and hid its source. Cancellation restores the icon while the trade and both inventories remain unchanged. The peer cancels through the public trade handler, and same-window pickup then retains the exact item through native page replay and cold loading. This is controlled ownership evidence. TestReclaimPlayerTradeRestoresSourceWithoutChangingTerms also establishes a real item offer, 37-credit offer and one-sided acceptance, then checks unchanged terms/store bytes, private source cancellation, trade cancellation/reclaim retry and both participants' exact cold inventories/wallets. Accepted native captures: local/trade-reclaim/20261102-210650/. The current extended fixture also checks the collected part's refused deposit during another trade, same-page retry into its owned bag and page/cold recovery; see inventory refusals during trade.

TestBrowserReclaimDuringEquipment opens reclaim beside the original street booth, starts real axe placement and holds its server completion at a controlled checkpoint. After the local animation ends, native pickup previously received no reply and hid the reclaim icon. Cancellation restores the same open source without changing its mapping, either owned item or the original equipment move. Completing that move permits same-window pickup; both exact instances survive native page replay and cold loading. This is controlled ownership evidence. TestReclaimPendingEquipmentRestoresSourceForRetry also collects one entry before starting removal and verifies cancellation of the remaining nonzero window slot, byte-identical durable state, unchanged completion timer, retry and exact cold locations for all five instances. Accepted native captures: local/pending-reclaim/20261102-205841/.

TestBrowserReclaimPickupRefusal uses a controlled stale free-space view beside the original street-level reclaim booth. Unpublished filler grants reach the server's 30 ordinary slots before a real page106 pickup. Refusal restores the visible icon; banking one filler permits a second native request in the same window. The exact recovered part and all 30 fillers remain accounted for across native page replay and cold loading. This verifies the rejection path, without claiming earned progression or faction travel. A public-handler regression also collects one reclaim item before filling inventory and verifies cancellation of the still-open nonzero source slot; failed persistence retains its existing error path and publishes no success. The fixture also submits a real pickup from a stale booth view after a controlled authoritative position change. It verifies cancellation and closure, returns, reopens the same item and completes the full-inventory retry above. Separate distance/playfield regressions compare exact item-store bytes and cold ownership; this is failure-path coverage rather than ordinary travel evidence.

TestReclaimPreventsInsuranceUntilEmptied now checks pending/available reclaim, new and stale Use sequences, failure-then-Feedback64 ordering and unchanged live/cold ownership. TestReclaimCollectionPermitsInsurance collects the same instance through the normal handler and verifies durable saving afterward. Invalid-session, faction, range and identity checks with reclaim present receive no reclaim explanation. The refusal regression failed before the server fix.

TestBrowserScannerReclaimRefusal is a focused controlled fixture beside the street-level Omni pair. Two native right-click attempts for each of pending and available reclaim display the shipped message. Native collection recovers the same item, and the next scanner use saves cumulative XP 38650. The 30-second run had no client errors; screenshots and traces are retained under local/scanner-refusal/20261102-100943/. These fixtures do not establish earned progression or original server timing. The original catalog/lookup evidence is in local/scanner-refusal/; the exact activation bytes and wire registration are retained in docs/research-notes/player-trade-research/native/feedback.md.

server/reclaim_test.go covers the level 9/10 boundary, equipment/NoDrop retention, persisted delay, failed death saves, native private contents and pickup packets, restart, invalid sessions/identities/range, full inventory, failed pickup saves, concurrent/repeated pickup, stable window slots, inventory transaction preservation, pools larger than the native window and insurance rejection with unclaimed items. A native wire round trip exercises GenericCmd, CharacterAction 109/110 and page 106 pickup through normal server dispatch.

server/mission_key_reclaim_test.go checks an accepted key through lethal combat, cold pending reclaim, resurrection, collection/retry, another cold load, entry to its bound mission, exact-objective pickup and settlement/retry. The key and objective disappear only on successful completion; the unrelated item and single cash payment survive the final cold load. The related 31-root selection passes with 131 results; the new regression passes under race and vet passes.

Two published WASM clients exercised the shipped booth. A fixture supplied a level-10 player with equipped axe ID 1 (template 209283), ordinary Monster Parts ID 100 (42640), and NoDrop starter weapon ID 101 (121567). At the starter fight location the low-health player attacked the profiled Leet and died to its retaliation. Native resurrection returned to the saved scanner without a page reload. Only ID 100 entered reclaim; the other two items remained owned. The native death message displayed the 75-second fallback.

A native opening before the deadline showed an empty window while the pending item stayed in the saved inventory file. Server restart and browser reconnect retained its identity and deadline. After availability, the owner saw Monster Parts while the second player's private window stayed empty. Native left-click sent page 106 pickup and recovered the same ID 100 into logical slot 64; repeated empty-slot clicks did not create another copy. Another restart retained all three owned identities and an empty reclaim window. Screenshots also show the retained equipped weapon and both final inventory icons.

There were zero page errors and 30 connection-refused console messages during the two intentional restarts. No client adapter change was required. Test-owned browser contexts and servers were closed before the full Go checks. Evidence is under local/reclaim-death-smoke/: verification.json, tmp_verify.py, encounter-packets.log, retrieval-packets.log, saved pending/recovered inventory snapshots, and per-step PNG/JSON files. The earlier wire-only probe is under local/reclaim-smoke/.

The final maintained suite, go test ./server/..., passed. Focused race checks passed for TestReclaim, TestInsurance, TestResurrection, TestLoot and TestEquipment, including concurrent pickup and shared Use sequencing.