mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-22 20:00:29 +03:00
Add basic support for ModuleInfo event.
This still needs documentation adding in PLUGINS.md, which is easiest done after #897 is merged and re-based upon.
This commit is contained in:
parent
361cd168af
commit
fd0ce63341
@ -680,6 +680,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
else:
|
||||
self.state['NavRoute'] = entry
|
||||
|
||||
elif event_type == 'ModuleInfo':
|
||||
with open(join(self.currentdir, 'ModulesInfo.json'), 'rb') as mf: # type: ignore
|
||||
entry = json.load(mf)
|
||||
self.state['ModuleInfo'] = entry
|
||||
|
||||
elif event_type in ('CollectCargo', 'MarketBuy', 'BuyDrones', 'MiningRefined'):
|
||||
commodity = self.canonicalise(entry['Type'])
|
||||
self.state['Cargo'][commodity] += entry.get('Count', 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user