[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  Handling of improper MXP tags

Handling of improper MXP tags

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1  2 

Posted by Mymyc   (25 posts)  [Biography] bio
Date Reply #15 on Fri 18 Jun 2010 01:40 PM (UTC)

Amended on Fri 18 Jun 2010 02:05 PM (UTC) by Mymyc

Message
Leaving mxp off in Mush is a big no-no. Substituting multi-coloured block of text is a pain.

OnPluginPacketReceived?

I never use plugins, only standard triggers and aliases...
... I foresee sweating and painful mistakes here. :-P

So, I have to write a plugin from scratch and place an OnPluginReceived("<RNum *><RName>*</RName>.") function and do a SetVariable("rnum","%1") inside?

Edit: deleted a plugin, I am too stupid at the moment and know nearly nothing about plugins. Let me read docs.
[Go to top] top

Posted by Mymyc   (25 posts)  [Biography] bio
Date Reply #16 on Fri 18 Jun 2010 02:42 PM (UTC)
Message
Here is the output of the MPX window when I swith on the mxp of the mud:

I 10000: ( 35) Sent version response: <VERSION MXP="0.5" CLIENT=MUSHclient VERSION="4.51" REGISTERED=YES>

I 10009: ( 35) Sent supports response: <SUPPORTS +head +body +afk +title +username +pass +samp +h +high +i +option +bold +xch_page +reset +strong +recommend_option +support +ul +em +send +send.href +send.hint +send.xch_cmd +send.xch_hint +send.prompt +p +hr +html +user +password +a +a.href +a.xch_cmd +a.xch_hint +underline +b +img +img.src +img.xch_mode +pre +li +ol +c +c.fore +c.back +color +color.fore +color.back +font +font.color +font.back +font.fgcolor +font.bgcolor +u +mxp +mxp.off +version +br +v +var +italic >

I 20002: ( 35) Got Definition: !element RNum ATT="id" FLAG="RoomNum" EMPTY
I 20002: ( 35) Got Definition: !element RName FLAG="RoomName"
I 20002: ( 35) Got Definition: !element RDesc FLAG="RoomDesc"
I 20002: ( 35) Got Definition: !element RExits FLAG="RoomExit"
I 20002: ( 35) Got Definition: !element Prompt FLAG="Prompt"
I 10000: ( 35) Sent version response: <VERSION MXP="0.5" CLIENT=MUSHclient VERSION="4.51" REGISTERED=YES>

I 10009: ( 35) Sent supports response: <SUPPORTS +head +body +afk +title +username +pass +samp +h +high +i +option +bold +xch_page +reset +strong +recommend_option +support +ul +em +send +send.href +send.hint +send.xch_cmd +send.xch_hint +send.prompt +p +hr +html +user +password +a +a.href +a.xch_cmd +a.xch_hint +underline +b +img +img.src +img.xch_mode +pre +li +ol +c +c.fore +c.back +color +color.fore +color.back +font +font.color +font.back +font.fgcolor +font.bgcolor +u +mxp +mxp.off +version +br +v +var +italic >

I 20002: ( 35) Got Definition: !element RNum ATT="id" FLAG="RoomNum" EMPTY
W 5000: ( 35) Replacing previously-defined MXP element: <rnum>
I 20002: ( 35) Got Definition: !element RName FLAG="RoomName"
W 5000: ( 35) Replacing previously-defined MXP element: <rname>
I 20002: ( 35) Got Definition: !element RDesc FLAG="RoomDesc"
W 5000: ( 35) Replacing previously-defined MXP element: <rdesc>
I 20002: ( 35) Got Definition: !element RExits FLAG="RoomExit"
W 5000: ( 35) Replacing previously-defined MXP element: <rexits>
I 20002: ( 35) Got Definition: !element Prompt FLAG="Prompt"
W 5000: ( 35) Replacing previously-defined MXP element: <prompt>

And this happens when I walk around:
W 5015: ( 163) Unused argument (1) for <rnum>: 707
W 5015: ( 179) Unused argument (1) for <rnum>: 708
W 5015: ( 186) Unused argument (1) for <rnum>: 707
W 5015: ( 190) Unused argument (1) for <rnum>: 700
W 5015: ( 201) Unused argument (1) for <rnum>: 707
W 5015: ( 226) Unused argument (1) for <rnum>: 699
W 5015: ( 235) Unused argument (1) for <rnum>: 698
W 5015: ( 245) Unused argument (1) for <rnum>: 697
W 5015: ( 255) Unused argument (1) for <rnum>: 698
W 5015: ( 278) Unused argument (1) for <rnum>: 699
W 5015: ( 283) Unused argument (1) for <rnum>: 707
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #17 on Fri 18 Jun 2010 10:30 PM (UTC)

Amended on Sat 19 Jun 2010 09:48 PM (UTC) by Nick Gammon

Message
OK, I made a plugin to fix this.

I think Achaea is mis-using the roomnum tag. The spec for an element definition (here: http://www.zuggsoft.com/zmud/mxp.htm) says:




Tag Properties

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:

RoomName

The text for the element is parsed by the automapper as the name of a room.

RoomDesc

The text for the element is parsed by the automapper as the description of a room.

RoomExit

The text for the element is parsed by the automapper as exits for the room

RoomNum

The text for the element is parsed by the automapper as a room number

Prompt

The text for the element is parsed by as a MUD Prompt

Set

The text for the element is stored into the named local variable within the client. For example:

<!ELEMENT Hp FLAG="Set hp">
<Hp>100</Hp>

would set the @hp variable in the user's session to 100.





Notice it says "the text for the element is parsed". That is it should be:


<RNum>707</RNum>


instead of:


<RNum 707>


(See his example for Hp).

Rather than getting into a lengthy argument about whether or I followed, or understood, the spec, the plugin below should work around it. It detects the problematic RNum tags, calls an alias to save the room number, and removes it from the input stream.

Template:saveplugin=Fix_Rnum_Tags To save and install the Fix_Rnum_Tags plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Fix_Rnum_Tags.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Fix_Rnum_Tags.xml (which you just saved in step 3) as a plugin
  7. Click "Close"



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Fix_Rnum_Tags"
   author="Nick Gammon"
   id="3ab30fcb783ef16beb4fd533"
   language="Lua"
   purpose="Changes RNUM tags on Achaea to work properly"
   date_written="2010-06-19 08:04:34"
   requires="4.40"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Install to detect:

<RNum n>

It deletes the MXP tag <RNum n> from the input packet and calls the 
alias "got_room_number n". You can make such an alias in another plugin
or the main world file to find the current room number.

]]>
</description>

