aorecomp

Anarchy Online classic in the browser

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


docs/team-chat.md (6998B)


Private team chat

Accepted team members receive a native Team channel over the separate chat connection. Messages reach connected teammates across playfields, including members who are dead, distant or still loading. Invitations do not grant access. A voluntary departure, kick or dissolution removes the affected channel; a leadership transfer keeps it. Authentication restores the channel for retained accepted membership after reconnect or server restart.

Use /g team message for one message, or /ch team to select Team before typing ordinary text. Ctrl+7 opens the original channel window. In this client /team is the world loot/help command; no /t chat alias was established by the audit. Removing a selected Team channel makes the native client select Vicinity.

Original client contract

Original DDR packet60 announces a group using GSID: five-byte group identity, BE16-length name, BE32 flags, and BE16-length blob. Packet61 removes a group using G. Client packet65 uses GSD; server packet65 uses GISD, inserting the authenticated sender's character ID before the text. Name packets20 precede message delivery. Group type2 selects native Team colors and sound behavior. The numeric group ID is opaque to the client; this server allocates it from the durable world team ID. The announced name is Team, flags are zero and the announcement blob is empty. Original server ID allocation and complete Team flag/blob policy remain unverified.

Shipped 14.9.1 tips/OnSelectPlayer.txt and tips/InvitedToATeam.txt explicitly establish private, location-independent Team chat. help/Chatting With Others.txt and help/ChatHelp.txt establish the channel commands. These are target-version resources, rather than later manuals.

Static evidence comes from original DDR SHA-256 3c937161de8f690351c3c08e158431417cee9ced77a41b677e7123b61a8c9883. REA records include outbound packet65 producer1009d240 ev_930c84e04acec31bc006bf9108f7e68976f684c31bc8c70eb6cef37ef9dbc9c1, group decoder100a6300 ev_83d52ecdc7b8c8d6f4f2527f3892c5e889c30e6336d1a841ae1a313020acca2b, Team discriminator10051720 ev_8da6617a1ee611927839ea27aa93f2452e2a3f60a2fa82ad781889dae65b41f6 and join/part dispatcher10007300 ev_30d81dee9e01261c5a7140bf5e64d21845f2e0337097bac9c6e3b0fcff2df6b7. The full bundle, instruction audits, PE checks and limitations are retained in local/team-chat-research/. These static queries do not claim observed original server execution.

Authorization and ordering

The server checks current authenticated chat/world association and accepted membership for every Team send. A fabricated or departed Team ID produces no delivery or history and leaves the connection usable; malformed packet bodies close the connection. This harmless handling of stale channel requests is a reconstruction policy, not an original denial-message claim.

One chat goroutine owns connections, buddy lists, names, credentials, world presence and announced Team membership. Zones publish values through its command channel; the chat owner never reads a remote character or waits for a zone. Committed roster changes carry revisions and update all affected chat memberships together. Older revisions cannot restore departed membership. Initialization, recipient selection, history and output queueing execute in the same order. A message can precede a departure or be excluded by it; it cannot reach that former member after the channel-part packet.

A separate mailbox accepts commands while the chat owner waits for SQLite. Network readers wait for their command to finish before submitting another; zone metadata publications return after admission. Vicinity selection runs in the sender's zone and passes recipient identities to chat. The connection waits for history and delivery outside the zone's command loop. Shutdown drains accepted commands before joining the owner and closing persistence. Socket writers retain their bounded output queues and never block simulation on a recipient's network connection.

Scrollback uses the existing per-owner history. Only the sender and selected connected recipients receive copies, committed together. New members and offline members do not inherit messages they never received. The existing two-minute browser transport grace keeps its game/chat connection alive and queues output; closing a tab briefly is therefore not a completed session disconnect. A former member can retain their own earlier history. History failure preserves the existing best-effort chat delivery behavior. History replay, disconnect retention duration, flood policy, preference enforcement and historical Team flags remain independent policy questions; this change does not establish their original rules.

Verification

Protocol tests drive authenticated chat connections and public team actions. They check accepted-only announcements, decline and SQL failure, cross-zone privacy, exact native join/part/message fields, Windows-1252 text, malformed messages, forged/stale IDs, leadership transfer, kick, dissolution, new team IDs, restart history and no inherited history for new/offline members. Concurrent message/departure tests check packet order against the received history copies. Additional eligibility tests cover dead, distant, loading and offline members. Ownership regressions hold both zone owners and the root simulation mutex while cross-zone team chat and buddy updates complete. Other checks hold SQLite while movement and metadata publication continue, including movement in the same zone as a pending vicinity message. Production startup and entrypoints now use these owners; startup partitioning and shutdown have separate regression coverage.

The retained protocol and browser evidence below predates the ownership refactor; its full Go suite passed in 299 seconds. All chat/team tests passed twice under the race detector in 144 seconds; the completed Team-chat cases passed twice under the race detector in 117 seconds. Logs are retained alongside the evidence.

A guarded native held-button test also verifies Kick: both members lose their Team channels when the pair dissolves, and the victim displays the native kick feedback. local/input-timing-research/native-timing-held-final.json records 16-18ms AAR deltas, the RightPress/event351 binding and an icon menu that stays open through the hold transition. Original CCR timing remains unchanged. The cause of earlier missing popups remains unproven; the separate browser wakeup correction is not claimed as that cause. Faster scripted typing also lost the first slash after load; separated native key actions supplied the successful command checks, and failed vicinity attempts are excluded from the private-delivery assertions.

local/team-chat-research/verification.json records the native/wire/privacy checks and item conservation. The test roster was dissolved, original profiles restored and owned browser contexts closed. The shared LAN preview remains on HTTPS 8443.