MUD Driver Progress
Posted in MUD Development
Forenoon watch, 2 bells (9:22 am)

I spent several hours last night working out a few issues I had with my MUD driver. Yes, the one I’ve been writing for some three years now. I completed my message-delivery engine and tested and debugged it last night. It’s quite nice. One big problem with programs like this is there are so many parts that all need to communicate with other parts. What I did was create a central message daemon and a unified message format—now all these different parts only need to communicate with the delivery daemon, and it takes care of everything else. It handles many different types of messages, such as Quit, Tell, Chat, Local Speech, Information, Mail, etc. Last night I completed the Quit message system (it was simple), and completely wrote and tested the Tell mechanism. Things are running very smooth now.

I borrowed ideas from the SMTP protocol for my message format, which looks like this:

typedef enum {
  mtChat = 0,
  mtQuit,
  mtSpeech,
  mtEmote,
  mtTell,
  mtInformation,
  mtMail,
} MessageType;

typedef struct {
  MessageType type;
  std::string from;
  std::string header;
  std::string rcpt;
  std::string body;
} Message;

The message daemon just accepts any Message object and delivers it. I have a feeling it will get a lot of use.

Leave a Comment »