XVMX / vmbot

Jabberbot based chatbot
GNU General Public License v3.0
2 stars 5 forks source link

Improve lookup for structure market orders with future ESI endpoints #73

Open TheJokr opened 6 years ago

TheJokr commented 6 years ago

ESI allows authenticated searches to find structures (much like the in-game search function) and also gives access to structure market orders. This can be used to add market orders of accessible structures to get_market_orders. Citadel spam is a problem with that approach though, since market data for every citadel needs to be requested individually. We will need to make those requests in parallel (see futures and their backport).

TheJokr commented 6 years ago

I'll wait for CCP to add the X-Pages header to the structure market orders route before continuing with this.

Edit: This is live now (12bc8f0), but there's no way to check if a structure has a market module installed without potentially producing a 403. Edit 2: An endpoint to query structure service data is supposed to be added sometime after parity is reached.

TheJokr commented 1 year ago

It seems like CCP stopped most development work on ESI, so that endpoint will probably never become reality. However, I had added a bespoke cache for market structures in c808458d3843cbf91c792fddff6966b26d836f67 already. The cache remembers a structure's location, type ID (i.e., can it fit a market module?), and whether the previous market lookup was successful. The usual structure spam can't fit market modules, so we immediately save ourselves a lot of requests.

Only new and expired entries can now produce 403s, which reduces their number to a level that (usually) doesn't trigger error rate limiting. I'll keep this issue open in case CCP ever adds a way to query the required information directly.