Tested in r17701.
Dynamic price data is available at http://kolmafia.us/scripts/updateprices.php?action=getmap. At login, if sharePriceData is true, mafia will download a copy of this and use its pricing data.
However, values in the map do not always update historical_price():
Value in updateprices.php, at the time of login, just before running that command: 23000
Value in mafia's data/mallprices.txt: 25000
In theory, it should have returned 23000, as updateprices.php has a more recent timestamp for that entry. I believe this is due to the following line of code in MallPriceDatabase.java:
This stops processing the data if it encounters an invalid line, particularly if the item ID is out of range.
If we check http://kolmafia.us/scripts/updateprices.php?action=getmap we find this line, among others:
Which means item ID 5985988. This is out of bounds, and prevents the rest of the prices from being properly read. So everything up to that point is updated in mafia's mall price tracking, but the rest is discarded.
Maybe it should just continue instead of stopping?
Also, sharePriceData isn't set to true by default. Should mafia be changed so it always loads updateprices.php at login for accurate pricing information, regardless of that setting? That's just my personal feeling, kind of like how I'd love for svnUpdateOnLogin to be true by default.
Dynamic price data is available at http://kolmafia.us/scripts/updateprices.php?action=getmap. At login, if sharePriceData is true, mafia will download a copy of this and use its pricing data.
However, values in the map do not always update historical_price():
Code:
322 prices updated from http://kolmafia.us/scripts/updateprices.php?action=getmap
> get sharePriceData
true
> ash $item[9119].historical_price()
Returned: 25000
Value in mafia's data/mallprices.txt: 25000
In theory, it should have returned 23000, as updateprices.php has a more recent timestamp for that entry. I believe this is due to the following line of code in MallPriceDatabase.java:
Code:
if ( id < 1 || id > ItemDatabase.maxItemId() ||
price < 1 || price > 999999999 || timestamp <= 0 )
{ // Something's fishy with this file...
return count;
}
If we check http://kolmafia.us/scripts/updateprices.php?action=getmap we find this line, among others:
Code:
5985988 1405180833 800
Maybe it should just continue instead of stopping?
Also, sharePriceData isn't set to true by default. Should mafia be changed so it always loads updateprices.php at login for accurate pricing information, regardless of that setting? That's just my personal feeling, kind of like how I'd love for svnUpdateOnLogin to be true by default.