</plugin>


<!--  Script  -->


<script>
<![CDATA[

function handle_room_number (rnum)
  Execute ("got_room_number " .. rnum)
  return ""  -- delete this MXP tag
end -- handle_room_number

function OnPluginPacketReceived (s)
  if GetInfo (104) or GetInfo (105) then  -- MXP or Pueblo active
    return (string.gsub (s, "<RNum (%d+)>", handle_room_number))  -- extract room number
  else
    return s  -- unchanged if not using MXP
  end -- if
end -- OnPluginPacketReceived 

]]>
</script>


</muclient>



I could have just set a variable, but that would be a plugin variable, not a variable you can easily use elsewhere.

Now you just need an alias in your world file, which picks up the room number change:


<aliases>
  <alias
   match="got_room_number *"
   enabled="y"
   variable="room_number"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>


Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


That detects "got_room_number 707" being sent from the plugin, and just saves it as the "room_number" variable.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Mymyc   (25 posts)  [Biography] bio
Date Reply #18 on Sat 19 Jun 2010 01:27 PM (UTC)

Amended on Sat 19 Jun 2010 04:17 PM (UTC) by Mymyc

Message
Nick! Thanks for your help! You are amazing.

Let me add a last word about mxp and Achaea, here is a chapter from the HELP MXP copy/pasted from the Achaea mud.

19.20 MXP - MUD eXtension Protocol
MXP is a MUD communication protocol that allows us to send enhanced information within the normal text stream. Examples of this enhanced information are:
formatted text, clickable commands, and even images.
To enable MXP for your character in Achaea, type:
CONFIG MXP ON
You can read more about what MXP offers at:
http://www.zuggsoft.com/zmud/mxp.htm
You may also have to enable MXP in your MUD client. Instructions for various popular MUD clients that do not automatically enable MXP follow:
CMUD v3.12 (Beta version)
---------------------------
- Click on "Options" in the top toolbar, then click on "General".
- Click on the "MXP" tab in the "Preferences" window that opens.
- Click on the button "Force remote MXP" if it is not already enabled.
MUSHclient v4.40
------------------
- Click on "Game" in the top toolbar.
- Mouse over to the "Configure" menu option.
- Click on the "MXP / Pueblo" menu option.
- Click on "Use MXP/Pueblo" drop-down menu and choose "Yes - always".
- MUSHclient supports an outdated version of the MXP specification, and therefore does not allow for all of the features used by zMUD and CMUD.

....

Regards!

Edit: I keep bugging the Achaean admins (mostly Tecton) about this issue until they change this very help file and they fix that mxp room number tag.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #19 on Sat 19 Jun 2010 09:34 PM (UTC)

