Why DEBUG log on unknown choice adventures?

Veracity

Developer
Staff member
I was wondering why I had a large debug log created when I ascended as Jarlsberg this morning. It appeared to open the debug log, print the text from a choice.php, and close it for every time it encountered an unknown choice.

Sure enough, the following code in ChoiceManager.processChoiceAdventure() does this:

Code:
			// Bail if no setting determines the decision

			if ( decision.equals( "" ) )
			{
				KoLmafia.updateDisplay( MafiaState.ABORT, "Unsupported choice adventure #" + whichchoice );
				StaticEntity.printRequestData( request );
				request.showInBrowser( true );
				ChoiceCommand.printChoices();
				return;
			}
Note how similar it is to what happens when you select "Manual Control" for a choice:

Code:
			// Let user handle the choice manually, if requested

			if ( decision.equals( "0" ) )
			{
				KoLmafia.updateDisplay( MafiaState.ABORT, "Manual control requested for choice #" + choice );
				request.showInBrowser( true );
				ChoiceCommand.printChoices();
				return;
			}
The difference (other than the ABORT message) is the call to StaticEntity.printRequestData( request ) - which does exactly what I observed: opens the debug log, logs the request, and closes the debug log.

Why is this useful? How about if we don't call (and delete from the code) StaticEntity.printRequestData()?
 

fronobulax

Developer
Staff member
I have a very vague recollection that this was a feature from a long time ago because it captured what was needed to make the unsupported choice adventure a supported one. Given the alternative ways of obtaining the information I don't mind if it goes away.
 

Bale

Minion
I am both amused and horrified to remark, but it does seem that the only significant function of this feature is to "annoy" the user. LoL!
 

Veracity

Developer
Staff member
I notice that it calls ChoiceCommand.printChoices() also. That looks like it parses the responseText and pulls out the options and text that KoL provides on the corresponding buttons and prints something like the following to the gCLI:

choice 1: Freak Out
choice 2: Run Wild
choice 3: Drop Dead

Seems to me, if it also put it into the session log, it would give all the information we'd need to support it. For example, my session log says this:

Encounter: Now Leaving Jarlsberg, Population You
Took choice 682/2: unknown
choice.php?pwd&whichchoice=682&option=2
Now walking on the Turtle Tamer road.

(Notice that last line. We actually do know what happens when you take one of these choices...)

How about:

Encounter: Now Leaving Jarlsberg, Population You
choice 1: "No offense, but I wish to club seals."
choice 2: "The magic was fun, but I'd rather be taming turtles."
choice 3: "Your magic inspires me. I want to mance pasta."
choice 4: "Spending time with you made me want to be sauced. Make me a sauceror."
choice 5: "How could I aspire to wizardry after embodying you? Make me a disco bandit."
choice 6: "I want to write a song about you, and I want to do it on a stolen accordion."
Took choice 682/2: unknown
choice.php?pwd&whichchoice=682&option=2
Now walking on the Turtle Tamer road.

Seems to me the extra logging in the session log would tell you what you need to know to support the choice, and it would be in a "permanent" place, like the DEBUG log, rather than just in the gCLI.
 

Veracity

Developer
Staff member
I have a patch for something like that. I'm out of turns for today but will see how it looks tomorrow.
 
Top