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

Items: ShipLockerMaterials now has Data

But also, we're not getting a `BackPackMaterials` at the same time to be
sure of the state of things.
This commit is contained in:
Athanasius 2021-04-30 13:56:26 +01:00
parent 8e8c9fa3ff
commit 1f8215ed92

View File

@ -772,15 +772,16 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
self.state['Component'] = defaultdict(int)
self.state['Consumable'] = defaultdict(int)
self.state['Item'] = defaultdict(int)
self.state['Data'] = defaultdict(int)
# TODO: Really we need a full BackPackMaterials event at the same time.
# In lieu of that, empty the backpack. This will explicitly
# be wrong if Cmdr relogs at a Settlement with anything in
# backpack. We can't track when they use/pick up items
# anyway (Odyssey Alpha Phase 1 Hotfix 2).
# alpha4 - This should be changed
# backpack.
# Still no BackPackMaterials at the same time in 4.0.0.31
self.state['BackPack']['Component'] = defaultdict(int)
self.state['BackPack']['Consumable'] = defaultdict(int)
self.state['BackPack']['Item'] = defaultdict(int)
self.state['BackPack']['Data'] = defaultdict(int)
clean_components = self.coalesce_cargo(entry['Components'])
self.state['Component'].update(
@ -797,6 +798,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
{self.canonicalise(x['Name']): x['Count'] for x in clean_items}
)
clean_data = self.coalesce_cargo(entry['Data'])
self.state['Data'].update(
{self.canonicalise(x['Name']): x['Count'] for x in clean_data}
)
elif event_type == 'BackPackMaterials':
# alpha4 -
# Lists the contents of the backpack, eg when disembarking from ship