evennia.server.portal.mxp¶
MXP - Mud eXtension Protocol.
Partial implementation of the MXP protocol. The MXP protocol allows more advanced formatting options for telnet clients that supports it (mudlet, zmud, mushclient are a few)
This only implements the SEND tag.
More information can be found on the following links: http://www.zuggsoft.com/zmud/mxp.htm http://www.mushclient.com/mushclient/mxp.htm http://www.gammon.com.au/mushclient/addingservermxp.htm
- evennia.server.portal.mxp.mxp_parse(text)[source]¶
Parse Evennia’s MXP link markup into MXP escape sequences suitable for sending to MXP-enabled clients.
Converts **|lc<cmd>|lt<label>|le** to a clickable SEND tag and **|lu<url>|lt<label>|le** to a clickable URL tag. Non-MXP text is left unchanged — MXP clients only interpret tags inside secure-mode markers, so surrounding text is treated as literal.
Messages containing no MXP markup are returned unchanged.
- Parameters:
text (str) – The text to parse.
- Returns:
str –
- The parsed text with MXP sequences substituted, or the
original text if no MXP markup was found.
Examples
**|lchelp overview|lthelp overview|le** becomes **x1b[4z<SEND HREF=”help overview”>help overviewx1b[4z</SEND>**
- class evennia.server.portal.mxp.Mxp(protocol)[source]¶
Bases:
objectImplements the MXP protocol.
- __init__(protocol)[source]¶
Initializes the protocol by checking if the client supports it.
- Parameters:
protocol (Protocol) – The active protocol instance.