/Users/thiagobelem/tmp/mud-analysis/CircleMUD/src/telnet.h- Standard telnet header/Users/thiagobelem/tmp/mud-analysis/CircleMUD/src/comm.c- Communication/network layer
Standard telnet options defined in telnet.h (lines 82-122):
- TELOPT_BINARY (0) - 8-bit data path
- TELOPT_ECHO (1) - Echo control
- TELOPT_SGA (3) - Suppress Go Ahead
- TELOPT_NAWS (31) - Negotiate About Window Size
- TELOPT_TTYPE (24) - Terminal Type
- TELOPT_LINEMODE (34) - Linemode option
- TELOPT_LFLOW (33) - Remote flow control
- TELOPT_TSPEED (32) - Terminal speed
- TELOPT_AUTHENTICATION (37)
- TELOPT_ENCRYPT (38)
- TELOPT_NEW_ENVIRON (39)
- And 33+ other standard telnet options
- NONE - No evidence of GMCP, MSDP, MSSP, MCCP, MXP, or ATCP support
- Uses standard BSD telnet header definitions (lines 42-72 of telnet.h)
- Manual telnet negotiation with IAC (Interpret As Command) codes
- Echo control functions: echo_off() and echo_on() in comm.c (lines 955-983)
- Simple DO/WILL/WONT negotiation
- No compression, no out-of-band protocols
- Minimal telnet implementation (bootstrap approach)
- Focuses on basic echo control for password entry
- All protocol handling manual/hardcoded in comm.c
- No subcommand negotiation for advanced features
/Users/thiagobelem/tmp/mud-analysis/DikuMUD2/dm-dist-ii/protocol.h- Protocol definitions/Users/thiagobelem/tmp/mud-analysis/DikuMUD2/dm-dist-ii/protocol.c- Protocol implementation/Users/thiagobelem/tmp/mud-analysis/DikuMUD2/dm-dist-ii/comm.c- Network layer
Custom protocol.h defines custom terminal control scheme:
- TERM_DUMB, TERM_TTY, TERM_ANSI, TERM_VT100, TERM_INTERNAL
- Width/height negotiation
- Echo control (CONTROL_ECHO_OFF, CONTROL_ECHO_ON)
- Custom color codes using escape sequences
- Terminal type tracking
- NONE - No GMCP, MSDP, MSSP, MCCP, MXP, or ATCP support
- Custom protocol wrapper around basic telnet
- struct terminal_setup_type tracks client capabilities (lines 46-54)
- Custom color mapping system (CONTROL_FG_, CONTROL_BG_)
- Multi-connection protocol support with unique frame markers
- Protocol messages for setup, text, host info, etc.
- Custom protocol layer on top of telnet (not standard telnet negotiation)
- Proprietary client required for full feature support
- Terminal type detection built-in
- No compression or advanced OOB protocols
/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/telnet.py- Main telnet protocol/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/telnet_oob.py- Out-of-band protocols/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/mccp.py- MCCP v2 compression/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/mssp.py- Server status protocol/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/mxp.py- MUD eXtension Protocol/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/naws.py- Window size negotiation/Users/thiagobelem/tmp/mud-analysis/Evennia/evennia/server/portal/ttype.py- Terminal type detection
From telnet.py imports and usage:
- ECHO (line 14) - Echo control
- GA (line 15) - Go Ahead
- IAC (line 16) - Interpret As Command
- LINEMODE (lines 17-20) with MODE_EDIT, LINEMODE_TRAPSIG
- WILL/WONT (lines 23-24)
- NULL (line 22)
- NOP (line 21)
- NAWS (line 34, naws.py line 18) - Negotiate About Window Size
- TTYPE (line 31, ttype.py line 18) - Terminal Type
-
MCCP (v2) - Mud Client Compression Protocol
- File: mccp.py, line 22: MCCP = bytes([86])
- Zlib-based compression (lines 26-39)
- Reduces bandwidth by 70-90%
- Negotiated via WILL/WONT (line 64)
-
MSSP - Mud Server Status Protocol
- File: mssp.py, line 20: MSSP = bytes([70])
- Server metadata: NAME, PLAYERS, UPTIME, PORT, CODEBASE (lines 88-113)
- Includes: ANSI, GMCP, MCCP, MSDP, MXP, SSL, UTF-8, VT100, XTERM256 support flags
- Designed for web crawlers and listing portals
-
GMCP - Generic Mud Communication Protocol
- File: telnet_oob.py, line 47: GMCP = bytes([201])
- Supports all core GMCP commands (lines 106-150 of CMProtocols)
- Commands: core., char., room., comm., client.*, etc.
- Uses JSON for structured data (line 27)
-
MSDP - Mud Server Data Protocol
- File: telnet_oob.py, lines 37-44: MSDP = bytes([69])
- MSDP_VAR, MSDP_VAL, MSDP_TABLE_OPEN/CLOSE, MSDP_ARRAY_OPEN/CLOSE
- Structured variable-value protocol
-
MXP - Mud eXtension Protocol
- File: mxp.py, line 26: MXP = bytes([91])
- Partial implementation (SEND tag only, line 8)
- Supports MXP_TEMPSECURE mode (line 28)
- SEND and URL parsing (lines 22-23)
- Configurable via MXP_ENABLED setting (line 67)
-
TTYPE - Terminal Type Detection (MTTS)
- File: ttype.py, line 18: TTYPE = bytes([24])
- MTTS bitstring capabilities (lines 23-36)
- Supports: ANSI, VT100, UTF-8, XTERM256, TRUECOLOR, PROXY, SCREENREADER, etc.
- Multi-step negotiation (lines 107-199)
- Client fingerprinting (Mudlet, CMUD, Mushclient, etc.)
- Uses Twisted framework's telnet support as base (line 13)
- Protocol flags dictionary tracks negotiated capabilities
- Callback system for feature negotiation (addCallbacks pattern)
- Negotiation map for protocol-specific handlers
- Silent flag propagation system
- OOB protocols check handshake_done() gates
- Modular protocol system with separate classes per feature
- Modern Python with async/await via Twisted
- Configuration-driven feature enablement
- Extensible protocol_flags dictionary
- Proper RFC/standard compliance
/Users/thiagobelem/tmp/mud-analysis/CoffeeMud/com/planet_ink/coffee_mud/Libraries/CMProtocols.java- Protocol library/Users/thiagobelem/tmp/mud-analysis/CoffeeMud/com/planet_ink/coffee_mud/Libraries/interfaces/TelnetFilter.java- Telnet filtering
Not explicitly documented in visible source, but filtering suggests standard telnet with:
- Color code handling
- MXP tag support
- MSP (Mud Sound Protocol) support (line 77)
- Text filtering and word wrapping
- Escape sequence handling
-
GMCP - Generic Mud Communication Protocol
- File: CMProtocols.java, line 106: enum GMCPCommand
- Core 50+ commands including:
- core_hello, core_supports_*, core_keepalive, core_ping, core_goodbye
- char_login, char_vitals, char_statusvars, char_status, char_base, char_maxstats, char_worth
- char_items_*, char_skills_get, char_effects_get
- room_info, room_exits, room_items_*, room_mobiles, room_players
- comm_channel, comm_channel_players
- group, request_*, maplevel, client, external_discord_hello
- Full enum definition (lines 106-151)
-
MXP - Mud eXtension Protocol
- File: CMProtocols.java: mxp() method (lines 75-82)
- Image support with getHashedMXPImage, getDefaultMXPImage
- MXP image path configuration (MXPIMAGEPATH setting)
- Can be disabled via CMSecurity flags (line 77)
-
MSP - Mud Sound Protocol
- File: CMProtocols.java, line 75: msp() method
- Format: !!SOUND(soundName V=volume P=priority U=url)
- Configurable sound path (MSPPATH setting, line 79)
- Volume and priority support
-
MCP - Multi-User Dungeon Client Protocol
- File: CMProtocols.java: MCP parsing (lines 85-300+)
- Full state machine parser: McpParseStartState enum
- Key-value pair parsing with quoted values
- Multi-line command support
- Star-tag support for extensibility
From TelnetFilter.java:
- fullOutFilter - Complete output processing (MXP, MSP, word wrap, colors)
- simpleOutFilter - Minimal processing (escapes only)
- colorOnlyFilter - Color codes with MXP
- mxpSafetyFilter - MXP tag safety
- wrapOnlyFilter - Word wrap only
- simpleInFilter/fullInFilter - Input safety filtering
- CMProtocols extends StdLibrary (line 61)
- Modular filtering system for input/output
- Pronoun tag substitution system
- Comprehensive MXP image management
- MCP parser with full state machine (McpParseStartState)
- GMCP command enum for type-safe handling
- Comprehensive MUD protocol support (MXP, MSP, MCP, GMCP)
- Java-based with strong typing and enums
- Modular filter system for text processing
- Configuration-driven feature enablement
- Professional-grade implementation
| Protocol | CircleMUD | DikuMUD2 | Evennia | CoffeeMud |
|---|---|---|---|---|
| ECHO | YES | NO | YES | YES (implicit) |
| SGA | YES | NO | YES | YES (implicit) |
| NAWS | YES (defined) | Custom | YES | NO |
| TTYPE | YES (defined) | Custom | YES | NO |
| GMCP | NO | NO | YES | YES |
| MSDP | NO | NO | YES | Partial (GMCP only) |
| MSSP | NO | NO | YES | NO |
| MCCP | NO | NO | YES | NO |
| MXP | NO | NO | YES | YES |
| MSP | NO | NO | NO | YES |
| MCP | NO | NO | NO | YES |
| Compression | NO | NO | YES (zlib) | NO |
CircleMUD: Minimal, bootstrap implementation
- Defines all standard telnet options but doesn't implement most
- Only uses ECHO negotiation in practice
- No MUD-specific protocols
- Hardcoded manual negotiation
DikuMUD2: Custom proprietary protocol
- Replaces standard telnet with custom wire protocol
- Terminal type tracking built-in
- Color mapping system
- Requires custom client implementation
- No standard telnet negotiation
Evennia: Modern, comprehensive, modular
- Full RFC compliance for all supported protocols
- Modular architecture: separate class per protocol
- Configuration-driven enablement
- Strong encapsulation with negotiation gates
- Uses modern async (Twisted) framework
- Best for standardized client support
CoffeeMud: Professional, feature-rich
- Comprehensive MUD protocol ecosystem (MCP, GMCP, MXP, MSP)
- Type-safe enum-based approach
- State machine parser for complex protocols
- Integrated filtering system
- Best for rich client features and extensibility
-
Standard Telnet is Minimal: CircleMUD shows that true telnet negotiation is simple - just ECHO control needed for basics
-
OOB Protocols are Essential: Evennia demonstrates that modern MUDs rely on out-of-band protocols (GMCP, MSDP, MSSP, MCCP) for advanced features
-
Modularity is Important: Evennia's separate protocol classes vs CoffeeMud's monolithic approach shows that separation of concerns aids maintainability
-
Configuration Matters: Both Evennia and CoffeeMud use settings/config for feature enablement, reducing coupling
-
Compression is Valuable: MCCP (zlib compression) is the only standard protocol that significantly improves bandwidth efficiency
-
Protocol Negotiation Pattern: All use similar pattern:
- Server sends WILL/DO offer
- Client responds with WILL/WONT or DO/DONT
- Subnegotiation (SB/SE) for detailed options
- Callback system for async handling
-
Best Practices:
- Use weakref for protocol references (Evennia pattern)
- Protocol flags dictionary for capability tracking
- Separate modules for each protocol
- Configuration-driven enablement
- Callback-based negotiation (not blocking)
- Proper RFC compliance