Bug - Fixed Adding new location: (none) - main.php

Bale

Minion
I believe I've found a bug resulting from the recent refactoring of lastAdventure and nextAdventure. Using r13132.

I've just ascended so my last location is (none). Unfortunately mafia has no clue what to do about this. About a gazillion times during my postAscensionScript it kept printing out:

Code:
Adding new location: (none) - main.php
 

fronobulax

Developer
Staff member
I saw several similar lines about the Mine (in disguise) which actually was the last place I adventured before I logged out and updated mafia. But it didn't happen enough to cause me concern.
 

Veracity

Developer
Staff member
I've just ascended so my last location is (none). Unfortunately mafia has no clue what to do about this. About a gazillion times during my postAscensionScript it kept printing out:

Code:
Adding new location: (none) - main.php
I was hoping and expecting that somebody would ascend and tell me this. I'm stuck in KOLHS until I finish the camera trophy. Thanks!
 

antimarty

Member
I saw several similar lines about the Mine (in disguise) which actually was the last place I adventured before I logged out and updated mafia. But it didn't happen enough to cause me concern.

I have the same problem (r13132) - my last adv location was mining, and I get this msg on login:
Code:
Adding new location: Itznotyerzitz Mine (in Disguise) - mining.php?mine=1&intro=1

And then it doesn't load the character pane.
 

Veracity

Developer
Staff member
You know, I guess this will be the generic thread about "Adding new location" messages. It's not really about the refactoring of lastAdventure/nextAdventure except insofar as that refactoring made KoLmafia start looking at the "last adventure" parts of api.php?what=status and charpane.php.

Revision 13140 fixes mining (in disguise) and revision 13141 should make use recognize brand new mines, should they appear.
 

Veracity

Developer
Staff member
Let's try again.

"The Sorceress' Chamber - lair6.php"

The "name" is "The Sorceress' Chamber"
The "URL" is "lair6.php".

What were the NAMES for the previous lairs?
 

Darzil

Developer
I saw lair4, lair6, but not lair5. That's as far as I can see back in CLI, and it's not logged in session log.
 

Darzil

Developer
Adding new location: The Sorceress' Tower - lair4.php
Adding new location: The Sorceress' Chamber - lair6.php
 

Winterbay

Active member
Found two before that:
Adding new location: The Sorceress' Cavern - lair2.php
Adding new location: The Sorceress' Courtyard - lair3.php
 

Veracity

Developer
Staff member
Well, those are interesting. We log some of them via code in AdventureDatabase.getUnknownName:

Code:
		else if ( urlString.startsWith( "lair4.php" ) )
		{
			if ( urlString.contains( "action=level1" ) )
			{
				return "Sorceress Tower: Level 1";
			}
			else if ( urlString.contains( "action=level2" ) )
			{
				return "Sorceress Tower: Level 2";
			}
			else if ( urlString.contains( "action=level3" ) )
			{
				return "Sorceress Tower: Level 3";
			}
			return null;
		}
		else if ( urlString.startsWith( "lair5.php" ) )
		{
			if ( urlString.contains( "action=level1" ) )
			{
				return "Sorceress Tower: Level 4";
			}
			else if ( urlString.contains( "action=level2" ) )
			{
				return "Sorceress Tower: Level 5";
			}
			else if ( urlString.contains( "action=level3" ) )
			{
				return "Sorceress Tower: Level 6";
			}
			return null;
		}
		else if ( urlString.startsWith( "lair6.php" ) )
		{
			if ( urlString.contains( "place=0" ) )
			{
				return "Sorceress Tower: Door Puzzles";
			}
			else if ( urlString.contains( "place=2" ) )
			{
				return "Sorceress Tower: Shadow Fight";
			}
			else if ( urlString.contains( "place=5" ) )
			{
				return "Sorceress Tower: Naughty Sorceress";
			}
		}
I'm not sure it's worth making them KoLAdventure objects - adventuring locations which appear in the Adventure selector - since you can't actually ADVENTURE there. But I find it very interesting that KoL considers them to be "zones" - complete with an adventure ID, although that was not logged.

OK, revision 13147 does this:

When we look at Last Adventure in either api.php or charpane.php, we look up the KoLAdventure.
If we don't find it, we consider registering it.
If it is adventure.php, cool.
If it is mining.php, cool.
If it is main.php, that is (none), as Bale discovered, and we ignore it.
If it is anything else, I'm curious to know what Last Adventure said about it, so it will log the info to the session log, but it will otherwise not create a KoLAdventure for it.

The previous "register unknown adventuring locations" only worked for adventure.php, so this is actually slightly better, in that we'll automatically discover new mines.

To test the session logging, I commented out the Barrel Full of Barrels. I got the following:

Unknown last adventure: id = '' name = 'The Barrel Full of Barrels' URL = 'barrel.php' container = 'mountains.php'
Unknown last adventure: id = '1011' name = 'The Barrel Full of Barrels' URL = 'barrel.php' container = 'mountains.php'

The first one was scraped from the (normal mode) charpane.php.
The second one was from api.php.

As I said, KoL itself assigns an "id" to non-adventure.php-locations; the id is not only a snarfblat. Very interesting.

In any case, I think this bug is fixed.
 
Top