aorecomp

Anarchy Online classic in the browser

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


docs/gestures.md (8697B)


Native gestures and social commands

The original 14.9.1 client starts a gesture locally and sends SocialActionCmd (0x3b290771). The server completes that command for the owner and observers. No animation timer, social enum or pose is persisted or added to join snapshots; the native client controls playback, blending and completion.

Command format and completion

The native IIR prefix has three big-endian uint32 fields (key, subject type, subject ID) and a one-byte pass-on flag. The Go dispatcher expands pass-on to uint32. Its normalized handler body is exactly 28 bytes:

Offset Size Field
0 4 Key 0x3b290771
4 4 Subject type 50000
8 4 Sending character ID
12 4 Pass-on, incoming 1 and outgoing 0
16 4 Command verification, incoming 0 and accepted completion 1
20 4 Command reference
24 4 Social action enum

All multibyte fields are big endian. Native body length is 25 bytes, giving an outer packet length of 41, transmitted with padding to 44 bytes. The reference is an incrementing native command counter, not a constant or an execution-state flag. Preserve it verbatim, including zero and wraparound.

The native constructor adds each locally originated command reference to a pending list. Local activation starts its animation before server completion. A verification-1 completion for the matching local subject/reference removes that pending entry without starting the animation again. The same completion for a foreign subject performs the gesture. Consequently, silently omitting an owner acknowledgement leaks pending commands, while merely rebroadcasting verification 0 bypasses the native completion protocol.

Verification 2 removes a pending local reference without triggering social animation. The social local-execution function itself returns 2 on failure. Using that completion for a current but dead, unready, loading or swimming player is this server's rejection policy; the exact historical enum label and full original server policy have not been recovered.

The handler validates owned subject identity, pass-on 1, verification 0, exact length, the native enum range 1..63, and the authenticated current session. Accepted requests receive verification 1 at the owner and ready observers in the same playfield. A replaced session, malformed fields or unsupported enum cannot animate another player. Gestures do not change held movement, posture, combat or a pending nano cast, and cause no SQLite writes.

Authored animations and limits

The native name table contains 62 entries, including wave=61, ymca=62 and bow=9. Some names are internal aliases; the shipped cd_image/text/help/Social Moves Commands.txt and EmoteHelp.txt document player commands. The receiver accepts enum 63, but its usable resource and meaning remain unresolved. The handler follows the recovered numeric range without inventing a name or a special animation for it.

The sender explicitly refuses social commands while swimming (movement mode 4). The server applies the same physical-mode restriction, including commands processed after authoritative water entry. A refusal preserves the exact command reference and is sent only to the owner. Leaving water restores normal eligibility independently of retained rest posture. The broader swimming model remains in TODO; no additional threshold, gesture cooldown, posture restriction or combat restriction is inferred here.

The actor controller stores a social enum for the next update, clears it, and asks the native mesh to play the breed/sex-specific animation once. That field is a transient request, not the current animation. The recovered social path does not force standing or clear movement/combat state. Other renderer paths can blend or interrupt animations; the server does not duplicate those timers.

Source evidence

Original image bases are 0x10000000. Targets under anarchy-vanilla-14.9.1/:

Artifact SHA-256
kkr.dll a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0
llr.dll ebb09047f6ead192388f7ddfb4795da5013a60f7c2d1c3933ec02eef58a10132
bbr.dll 28f196f650edbb1573fb874ccaf7746453d3e4a183e1d86db1d790c1c32ecc2c

KKR sender is 0x1002b360; social constructor/reader/writer are 0x10084e20/0x10084fd0/0x10084fa0; local execution/completion are 0x10084ef0/0x10084f40; enum setter is 0x10050810. SimpleChar update consumes the enum at 0x1006f87c and plays it through 0x100185f0. Name registration is 0x100dda40. LLR base command constructor, activation and reader are 0x100167d0, 0x100168f0 and 0x100169c0.

The complete ledger, catalog and REA exports are in local/gesture-research/. Principal evidence IDs: ev_bbdccaa35219cb2606f05d80b1778b4e03b6fa3574022bee97a1cbdcc8b63ae1 (sender), ev_3c07ce549cf15ce70d6e3eb31b6af07a34f86f97a073acc6c615fbfdec1c402f (command lifecycle), and ev_2054f0aa439e8c96526ba055122930471aef5259efd1a795362645188b958e9e (reference allocation). These establish client behavior, not the original server's undisclosed acceptance policy.

Verification

server/social_actions_test.go covers native framing, captured TCP dispatch, owner completion, arbitrary references and repeated commands, enum boundaries, malformed and unauthorized requests, stale/dead/loading sessions, observer filtering, late joins, unchanged posture/held input/casting, and zero database writes through SQLite audit triggers.

server/social_swimming_test.go reproduces water entry through the public movement handler and original terrain/water geometry. Standing and seated swimmers receive verification 2 for references 0, 1 and 0xffffffff without observer relay, movement/resource changes or database writes. Public water exit restores acceptance while preserving rest posture. The original sender's physical-mode comparison is at kkr.dll 0x1002b39f, retained in client/game/kkr.dll/lifted-0016.c::sub_3602B360.

The focused WASM regression (server/browser_social_swimming_test.go and tools/client/test_social_swimming.mjs) sends actual /wave input while a controlled fixture withholds the server's water-mode publication. This models a late command from a client still viewing land, not natural shoreline travel. Before the fix the command received verification 1 and reached the observer; afterward it receives 2 privately, then a new land command receives 1 and reaches the observer once. Page reconnect replays no prior gesture, and cold loading retains resources and empty inventory. This does not claim that rejection cancels an animation already started locally. The 10.97-second fixed run and failing baseline are retained under local/social-swimming/. The focused social/water selection passes 22 roots and 61 results both normally and under the race detector; vet passes for all maintained Go packages.

Runtime evidence is retained under local/gesture-smoke/. Read-only native probes follow the actual mesh animation list and the pending-command list; they do not call guest functions or modify game memory. LLR's pending count is guest 0x3806eac8. QQR/LLR body probes and BBR FindAnim/IsAnimDone determine actor facing, animation resources, handles, loop count and raw integer time. An animation's started flag alone does not prove it remains active. Repeated commands can also restart an existing native handle, so distinct handles are not required for valid repetition.

Two hardware Chromium WASM clients verified repeated /wave, /bow, a seated wave, walking during a wave, final idle, an unsupported command and an observer reconnect. In this character's authored animation set, both clients played wave resource 13089 and bow resource 10153. A seated wave returned to seated idle resource 13591; walking used resource 10146 and then returned to standing idle. The server introduced no animation cancellation or posture change.

Five actual native requests used references 1..5. Each received one matching verification-1 completion at the owner and observer, and native pending-command counts stayed at zero after processing. A sampled single wave used one social animation handle per client, with no second owner playback after the reply. Late observers received no prior gesture. Page errors were empty. The checked report is local/gesture-smoke/verification.json.

The full Go server suite and focused social/movement/posture race checks pass, as does vet with the repository's existing stdversion exception. Test cleanup removed only players 33/34 and their four owned chat-history rows; all other database rows were unchanged and integrity/foreign-key checks passed. The published WASM artifact required no changes.