====== ANet BBS — Architecture ====== ANet follows a **modular, event-driven architecture** built on Python’s asyncio framework. ---- ===== High-Level Design ===== * One asyncio event loop * One coroutine per connected user (node) * No threads * Non-blocking I/O everywhere ---- ===== Core Components ===== ^ Component ^ Description ^ | server/telnet.py | TCP listener + Telnet IAC handling | | server/session.py | Per-user state machine | | server/terminal.py | MCI → ANSI rendering engine | | server/database.py | SQLite access layer | | sysop/main.py | PyQt6 SysOp Control Panel | ---- ===== Session Model ===== Each user connection creates a **BBSSession** coroutine: * CONNECT * LOGIN (handle/password) * MAIN MENU * COMMAND LOOP * LOGOFF State transitions are explicit and readable. ---- ===== Text Rendering ===== ANet supports **CNet-style MCI escape codes** using `\x19` as a control prefix. Examples: * `\x19n1` → New line * `\x19c6` → ANSI cyan * `\x19hc` → Clear screen This allows reuse of original `bbstext.txt` files. ----