mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +03:00
ShipLocker: Can now ignore SellMicroResources
for inventory purposes
`ShipLocker` empty/file event has full new inventory.
This commit is contained in:
parent
db43442504
commit
59b410341c
10
monitor.py
10
monitor.py
@ -1023,13 +1023,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
self.state['Credits'] -= entry.get('Price', 0)
|
||||
|
||||
elif event_type == 'SellMicroResources':
|
||||
# Selling to a Bar Tender on-foot.
|
||||
# As of 4.0.0.400 we can ignore this as an empty (see file)
|
||||
# `ShipLocker` event is written for the full new inventory.
|
||||
|
||||
# But still record the credits balance change.
|
||||
self.state['Credits'] += entry.get('Price', 0)
|
||||
# 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 == 'TradeMicroResources':
|
||||
# As of 4.0.0.400 we can ignore this as an empty (see file)
|
||||
|
Loading…
x
Reference in New Issue
Block a user