Results 1 to 6 of 6

Thread: "There is no swimming pool in this clan." always printed

  1. #1

    Default "There is no swimming pool in this clan." always printed

    GCLI:

    [...]
    Let's cannonball in the swimming pool.
    There is no swimming pool in this clan.<<<
    In the pool, flipping over.

    Doing handstand in clan VIP swimming pool
    In the pool, diving for treasure.

    Diving for treasure in clan VIP swimming pool
    You found a lost key in the VIP pool!
    Preference _olympicSwimmingPoolItemFound changed from false to true
    Getting out of the pool.

    Getting out of clan VIP swimming pool
    [...]

    Appears every day.
    Not such a big deal since the pool is still interacted with afterwards (the 'print' must simply be at a wrong place), but annoyingly false nonetheless.

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,856

    Default

    Do you start your day in a different clan?

  3. #3

    Default

    no change of clan

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,180

    Default

    Reproducible. From my DEBUG log:

    Code:
    Let's cannonball in the swimming pool.
    class net.sourceforge.kolmafia.request.ClanLoungeRequest
    Connecting to clan_viplounge.php...
    Requesting: https://www.kingdomofloathing.com/clan_viplounge.php?preaction=goswimming&subaction=screwaround&whichfloor=2
    ...
    Retrieved: https://www.kingdomofloathing.com/clan_viplounge.php?preaction=goswimming&subaction=screwaround&whichfloor=2
    Field: Location = [choice.php?forceoption=0]
    ...
    Connecting to choice.php...
    Requesting: https://www.kingdomofloathing.com/choice.php?forceoption=0
    ...
    Retrieved: https://www.kingdomofloathing.com/choice.php?forceoption=0
    [choice page of things to do in the pool]
    ClanLoungeRequest:

    Code:
    	@Override
    	protected boolean shouldFollowRedirect()
    	{
    		return true;
    	}
    That is why it automatically followed the redirect. Also ClanLoungeRequest:

    Code:
    		case ClanLoungeRequest.SWIMMING_POOL:
    			if ( this.redirectLocation != null && this.redirectLocation.startsWith( "choice.php" ) )
    			{
    				RequestLogger.printLine( "You start screwing around in the swimming pool." );
    			}
    ...
    			else if ( !responseText.contains( "vippool.gif" ) )
    			{
    				KoLmafia.updateDisplay( "There is no swimming pool in this clan." );
    			}
    It is coded assuming the redirect will NOT be followed.

    Not sure when the redirect following was added (presumably to make something else work) but it made the swimming pool no longer "You start screwing around in the swimming pool." when you cannonball in to it.

    A simple fix might be to change the "shouldFollowRedirect" method return false if the URL contains "subaction=screwaround". Or, since the check is in the run() method of ClanLoungeRequest, to simply assume that the request worked, if ( this.option == CANNONBALL ).

    Hmm. I should finish my current Kingdom of Explathing run today and be able to test this in aftercore breakfast...

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,180

    Default

    OK. There is code all over ClanLoungeRequest which assumes we do not follow redirects. Redirecting to the clan recruiter is how we detect that you are not in a clan, for example.

    The shouldFollowRedirect override was added in revision 18488 when the "fortune" command was added.

    I'm going to remove that method override and figure out what needs to be down to make that command work anyway. Probably as simple as adding a visit to choice.php at the place it will redirect...

  6. #6
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,180

    Default

    Fixed in revision 19517.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •