Bug - Fixed Mafia no longer pulls from clan stash with the "acquire" command from the CLI

Bullson

New member
Mafia no longer pulls from clan stash with the "acquire" command from the CLI

Using r14301 (but tested with r14292), made sure the option to pull from clan stash is checked in Preferences, check stock of item, go to CLI and type "acquire 1 item" and Mafia throws an error "You need 1 more item to continue."

There are items in the clan stash and I have authority to pull them, in fact I can with the "stash pull" command, but acquire fails to access the clan stash. If the option to buy from the mall is checked it will merrily spend my meat but won't take free items from the clan. Boo.
 

Bale

Minion
Please verify the Preference -> Item Acquisition -> Take items from the clan stash whenever needed

Just to confirm that none of your settings got changed by some weird magic.
 

StaticMan

New member
Got the same error on three different accounts, and yes, all of them have the "take item from clan stash whenever needed" box ticked.

I'm currently using an older version (r14256) and had no problem with this until today.
 

lostcalpolydude

Developer
Staff member
I can't reproduce this. I turned on the setting (since I never have it on) and acquire grabbed an item from the stash just fine, using 14302.

I thought maybe mafia might not refresh the stash for some reason, but then I switched clans to clear the cached item list and mafia checked what was in the stash just fine too.
 

Veracity

Developer
Staff member
I cannot reproduce this.

> stash put * black pixel

Dropping items into stash...
Requests complete.

> set autoSatisfyWithStash=true

autoSatisfyWithStash => true

> acquire 1 black pixel

Pulling items from stash...
You acquire an item: black pixel
Requests complete.

> stash put * black pixel

Dropping items into stash...
Requests complete.

> set autoSatisfyWithStash=false

autoSatisfyWithStash => false

> acquire 1 black pixel

Searching for "black pixel"...
Search complete.
Purchasing black pixel (1 @ 100)...
Purchases complete.
 

Bullson

New member
I had checked before submitting but I just tried unchecking and re-checking the box. No change and still won't pull with acquire.
 

Bullson

New member
Also tried "set autoSatisfyWithStash=true"


> set autoSatisfyWithStash=true

> acquire 100 black pixel

Searching for "black pixel"...
Search complete.
Purchasing black pixel (1 @ 100)...
Purchasing black pixel (45 @ 100)...
Purchasing black pixel (5 @ 100)...
Purchasing black pixel (30 @ 100)...
Purchasing black pixel (19 @ 100)...
Purchases complete.

edit: I just noticed NO response to "set autoSatisfyWithStash=true"

edit 2: I did a complete new download to a clean folder to see if there was something I was missing. r14305 and still not pulling from stash with acquire. I checked and set preferences and tried to "set autoSatisfyWithStash=true" but no response and no joy.
 
Last edited:

Veracity

Developer
Staff member
If autoSatisfyWithStash is already true, setting it to true will not print anything. Try this:

> ash stash_amount( $item[ black pixel ] )

Refreshing stash contents...
Stash list retrieved.
Returned: 4

> stash take 1 black pixel

Pulling items from stash...
You acquire an item: black pixel
Requests complete.
 

Bullson

New member
If autoSatisfyWithStash is already true, setting it to true will not print anything. Try this:
OK...

> ash stash_amount( $item[ black pixel ] )

Refreshing stash contents...
Stash list retrieved.
Returned: 100

> stash take 1 black pixel

Pulling items from stash...
You acquire an item: black pixel
Requests complete.

> acquire 2 black pixel

Searching for "black pixel"...
Search complete.
Purchasing black pixel (1 @ 100)...
Purchases complete.
 

Veracity

Developer
Staff member
Ah. I bet this is a side effect of the new top menu.

InventoryManager.retrieveItem:

Code:
		boolean shouldUseStash = Preferences.getBoolean( "autoSatisfyWithStash" ) && allowed;
		if ( shouldUseStash && KoLCharacter.canInteract() && KoLCharacter.hasClan() )
KoLCharacter.hasClan is set like this when we parse the top menu in MoonPhaseRequest:

Code:
		KoLCharacter.setClan( this.responseText.indexOf( "clan_hall.php" ) != -1 );
I expect this would always have failed if you had icons in your top menu (and nothing going to the clan hall). But now, with the icons there by default, it is much more likely to bite you.

FWIW, I changed my top menu back to links immediately after I saw the new change.
 

Bullson

New member
FWIW, I changed my top menu back to links immediately after I saw the new change.

That makes sense, especially timing-wise.
(Now to hunt down the option for links.)

edit: Hooray!

options> Menu Pane Options> links
close mafia
open mafia

> acquire 2 black pixel

Refreshing stash contents...
Stash list retrieved.
Pulling items from stash...
You acquire black pixel (2)
Requests complete.

Thanks for all the help!
 
Last edited:

lostcalpolydude

Developer
Staff member
With the new menu active, topmenu.php redirects to awesomemenu.php. My guess is that mafia doesn't follow the redirect, since awesomemenu includes clan_rumpus.php even if you haven't added an icon for it (the page has all of the HTML/etc for adding icons already loaded, apparently).
 

Veracity

Developer
Staff member
That is correct. I just opened a New Content thread to deal with this.

I think it would be easy to make MoonPhaseRequest handle the redirect - either by following it automatically, or by explicitly following it and noting that we are in "fancy" menu style.
 

Veracity

Developer
Staff member
Well, I don't know what to do with this report. Bottom line is, it WILL pull from the clan stash - if it believes you HAVE a clan. I changed the top menu parsing and it will always think you are in a clan if you have icons, unfortunately, which will result in a useless server hit if you actually are not in a clan and you give acquire permission to pull from the stash.

Other than tracking your clan differently - an additional server hit at login, say, as well as tracking when you leave a clan - I don't know what to do about that.
 

Veracity

Developer
Staff member
Revision 14325 no longer looks at the top menu to decide if you are in a clan. Instead, at login (or session refresh), we look at your profile to get your clan name and clan id.

I don't think we necessarily update that info correctly when you switch clans or leave your clan, but there is another bug report taking about that.

Modulo that, I am declaring this bug fixed.
 
Top