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
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sat Jan 29, 2011 7:37 am   

[3.33a] Can't use #show or #showp in GMCP triggers. [BUG]
 
I've been playing around with GMCP the last two evenings a little. I've noticed if you try to use #show or #showp in a GMCP trigger it fails to display anything on the screen. This isn't an issue of not accessing the GMCP table correctly. A simple #show test or #showp test fails to display test. #print, #echo, #say, #echop, and #sayp all seem to display, but not #show or #showp.

Script debugger output:
GMCP trigger using #show test.
(Test not displayed.)
Code:
02:06:15.419a |
02:06:15.420a | c   [1] Aardwolf.mud Comline : start :
02:06:15.422a | a drop 1 coin
02:06:15.423a | h <ESC>[2Sdrop 1 coin<ESC>[0m
02:06:15.427a | i drop 1 coin<CR><LF>
02:06:15.427a | d   [1] Aardwolf.mud Comline : stopped
02:06:15.666a | i You drop <ESC>[1;33m1<ESC>[0;37m gold coin.<LF><CR>
02:06:15.666a | <IAC><SB><201>char.worth { "gold": 800020, "bank": 1872343, "qp": 6620, "tp": 7, "trains": 120, "pracs": 248 }<IAC><SE><LF><CR>
02:06:15.667a | a Telnet 201: char.worth { "gold": 800020, "bank": 1872343, "qp": 6620, "tp": 7, "trains": 120, "pracs": 248 }
02:06:15.668a | f   GMCP: char.worth
02:06:15.671a | l   Trigger "char.worth" compiled (Normal) : #show test     #if (%gmcp.char.worth.gold != @gold) {gold...
02:06:15.672a | c   exec : GMCP "char.worth" : #show test     #if (%gmcp.char.worth....
02:06:15.673a | n   Exec Trigger "char.worth"
02:06:15.675a | k   Var "gold" changed from "800021" to "800020"
02:06:15.680a | a You drop 1 gold coin.
02:06:15.688a | a
02:06:16.459a | ---
02:06:16.460a | c   [1] Aardwolf.mud Comline : start :
02:06:16.462a | a get coin
02:06:16.463a | h <ESC>[2Sget coin<ESC>[0m
02:06:16.466a | i get coin<CR><LF>
02:06:16.467a | d   [1] Aardwolf.mud Comline : stopped
02:06:16.789a | i You get <ESC>[1;33m1<ESC>[0;37m gold coin.<LF><CR>
02:06:16.789a | <IAC><SB><201>char.worth { "gold": 800021, "bank": 1872343, "qp": 6620, "tp": 7, "trains": 120, "pracs": 248 }<IAC><SE><LF><CR>
02:06:16.790a | a Telnet 201: char.worth { "gold": 800021, "bank": 1872343, "qp": 6620, "tp": 7, "trains": 120, "pracs": 248 }
02:06:16.791a | f   GMCP: char.worth
02:06:16.792a | c   exec : GMCP "char.worth" : #show test     #if (%gmcp.char.worth....
02:06:16.792a | n   Exec Trigger "char.worth"
02:06:16.794a | k   Var "gold" changed from "800020" to "800021"
02:06:16.799a | a You get 1 gold coin.
02:06:16.806a | a
02:06:16.806a |
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jan 31, 2011 5:54 pm   
 
This is correct and is normal. The #SHOW command is used to try and reproduce incoming data from the MUD (mostly for debugging purposes). When the GMCP trigger fires, CMUD is in the middle of processing the telnet option data for GMCP. CMUD doesn't allow you to stuff data into the network buffer (using #show) when it is in the middle of processing the buffer.

The #say, #echo, #print commands queue up the text rather that stuffing it into the network buffer, so those work fine in GMCP triggers.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Mon Jan 31, 2011 6:28 pm   
 
Ok, so do the Trigger on new line and trigger on prompt options for GMCP trigger not work like described in the help file?

Quote:
A GMCP trigger can be either "Trigger on Prompt" or "Trigger on Newline". While these names don't mean much for GMCP, they do create a difference that you can take advantage of. A GMCP trigger with "Trigger on Prompt" set will fire before CMUD does anything with the raw GMCP data. For example, you can capture the Room.Info message before the CMUD mapper does anything with it. A GMCP trigger with "Trigger on Newline" fires *after* CMUD has processed the GMCP data. For the Room.Info messages, the mapper will have already moved to the proper room, or created the proper room before calling your GMCP Room.Info trigger.


My triggers are set to trigger on new line, which according to the help files means CMUD should not be in the middle of processing the telnet option data. Is the help file incorrect or am I just misunderstanding it?
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Feb 01, 2011 5:39 pm   
 
They still work as documented. But both cases are still in the middle of processing the telnet option data. The difference is only that the Prompt trigger is fired before CMUD does anything with the raw GMCP data (before calling any mapper stuff), allowing you to change the raw GMCP data. While the "NewLine" trigger fires after the mapper has already processed the GMCP data. Both of these are still being processed at a low level within the telnet option code where #show might not work properly.
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