A Small MUD
This is a minimal mud implementation, with some mildly intelligent mobs running around creating rooms.
A few pointers when reading the source code... the World class contains the "cells" in the dungeon - all those are created randomly by the mobs. The MobFactory class contains and controls all mobs in the world - the class holds a reference to the World class. Cells are specified by the World::CELL struct and mobs by the MobFactory::MOB struct. The SmallHandler class contains the World, MobFactory, and active sockets list (via SocketHandler). Finally, the SmallSocket class handles all socket communication and the ListenSocket template class acts as the socket listen server.
New 2004-05-17: There is an ItemFactory class that can spawn random items in the world. Right now an item only has four properties: wield pos, physical, magical, and amount. The "cstring" class adds ansi color functionality. It's a std::string class with modified behaviour. The c_str() method returns the string with ansi control chars, the nc_str() method returns the string without color information, and when used as normal the string returns the ansi "shortcut" chars - read about them below.
Low int. Bright Background Red &r &R &e Green &g &G &k Yellow &y &Y &p Blue &b &B &u Magenta &m &M &a Cyan &c &C &f White &w &W &h Black &l &L &i &n - back to normal &F - flash &U - underline
Update to sockets library v2.1
Please note. This example was primarily developed on linux, and may require some tweaking to compile on other platforms.