Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Fri Jul 22, 2011 5:40 pm   

How to correctly use a GMCP Redirect.Window package
 
So I was poking around IRE's Achaea and came across the Redirect GMCP package. When enabled this allows Achaea to send Redirect.Window "windowname" commands. Achaea's builtin map uses this package in the following way (taken from the debugger):
Code:
<SB><201>Redirect.Window "map"<IAC><SE>
<textual map data here>
<SB><201>Redirect.Window "main"<IAC><SE>

So I thought I'd try to use this gmcp package to capture the map to a window in CMUD because hey, why not? I've tried a few things, none of which work. The following is the most 'obvious' method of doing it for me:
Code:
<trigger name="Redirect" type="GMCP" param="201" priority="100" id="10">
  <pattern>Redirect.Window</pattern>
  <value>#switch ( %gmcp.Redirect.Window )
  ("map") {
    #clr "Map"
    #c+ "Map"
  }
  ("main") {
    #c-
  }
</value>
</trigger>


When this trigger is executed I get the following in the main session window:
Code:
Capture text ON
Capture text OFF
Ruminic Street circling the Imperium.
--- Area 67: Cyrene -------------------------
                                           
                                         [$]-
                                             
                                -[ ]- - -[ ]-
\                                         |
  \                                       |
    \                                     |
     [ ]                                 [ ]-
        \   /                             |
         [ ]                             [ ]
            \                           /
 [ ]         [ ]- - -[+]- - -[ ]- - -[ ]- - -
/   \       /
     [ ]-[ ]
                                             
                                             
                                            /
             [ ]     [ ]- - -[ ]-[ ]     [ ]
              |     /               \   /
             [ ]-[ ]                 [ ]
                /                       \
             [ ]                         [ ]
                                          |
----------------- -26:-4:0 ------------------

So I can see the trigger is firing, but the #C+/- commands just toggle one after the other. I believe this is due to how CMUD actually processes these GMCP messages. It looks like CMUD is processing all the GMCP messages at once before it actually renders out the received text and not inline with the actual data received.
Code:
0.0052 | a    Achaea #Telnet 201: Redirect.Window "map"
0.0018 | f    Achaea |  GMCP: Redirect.Window
0.0019 | c    Achaea |  exec : GMCP "Redirect" : #switch ( %gmcp.Redirect.Window )   ("m...
0.0018 | n    Achaea |  Exec Trigger "Redirect"
0.0022 | a    Achaea |Capture text ON
0.0046 | a    Achaea #Telnet 201: Redirect.Window "main"
0.0019 | f    Achaea |  GMCP: Redirect.Window
0.0020 | c    Achaea |  exec : GMCP "Redirect" : #switch ( %gmcp.Redirect.Window )   ("m...
0.0019 | n    Achaea |  Exec Trigger "Redirect"
0.0022 | a    Achaea |Capture text OFF
0.0037 | a    Achaea #Telnet 201: Char.Items.List { "location": "room", "items": [ { "id": "257477", "name": "a runic totem" }, { "id": "334059", "name": "a baby rat" }, { "id": "322491", "name": "a baby rat" } ] }
0.0025 | a    Achaea #Telnet 201: Room.Info { "num": 6403, "name": "Ruminic Street circling the Imperium", "area": "Cyrene", "environment": "Urban", "coords": "57,-26,-4,0", "map": "www.achaea.com/irex/maps/clientmap.php?map=57&building=0&level=0 17 12", "details": [  ], "exits": { "e": 6402, "w": 6404 } }
0.0455 | a    Achaea #Telnet 201: Char.Vitals { "hp": "470", "maxhp": "470", "mp": "599", "maxmp": "599", "ep": "1248", "maxep": "1250", "wp": "1625", "maxwp": "1625", "nl": "59", "string": "H:470/470 M:599/599 E:1248/1250 W:1625/1625 NL:59/100 " }
0.0029 | m    Achaea |  Event "onRoomEnter" raised : (%1="45", %2="", %3="", %4="")
0.0017 | m    Achaea |  Event "onWalkEnd" raised : (%1="45", %2="", %3="", %4="")
0.0021 | a    Achaea |Ruminic Street circling the Imperium.
0.0020 | a    Achaea |--- Area 67: Cyrene -------------------------

This seems more like design feature than bug to me but I'm still left with the question of how to use this GMCP package to capture the map data into a window. Is this even possible in CMUD with the GMCP method IRE has implemented here?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Jul 23, 2011 3:43 pm   
 
Yes, this is how GMCP works unfortunately. GMCP is sent as "out of band" Telnet messages (the IAC SB stuff) and "out of band" messages are processed before any other text and there is no way to sync these messages with the text. You might send a message to Achaea to see if they can send their "Redirect Main" message is a separate network packet so that it doesn't get processed before the actual map data itself.

All of the GMCP stuff is still relatively new to both the clients and the MUDs so issues like this need to be worked out. So they should be willing to help you get this working.
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Sun Jul 24, 2011 6:44 am   
 
Yeah they follow this pattern for a lot of stuff. Comm channels too. Why they don't just include the channel text as the body of the gmcp data I haven't the faintest idea. I'll see how I can get in contact with IRE to get this fixed. Since you have a relationship with IRE maybe you could send them a quick email? Not trying to impose, just figure they would pay attention more coming from you.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net