aorecomp

Anarchy Online classic in the browser

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


docs/research-notes/player-trade-research/native/cash-consent.md (6003B)


Cash field Enter, Accept, and consent

Read-only follow-up from existing native evidence and lifted source. No source edits, tests, runtime sessions, or REA lifecycle calls were made. The parent performed the cited two-client runtime experiment independently.

Result

The parent's observation matches the original client path: Enter commits the cash field locally; ACCEPT sends Cash6 and then Accept1. Enter's configured handler does not send Cash6. The previous recommendation to freeze BOTH sides' cash immediately after either Accept therefore prevents ordinary two-sided cash offers, because the other player's first Cash6 may only arrive with their Accept. This is a server policy issue, not evidence of a WASM Enter regression.

EER event0x16d is AbortTradeMessage at original10003480. It receives a boolean and calls TradeAbort. It is unrelated to setting cash.

Native field event path

DDR TradeView constructor100479c0 builds TextInput configuration with:

The adjacent configuration value2 is not the flags field. Exact source is client/game/ddr.dll/lifted-0018.c:5210, instructions2b047f2e..2b047f56. Existing REA evidence is ev_e80c5381d39b65a7616e28888f4b02fe7d9dbfaa12bd76ee413104d34a9549a6 in ddr-evidence.json, with copied constructor ddr-build-0x100479c0.c.txt.

CCR TextInput constructor original1001e660 copies module/event into object +0x30/+0x34 and flags into+0x44. The focused TextInputModule's TerminateTextMessage1001e060 tailcalls focused input SendText1001f3e0. SendText sees flags0x10 and invokes configured AFCM module/event without the string payload. Flags0xbc includes bit4, so it retains the field text afterward.

These CCR steps are source observations, not fresh original-binary REA evidence:

tmp_ccr_exports.py decodes the export table from existing generated source client/data/ccr_dll.c and resolves these exact symbol names/RVAs. It does not read a new native artifact or create a REA session. The final OS-key-to-AFCM0x49 binding was not independently recovered in this bounded source pass.

DDR TradeViewModule constructor10049170 registers SetCashMessage10049410 for event0x16e. SetCashMessage directly calls10049090. That helper:

  1. Reads current cash stat61 through N3InterfaceModule.
  2. Parses TextInput string usingatoi and caps above available cash.
  3. Stores the result at TradeView+a0.
  4. Emits AFCM module3/event0x97 to redraw.

It makes no network call. The retained evidence is ev_c377df0a78b0a09634426321e7c2edd319bad2630359ebf2582069822a6b2017 and ev_14ec02170beb079a5d02c4fd0900fa29e4fbf2ad9cc7b1f22a080eb443932971. Extracts: ddr-0x10049170.c.txt, ddr-0x10049410.c.txt, ddr-0x10049090.c.txt.

Native Accept path

DDR10048870 unconditionally first calls10049090 again, then invokes N3InterfaceModule::N3Msg_TradeSetCash(view+a0). It subsequently emits module9/event0x16c once per session, which EER100034c0 forwards to KKR Accept1. Therefore even clicking ACCEPT without pressing Enter first picks up the latest field text; clicking ACCEPT again still sends Cash6 before the one-shot check.

Evidence: ev_54f573e7f808a88dcbfa7bd04148f5d080b9b5e15b33b89b502baa39c4dea19f and ev_d0d0fa19d74c314b98b189846115599eb982a78f62a06cd773e166e8cbba81c8. Extracts: ddr-controls-0x10048870.c.txt, eer-0x10003480.c.txt, eer-0x100034c0.c.txt. EER registration is in client/game/eer.dll/lifted-0000.c:512 for Abort0x16d; Accept0x16c is nearby.

KKR Cash6 producer100200d0 packs first=(0,signedCash), second=(0,0). There is no separate cash finalization stage or trade revision in this packet.

Browser keyboard source boundary

The current window adapter maps SDL_RETURN to VK13/scan28 and keypad Enter to VK13/extended scan0x11c. KEYDOWN/KEYUP become WM_KEYDOWN/UP. TranslateMessage uses key_character, which returns13 for unmodified Enter, then queues WM_CHAR 0x102 preserving the original key flags. See client/runtime/linux_window.c around938,1065,1243 and1287.

client/browser/index.html around910 only intercepts an open HTML menu/chat, Tab focus capture, and explicit keypad forwarding. Ordinary Enter with game canvas focus has no suppression branch. Keypad Enter is forwarded to browser_input_key. Existing browser_camera.c test around305 checks Enter down/up queue ordering; character translation is separately exercised around196. These existing tests were read, not rerun in this worker. No live evidence here proves delivery of a specific Enter press, but the absent Cash6 is expected even when Enter succeeds.

Historical server behavior remains unresolved. The original native Accept callback still provides one-shot UI acceptance, and no second trade-specific confirmation stage was found. Generic server-driven questions were not exhaustively excluded. Later2009 descriptions alone cannot require a14.9.1 confirmation box or justify inventing additional TradeIIR actions.

The parent selected this implementation policy, explicitly inference: freeze an accepted actor's own promise, while allowing the still-unaccepted actor to add items or increase cash after peer acceptance. Reductions after peer acceptance are rejected/cancelled. This admits the ordinary initial0->positive Cash6 on their Accept without reducing what the already-accepted peer saw. Admission, Unique checks and destination capacity still apply to additions. Changes making a previously accepted basket worse need cancel/restart or a separately established confirmation protocol. Merely clearing server acceptance cannot obtain another native Accept from the one-shot UI.