Bug - Fixed Error during session initialization - r12624 and r12625

Theraze

Active member
I get the following gCLI when I try to log in:
Installing default certificate validation...
Validating login server (www.kingdomofloathing.com)...
605 players online.
Sending login request...
Initializing session for Theraze...
Refreshing session data...
Synchronizing moon data...
Loading character status...
Retrieving character data...
Refreshing closet...
Examining consumables in closet...
Examining equipment in closet...
Examining miscellaneous items in closet...
Updating inventory...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
Refreshing storage...
Examining meat in storage...
Examining consumables in storage...
Examining equipment in storage...
Examining miscellaneous items in storage...
Session data refreshed.
Error during session initialization
I've attached a debug log. It appears that something is making the Adventure frame not load anymore.
 

Attachments

Last edited by a moderator:
Your choiceAdventure700 value is bad. You should fix it.

That whole block in ChoiceOptionsPanel could use some refactoring so we can't expose outOfBoundsExceptions to the client from bad prefs like that.
 
Ah... maybe with the choiceadv refactoring making my old choices invalid. Or something like that...? Eh, anyways, set my choices to 1 and hoping that they should let me log in today. Thanks!
 
Still getting the same debug errors, but it's not stopping me from logging in. Is there an easy way to tell which choice adventures still have (currently) invalid choices?
 
Figured out what caused/s it. The code Bale suggested adding to BBB in post 514 sets the right lunch option automatically. With some of the KOHLS auto-handling, that's no longer valid unless you were with the jocks.

What I'm wondering is, how can we make this not-painful for the users who don't like to read code? If they made use of Jason's awesome new choice always, they may VERY easily set their desired lunch option. Which has a 66% chance of now causing errors. And it's not hard to do... you don't even need to know the choice adventure number for that or anything.

Is it possible that, if an invalid choice is configured, mafia loads the default valid for that preference and warns the user that they set something that is now invalid and the default has been loaded? I'm just envisioning a moderate scattering of confused users who are good enough users to read the changelogs, but not savvy enough to have their own mafia build, possibly with additional cranberry handling or something else similar (which reminds me, I should probably update that FReq with a new patch) and so, while they can get a debug log and post it, they aren't going to be able to tell what choice 2 or 3 in line 1186 of the choice manager (both of those being the lunch option, I believe) actually means.
 
My Adventure frame is also not appearing anymore. Logging in made a debug file showing a setSelectedIndex: 6 out of bounds error, but I believe this value is actually correct -- it's a skip adventure value for the ... <goes to check Adventure pane> <can't> ... I think Hidden something-or-other, though mafia's UI only gives one option in the dropdown (it doesn't include the skip adventure option).

ETA: Also, I'm one of the users Theraze mentioned. I've never looked at the KoLmafia source code, and I don't know how. I'd have to research where the code can be browsed. Yet, simply setting a choiceadv to the exact number used by KoL itself corrupted my mafia installation -- the entire Adventure pane is now missing. +1 to Theraze's suggestion.
 
Last edited:
I'm working on handling of these issues for the affected choices, hopefully I'll have something out shortly. Looks like there is already code for the more generic choices.

Part of the reason for restricting the options is to stop people doing things like setting skip the encounter for hidden city shrines, and then adventuring infinitely as the choice is the only option.

Edit - Try 12643.
 
Last edited:
Ah, that makes sense.

I think -- if I recall correctly -- that one of those problem choices was in the Hidden Park (choice 789), which doesn't fall under that category.

In the case of the Ziggurat (choice 791), if you don't have enough triangles, I believe you'll waste a turn unless you set it to skip. And encountering that choice without enough triangles is likely, as players might be clearing the dense liana away toward the beginning of the quest.
 
I can add special handling for Ziggurat so that it will pick show in browser if you don't have the triangles. I don't want to switch to leave as that'll allow automation to keep hitting it repeatedly and spamming the server. Would you like that? (Edit, it doesn't use an adventure without enough turns)

Hidden Park has a skip option.

Edit - 12644 will now show in browser if you have less than 4 triangles and have chosen to fight the protector spectre.
 
Last edited:
Hmmm, I don't think that's quite it. I could imagine someone who wanted to automate clearing the dense liana from the Ziggurat setting "1 choiceadv" as a condition. Your solution of automatically setting it to "Show in browser" would break their automation. I think a better option would be for mafia to consider that encounter an autostop when you don't have enough triangles or if the choice is set to skip. Thus it would also work with "adv * ziggurat" just as with conditions of 1 choiceadv.

As I recall, setting the Hidden Park to skip the adventure caused an out of bounds error. Does mafia not use 6 for this (as KoL does)? I may be thinking of a different choice though -- since my Adventure panel is not visible yet I can't verify (I've changed all my 6's to 0's though so hopefully it will reappear when I next log in).

EDIT: Okay I've logged out/upgraded/logged in and have my Adventure Panel back. Looks like one of the problems was the bowling alley, where there's a choice to skip bowling (6), which you would probably want to do if you don't have any balls (heh).

Also, I'd been adding Hidden City choiceadv support to BBB, which I think is what led to the trouble. It seems that using set_property() to set the choiceadv to quite a few of the selectable options does not result in the UI changing, because those options are missing from the dropdown. Furthermore, clicking on any of the GUI options results in mafia overwriting my settings with the present GUI state.

I'd like to request that all of the options present in KoL always be valid values for a choiceAdventure property. There can also be "smart" options like "get a this, then get a that, then skip" available in the dropdown, but having the normal options present would allow people who want to script their choiceadventures to continue to do so.
 
Last edited:
I set mine to high numbers, and it handled them fine, just didn't set the index. So it won't break adventure panel any more I think.

