Feature - Implemented Faster autosell handling (in many cases)

gulaschkanone

New member
Currently, the CLI autosell command and the ASH autosell function seem to always hit autosell_ugly.php for their job, which does a wasteful full inventory load. In cases where only one item is handled, or all quantities are the same numeric amount (or all of them, or all but one of them), which probably covers a large amount of cases, hitting sellstuff.php?action=sell&ajax=1&type=<quant|all|allbutone>&whichitem[]=<itemid>&<whichitem[]=<other itemid>&>*howmany=<type==quant?amount:1>&pwd&_=<unix timestamp> (game uses GET for this) would do the job faster.
 

heeheehee

Developer
Staff member
Interesting that sellstuff_ugly.php doesn't seem to support ajax=1.

Unix timestamp doesn't seem to be necessary. With that said, r16729 should fix this.

There's another minor bug with batching of autosell requests (priority is given to all, then all but one, then individual quantities --- if you try to autosell 1 meat paste, 1 meat stack when you have 1 meat paste and 2 meat stacks, it'll use two requests). I have a patch for that as well, but it's relatively complicated logic for a relatively small change in behavior, and I don't want to commit it without further review.
 

heeheehee

Developer
Staff member
Also, for what it's worth, sellstuff_ugly.php allows you to sell items in exactly the same fashion.
 
Top