1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Cargo: Update ship cargo on CargoTransfer event

We missed this when it was brought in with Fleet Carriers in 2020.
This commit is contained in:
Athanasius 2021-05-01 12:15:57 +01:00
parent 812398ee0d
commit 7c7609f2ee

View File

@ -783,8 +783,14 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
self.state['Cargo'].update({self.canonicalise(x['Name']): x['Count'] for x in clean})
elif event_type == 'CargoTransfer':
# TODO: Transfers between ship and FC/SRV
pass
for c in entry['Transfers']:
name = self.canonicalise(c['Type'])
if c['Direction'] == 'toship':
self.state['Cargo'][name] += c['Count']
else:
# So it's *from* the ship
self.state['Cargo'][name] -= c['Count']
elif event_type == 'ShipLockerMaterials':
# This event has the current totals, so drop any current data