A small Zig workspace for experimenting with the NMDC (Direct Connect) protocol.
It currently includes:
- a shared NMDC protocol library
- a terminal client with a tabbed TUI
- a minimal multi-user hub focused on chat and private messages
File transfer is intentionally not implemented yet.
- lib/ — shared NMDC protocol code used by both client and server
- client/ — terminal NMDC client
- server/ — minimal NMDC hub
The shared library in lib/ provides reusable NMDC helpers for:
- command classification and parsing
- stream framing with pipe-delimited message buffering
$Lock→$Keycalculation- public chat formatting and decoding
- private message parsing and formatting
$MyINFOparsing and rebuilding$NickList,$OpList,$BotList,$Quit,$Hello, and related helpers
The client in client/ currently supports:
- raw terminal TUI
- tabbed views for Logs, Chat, and PMs
- public chat send/receive
- private message receive and send via
/msg <nick> <message> - op and bot list highlighting
- NMDC login flow:
$Lock$Key$ValidateNick$Hello$Version$GetNickList$MyINFO
The server in server/ is a minimal hub intended for local testing and development.
It currently supports:
- multiple connected clients
- nickname validation
- public chat rebroadcast
- private message routing
- storing and rebroadcasting
$MyINFO - generated
$NickList,$OpList, and$BotList - simple operator assignment
Target the current Zig toolchain used by this workspace.
If you are building manually, use:
zig build
zig build testFrom the server package:
cd server
zig build runDefault listen address:
- host:
127.0.0.1 - port:
4111
You can also pass a custom host and port:
cd server
zig build run -- 127.0.0.1 4111From the client package:
cd client
zig build run -- 127.0.0.1 4111 TestBotArguments are:
- host
- port
- nick
If omitted, the client uses its built-in defaults.
Inside the client:
- type plain text in the Chat tab to send public chat
- use
Tabto switch between Logs, Chat, and PMs - use
/msg <nick> <message>to send a private message - in the PMs tab, plain text is not sent as public chat
- press
Ctrl+Cto exit
Run tests per package:
cd lib && zig build test
cd client && zig build test
cd server && zig build testThis workspace is focused on the NMDC chat/login side of the protocol.
Not implemented yet:
- file transfers
- search
- download/upload management
- richer hub administration