MXP is designed to allow players to use the tags directly, for example in "say" or "chat".
The problem with allowing this is that players may annoy others by using MXP tags to do things to other players, like turning MXP off, making large headings, and so on.
To prevent this the MXP spec defines three modes:
* Open mode - where "open" tags are allowed
* Secure mode - where all tags are allowed
* Locked mode - where tags are not interpreted at all
These modes are established by an "escape sequence", similar to the ANSI sequences used to colour text in bold, red, and so on.
Note that modes do not necessarily pertain to an entire line, you can switch modes in the middle of a line.
Open mode
This mode is used to allow a "harmless subset" of MXP commands, such as <b> for bold, and <i> for italic.
Open mode is the default mode after a newline is received (unless the <MXP DEFAULT_OPEN> or <MXP DEFAULT_LOCKED> tags have been received, see below).
To switch to open mode the following sequence is sent from the server to the client:
At present the following tags are allowed in open mode:
Note - if a "secure" tag is received on an open line MUSHclient does not display it. However an error message will appear in the error log, if you have the MXP debug level (Configuration -> Output tab) set to anything other than "none".
Secure mode
This mode is used to allow all MXP tags, including those that define new elements or entities.
To switch to secure mode the following sequence is sent from the server to the client:
Locked mode
This mode is used to temporarily disregard MXP tags on a line. Thus a line can be sent "verbatim" including MXP tags. For example help text:
In this case the word <west> would not be interpreted as an MXP tag.
To switch to locked mode the following sequence is sent from the server to the client:
Reset
To allow the client to close any outstanding tags, and return to "normal" operations MUSHclient supports the "reset" sequence. This:
* Closes any outstanding tags (eg. implies </send> if a <send> was outstanding)
* Resets colours to white on black, no underline, no bold, no italic.
This is useful to make sure that output is "back to normal" after (say) a chat line.
You might want to implement the server to routinely send the reset sequence every time it sends the player prompt.
To send the "reset" sequence the following sequence is sent from the server to the client:
You can also achieve the same effect by sending the MXP tag <reset>.
The problem with allowing this is that players may annoy others by using MXP tags to do things to other players, like turning MXP off, making large headings, and so on.
To prevent this the MXP spec defines three modes:
* Open mode - where "open" tags are allowed
* Secure mode - where all tags are allowed
* Locked mode - where tags are not interpreted at all
These modes are established by an "escape sequence", similar to the ANSI sequences used to colour text in bold, red, and so on.
Note that modes do not necessarily pertain to an entire line, you can switch modes in the middle of a line.
Open mode
This mode is used to allow a "harmless subset" of MXP commands, such as <b> for bold, and <i> for italic.
Open mode is the default mode after a newline is received (unless the <MXP DEFAULT_OPEN> or <MXP DEFAULT_LOCKED> tags have been received, see below).
To switch to open mode the following sequence is sent from the server to the client:
<esc>[0z
which in hex is: 0x1B 0x5B 0x30 0x7A
At present the following tags are allowed in open mode:
<bold> or <b>
<underline> or <u>
<italic> or <i>
<color> or <c>
<font>
<strike> or <s>
<strong>
<small>
<tt>
Note - if a "secure" tag is received on an open line MUSHclient does not display it. However an error message will appear in the error log, if you have the MXP debug level (Configuration -> Output tab) set to anything other than "none".
Secure mode
This mode is used to allow all MXP tags, including those that define new elements or entities.
To switch to secure mode the following sequence is sent from the server to the client:
<esc>[1z
which in hex is: 0x1B 0x5B 0x31 0x7A
Locked mode
This mode is used to temporarily disregard MXP tags on a line. Thus a line can be sent "verbatim" including MXP tags. For example help text:
Type <west> to go west.
In this case the word <west> would not be interpreted as an MXP tag.
To switch to locked mode the following sequence is sent from the server to the client:
<esc>[2z
which in hex is: 0x1B 0x5B 0x32 0x7A
Reset
To allow the client to close any outstanding tags, and return to "normal" operations MUSHclient supports the "reset" sequence. This:
* Closes any outstanding tags (eg. implies </send> if a <send> was outstanding)
* Resets colours to white on black, no underline, no bold, no italic.
This is useful to make sure that output is "back to normal" after (say) a chat line.
You might want to implement the server to routinely send the reset sequence every time it sends the player prompt.
To send the "reset" sequence the following sequence is sent from the server to the client:
<esc>[3z
which in hex is: 0x1B 0x5B 0x33 0x7A
You can also achieve the same effect by sending the MXP tag <reset>.