Bug - Fixed Don't Generate a Debug Log when Visiting fight.php or choice.php

Cool12309

Member
When you visit fight.php or choice.php while not in a fight or choice adventure, a new message shows up that's generating a debug log (which seems to stem from the stationary buttons). HTML:

fight.php
Code:
<font face="Arial">You're not currently in a fight.  Maybe you accidentally reloaded the page after beating a monster?<p>If so, congratulations on beating that monster!</p><p></p><center><a href="main.php">Back to the Main Map</a></center></font>

choice.php
Code:
<tbody><tr><td style="color: white;" align="center" bgcolor="blue"><b>Choice Adventure</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tbody><tr><td><font face="Arial">Whoops!  You're not actually in a choice adventure.<p></p><center><a href="main.php">Back to the Main Map</a></center></font></td></tr></tbody></table></center></td></tr><tr><td height="4"></td></tr></tbody>
 

Veracity

Developer
Staff member
When you visit fight.php or choice.php while not in a fight or choice adventure, a new message shows up that's generating a debug log (which seems to stem from the stationary buttons).
I'm interested to learn how you conclude that it "seems to stem from the stationary buttons". Perhaps the stack trace in your DEBUG log indicates that to you, but since you didn't post the DEBUG log, it's hard to tell. Especially since I don't get a DEBUG log.

1) I went to fight.php. I see the following in the gCLI:

Encounter:
Round 0: Veracity loses initiative!
Cannot find monster

and this is the entirety of the HTML that KoL sends back:

Code:
<center><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Not in a Fight</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><font face=Arial>You're not currently in a fight.  Maybe you accidentally reloaded the page after beating a monster?<p>If so, congratulations on beating that monster!<p><center><A href=main.php>Back to the Main Map</a></center></font></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center>
I expect we could detect that we are Not In A Fight and suppress the logging, but I get no stack trace.

2) I went to choice.php. Nothing was written to the gCLI. The following is the entirety of what KoL send me:

Code:
<center><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Choice Adventure</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><font face=Arial>Whoops!  You're not actually in a choice adventure.<p><Center><a href=main.php>Back to the Main Map</a></center></font></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center>
Again, no stack trace.
 

lostcalpolydude

Developer
Staff member
Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.insert(AbstractStringBuilder.java:969)
at java.lang.StringBuffer.insert(StringBuffer.java:438)
at net.sourceforge.kolmafia.webui.StationaryButtonDecorator.decorate(StationaryButtonDecorator.java:212)
at net.sourceforge.kolmafia.RequestEditorKit.applyPageAdjustments(RequestEditorKit.java:474)
at net.sourceforge.kolmafia.RequestEditorKit.getFeatureRichHTML(RequestEditorKit.java:311)
at net.sourceforge.kolmafia.RequestEditorKit.getFeatureRichHTML(RequestEditorKit.java:286)
at net.sourceforge.kolmafia.swingui.RequestFrame.getDisplayHTML(RequestFrame.java:251)
at net.sourceforge.kolmafia.swingui.RequestFrame.getDisplayHTML(RequestFrame.java:234)
at net.sourceforge.kolmafia.swingui.RequestFrame.showHTML(RequestFrame.java:515)
at net.sourceforge.kolmafia.swingui.RequestFrame$DisplayRequestRunnable.run(RequestFrame.java:505)
at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:400)

That is the debug log for hitting either page, and only happens with KoL's CAB enabled.
 

Veracity

Developer
Staff member
Heh. Yeah, I looked at the Stationary Button code and deduced that it had to be a KoL CAB thing. Since I don't use that, I don't see the bug.

I'll fix that, and will also look into not generating the unnecessary logging for a non-fight.
 
Top