1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00

Support for event 'SellMicroResources'

These are being sold to a Bar Tender.

There's a MicroResources array, one per item name.  We assume this is
always selling from ShipLocker, not BackPack.
This commit is contained in:
Athanasius 2021-04-05 11:17:42 +01:00
parent a2c48fdd70
commit c94ebad54c

@ -757,7 +757,18 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
elif event_type == 'BuyMicroResources':
# Buying from a Pioneer Supplies, goes directly to ShipLocker.
# One event per Item, not an array.
self.state[entry['Category']][entry['Name']] += entry['Count']
category = self.category(entry['Category'])
name = self.canonicalise(entry['Name'])
self.state[category][name] += entry['Count']
elif event_type == 'SellMicroResources':
# Selling to a Bar Tender on-foot.
# One event per whole sale, so it's an array.
for mr in entry['MicroResources']:
category = self.category(mr['Category'])
name = self.canonicalise(mr['Name'])
self.state[category][name] -= mr['Count']
elif event_type == 'NavRoute':
# Added in ED 3.7 - multi-hop route details in NavRoute.json