pkg://ldmud-3.4.2.tar.gz:2655931/
ldmud-3.4.2/
doc/
other/mxp.htm
downloads
<html>
<head>
<title>MUD eXtension Protocol </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<link rel="stylesheet" type="text/css" href="../common/master.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#0080C0" alink="#FF8080">
<script language="JavaScript" SRC="/common/js_dynMenuFunctions.js">
</script>
<script language="JavaScript">
<!--
var garyMenuData = new Array()
var garyMenuNames = new Array()
garyMenuData["News"] = new Array()
garyMenuNames.push( new Array("News", 12, 14, 95, 80) )
garyMenuData["News"].push( new Array("Privacy","/zuggsoft/privacy.htm") )
garyMenuData["News"].push( new Array("Press","/zmud/press.htm") )
garyMenuData["News"].push( new Array("About us","/zuggsoft/about.htm") )
garyMenuData["Products"] = new Array()
garyMenuNames.push( new Array("Products", 63, 65, 160, 145) )
garyMenuData["Products"].push( new Array("zMUD","/zmud/zmudinfo.htm") )
garyMenuData["Products"].push( new Array("zMapper","/zmapper/zmapperinfo.htm") )
garyMenuData["Products"].push( new Array("AC Explorer","/ac/ac.asp") )
garyMenuData["Products"].push( new Array("zExplorer","/zexplorer/zexplorerinfo.htm") )
garyMenuData["Products"].push( new Array("DoctorZ","/doctorz/doctorzinfo.htm") )
garyMenuData["Products"].push( new Array("zMUD Developer's Kit","/devkit/devkitinfo.htm") )
garyMenuData["Products"].push( new Array("zChat","/zchat/zchatinfo.htm") )
garyMenuData["Buy"] = new Array()
garyMenuNames.push( new Array("Buy", 147, 149, 160, 145) )
garyMenuData["Buy"].push( new Array("zMUD","/zmud/order_zmud.htm") )
garyMenuData["Buy"].push( new Array("zMapper","/zmud/order_zmap.htm") )
garyMenuData["Buy"].push( new Array("AC Explorer","/zmud/order_ac.htm") )
garyMenuData["Buy"].push( new Array("zExplorer","/zmud/order_zexp.htm") )
garyMenuData["Buy"].push( new Array("DoctorZ","/doctorz/register.htm") )
garyMenuData["Buy"].push( new Array("zMUD Developer's Kit","/zmud/order_devkit.htm") )
garyMenuData["Downloads"] = new Array()
garyMenuNames.push( new Array("Downloads", 224, 226, 105, 90) )
garyMenuData["Downloads"].push( new Array("zMUD","/zmud/down.asp#zMUD") )
garyMenuData["Downloads"].push( new Array("zMapper","/zmud/down.asp#zMap") )
garyMenuData["Downloads"].push( new Array("AC Explorer","/zmud/down.asp#ACX") )
garyMenuData["Downloads"].push( new Array("zExplorer","/zmud/down.asp#ACX") )
garyMenuData["Downloads"].push( new Array("DoctorZ","/zmud/down.asp#DoctorZ") )
garyMenuData["Support"] = new Array()
garyMenuNames.push( new Array("Support", 322, 324, 160, 145) )
garyMenuData["Support"].push( new Array("Support Library","/library") )
garyMenuData["Support"].push( new Array("Bug reports","/zmud/bugs.htm") )
garyMenuData["Support"].push( new Array("Lost Registration code","/zuggsoft/regcode.htm") )
garyMenuData["Support"].push( new Array("Links","/links/links.asp") )
garyMenuData["Support"].push( new Array("MUDs","/muds/links.cfm") )
garyMenuData["Forums"] = new Array()
garyMenuNames.push( new Array("Forums", 396, 398, 120, 105) )
garyMenuData["Forums"].push( new Array("zMUD General","/forum/FORUM.asp?FORUM_ID=7&CAT_ID=1&Forum_Title=zMUD+General+Discussion") )
garyMenuData["Forums"].push( new Array("zMUD Beta","/forum/FORUM.asp?FORUM_ID=8&CAT_ID=1&Forum_Title=zMUD+Beta+Forum") )
garyMenuData["Forums"].push( new Array("zMapper","/forum/FORUM.asp?FORUM_ID=31&CAT_ID=3&Forum_Title=zMapper+Discussion") )
garyMenuData["Forums"].push( new Array("AC Explorer","/forum/FORUM.asp?FORUM_ID=13&CAT_ID=3&Forum_Title=AC+Explorer+Discussion") )
garyMenuData["Forums"].push( new Array("zExplorer","/forum/FORUM.asp?FORUM_ID=13&CAT_ID=3&Forum_Title=AC+Explorer+Discussion") )
garyMenuData["Forums"].push( new Array("DoctorZ","/forum/FORUM.asp?FORUM_ID=12&CAT_ID=3&Forum_Title=DoctorZ+Discussion") )
garyMenuData["Forums"].push( new Array("Developers","/forum/FORUM.asp?FORUM_ID=10&CAT_ID=1&Forum_Title=zMUD+Developers") )
garyMenuData["Contact"] = new Array()
garyMenuNames.push( new Array("Contact", 400, 403, 160, 145) )
garyMenuData["Contact"].push( new Array("Feedback","/zuggsoft/feedback.htm") )
garyMenuData["Contact"].push( new Array("Bug reports","/zmud/bugs.htm") )
garyMenuData["Contact"].push( new Array("Lost Registration code","/zuggsoft/regcode.htm") )
garyMenuData["Contact"].push( new Array("Email","mailto:support@zuggsoft.com") )
//-->
</script>
<script language="JavaScript">
<!--
var gstrBrowserType = null
if( document.layers ) gstrBrowserType="Netscape";
else if( document.all ) gstrBrowserType="IE";
gstrMenuColor = "#F3E9EF"
gstrMenuColorOn = "#D2AEC4"
gstrBorderColor = "#993366"
var strAlignment = "left"
if( gstrBrowserType == "Netscape" )
{
for (var intCnt=0; intCnt<garyMenuNames.length; intCnt++) {
if( intCnt == (garyMenuNames.length - 1) ){
//All menus are left-aligned except the last menu
strAlignment = "right"
}
//Pass the menu name, the menu left position Netscape, the Netscape width, and the alignment of text in the menu
createNetscapeMenu(garyMenuNames[intCnt][0], garyMenuNames[intCnt][1], garyMenuNames[intCnt][3], strAlignment)
}
}
else if( gstrBrowserType == "IE" )
{
for (var intCnt=0; intCnt<garyMenuNames.length; intCnt++) {
if( intCnt == (garyMenuNames.length - 1) ){
//All menus are left-aligned except the last menu
strAlignment = "right"
}
//Pass the menu name, the menu left position for IE, the IE width, and the alignment of text in the menu
createIEMenu(garyMenuNames[intCnt][0], garyMenuNames[intCnt][2], garyMenuNames[intCnt][4], strAlignment)
}
}
//-->
</script>
<table width="100%" border="0" cellpadding="0">
<tr>
<td>
<table border="0" cellpadding="0" width="100%" background="/common/background.gif">
<!--
<table border="0" cellpadding="0" width="100%" background="/common/pumpbg2.gif">
-->
<tr>
<td width="160"><a href="/zuggsoft/zuggsoft.htm" target="_top"><img border="0" src="/common/zs.gif" width="130" height="53"></a>
<!--
<img border="0" src="/common/flag.gif" width="100" height="55">
-->
</td>
<td>
<font face="Verdana" size="2" color="#0000FF"><b>Customer driven Internet Software<br>
Upgrades are always FREE, FOREVER!</b></font>
</td>
<td valign="middle" align="right"><font size="-2" face="Arial">
[<a href="http://www.mudconnector.com/" target="_blank">The MUD Connector</a>]<br>
[<a href="http://www.themudjournal.com/" target="_blank">The MUD Journal</a>]<br>
[<a href="http://www.mudcompanion.com/" target="_blank">The MUD Companion</a>]<br>
[<a href="http://www.kyndig.com">Kyndig.com</a>]</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="0">
<tr>
<td width="48" valign="top">
<a href="/zuggsoft/whatsnew.htm" onmouseover="showMenu('News')" onmouseout="hideMenu('News')">
<img src="/common/newsbutton.gif" width="49" height="21" alt="" border="0"></a></td>
<td width="81" valign="top">
<a href="/zuggsoft/product.htm" onmouseover="showMenu('Products')" onmouseout="hideMenu('Products')">
<img src="/common/productbutton.gif" width="82" height="21" alt="" border="0"></a></td>
<td width="74" valign="top">
<a href="/zmud/register.htm" onmouseover="showMenu('Buy')" onmouseout="hideMenu('Buy')">
<img src="/common/buybutton.gif" width="75" height="21" alt="" border="0"></a></td>
<td width="95" valign="top">
<a href="/zmud/down.htm" onmouseover="showMenu('Downloads')" onmouseout="hideMenu('Downloads')">
<img src="/common/downloadbutton.gif" width="96" height="21" alt="" border="0"></a></td>
<td width="71" valign="top">
<a href="/library" onmouseover="showMenu('Support')" onmouseout="hideMenu('Support')">
<img src="/common/supportbutton.gif" width="72" height="21" alt="" border="0"></a></td>
<td width="67" valign="top">
<a href="/forum/default.asp" onmouseover="showMenu('Forums')" onmouseout="hideMenu('Forums')">
<img src="/common/forumbutton.gif" width="68" height="21" alt="" border="0"></a></td>
<td width="93" valign="top">
<a href="/zuggsoft/feedback.htm" onmouseover="showMenu('Contact')" onmouseout="hideMenu('Contact')">
<img src="/common/contactbutton.gif" width="94" height="21" alt="" border="0"></a></td>
<td width="9999" bgcolor="#9C3163" align="right">
<font size="-2" face="Arial" color="#FFFFDE">© 2002 Zugg Software </font>
</td>
</tr>
<noscript>
<tr>
<td bgcolor="#F5F5F5" width="48">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/zuggsoft/privacy.htm">Privacy</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/press.htm">Press</a></font></td></tr>
<tr><td><font size="1"><a href="/zuggsoft/about.htm">About us</a></font></td></tr>
<tr><td><font size="1"> </font></td></tr>
<tr><td><font size="1"> </font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="81">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/zmud/zmudinfo.htm">zMUD</a></font></td></tr>
<tr><td><font size="1"><a href="/zmapper/zmapperinfo.htm">zMapper</a></font></td></tr>
<tr><td><font size="1"><a href="/ac/ac.asp">AC Explorer</a></font></td></tr>
<tr><td><font size="1"><a href="/zexplorer/zexplorerinfo.htm">zExplorer</a></font></td></tr>
<tr><td><font size="1"><a href="/doctorz/doctorzinfo.htm">DoctorZ</a></font></td></tr>
<tr><td><font size="1"><a href="/devkit/devkitinfo.htm">Developer's Kit</a></font></td></tr>
<tr><td><font size="1"><a href="/zchat/zchatinfo.htm">zChat</a></font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="74">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/zmud/order_zmud.htm">zMUD</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/order_zmap.htm">zMapper</a> </font></td></tr>
<tr><td><font size="1"><a href="/zmud/order_ac.htm">AC Explorer</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/order_zexp.htm">zExplorer</a></font></td></tr>
<tr><td><font size="1"><a href="/doctorz/register.htm">DoctorZ</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/order_devkit.htm">Developer's Kit</a></font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="95">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/zmud/down.asp#zMUD">zMUD</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/down.asp#zMap">zMapper</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/down.asp#ACX">AC Explorer</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/down.asp#ACX">zExplorer</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/down.asp#DoctorZ">DoctorZ</a></font></td></tr>
<tr><td><font size="1"> </font></td></tr>
<tr><td><font size="1"> </font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="71">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/library">Library</a></font></td></tr>
<tr><td><font size="1"><a href="/links/links.asp">Links</a></font></td></tr>
<tr><td><font size="1"><a href="/muds/links.cfm">MUDs</a></font></td></tr>
<tr><td><font size="1"> </font></td></tr>
<tr><td><font size="1"> </font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="67">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=7&CAT_ID=1&Forum_Title=zMUD+General+Discussion">zMUD General</a></font></td></tr>
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=8&CAT_ID=1&Forum_Title=zMUD+Beta+Forum">zMUD Beta</a></font></td></tr>
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=13&CAT_ID=3&Forum_Title=AC+Explorer+Discussion">AC Explorer</a></font></td></tr>
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=13&CAT_ID=3&Forum_Title=AC+Explorer+Discussion">zExplorer</a></font></td></tr>
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=12&CAT_ID=3&Forum_Title=DoctorZ+Discussion">DoctorZ</a></font></td></tr>
<tr><td><font size="1"><a href="/forum/FORUM.asp?FORUM_ID=10&CAT_ID=1&Forum_Title=zMUD+Developers">Developers</a></font></td></tr>
</table></td>
<td bgcolor="#F5F5F5" width="93">
<table border="0" cellpadding="0">
<tr><td><font size="1"><a href="/zuggsoft/suggest.cfm">Feedback</a></font></td></tr>
<tr><td><font size="1"><a href="/zmud/bugs.cfm">Bug reports</a></font></td></tr>
<tr><td><font size="1"><a href="mailto:support@zuggsoft.com">Email</a></font></td></tr>
<tr><td><font size="1"> </font></td></tr>
<tr><td><font size="1"> </font></td></tr>
</table></td>
<td width="9999" bgcolor="#F5F5F5"> </td>
</tr>
</noscript>
</table>
</td>
</tr>
<tr>
<td bgcolor="808080" height="2"><img border="0" src="/common/1x1.gif" width="1" height="2"></td>
</tr>
</table>
<h1>MUD eXtension Protocol (MXP)</h1>
<p>The MUD eXtension Protocol (MXP) is an open specification for enhancing the
communication between MUD servers and clients. To contribute to this
specification, email <a href="mailto:zugg@zuggsoft.com">zugg@zuggsoft.com</a> or
participate in the <a href="http://www.zuggsoft.com/forums">Developer's Forum</a>
on www.zuggsoft.com.
<dl>
<dt><img border="0" src="../common/diamond.gif" align="bottom" width="14" height="14">
<a href="#MXP Specification">MXP specification</a></dt>
<dt><img border="0" src="../common/diamond.gif" align="bottom" width="14" height="14">
<a href="mxplist.htm">List of MUDs with MXP support</a></dt>
<dt><img border="0" src="../common/diamond.gif" align="bottom" width="14" height="14">
<a href="mxplist.htm#MUD Clients that support MXP">List of MUD Clients with
MXP support</a></dt>
<dd><a href="mxpzmud.htm">zMUD Implementation notes</a><br>
<a href="http://www.mushclient.com/mxp.htm">MUSHclient Implementation notes</a></dd>
<dt> </dt>
</dl>
<h2><img src="../common/red_bar.gif" width="100%" height="2"><br>
<a name="MXP Specification">MXP Specification</a> </h2>
<p>Version 0.5 (18-Oct-01)</p>
<h4>Contents</h4>
<blockquote>
<dl>
<dt><a href="#Introduction">Introduction</a></dt>
<dt><a href="#Overview of MXP">Overview of MXP</a></dt>
<dt><a href="#MXP Line Tags">MXP Line Tags</a></dt>
<dt><a href="#MXP Reference">MXP Reference</a></dt>
<dd><a href="#ELEMENT">Elements</a> <!ELEMENT></dd>
<dd><a href="#ATTLIST">Attributes</a> <!ATT></dd>
<dd><a href="#ENTITY">Entities</a> <!ENTITY> <VAR></dd>
<dt><a href="#User-defined Line Tags">User-defined Line Tags</a></dt>
<dt><a href="#Tag Properties">Tag Properties</a></dt>
<dt>MXP Tags</dt>
<dd><a href="#Text Formatting">Text Formatting</a> <B> <I>
<U> <S> <H> <COLOR> <FONT></dd>
<dd><a href="#Line Spacing">Line Spacing</a> <NOBR> <P>
<BR> <SBR></dd>
<dd><a href="#Links">Links</a> <SEND> <A> <EXPIRE></dd>
<dd><a href="#Version Control">Version Control</a> <VERSION>
<SUPPORT></dd>
<dt>Optional Tags</dt>
<dd><a href="#MSP Compatibility">MSP Compatibility</a> <SOUND>
<MUSIC></dd>
<dd><a href="#Using Entities">Using Entities</a> <GAUGE> <STAT></dd>
<dd><a href="#Frames">Frames</a> <FRAME></dd>
<dd><a href="#Cursor Control">Cursor Control</a> <DEST></dd>
<dd><a href="#Crosslinking multiple MUD servers">Cross-linking Multiple
MUD Servers</a> <RELOCATE> <USER> <PASSWORD></dd>
<dd><a href="#Images">Images</a> <IMAGE></dd>
<dd><a href="#File Filters">File Filters</a> <FILTER></dd>
<dt>Outdated Tags</dt>
<dd><a href="#Server-side scripting">Server-side Scripting</a>
<SCRIPT></dd>
<dt><a href="#Implementation Details">Implementation Details</a></dt>
<dt><a href="#A Detailed Example"><b>A Detailed Example</b></a></dt>
<dt><a href="#Conclusions">Conclusions</a></dt>
</dl>
</blockquote>
<h3><a name="Introduction">Introduction</a></h3>
<p>MUD Servers communicate with MUD Clients via the Telnet Protocol.
While Telnet is the basis of most Internet protocols (FTP, HTML, SMTP, etc), most
of these protocols enhance Telnet with their own higher-level protocol in order to provide
more specific and directed features. For example, FTP adds a command language for
transferring files via the Telnet socket connection.</p>
<p>Traditionally, MUDs have used raw Telnet. MUD sessions have
been enhanced using standard terminal protocols, such as ANSI and VT100 to add color and
cursor control. However, there is no higher-level command protocol used by MUDs to
enhance the game session. The MUD eXtension Protocol (MXP) attempts to fill this gap
by providing a markup language based loosely upon HTML and XML that allows better communication between the
MUD Server and Client.</p>
<p>The design goals for MXP are:
<ol>
<li>MXP will be based upon existing standards when possible.</li>
<li>MXP will be small and efficient since MUDs send a great deal of text
to the client already.</li>
<li>MXP will be easy to implement for both the MUD Server and Clients.</li>
<li>The MXP specification will be public-domain.</li>
</ol>
<p>NOTE: The copyright for the MXP protocol
has been removed by Zugg Software as of MXP version 0.1. Zugg Software
will still lead the development of MXP, but any MUD client or server is welcome
to use and extend this specification as desired. Zugg Software will
coordinate the documentation of MXP in the Developer's Forum at the web site: <a href="http://www.zuggsoft.com">www.zuggsoft.com</a>.
Send all proposed changes to <a href="mailto:zugg@zuggsoft.com">zugg@zuggsoft.com</a>
to get them incorporated into this spec.</p>
<h3><a name="Overview of MXP">Overview of MXP</a></h3>
<p>MXP is based loosely on the HTML and XML standards supported by modern web
browsers. It is only "loosely" based upon these standards
because MUDs require dynamic, streaming text, rather than the page-oriented view
of web browsers. Also, the existing standards are needlessly verbose for
use on a MUD where text efficiency is important.</p>
<p>In addition, there are additional security concerns to worry about
with MXP. While support for HTML tags within a line is desired, players on a MUD can
exploit this power and cause problems. Certain HTML functions need to be restricted
so that MUD players cannot abuse them. For example, while it might be desirable to
allow players to change the font or color of their chat messages, you would not want to
allow them to display a large graphics image, or execute script commands on the client of
other users. MXP handles this by grouping the various tags and commands into secure
and open categories, and preventing the secure tags from being used by MUD players.</p>
<p>Two additional Client/Server protocols are not discussed in this
document. The <a href="msp.htm"> MUD Sound Protocol</a> (MSP) is a separate specification, and while MXP
provides compatibility with MSP, it does not add any additional sound support of its own. </p>
<h3><a name="MXP Line Tags">MXP Line Tags</a></h3>
<p>The core of MXP involves tagging text lines sent by the MUD.
Each MXP command is marked as either "Open" or
"Secure". Lines sent from the MUD are also marked as
"Open" or "Secure". On an "Open" MUD Line,
only "Open" MXP commands are allowed. On a "Secure"
MUD line, both "Open" and "Secure" MXP tags are
allowed. Additional "open" tags can also be used to group lines
from the MUD into channels that the user can easily control on the client.</p>
<p><font color="#0000FF">MUD Server Implementation Note: Be very
careful when sending Secure lines from the MUD. Be absolutely sure that
MUD players cannot control the output of a secure line. If a MUD player is
able to send a secure MXP command, he will be able to cause great damage to
other MUD players using MXP.</font></p>
<p>To ensure that tags are difficult to send by MUD players, an escape
sequence, similar to ANSI or VT100 is used:</p>
<pre><ESC> [ # z</pre>
<p>where # is the tag number to use. Tag numbers are defined as:
<dl>
<dt>0 open line</dt>
<dd>only MXP commands in the "open" category are allowed.</dd>
<dt>1 secure line (until next newline)</dt>
<dd>all tags and commands in MXP are allowed within the line. When a
newline is received from the MUD, the mode reverts back to Open mode.</dd>
<dt>2 locked line (until next newline)</dt>
<dd>no MXP or HTML commands are allowed in the line. The line is
not parsed for any tags at all. This is useful for "verbatim" text output
from the MUD. When a newline is received from the MUD, the mode
reverts back to Open mode.</dd>
</dl>
<p>The following additional modes were added to the v0.4 MXP spec:</p>
<dl>
<dt>3 reset</dt>
<dd>close all open tags. Set mode to Open. Set text color and
properties to default.</dd>
<dt>4 temp secure mode</dt>
<dd>set secure mode for the next tag only. Must be immediately followed
by a < character to start a tag. Remember to set secure mode when
closing the tag also.</dd>
<dt>5 lock open mode</dt>
<dd>set open mode. Mode remains in effect until changed.</dd>
<dt>6 lock secure mode</dt>
<dd>set secure mode. Mode remains in effect until changed.</dd>
<dt>7 lock locked mode</dt>
<dd>set locked mode. Mode remains in effect until changed.</dd>
</dl>
<p>The following modes are client-specific and were implemented in the v0.3 MXP
spec by zMUD:</p>
<dl>
<dt>10 room name</dt>
<dd>the line is parsed as the name of a room. Only used by MUDs
that only support tagging for the automapper and do not support the full MXP tag set.</dd>
<dt>11 room description</dt>
<dd>the line is parsed as a description of a room. Only used by
MUDs that only support tagging for the automapper and do not support the full MXP tag set.</dd>
<dt>12 room exits</dt>
<dd>the line is parsed as an exit line for a room. Only used by
MUDs that only support tagging for the automapper and do not support the full MXP tag set.</dd>
<dt>19 welcome text</dt>
<dd>This text is sent from the MUD at the beginning of a session to
welcome the user to the MUD. This text is not displayed by the client if a
<RELOCATE> command has been used. See the section on Multi-Server MUDs for
more details. Same as the <WELCOME> MXP tag.</dd>
<dt> </dt>
<dt>20-99 user-defined</dt>
<dd>the line is tagged for a MUD-specific purpose. The tag must
have been previously defined using an MXP definition command to tell the client how to
handle the line. A common use for these is to tag various chat channels to allow
client-side filtering or redirection of the text.</dd>
</dl>
<p>Note that the tag numbers from 10-19 are reserved for
automapper usage. MUDs can easily support the automapper by simply tagging lines
sent to the client using these codes. However, MUDs that fully support the MXP
spec should mark the automapper information using the MXP tags described later rather than
just tagging the line.</p>
<p>As with VT100 and ANSI sequences, the tag number is sent as decimal
text. So, for example, to tag a line as "secure", the sequence:
<ESC>[1z is sent from the MUD (where <ESC> is ascii character 27).</p>
<p>When the mode is changed from OPEN mode to any other mode, any unclosed OPEN tags
(tags that were used while in open mode) are automatically closed. Also,
when in OPEN mode, any unclosed OPEN tags are automatically closed when a
newline is received from the MUD.</p>
<p>Note that secure tags are never automatically closed (this is a change from
the 0.3 spec). Be sure to close your secure tags sent from the MUD, or use
the Reset mode periodically.</p>
<h3><a name="MXP Reference">MXP Reference</a></h3>
<p>The core of MXP involves "Elements."
Elements are like normal HTML tags. For example <B> is an element
called "B". It causes text to be bolded. To turn off the
bold, the </B> element is used. Each element has a corresponding
closing element that starts with a /. The exception are Commands.
Commands are elements that do not require a closing tag. For example, the
element <BR> causes a line break. No closing tag is needed.<p>Borrowing
a feature from XML, MXP allows you to define your own elements. This is
the true power of MXP. By defining your own elements and giving them short
names, you can cause complex output formatting in only a few short characters.<p>In
addition to Elements, you can also define "Entities." Entities
are like macro string replacements. For example, in HTML, the entity &lt;
indicates the < or less-than symbol. Since a normal < symbol is
interpreted as the start of an element tag, you must use &lt; to refer to a
less-than symbol directly. Entities are accessed by putting a &
character in front of the entity name, and terminating the name with a ;
character. All of the standard HTML entities are available in MXP,
including the &#nnn; entity to insert character /nnn into the text
stream. Note that nnn values less than 32 are ignored.<p> Of course, like in XML, you can define your own entities in MXP.
MUD-defined entities work much like server variables. For example, you
could store the player's hit-points in an entity called &hp;
<p>Here is a list of each MXP command, along with it's purpose
and abbreviation:
<h4>Elements</h4>
<dl>
<dt><a name="ELEMENT"><!ELEMENT>
<!EL></a></dt>
<dt><!ELEMENT element-name [definition]
[ATT=attribute-list] [TAG=tag] [FLAG=flags] [OPEN] [DELETE] [EMPTY]></dt>
<dd> </dd>
<dd>Used to define a new element (user-defined tag). The name of the tag is
specified. To specify a Command element
with empty content (such as a simple command tag), add the keyword EMPTY after the name of
the tag. For example:</dd>
</dl>
<blockquote>
<pre><!EL Command EMPTY></pre>
</blockquote>
<blockquote>
<p>specifies a tag called <Command> which does not require a closing
</Command> since it has no content.</p>
<p>The 'Definition' is the optional macro expansion for
this element. You can use a list of any text or other MXP commands in
this definition. For example, to create a new element called
"RED" which colors text red and makes it bold, you would define it
as:</p>
<pre><!ELEMENT red '<COLOR red><B>'></pre>
<p>And then you could use it in your MUD output like this:</p>
<pre><red>This text is bold and red</red></pre>
<p>The 'Attribute-list' allows you to define arguments or
attributes for your element. You can optionally specify the attributes
using the <!ATTLIST> MXP command described later, or you can include
them in the <!ELEMENT> definition for simplicity. To create an
element that would allow you to change the text color, but would default to
red, you would do:</p>
<pre><!ELEMENT boldtext '<COLOR &col;><B>' ATT='col=red'></pre>
<p>Then you could use it on the MUD like this:</p>
<pre><boldtext>This is bold red</boldtext>
<boldtext col=blue>This is bold blue text</boldtext>
<boldtext blue>This is also bold blue text</boldtext></pre>
<p>Note that you use an attribute in the element definition
by referring to it as an entity. In this case, the temporary entity &col;
refers to the color attribute that is passed. The 'col=red' defines the
attribute, and gives the default value of 'red'. When the new element is
used, the name of the attribute can be omitted if you give the arguments in
the same order as the definition. That is how the third example is able
to work.</p>
<p>The TAG=tag argument allows you to associate an element
with a user-defined line tag. This is explained more in a later section.</p>
<p>The FLAG=flags argument allows you to assign an internal
action to the element. This is explained more in a later section.</p>
<p>The OPEN argument sets the defined element to be an
"Open" element. By default, elements are created as
"Secure" elements.</p>
<p>The DELETE argument allows you to delete an element
previously defined.</p>
<p><font color="#0000FF">Security Note: Elements are marked as to whether they
are created by the MUD or created interactively by the user. The user
cannot override Secure elements sent from the MUD. The user is only
allowed to override Open elements sent from the MUD.</font></p>
</blockquote>
<h4>Attributes</h4>
<dl>
<dt><a name="ATTLIST"><!ATTLIST> <!AT></a></dt>
<dt><!ATTLIST element-name attribute-list></dt>
<dd> </dd>
<dd>As described in the previous section, this allows you to add attributes to elements. An attribute list specifies the name of
the attribute and an optional default value. In MXP, attribute names can be
eliminated from the Element if they are given in the same order that they are defined. </dd>
<dd>
<p><font color="#0000FF">Implementation Note (MXP v0.1): Attribute
lists were changed from the earlier MXP spec. The data type of the
attributes are no longer specified, since the type is not important to the MUD
server of client. </font></p>
</dd>
</dl>
<blockquote>
<dl>
<dt>To define attributes, simply list the names of the
attributes in the order that you want. To add an optional default,
use the syntax =Default after the attribute name. For example the
command:</dt>
</dl>
<pre><!ATTLIST boldtext 'color=red background=white flags'></pre>
<p>Specifies the attribute list for the 'boldtext'
element. The first argument is called 'color' and has a default value of
'red'. The second argument is called 'background' and has a default
value of 'white'. The third argument is called 'flags' and has no
default value.</p>
<p>Note that you can specify the attribute list using the
ATT='list' argument in the <!ELEMENT> definition. Because of this,
there is little use for the <!ATTLIST> command except for modifying the
argument list on-the-fly without changing the original definition.</p>
</blockquote>
<blockquote>
<p>For example, here is the full MSP Sound command as defined in MXP:</p>
</blockquote>
<blockquote>
<pre><!ELEMENT Sound EMPTY>
<!ATTLIST Sound FName V=100 L=1 P=50 T U></pre>
</blockquote>
<blockquote>
<p>The full usage of this element would normally be:</p>
</blockquote>
<blockquote>
<pre><SOUND FName="ouch.wav" V=50 L=2 P=80 T="combat" U="http://www.zuggsoft.com/sounds/"></pre>
</blockquote>
<blockquote>
<p>But in MXP, the shorthand could be used:</p>
</blockquote>
<blockquote>
<pre><SOUND "ouch.wav" 50 2 80 "combat" "http://www.zuggsoft.com/sounds/"></pre>
</blockquote>
<blockquote>
<p>You can omit some parameters using "" to specify the default, or mix
attribute names in:</p>
</blockquote>
<blockquote>
<pre><SOUND "ouch.wav" "" 2 T="combat"></pre>
</blockquote>
<blockquote>
<p>would be the same as</p>
</blockquote>
<blockquote>
<pre><SOUND FName="ouch.wav" V=100 L=2 T="combat"></pre>
</blockquote>
<blockquote>
<p>Note the "" to specify the default for the V attribute. The P and U
attributes also take their defaults since they are not specified at all. The T=
overrides the parsing and tells MXP that the following value is for the T attribute
instead of the P attribute that it was expecting at that position in the element.</p>
</blockquote>
<h4>Entities</h4>
<dl>
<dt><a name="ENTITY"><!ENTITY>
<!EN></a></dt>
<dt><!ENTITY Name Value [DESC=description] [PRIVATE] [PUBLISH] [DELETE]
[ADD] [REMOVE]></dt>
<dd> </dd>
<dd>Entities in MXP are used to store information from the MUD (MUD
Variables). Once an entity is defined, you can reference it's value
using the &Name; syntax. For example:</dd>
</dl>
<blockquote>
<pre><!ENTITY Version "6.15">
The current version of zMUD is &version;</pre>
</blockquote>
<blockquote>
<p>would display:</p>
</blockquote>
<blockquote>
<pre>The current version of zMUD is 6.15</pre>
</blockquote>
<blockquote>
<p>Tags can be included within entities. Unlike in XML, tags can be broken across
entities within MXP as long as when all entities on a line from the MUD are expanded, all
of the tags are properly closed (or MXP will close the dangling tags for you). So,
the following is valid in MXP:</p>
</blockquote>
<blockquote>
<pre><!ENTITY Start "<em>">
<!ENTITY End "</em>">
&Start;This text is emphasized&End;</pre>
</blockquote>
<blockquote>
<p>Also note that as in XML, entities are case sensitive, so &Start; is different than
&start;. Unlike XML, entities can be used anywhere in MXP, even within other
tags. However, if an external entity has the same name as an attribute, the
attribute within a tag takes precedence.</p>
<p>All of the default HTML entities are defined in MXP.</p>
<p>To delete an entity, use the DELETE argument. Setting an entity to a
empty value does not delete it.</p>
<p>PRIVATE entities cannot be queried by the MUD client. They are
completely hidden.</p>
<p>PUBLISH entities can be used by the client to produce a list of MUD Server
variables to be access by the player</p>
<p>The DESC description is used to give your entity a longer description</p>
<p>The ADD argument causes the Value to be added as a new item in a string
list. So, it is appended to the existing value of the variable.
String lists are values separated by the | character.</p>
<p>The REMOVE argument causes the Value to be removed from the existing string
list.</p>
<p><font color="#0000FF">Security Note: Entities are marked as to whether they
are created by the MUD or created interactively by the user. The user
cannot override Entites sent from the MUD. The user is only allowed to
override user-defined entities.</font></p>
</blockquote>
<dl>
<dt><<a name="VAR">VAR</a>>
<V></dt>
<dt><VAR Name [DESC=description] [PRIVATE] [PUBLISH] [DELETE] [ADD]
[REMOVE]>Value</VAR></dt>
<dd> </dd>
<dd>The <!ENTITY> tag allows the MUD server to set the value of a
variable without displaying the value to the user. The <VAR> tag
is just like the <!ENTITY> tag, except that the value of the variable
is placed between the <VAR> and </VAR> tags, and this value is
displayed to the user.</dd>
<blockquote>
<pre>Hp: <VAR Hp>100</Var></pre>
</blockquote>
<dl>
<dd>would display: "Hp: 100" to the user, and would set the entity hp
to 100.</dd>
</dl>
<h3><a name="User-defined Line Tags">User-defined
Line Tags</a></h3>
<p>As mentioned near the beginning of this spec, a simple escape sequence can be used to
tag a line. The tags 20-99 are defined by the MUD. The main purpose
for user-defined line tags is to allow the user to customize how these lines are
displayed. In particular, if the tag element is Open, the user can change
the color, gag, or redirect the tagged line. This is useful for various chat
channels on the MUD. Simply give them a name, and perhaps a default color, and make
them open to allow the client user to gag them or redirect them to a different frame or
window. Here is an example of an auction channel that can be controlled by the
client user:</p>
<pre><!ELEMENT Auction '<FONT COLOR=red>' TAG=20 OPEN>
<ESC>[20zA nice shiny sword is being auctioned.
<Auction>Also, a gold ring is being auctioned.</Auction></pre>
<p>This also shows the two different ways the MUD server would then send text on this new
auction channel. The use of the user-defined tag (<ESC>[20z) sends
less text to the client, although the regular use of the tag name is easier to
read and understand.</p>
<p>In both cases, the line is displayed to the user in red, by default.
However, the user can change the attributes of this tag in the client, allowing
them to change the color, gag the line, or redirect it to a different window.</p>
<p>Note that if the OPEN tag is left out, the user cannot change how the line is
displayed.</p>
<h3><a name="Tag Properties">Tag Properties</a></h3>
<p>MUD Clients can define properties tags to be used by the server in !ELEMENT
definitions. The syntax is FLAG='value'. The following special flags are
defined in zMUD:
<dl>
<dt>RoomName</dt>
<dd>The text for the element is parsed by the automapper as the name of a room.</dd>
<dt>RoomDesc</dt>
<dd>The text for the element is parsed by the automapper as the description of a room.</dd>
<dt>RoomExit</dt>
<dd>The text for the element is parsed by the automapper as exits for the room</dd>
<dt>RoomNum</dt>
<dd>The text for the element is parsed by the automapper as a room number</dd>
<dt>Prompt</dt>
<dd>The text for the element is parsed by as a MUD Prompt</dd>
<dt>Set</dt>
<dd>The text for the element is stored into the named local variable within
the client. For
example:</dd>
</dl>
<blockquote>
<pre><!ELEMENT Hp FLAG="Set hp">
<Hp>100</Hp></pre>
</blockquote>
<blockquote>
<p>would set the @hp variable in the user's session to 100.</p>
</blockquote>
<h2>MXP Tags</h2>
<h3><a name="Text Formatting">Text Formatting</a></h3>
<p><b>NOTE</b>: Only the tags described in this section are OPEN tags. All
other MXP tags are SECURE tags.</p>
<dl>
<dt><B> <BOLD> <STRONG></dt>
<dd>Render the text using a bold font. Any above tag name can be used
for HTML compatibility, although the <B> tag is preferred for MUD
usage.</dd>
<dd><b>Example</b>: <B>this text is bold</B></dd>
<dt><I> <ITALIC> <EM></dt>
<dd>Render the text using an italic font. Any above tag name can be used
for HTML compatibility, although the <I> tag is preferred for MUD
usage.</dd>
<dd><b>Example</b>: <I>this text is italic</I></dd>
<dt><U> <UNDERLINE></dt>
<dd>Underline the text. Any above tag name can be used for HTML
compatibility, although the <U> tag is preferred for MUD usage.</dd>
<dd><b>Example</b>: <U>this text is underlined</U></dd>
<dt><S> <STRIKEOUT></dt>
<dd>Strike-out the text. Any above tag name can be used for HTML
compatibility, although the <S> tag is preferred for MUD usage.</dd>
<dd><b>Example</b>: <S>this text is crossed out</S></dd>
<dt><C> <COLOR FORE=foreground [BACK=background]></dt>
<dd>Set the color of the text. If the background color is omitted, the
current background color is used.</dd>
<dd><b>Example</b>: <C red>This text is red</C></dd>
<dt><H> <HIGH></dt>
<dd>Sets the color to a brighter version of the current color.</dd>
<dt><FONT FACE=name [SIZE=size] [COLOR=foreground] [BACK=background]></dt>
<dd>Change the font for the text. You can change the color at the same
time instead of using a separate <COLOR> tag. Note that changing
the font size can cause display problems on some clients.</dd>
<dd><b>Example</b>: <FONT "Times New Roman">This text is in a
fancy font</FONT></dd>
</dl>
<h3><a name="Line Spacing">Line Spacing</a></h3>
<p>Also, unlike HTML, normal spacing still applies to the MUD output in MXP. So,
anywhere that there is a newline in the MUD output, a new line appears on the client.
Multiple spaces are not absorbed, but are displayed as sent by the MUD. Tab
characters can still be used for tab stops, and ANSI and VT100 codes can still be used as
normal. This provides a very rich output environment for the MUD which has the best
of both worlds between standard Telnet text and HTML tags. </p>
<dl>
<dt><NOBR></dt>
<dd>
To prevent a line break
use the <NOBR> tag at the end of the line from the MUD. The next
newline after the <NOBR> tag is ignored.
</dd>
<dt><P></dt>
<dd>Mark a paragraph. A paragraph is a set of separate lines sent by the
MUD which are recombined into a single line by the client. Basically,
all newlines sent from the MUD between the <P> and the </P> are
ignored. To force a line break, use <BR></dd>
<dt><BR></dt>
<dd>Line break. Forces a line break inside or outside of a
paragraph. Note that <BR> is NOT parsed as a newline from the
MUD as far as mode changes are concerned.</dd>
<dt><SBR></dt>
<dd>Soft line break. This is displayed as a space character in the
client. However, it marks a preferred location on the line for a
line-break to occur when word-wrapping the text in the client.</dd>
<dt>&nbsp;</dt>
<dd>As in HTML, the &nbsp; entity can be used to indicate a non-breaking
space character. Text will not be word-wrapped at this space by the
client.</dd>
</dl>
<h3><a name="Links">Links</a></h3>
<dl>
<dt><A href=URL [hint=text] [expire=name]></dt>
<dd>The <A> tag works as it does in HTML to open a web page in the
user's web browser. When the mouse hovers over the link, the optional
"hint" text is displayed. If the hint text is not given, the
URL of the link will be shown in the hint box. The Expire name is used
for links that expire. See the <expire> tag for more details.
<p> The http:// URL
will open the user's external web browser to the specified web page. The telnet://
URL will open another window for the specified telnet address and port. The
mailto: URL will open your email client allowing you to send email to the specified
address. </p>
<p> <b>Example</b>: <A "http://www.zuggsoft.com>Click here for
zMUD</A> </p></dd>
<dt><SEND [href=command] [hint=text] [prompt] [expire=name]></dt>
<dd>
Send links allow you to initiate certain actions when a user clicks on linked text. On
the web, clicking on a link results in opening a new web document. In MXP, links are
more flexible, and normally will send commands back to the MUD rather than opening
documents. For example,
to send the command "buy bread" to the MUD, you would use the syntax:
<pre><send>buy bread</send></pre>
<p>The MUD client would display "buy bread" as a link (underlined). If
the user clicks on this link, the text "buy bread" is sent to the MUD. </p>
<p> You
can make the text sent by the link and the text displayed to the user different using the
HREF attribute for the <send> command. You can refer to the text being
displayed using the entity value of &text; For example, if displaying a list of items to be purchased from the store when the user
clicks on the item, you could send:</p>
<pre><send href="buy bread">bread</send>
<send href="buy water">water</send></pre>
<p>This would display the text "bread" and "water" and send the
appropriate "buy" command when they are clicked. To minimize the text sent
by the MUD in this case, it would be easier to set up your own Element for the store.
For example:</p>
<pre><!ELEMENT Item '<send href="buy &text;">'>
<Item>bread</Item>
<Item>water</Item></pre>
<p>Would display the same list and still send the correct "buy" command to the
MUD when the item is clicked on. In each case, the &text; entity is
filled in with the text between the opening <Item> and closing
</Item> tags.</p>
<p>Of course, you can omit the HREF= part since the first attribute of <send> is the
command text. So, the real short form of this example would be:</p>
<pre><!EL Itm '<send "buy &text;">'>
<Itm>bread</Itm>
<Itm>water</Itm></pre>
<p> (MXP v0.2): You
can change the mouse-over text of the link using the HINT="text"
argument to the SEND tag.</p>
</dd>
<dt><b> <SEND> menus </b></dt>
<dd>
You can create a popup menu of several commands by using a
string list in the <SEND> command. Simply place a vertical bar |
character between each command and each hint text. The hint text is used
for the caption of the popup menu items. When a particular menu item is
selected by the user, the command is sent to the MUD. If the Hint text
contains one additional string, it is used as the mouse-over text. For
example:
<pre><send "command1|command2|command3" hint="click to see menu|Item 1|Item 2|Item 2">this is a menu link</SEND></pre>
<p>will create a link on the text "this is a menu
link". When the mouse is moved over this link, the text "click
to see menu" will be displayed. If you click on the link, a menu with
3 items will be displayed. If you select "Item 1", the
"Command1" is sent to the MUD.</p>
</dd>
<dt><SEND> to command line</dt>
<dd>To send text to the client's command line instead of sending it directly
to the MUD, use the PROMPT argument in the <SEND> tag. <br>
<b>Example</b>: <SEND "tell Zugg " PROMPT>Zugg</SEND><br>
will put the text "tell Zugg " (without the quotes) into the
command line when the "Zugg" link is clicked.</dd>
<dt> </dt>
<dt><EXPIRE [Name]></dt>
<dd>The <EXPIRE> tag is used to remove links previously displayed with
the <A> or <SEND> tags. For example, when moving to a new
room, <SEND> links from the previous room description are no longer
valid and need to be removed. To accomplish this, you create a Name
for the tags that you want removed. Then you specify this name in the
<EXPIRE> tag.
<p><b>Example</b>:</p>
<pre><SEND EXPIRE="Exits">E</SEND>
<EXPIRE Exits></pre>
<p>will remove all links that used the EXPIRE="Exits" option in either
the <SEND> or <A> tags. </p>
<p>Using <EXPIRE> without any Name argument will expire any <SEND>
or <A> tags no matter what Expire Name was given, as long as some name was
given. <SEND> and <A> tags that never specified an Expire Name
never expire.</p>
</dd>
</dl>
<h3><a name="Version Control">Version Control</a></h3>
<dl>
<dt><VERSION></dt>
<dd>
The <VERSION> tag can be sent by the MUD to request the version of
MXP and the MUD client
being used. The client sends the version information back to the MUD in
the format of a SECURE <VERSION> MXP tag. The following syntax is
sent by the client back to the MUD server:
<pre><VERSION MXP=mxpversio