Feature remove unnecessary server hits from KoLAdventure.validate()

roippi

Developer
Many zones in validate() do not perform a server hit; others only perform a server hit if equipping an item is necessary.

Others, though:

Code:
        if ( this.adventureId.equals( AdventurePool.PALINDOME_ID ) )
        {
            AdventureResult talisman = ItemPool.get( ItemPool.TALISMAN, 1 );
            if ( !KoLCharacter.hasEquipped( talisman ) )
            {
                if ( !InventoryManager.hasItem( talisman ) )
                {
                    return;
                }

                RequestThread.postRequest( new EquipmentRequest( talisman ) );
            }

            RequestThread.postRequest( KoLAdventure.ZONE_UNLOCK.constructURLString(
                "place.php?whichplace=plains" ) );
            this.isValidAdventure = KoLAdventure.ZONE_UNLOCK.responseText.indexOf( "dome.gif" ) != -1;
            return;
        }

As far as I can tell this is an unnecessary hit to whichplace=plains every time validate() is called in the palindome.

There are some other examples of this in validate() (bathole, mclargehuge, ...), and I think most if not all can be pre-empted with checks to the quest log status. Like the one lost recently added:

Code:
        if ( this.adventureId.equals( AdventurePool.WHITEYS_GROVE_ID ) )
        {
            if ( !Preferences.getString( "_questG02Whitecastle" ).equals( "unstarted" ) )
            {
                this.isValidAdventure = true;
                return;
            }
            RequestThread.postRequest( KoLAdventure.ZONE_UNLOCK.constructURLString( "woods.php" ) );
            this.isValidAdventure = KoLAdventure.ZONE_UNLOCK.responseText.indexOf( "grove.gif" ) != -1;
            
            ...
 
Last edited:

lostcalpolydude

Developer
Staff member
If you open Whitey's Grove by talking to Mr. Alarm, mafia still uses a server hit to check every time (because you can instead pull wet stew and skip opening it). The only solution in that case is a property just to keep track of whether the zone is opened to check once per ascension. Or maybe an internal variable to limit checking to once per session.
 

Bale

Minion
The only solution in that case is a property just to keep track of whether the zone is opened to check once per ascension. Or maybe an internal variable to limit checking to once per session.

I favor the "only solution" rather than the second solution.
 

roippi

Developer
Nope! You can also get access to Whitey's Grove from your guild.

Right, the questG02Whitecastle check that's already there.

Edit: now that I think about it, having a talisman is the necessary and sufficient condition for palindome access. You don't have it, you can't go there; you do, you can. No quest checking (or hits to whichplace=plains) necessary.
 
Last edited:

Bale

Minion
Edit: well, not really. A quick ctrl-G shows that only step5 gets set automatically.

Once you fix that mafia will have the necessary information to skip the server hit.

Edit: now that I think about it, having a talisman is the necessary and sufficient condition for palindome access. You don't have it, you can't go there; you do, you can. No quest checking (or hits to whichplace=plains) necessary.

Not true! Even if you have the talisman o nam you cannot access the Palindome until you visit the plains. Any hit to to_url($location[Palindome]) will fail. After you see the outside of the Palindome you will then be able to access the Palindom when you have the talisman equipped. This is very weird, but true.
 

roippi

Developer
Not true! Even if you have the talisman o nam you cannot access the Palindome until you visit the plains. Any hit to to_url($location[Palindome]) will fail. After you see the outside of the Palindome you will then be able to access the Palindom when you have the talisman equipped. This is very weird, but true.

Well, that's terrible. But okay. I probably have to fix quest tracking too - I made it tick to step1 when you acquire the talisman, but it should really be when you see the Palindome?

Stuff like this is why I post a thread instead of just committing it.

You can free the king without opening Whitey's Grove if you pull wet stew. Palindome quest status is useless for that.

Sigh. This game. Okay.
 
Last edited:

Theraze

Active member
Not true! Even if you have the talisman o nam you cannot access the Palindome until you visit the plains. Any hit to to_url($location[Palindome]) will fail. After you see the outside of the Palindome you will then be able to access the Palindom when you have the talisman equipped. This is very weird, but true.

Oddly, this changed slightly during the plains refresh. The quest update doesn't happen until your first Palindome adventure... Even manually visiting the plains and seeing it doesn't keep the zone unlocked. Sad, but...

Had to update the Rinn Level 11 quest script for that.

And the official quest status should now be updated when you do your first adventure, not acquisition now... :(
 

Catch-22

Active member
Oddly, this changed slightly during the plains refresh. The quest update doesn't happen until your first Palindome adventure... Even manually visiting the plains and seeing it doesn't keep the zone unlocked. Sad, but...

That sounds like a bug, similar to the beanstalk in the plains change. Surely this can be fixed?
 

Theraze

Active member
Well, sending a visit_url to plains.php doesn't update the quest log. Sending a visit_url to place.php?whichplace=plains didn't unlock it either.

Maybe it's changed back since. But the first two weeks after the change, it definitely didn't update the quest log...
 

Bale

Minion
Oddly, this changed slightly during the plains refresh. The quest update doesn't happen until your first Palindome adventure... Even manually visiting the plains and seeing it doesn't keep the zone unlocked. Sad, but...(

Urgh. It got more annoying.
 

xKiv

Active member
I think Jick said something to the effect that this was not intended, and will maybe get fixed (two weeks)?
 

roippi

Developer
11320 gets a couple of these.

McLargeHuge needs it too but I'm going to lay off on that one for a couple days for obvious reasons.
 

lostcalpolydude

Developer
Staff member
Nothing has been changed about The Palindome or Whitey's Grove in that function. Mafia could actually check the queue for the palindome to see if you've spent a turn there.
 
Top