关于MXP协议的相关知识

FluffOS v2019 运行时配置文件中增加了以下内容:

# telnet extensions support
; enable mxp : 0
; enable gmcp : 0
; enable zmp : 0
; enable mssp : 1

如果我们enable mxp : 1即可开启服务端对MXP的支持,这里对mxp协议做简单说明,MXP是MUD eXtension Protocol (MXP),简单的说,MXP可以在服务端代码中通过类似html和xml的标记语言格式代码,在客户端实现类似网页的点击效果。

详细说明见官方文档:http://www.zuggsoft.com/zmud/mxp.htm

以下是官方给的一个示例

A Detailed Example

Want a more complete example of all of this? I thought so. Here is a basic MXP package the you can use on your MUD to handle the most common MUD functions. Go through this example line by line with the documentation above and you should be able to figure it out. Once you get the hang of it, it is pretty easy.

<!-- Elements to support the Automapper -->
<!ELEMENT RName '<FONT COLOR=Red><B>' FLAG="RoomName">
<!ELEMENT RDesc FLAG='RoomDesc'>
<!ELEMENT RExits '<FONT COLOR=Blue>' FLAG='RoomExit'>
<!-- The next element is used to define a room exit link that sends
the exit direction to the MUD if the user clicks on it -->
<!ELEMENT Ex '<SEND>'>
<!ELEMENT Chat '<FONT COLOR=Gray>' OPEN>
<!ELEMENT Gossip '<FONT COLOR=Cyan>' OPEN>
<!-- in addition to standard HTML Color specifications, you can use
color attribute names such as blink -->
<!ELEMENT ImmChan '<FONT COLOR=Red,Blink>'>
<!ELEMENT Auction '<FONT COLOR=Purple>' OPEN>
<!ELEMENT Group '<FONT COLOR=Blue>' OPEN>
<!-- the next elements deal with the MUD prompt -->
<!ELEMENT Prompt FLAG="Prompt">
<!ELEMENT Hp FLAG="Set hp">
<!ELEMENT MaxHp FLAG="Set maxhp">
<!ELEMENT Mana FLAG="Set mana">
<!ELEMENT MaxMana FLAG="Set maxmana">
<!-- now the MUD text -->
<RName>The Main Temple</RName>
<RDesc>This is the main hall of the MUD where everyone starts.
Marble arches lead south into the town, and there is a <i>lovely</i>
<send "drink &text;">fountain</send> in the center of the temple,</RDesc>
<RExits>Exits: <Ex>N</Ex>, <Ex>S</Ex>, <Ex>E</Ex>, <Ex>W</Ex></RExits>

<Prompt>[<Hp>100</Hp>/<MaxHp>120</MaxHp>hp <Mana>50</Mana>/<MaxMana>55</MaxMana>mana]</Prompt>

This would display the following:

file

and set the variables @hp, @maxhp, @mana, @maxmana appropriately. Clicking on the exit links would send the proper direction to the MUD to move you in that direction. It would send the "drink fountain" command if the user clicked on the underlined word "fountain".

MXP 功能实现相关贴子

其它协议相关知识

京ICP备13031296号-4