Amended on Sat 19 Jun 2010 09:49 PM (UTC) by Nick Gammon

Message
Mymyc said:

- Click on "Use MXP/Pueblo" drop-down menu and choose "Yes - always".
- MUSHclient supports an outdated version of the MXP specification, and therefore does not allow for all of the features used by zMUD and CMUD.
....


Hmmm. The default behaviour in MUSHclient is to accept an MXP-enabled MUD if the telnet negotiation sequences are sent to it (as documented in the official MXP spec).

Thus it shouldn't be necessary to set it to "choose "Yes - always". I wonder if Achaea is following the spec itself?

Further grumbles deleted.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #20 on Sat 19 Jun 2010 09:54 PM (UTC)
Message
Nick Gammon said:

Mymyc said:

- Click on "Use MXP/Pueblo" drop-down menu and choose "Yes - always".
- MUSHclient supports an outdated version of the MXP specification, and therefore does not allow for all of the features used by zMUD and CMUD.
....


Hmmm. The default behaviour in MUSHclient is to accept an MXP-enabled MUD if the telnet negotiation sequences are sent to it (as documented in the official MXP spec).

Thus it shouldn't be necessary to set it to "choose "Yes - always". I wonder if Achaea is following the spec itself?

Further grumbles deleted.


Well, I should quote this bit from the same help file:

Quote:
To enable MXP for your character in Achaea, type:
CONFIG MXP ON


I imagine they won't send the negotiation if you don't have CONFIG MXP ON set. I imagine you just need to set CONFIG MXP ON, then reconnect.

I have heard of a bug where people who have CONFIG MXP OFF set will still receive MXP, even though it says its off when you check. I think they're aware of it though.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #21 on Sun 20 Jun 2010 12:19 AM (UTC)
Message
They probably do that because zMUD processes MXP regardless of the negotiation. In other words, it is always on. So to avoid confusion, you have to explicitly enable it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #22 on Sun 20 Jun 2010 12:57 AM (UTC)
Message
Hmm, that makes sense.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Xtian   (53 posts)  [Biography] bio
Date Reply #23 on Fri 25 Jun 2010 09:46 AM (UTC)
Message
Hi Nick,

To activate MXP in mushclient in its factory default (on command) the MUD has to send a (IAC, SE, MXP, IAC, SE) after the negotiation. Other clients don't need this step and activate after the negotiation with DO/WILL, so maybe the IRE staff didn't know this about Mushclient and it's just a matter of somebody telling them.

At the beginning of the year there was a change in CMUD concerning the RNUM-tag. I found this in the changelog:

Quote:

MXP: RoomNum flag now supported in EMPTY tag and tags ending in /> with the first argument of the tag passed as the room number. E.g. <RoomNum 123/>


There was also a corresponding thread on the cmud forums, that I didn't find now.

Maybe this helps,
xtian
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #24 on Fri 25 Jun 2010 09:51 AM (UTC)
Message
Xtian said:
(IAC, SE, MXP, IAC, SE)


This seems suspicious. Did you mean (IAC, SB, MXP, IAC, SE) (note the SB)?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #25 on Fri 25 Jun 2010 10:55 AM (UTC)
Message
Xtian said:

To activate MXP in mushclient in its factory default (on command) the MUD has to send a (IAC, SE, MXP, IAC, SE) after the negotiation. Other clients don't need this step and activate after the negotiation with DO/WILL, so maybe the IRE staff didn't know this about Mushclient and it's just a matter of somebody telling them.


Thanks for the clarification, assuming you mean IAC SB MXP IAC SE. It is strange the cMUD activates MXP on a query rather than a command (it is like asking someone if they can play the piano, and rather than just replying "yes" they sit down and actually play it, which you might not want them to do if you have a baby asleep in the next room).

The confusion probably arises because, as far as I know, cMud and zMud parse MXP whether or not it is actually activated, and thus when IRE did their testing it appeared to work. A pity they didn't try it with other clients, but there you are.

MUSHclient does have an option to activate MXP "on query", which is not the factory default because I don't think it is sensible to turn an option on just because you have been asked if you support it or not.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #26 on Fri 25 Jun 2010 10:59 AM (UTC)
Message
Xtian said:


At the beginning of the year there was a change in CMUD concerning the RNUM-tag. I found this in the changelog:

Quote:

MXP: RoomNum flag now supported in EMPTY tag and tags ending in /> with the first argument of the tag passed as the room number. E.g. <RoomNum 123/>


There was also a corresponding thread on the cmud forums, that I didn't find now.


Well I don't browse the cMUD change logs (and no doubt Zugg doesn't browse the MUSHclient ones either). It would be nice to hear about changes that affect MXP, but ... oh well.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


82,032 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]