aorecomp

Anarchy Online classic in the browser

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


docs/remote-bank.md (8788B)


Remote bank access

Briefcase of Holding (205736, QL100) opens the owner's normal 102-slot bank from ordinary inventory or a carried backpack. The server checks Bureaucrat, effective Psychology >=300, title level >=4 and no combat. It sends native GenericCmd Use success followed by the existing BankIIR and banked Chest updates. No item, charge, credit or nano cost is authored for this use.

The terminal and portable item share one bank-opening implementation. Both anchor the session at the player's current position and use the existing five-metre locality, ownership, transfer, Unique and persistence rules described in bank storage. A newer repeated Use sends a fresh snapshot; an already processed sequence does nothing. Opening does not change the Briefcase's instance, count or location.

Original evidence

Original 14.9.1 resource 1000020:205736, offset 566865480, contains a 1309-byte payload with SHA-256 27472718879a9ad49bbb8adbb421f22d713b34110190b0d5805a6e46d2c1746e. Its decoded authored Use3 requirements are:

Stat Predicate
Profession 60 ==8, Bureaucrat
Psychology 162 >299
TitleLevel 37 >3
IsFightingMe 410 ==0

The OnUse function is 53092, OpenBank, targeting User with no arguments, one tick and no interval. Only this item and terminal 116807 have that function in the decoded target-era catalog. The record has neither Eat nor UseEmptyDestruct. Its weapon attack/recharge/equip delays and OnHit effects are separate events; they do not establish a bank-use timer. Psychology uses the original 50% Intelligence / 50% Sense ability weights. The server includes ability trickle and supported equipment modifiers when checking the boundary.

Original KKR SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0 establishes the client path:

Original DDR SHA-256 3c937161de8f690351c3c08e158431417cee9ced77a41b677e7123b61a8c9883 toolbar producer 0x10078f90 calls builder 0x10078320, whose page107 branch clears the destination shortcut. The native toolbar therefore does not provide a bag-content shortcut; no client change bypasses that behavior.

Retained research is in local/remote-bank-research/: content/ holds exact resource bytes and parser identities, native/ holds the original KKR snapshot and 46 validated citations, and shortcut/ holds the DDR snapshot and 10 validated citations. The modern AO Universe guide corroborates inventory/backpack use but postdates the target version; the original resources and procedures establish the implementation here.

Policy boundaries and remaining work

The server requires a known handle, an actually carried portable container and a matching child slot. A stale handle to a banked or foreign bag cannot open the bank. These ownership checks are server policy; static client evidence does not observe an original server accepting crafted requests.

Stat410's original name is IsFightingMe / Number of fighting opponents. The implementation uses the server's existing incoming-or-outgoing combat predicate. The original producer and expiry of that state, original-server repeat policy and the bank's lifetime after source removal remain unresolved.

Wielded page101 Use, equipment and normal attacks are implemented through the shared weapon rules. Its Equip8 predicate lacks the Use3 combat restriction, so those events stay distinct. General combat equipment changes still use the existing combat-swap policy. Specials and OnHit effects remain explicit TODOs.

Stale contained Use

A known carried backpack can retain an old native child after an earlier transfer commits without its contents refresh. The server previously consumed the new Use sequence but returned without completing it when that child slot was empty. A valid page107 position now receives failure2 with its exact command sequence and packed source. CharacterAction112 then clears only that empty cached child row, removing its stale icon while retaining other items. An empty BackpackIIR snapshot alone leaves the native child cached. Closed handles stay closed. Unknown handles, out-of-range child slots and non-carried bags retain their ownership guards.

TestStaleContainedUseCompletesAndClearsOnlyEmptyOwnedSources covers both child boundaries, duplicate sequences, open/closed handles, unknown handles and the first invalid slot. It checks exact ordered replies, unchanged sessions, zero checkpoint writes, byte-identical item storage and cold ownership. A later valid Use opens the bank through the retained Briefcase. The existing unavailable source regression also requires clearing only the empty slot while retaining the real child in another slot, without reporting successful bank Use.

TestBrowserStaleContainedUse isolates an earlier bag-to-bag transfer with a controlled level100 Bureaucrat and sufficient Psychology. A real native right-click reproduces the unanswered command. Completion and row clearing then remove the old icon; the same page opens the real destination and uses that exact Briefcase to open the bank. Page replay and a fresh Go database reader retain both bags and the Briefcase without new allocation or consumption. Captures are retained under local/stale-contained-use/. This is controlled protocol/ownership evidence, separate from earned acquisition and original-server lost-publication policy. The initial missing-completion run fails in19.18seconds; a contents-only correction still leaves the ghost. Explicit row clearing passes in14.71seconds. The final focused Go and race selections each pass11roots/54results, with vet and driver syntax checks passing. Exact reply/clear ordering, the empty native row, later accepted Use and unchanged ledger are independently checked in local/stale-contained-use/verification.json.

Verification

Automated tests exercise exact Psychology/title boundaries, ability trickle, profession, incoming/outgoing combat, known open/closed bags, unavailable and banked sources, invalid actors/sessions, replay, repeated opening, close/reopen and durable transfers. A real world connection opens a bag, closes its window and successfully uses the Briefcase through the retained page107 handle.

Hardware WASM testing used Chromium with GPU OpenGL4.5, away from any terminal. Native right-clicks showed profession, title and skill rejection messages locally; these failures sent no Use request. Successful ordinary and bag uses received Use success and BankIIR, with capacity102 and occupied slot101 verified in native memory. Repeated use consumed nothing. A filled backpack was withdrawn, opened with its child still in slot20, and redeposited; a three-unit stack was withdrawn and redeposited intact. Movement closed the window and sent action106. A fresh Use reopened it, and browser reconnect preserved every item and allowed bag use again. The attempted bag-content toolbar shortcut remained empty, matching the original DDR branch.

SQLite and native-memory checks preserve all six fixture instances, quantities and child placements, with no new instance allocation. Browser/adapter errors were empty. Evidence is retained in local/remote-bank-smoke/verification.json, wire captures, screenshots and SQLite/native snapshots. Fixtures are removed after testing while the shared LAN preview remains available.

The full go test ./server/... suite and two repeated race runs of remote bank, bank, backpack, inventory, reload and item-store tests pass. Vet passes with -stdversion=false; the declared Go version versus existing WaitGroup.Go usage remains a separate TODO. Logs are in local/remote-bank-research/.