I'll remember to include the adventure count in the future, no problem.
I noticed it happen w/ the besneaky mood, and I agree, maybe changing to it was the cause. I swap between default and besneaky many many times a day, especially while ascending. So I'm not sure what to make of that.
Thanks. I think about this and look at code but I'm getting nowhere.
Originally Posted by Terrabull
Originally Posted by Veracity
Happened again, this time w/o moods. I noticed it BEFORE I adventured, but I can't stop it once it strips me.
I beat the Goblin King, auto-sold my meat stacks, then changed my equipment to something more reasonable. Then Mafia decided I was TOO reasonable apparently, and said everything was off.
I clicked onto the counsel to get my new quest, clicked on the Friars copse, then went to my campsite for the buff, and that's when I realized I was naked. Happens right after adventure 27. Unfortunately, there isn't much there.
It is installed, but was not running anytime today.
Edit: Speaking of Relay Browser stuff. I have Chit running, and that's how I noticed I was naked while mucking around in the GUI. I looked at the left, saw all the boxes were empty, then went to my inventory page and saw my equipment. Then I confirmed mafia thought I was naked and went to adventure to trigger the disrobing.
Last edited by Terrabull; 02-05-2020 at 06:32 AM.
Got stripped again, this time after going to the Boxing Daycare. Again, noticed it in Chit, all my stuff is still equipped right now. Went to Mafia and re-equipped the stuff in there. Adventure 676
Was not running Guide today.
Should I run anything to make the logs more detailed?
Not sure what else you could log. Thank you.
My only hypothesis is that it is a threading issue related to the relay browser and/or relay scripts. So not running Chit or Guide might eliminate the problem. But I can also understand that running without those is more of a problem than nakedness.
Let's try an experiment. Somehow, this is happening:
Save outfit checkpoint
Do NPC purchase
api.php comes back with current equipment
--> it disagrees with our current model of equipment (naked) and we update current model to agree with KoL
Restore outfit checkpoint
--> which is apparently naked, so we remove all equipment.
Now, there are definitely threading issues:
SpecialOutfit.implicitPoints is a static class field
SpecialOutfit.explicitPoints is a static class field
Studying the code, those last three provide complexity but serve no purpose that I can discern.
The stack of "explicitPoints" is pushed and popped by script commands.
The stack of "implicitPoints" is pushed and popped in numerous places all over KoLmafia to handle restoring equipment when called code - recovery, NPC purchases, whatever - might change gear - reduce MP cost of skills, wear an outfit to visit NPC store or lower purchase cost, and so on.
To be thread safe, we'd need to synchronize all those push/action/pop code blocks.
But what is so puzzling is that your session logs don't show any indication of extra stuff (from other threads) that would push or pop checkpoints - and how would you get an empty checkpoint?
I am going to submit a change that removes all usage of:
since, as I said, I cannot see how it is doing anything at all useful and it complicates the code.
I'm also considering adding a debugging property which will log creating and restoring checkpoints and specially calling out when the checkpoint is empty. Whatever happened just before creating an empty checkpoint would be something to look at. What would really be necessary to understand this is a DEBUG log, not a session log, but that is super cumbersome for something which happens so rarely - especially if you run Guide.
Revision 19730 simplifies the code by removing apparently unnecessary complexity.
Lets see how KoLmafia runs without that code.
Revision 19731 prints a stack trace to the DEBUG log if we create an implicit checkpoint with no equipment.
It also prints "Created an empty implicit checkpoint" to the gCLI and session log.