When you select the Hidden Park to skip, this is index 3, as it's the fourth on the list. The code then looks at this and interprets it [option 1->1, 2->2, 3->6] and writes 6 to ChoiceAdventure789 preference.

I'll look into autostops, I've not mucked around with them before. I'm trying to think of a reason not to define the four shrines and the Ziggurat as autostops. Any reasons ?
 
Last edited:
Aha, so the translation from GUI to preferences works -- but the translation from preference to GUI doesn't (see my edit above).

I think those would make excellent autostops. Speaking of, is there a list of autostops somewhere? I searched for one a while back and couldn't find one.
 
You would never want to skip bowling, I think, as that choice doesn't appear without a bowling ball, so you'd be making an infinite loop.

The GUI ChoiceAdventures are built on load, so don't change if you use set property.

If you don't alter the GUI settings, the settings remain unchanged.

The request to allow all options to be available is in conflict with the implemented request, which was to stop kolmafia getting into infinite loops and save users from themselves.

I am going to look at changing this in future, but not changing existing code. Whilst I may regret that somewhat, I am less upset at inconveniencing people who understand enough to set things manually who can unset them manually than people who have used the GUI and might not be able to manually fix things.

Autostops (from encounters.txt) :
Code:
### Autostop Adventures
The Haunted Library	STOP	History is Fun!
Whitey's Grove	STOP	It's A Sign!
The Haunted Pantry	STOP	The Manor in Which You're Accustomed
The Sleazy Back Alley	STOP	Under the Knife
The Enormous Greater-Than Sign	STOP	The Oracle Will See You Now
Pre-Cyrpt Cemetary	STOP	A Grave Situation
Post-Cyrpt Cemetary	STOP	A Grave Situation
Tower Ruins	STOP	Take a Dusty Look!
The Palindome	STOP	Drawn Onward
# The following is unnecessary, since you can use "1 choice" as a goal
Cobb's Knob Laboratory	STOP	Mr. Alarm, I Presarm
The Haunted Ballroom	STOP	We'll All Be Flat
Barrrney's Barrr	STOP	You and the Cap'm Make it Hap'm
# The following is unnecessary, since you can use "blueprints" as a goal
Barrrney's Barrr	STOP	This Adventure Bites
The Poop Deck	STOP	It's Always Swordfish
# The Sea
The Mer-Kin Outpost	STOP	Granny, Does Your Dogfish Bite?
Anemone Mine	STOP	Not a Micro Fish
The Marinara Trench	STOP	You've Hit Bottom
The Dive Bar	STOP	Ode to the Sea
The Dive Bar	STOP	Boxing the Juke
# Adventures that start the Around the World Quest
Frat House	STOP	I Just Wanna Fly
The Frat House (Bombed Back to the Stone Age)	STOP	Me Just Want Fly
# Giant's castle end
The Castle in the Clouds in the Sky (Top Floor)	STOP	Keep On Turnin' the Wheel in the Sky
# Adventure in the Arid, Extra-Dry desert until you find the Oasis
Desert (Ultrahydrated)	STOP	Let's Make a Deal!
# Get Ultra-hydrated and adventure in the Arid, Extra-Dry desert until you are given the task to find a stone rose.
Desert (Ultrahydrated)	STOP	A Sietch in Time
# Adventure in Oasis until you have a stone rose and a drum machine. Buy black paint.
# Come back to the Arid, Extra-Dry Desert and adventure until you are tasked to find the missing pages from the worm-riding manual.
Desert (Ultrahydrated)	STOP	Walk Without Rhythm
# Adventure in Oasis until you have worm-riding manual pages 3-15.
# Adventure in Arid, Extra-Dry Desert until you have worm-riding hooks.
# The following is unnecessary, since you can use "worm-riding hooks" as a goal
Desert (Ultrahydrated)	STOP	The Sleeper Has Awakened
# Adventure that finishes filling the Extreme Meter
The eXtreme Slope	STOP	3 eXXXtreme 4ever 6pack

### Hobo code binder glyph Adventures
Battlefield (No Uniform)	GLYPH	A Funny Thing Happened On the Way
Belowdecks	GLYPH	My Little Stowaway
Bugbear Pens	GLYPH	Bacon Bacon Bacon
Camp Logging Camp	GLYPH	Stumped
Cobb's Knob Menagerie, Level 3	GLYPH	He's a Melancholy Drunk
Desert (Unhydrated)	GLYPH	How Dry I Am
Lair of the Ninja Snowmen	GLYPH	Not So Much With the Corncob Pipes, Either.
Pre-Cyrpt Cemetary	GLYPH	They Hate That
The Battlefield (Frat Uniform)	GLYPH	God Bless, Bra
The Defiled Nook	GLYPH	They Gave at the Morgue
The Enormous Greater-Than Sign	GLYPH	Elbereth? Who's Elbereth?
The Fun House	GLYPH	They Hate Mimes, Too
The Limerick Dungeon	GLYPH	Thud
The Noob Cave	GLYPH	How Do I Shot Web?
The Penultimate Fantasy Airship	GLYPH	Number 163
The Poker Room	GLYPH	It's In the Cards
The Road to White Citadel	GLYPH	Breakfast of Champions
The Sleazy Back Alley	GLYPH	For Sale By Squatter
The eXtreme Slope	GLYPH	Not a Standard-Issue Windowsill, Obviously
Thugnderdome	GLYPH	Now You're a Hero

Under the knife also autostops, if switch genders is picked.
 
Thanks, Darzil!

The GUI ChoiceAdventures are built on load, so don't change if you use set property.

But that means you can't use the GUI at all -- even to set a different choiceAdventure, since it seems that merely clicking any one of the dropdowns will write every current GUI position to preferences.
 
Back
Top