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
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Jul 05, 2008 6:55 am   

[2.30] Another ATCP bleedthrough
 
Here's what it looks like in Cmud:
Code:
It weighs about 70 pounds.
It weighs about 27 pounds.
úÈChar.Vitals
H:8360/8360 M:8458/8470 E:36872/36900 W:33596/33900 NL:57/100 8360h, 8458m, 36872e, 33596w cexdb-
It weighs about 14 pounds.
It weighs about 30 pounds.
It weighs about 22 pounds.


Here's the debugfile:
Code:
It weighs about 27 pounds.<CR><LF>
<IAC>
in  ( 1500) 07/05/08 11:45:33:687 : <SB><200>Char.Vitals<LF>
H:8360/8360 M:8458/8470 E:36872/36900 W:33596/33900 NL:57/100 <IAC><SE><ESC>[32m8360h, <ESC>[37m<ESC>[32m8458m, <ESC>[37m<ESC>[32m36872e, <ESC>[37m<ESC>[32m33596w <ESC>[37mcexdb-<IAC><EOR>This strange-looking shard is made of a stone-like material and sports dull, chipped edges as if it had been cloven from a larger source. Power pulses in a thick cloud around it, giving off a soft blue glow of energy that crackles faintly. Inscribed upon the shard's smooth surface are many exotic, alloy-filled glyphs that glitter strangely with a light of their own.<CR><LF>
It has about a month of usefulness left.<CR><LF>
It weighs about 14 pounds.<CR><LF>


Here's the slimmed down, converted, and repeatable text to copy into your command-line:
Code:
#showprompt {It%cr%char(10)};#showprompt {%char(255)};#showprompt {%char(250)%char(200)Char.Vitals%char(10)};#showprompt {H:8360/8360 M:8458/8470 E:36872/36900 W:33596/33900 NL:57/100 %char(255)%char(240)%e[32m8360h, %e[37m%e[32m8458m, %e[37m%e[32m36872e, %e[37m%e[32m33596w %e[37mcexdb-%char(255)%char(239)This.%cr%char(10)}
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jul 07, 2008 7:37 pm   
 
Confirmed. Thanks for the command line code. I swear, this is the last time that I'm going to kludge CMUD to handle MUDs that don't adhere to the proper telnet protocol standard. All of these ATCP packet boundary bugs are being caused by these fixes that allow MUDs to be sloppy with their IAC codes. From now on I'm taking the Firefox approach...force the MUD to adhere to the proper standard if they want CMUD to work with it.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Fri Jul 18, 2008 2:39 pm   
 
Just was trying out the new version and got something unexpected:

7707h, 8254m, 37263e, 31424w cxdb-|-662h(-8%):0m(0%)|
[NPC]: A pale-skinned, humanoid vampire (prone|blackout)
-|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
|-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)||-405h(-5%):0m(0%)|
You have recovered equilibrium.
ÈChar.Vitals
H:7435/8418 M:8526/8526 E:37265/37265 W:31448/34235 NL:7/100 -

During this output it popped up a window saying it detected a loop and gave an option to disable the triggers responsible. One of them it disabled was the ATCP trigger.

Was there something in the fix that would cause it to loop the ATCP execution?
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Fri Jul 18, 2008 2:45 pm   
 
The triggers that it disabled because of the infinite loop where the prompt and this trigger:

<trigger type="Telnet" param="200" priority="4" case="true" stop="true" regex="true" id="3297">
<pattern>^Char\.Vitals\12(H:(\d+)/(\d+) M:(\d+)/(\d+) E:(\d+)/(\d+) W:(\d+)/(\d+)) NL:\d+/100</pattern>
<value>#if (%1 &lt;&gt; @old_stats) {
#var old_stats %1
#var health %2
#var max_health %3
#var mana %4
#var max_mana %5
#var endurance %6
#var max_endurance %7
#var willpower %8
#var max_willpower %9
#RAISEEVENT Vitals
}</value>
</trigger>

The #raiseevent Vitals in the ATCP trigger enables the i_scan_damage code which is raised when it sees a prompt and is what was causing it to repeat infinitely (my health change) above.

I've never seen this happen on any other version, so I suppose this has something to do with 2.32. I've now run into this several times and reverted back to 2.30 until this is either changed back to how it was before or is fixed.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jul 18, 2008 6:08 pm   
 
You'll need to paste the results of the Script Debugger so I can see exactly what the MUD is sending. My guess is that your Vitals event is sending something to the MUD which is causing the MUD to send another ATCP message. Or, maybe you have an expression trigger that is firing when you set one of the variables. But without the debugger output, we have no way to tell what is happening here.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Jul 19, 2008 2:36 pm   
 
The only place the repeating code is executed is an event call that happens in the prompt. Which means that the prompt is somehow executing multiple times out of control. The ATCP trigger just enables the event that is called in the prompt, it doesn't actually run it.

Given that this only started being an issue in 2.32, could you give me some idea of how you fixed the issue so I can have some idea of what I'm trying to debug?
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sun Jul 20, 2008 12:04 am   Dubugging 2.32 Fix
 
Okay, here's the debug information on the 2.32 fix. I'm pretty sure this error was caused by one of your fixes Zugg. My code works flawlessly on version 2.30 and it gets into a loop consistently in version 2.32.

Debugger Window:
As you can see it is a classic trigger matching on text the trigger outputs itself.
Code:

0.0006 | f    Achaea |  Pattern: ^-
0.0006 | c    Achaea |  exec : Pattern "prompt_blackout" : #RAISEEVENT Blackout #RAISEEV...
0.0005 | c    Achaea |  exec : Event "Blackout" : i_aff blackout i_oncures i_onvenom #T+...
0.0044 | c    Achaea |  exec : Event "Prompt" : #var prompt_lock 1 #var fst_prompt %null...
0.0009 | c    Achaea |  exec : i_add afflictions blackout
0.0008 | c    Achaea |  exec : Event "i_scan_damage" : $h_delta = (@health - %db( @damag...
0.0016 | a    Achaea ]-|+339h(+4%):-10m(0%)|
0.0007 | f    Achaea |  Pattern: ^-
0.0006 | c    Achaea |  exec : Pattern "prompt_blackout" : #RAISEEVENT Blackout #RAISEEV...
0.0005 | c    Achaea |  exec : Event "Blackout" : i_aff blackout i_oncures i_onvenom #T+...
0.0012 | c    Achaea |  exec : Event "Prompt" : #var prompt_lock 1 #var fst_prompt %null...
0.0007 | c    Achaea |  exec : Event "i_scan_damage" : $h_delta = (@health - %db( @damag...
0.0014 | a    Achaea ]-|+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)|
0.0006 | f    Achaea |  Pattern: ^-
0.0006 | c    Achaea |  exec : Pattern "prompt_blackout" : #RAISEEVENT Blackout #RAISEEV...
0.0005 | c    Achaea |  exec : Event "Blackout" : i_aff blackout i_oncures i_onvenom #T+...
0.0012 | c    Achaea |  exec : Event "Prompt" : #var prompt_lock 1 #var fst_prompt %null...
0.0007 | c    Achaea |  exec : Event "i_scan_damage" : $h_delta = (@health - %db( @damag...
0.0014 | a    Achaea ]-|+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)|
0.0007 | f    Achaea |  Pattern: ^-
0.0006 | c    Achaea |  exec : Pattern "prompt_blackout" : #RAISEEVENT Blackout #RAISEEV...
0.0005 | c    Achaea |  exec : Event "Blackout" : i_aff blackout i_oncures i_onvenom #T+...
0.0012 | c    Achaea |  exec : Event "Prompt" : #var prompt_lock 1 #var fst_prompt %null...
0.0007 | c    Achaea |  exec : Event "i_scan_damage" : $h_delta = (@health - %db( @damag...
0.0013 | a    Achaea ]-|+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)|
0.0009 | f    Achaea |  Pattern: ^-
0.0006 | c    Achaea |  exec : Pattern "prompt_blackout" : #RAISEEVENT Blackout #RAISEEV...
0.0005 | c    Achaea |  exec : Event "Blackout" : i_aff blackout i_oncures i_onvenom #T+...
0.0012 | c    Achaea |  exec : Event "Prompt" : #var prompt_lock 1 #var fst_prompt %null...
0.0007 | c    Achaea |  exec : Event "i_scan_damage" : $h_delta = (@health - %db( @damag...
0.0013 | a    Achaea ]-|+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)||+339h(+4%):-10m(0%)|
0.0009 | f    Achaea |  Pattern: ^-


To dissect this, what starts this out is a blackout condition where my prompt is "-". Then Achaea sends me a health update and the line now becomes:
-|+339h(+4%):-10m(0%)|

Now defying all logic that line is now setting off the trigger matching on "^-" which starts the cycle all over again. This shouldn't be matching, here is the trigger:

Code:
<trigger name="prompt_blackout" priority="46340" case="true" regex="true" newline="false" prompt="true" id="4634">
  <pattern>^-</pattern>
  <value>#RAISEEVENT Blackout
#RAISEEVENT Prompt
#if (@baleq( )) {#RAISEEVENT PromptBalanced}
#tag prompt
#var PromptSeen 1</value>
</trigger>


Note that this is a regex trigger with an anchor "^" at the beginning. It is also marked as a prompt trigger and if I'm not mistaken either of those should have prevented it from matching on what it output above.

Perhaps something affecting how prompt lines are matched has changed. To me it looks like an issue on your end and I'm not sure I can go anywhere else with this.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jul 21, 2008 5:29 pm   
 
Turn off the Trigger on Trigger option for the prompt_blackout trigger to prevent it from firing again. The bug fix was that CMUD wasn't executing events properly within triggers before, and now it is. So your Prompt event is doing some sort of #SUB command to modify the prompt, which then causes Prompt triggers to fire on the new result again.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Jul 21, 2008 6:23 pm   
 
Zugg wrote:
Turn off the Trigger on Trigger option for the prompt_blackout trigger to prevent it from firing again. The bug fix was that CMUD wasn't executing events properly within triggers before, and now it is.

You are saying that the correct operation of my scripts prior to version 2.32 was due to a bug that caused events to not work properly within triggers? In other words my scripts were relying on a bug to operate correctly and that it is now operating properly in 2.32?

Zugg wrote:
So your Prompt event is doing some sort of #SUB command to modify the prompt, which then causes Prompt triggers to fire on the new result again.

This is incorrect. My prompt doesn't do any sort of #SUB command to modify the prompt. All it does is raise an event which does a #SAYP. Can a #SAYP cause the reevaluation I was experiencing?

I must admit I don't completely understand what you were saying in your post. Are you saying that 2.32 is operating as expected and that it is my code which needs to be adjusted? If so how do you explain the regular expression "^-" matching on the #SAYP output? The #SAYP output is neither at the beginning of the line nor is it a prompt statement, both things should have prevented it from matching.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Jul 21, 2008 6:55 pm   
 
Zugg wrote:
Well yes, this is as designed. When you use #ECHOPROMPT, CMUD will fire any Prompt triggers on the resulting line. If Trigger on Trigger is turned ON, then you are allowing other triggers to run on your output, including your current trigger.

So, the solution is to turn off the Trigger on Trigger option for your prompt trigger.

I just saw this from another post and it explained why the resultant #SAYP is being re-evaluated. However, this doesn't explain why the anchoring "^" in the expression "^-" isn't keeping it from executing. The anchoring *should* make it only match when it "-" is the first character on the line and it obviously isn't in my example. So my question remains as to why it matches when the anchor should be preventing it from matching.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jul 21, 2008 7:03 pm   
 
Yes, #SAYP will cause Prompt triggers to be executed again (just like #ECHOP or #SHOWP).
Quote:
The anchoring *should* make it only match when it "-" is the first character on the line and it obviously isn't in my example.

In all of your examples above, each line still starts with the "-" character, so your trigger will still fire. Your #SAYP is just appending more text to the line...the line itself still starts with the "-" character.

Edited: Think about it this way...#SAYP is *not* adding a newline before it's text. It is being executed within a Prompt trigger, so there isn't any newline yet. #SAYP adds text to the current line and still prevents any newline from being added. Then CMUD re-tests all Prompt triggers with the new/modified prompt line.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Jul 21, 2008 7:36 pm   
 
Okay, I think I understand now. I suppose there was a reason to make it re-evaluate the triggers each time it was modified, but I can see causing issues for a lot of people who use #SAYP statements in their prompts.

Edit: I'm also surprised my normal prompt isn't seeing this issue as well. It should from everything I understand about this. Well at least the solution is a quick check box for two of my triggers so this should be easy now that I understand what was causing it.

Edit2: I just realized I already had my main trigger stop matching to save compute time, so that's the reason why my main prompt seemed exempt while the blackout prompt was affected. It all makes sense now.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Tue Jul 22, 2008 2:52 am   
 
Works great in 2.33.

Thanks!
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 22, 2008 3:51 am   
 
Great! Thanks for letting me know that it's finally fixed.
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