MUD Snippets

This page contains a list of all my MUD snippets, as well as a description of each of them. If you have questions or suggestions, please send me an email at jobo@daimi.au.dk. Most of the snippets should work with any C/C++ based codebase, though some might require that it's DIKU based, or at least require a few modifications before it can run.

MCCP patch (GW95) (14 kb)
MCCP is a compression protocol written by Oliver Jowett, who runs the site www.randomly.org. This patch will work against a plain godwars 95 MUD base, and can be added either with the patch shell command or by hand.

MCCP patch (GW96) (13 kb)
MCCP is a compression protocol written by Oliver Jowett, who runs the site www.randomly.org. This patch will work against a plain godwars 96 MUD base, and can be added either with the patch shell command or by hand.

Alias howto/snippet (5 kb)
This snippet is highly outdated, and a new version will be available as soon as I find the time to write it. It works, so if you really need alias support in your MUD now, then use it, but if you have the time to wait, I suggest waiting for the next version.

Changes snippet (2 kb)
This snippet allows for a dynamic and easy to update changes command, which will list the last changes done to the MUD. It is possible to add/delete changes from inside the MUD itself.

J.O.P.E (5 kb)
J.O.P.E is an online pfile editor, which allows admins to load and edit players pfiles from within the MUD. It has some security build-in, which can be used to flag parts of the pfile, so some fields require a higher level to edit than others.

Mudinfo Snippet (2 kb)
This snippet keeps track of active players and their usage of protocols like MCCP, MSP and MXP, it also keeps track of bandwidth usage and other things like average players online.

Pathfinding (Dijkstra) (3 kb)
This pathfinding snippet should work with any DIKU derived codebase, or any custom base which uses a system similar to the DIKU room structure. It finds the shortest path between two given rooms and outputs a string with the walking directions, which can be used either by mobprograms or simple output to the player.

Threaded DNS howto/snippet (13 kb)
This snippet is a guide to fixing a common problem with the gethostbyaddr() funciton, which tends to "lag" the MUD when doing a difficult lookup. This solution uses threads, and have been used succesfully on all MUD's I've worked on.

MXP snippet/guide (4 kb)
This guide and code will help you get started using the eXtended Mud Protocol (MXP), which is a pseudo markup language much like HTML, which allows you to use special tags in the messages you send to players, which will format the text (like bold, italic, hyperlinks, pull-down menus, etc). MXP is supported by ZMUD and MUSHClient.

MUD2HTML ANSI Converter (2 kb)
This small snippet will convert normal MUD output so it can be written to a HTML file and viewed on the WEB. This is useful for commands that generate HTML pages (like a web-who), since it will translate MUD colors to the correct HTML FONT tags.

ANSI sprintf replacement (cprintf) (7 kb)
This function is a replacement for sprintf() which handles ANSI colors better, and makes sure the alignment is correct. Normal sprintf() doesn't take into consideration that ANSI tags are not shown, and shouldn't count towards the size of strings.

Generic C list code (2 kb)
A generic (and safe) linked list code, with a safe Iterator. Read the list.api file for details on how to use the code.

This is a website bent on world domination - all rights reserved