Some code that I've written for DuneMUD, an online text-based multi-user dungeon, played over the Telnet protocol.