# Original BN Online Server — Extracted Documentation

Searchable subsystem-keyed documentation of the BNO 5-4 server engine, extracted from `BN Online Master 5-4.gmd` via Phase 1 plan 01-04.

## Start here by task

| Task | Read |
|------|------|
| **CLI-08** — "How do two players walk + chat?" (Phase 6 MVP gate) | [chat](chat.md) → [room-management](room-management.md) → [packet-protocol](packet-protocol.md) → [client-server-bridge](client-server-bridge.md) |
| **SRV-01 / SRV-02 / SRV-03** — "How do I implement the wire protocol?" (Phase 4) | [packet-protocol](packet-protocol.md) → [protocol.md](protocol.md) → [protocol.json](protocol.json) → [../../decomp/wiki/08-39dll-networking](../../decomp/wiki/08-39dll-networking.md) |
| **SRV-09 / SRV-10 / SRV-11** — "How do I migrate auth from `localList.txt` to argon2id?" (Phase 4) | [account-auth](account-auth.md) → [save-formats](save-formats.md) → [../adr/0002-persistence-layer.md](../adr/0002-persistence-layer.md) |
| **SRV-04 / SRV-05** — "How does the original tick + room model work?" | [world-simulation](world-simulation.md) → [room-management](room-management.md) |
| **SRV-06 / SRV-07** — "Where is per-player state persisted?" | [persistence](persistence.md) → [save-formats](save-formats.md) |
| **PAR-02** — "What's left for full parity past CLI-08?" (Phase 7) | [parity-checklist](parity-checklist.md) → [message-board](message-board.md) → [admin-anti-port](admin-anti-port.md) |
| **PAR-07** — "How do I implement the admin web UI?" (Phase 7) | [admin-anti-port](admin-anti-port.md) → [CLAUDE.md hard rule #3](../../CLAUDE.md) |
| **Phase 5 RESTORE** — "How does the credential staging table work in disaster recovery?" | [account-auth](account-auth.md) §"Plaintext credentials staging path" → [persistence](persistence.md) §"Crash-loss surface" |
| "Are there unresolved server-side DnD actions?" | [unknown-actions-status](unknown-actions-status.md) (status: drained per Phase 1) |
| "Which assets are in the server tree?" | [asset-catalog/index.md](asset-catalog/index.md) |

## Convention

Cross-refs use relative `.md` links. Per Phase 1 D-19 thin-wrapper pattern: where the `decomp/wiki/` already covers a topic (39dll, GML core functions, save-format file binding), this tree links into the wiki rather than duplicating it.

Each subsystem MD carries YAML front-matter with `mvp: yes | no` (D-04) tagging features required for the CLI-08 MVP gate. Phase 6 client work + Phase 4 server work cherry-pick `mvp: yes` features without re-reading the full server tree.

Generated tables under `<!-- AUTOGEN:NAME:start ... -->` markers are produced by `tools/asset-catalog`. Do not hand-edit; re-run `pnpm catalog:server` to refresh.

## Generation pipeline

```
extracted/server-5-4/  ──►  tools/asset-catalog (loadExtracted → buildCrossRefIndex → buildCatalog)
                                    │
                                    ├──►  asset-catalog/index.{json,md}  (mechanical inventory; D-06 three-tier)
                                    │
                                    └──►  AUTOGEN-block rewrites in subsystem MDs (driven by SUBSYSTEM-MAP.json)
                                                │
                                                └──►  account-auth.md, world-simulation.md, ...
                                                        (hand-authored prose preserved across re-runs)
```

`pnpm catalog:server` regenerates everything in one pass. `pnpm catalog:verify:server` and `node tools/asset-catalog/scripts/lint-subsystem-mds.mjs docs/extracted-server` are the CI guards.

## Subsystem index

| Subsystem | mvp | One-liner |
|-----------|-----|-----------|
| [account-auth](account-auth.md) | yes | Login, user-init, plaintext-credential staging migration into argon2id |
| [world-simulation](world-simulation.md) | yes | Single-threaded GM step-event tick; `0349-operations` dispatcher; `p_*[pid]` parallel arrays |
| [room-management](room-management.md) | yes | Room transitions (opcode 1); area-vs-room distinction; `ac_*` area-change objects |
| [chat](chat.md) | yes | Area-scoped opcode-4 broadcast; benign backtick commands; chat scrollback |
| [persistence](persistence.md) | yes | Per-event + scheduled `.bno`/`.bnb`/`.bnu` writes; crash-loss surface; ADR-0002 forward-link |
| [packet-protocol](packet-protocol.md) | (n/a) | 39dll narrative companion to protocol.json — buffer-build pattern, dispatcher shape, wire invariants |
| [admin-anti-port](admin-anti-port.md) | no | REJECTED-AS-PORTED reference; 7 modernized typed admin intents; opcode 12 deletion |
| [client-server-bridge](client-server-bridge.md) | yes | Rosetta stone: client-emit ↔ server-handle opcode mapping for the CLI-08 MVP slice |
| [message-board](message-board.md) | no | `MB_Log.bnb` topic/reply lifecycle; PAR-scope only |
| [unknown-actions-status](unknown-actions-status.md) | n/a | DnD action ID resolution status (drained — no UNKNOWN-ACTIONS.md emitted) |

## Phase wiring

| Phase | Reads from this tree |
|-------|---------------------|
| **Phase 4 (server rebuild)** | [packet-protocol.md](packet-protocol.md) + [protocol.md](protocol.md) for opcode shapes; [account-auth.md](account-auth.md) + [persistence.md](persistence.md) for migration; [world-simulation.md](world-simulation.md) for tick model |
| **Phase 5 (deploy)** | [persistence.md](persistence.md) for crash-loss surface (Litestream answer); [account-auth.md](account-auth.md) staging-table for the read-once-then-purge step |
| **Phase 6 (client rebuild + CLI-08)** | [client-server-bridge.md](client-server-bridge.md) + [chat.md](chat.md) + [room-management.md](room-management.md); avoids re-reading 11 files by having SUBSYSTEM-MAP partition the codebase |
| **Phase 7 (full parity + admin UI)** | [admin-anti-port.md](admin-anti-port.md) for the typed admin intents; [message-board.md](message-board.md) + [parity-checklist.md](parity-checklist.md) for PAR scope |
