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

Ignore Loadout events for SRV and SLF

This commit is contained in:
Jonathan Harris 2018-03-08 18:35:53 +00:00
parent 055d59c3d6
commit a157478f03

View File

@ -393,7 +393,9 @@ class EDLogs(FileSystemEventHandler):
self.state['ModulesValue'] = None
self.state['Rebuy'] = None
self.state['Modules'] = None
elif entry['event'] == 'Loadout': # Not generated if in Fighter or SRV
elif (entry['event'] == 'Loadout' and
not self.canonicalise(entry['Ship']).endswith('fighter') and
not self.canonicalise(entry['Ship']).endswith('buggy')):
self.state['ShipID'] = entry['ShipID']
self.state['ShipIdent'] = entry['ShipIdent']
self.state['ShipName'] = entry['ShipName']
@ -413,12 +415,13 @@ class EDLogs(FileSystemEventHandler):
module.pop('AmmoInHopper')
self.state['Modules'][module['Slot']] = module
elif entry['event'] == 'ModuleBuy':
self.state['Modules'][entry['Slot']] = { 'Slot' : entry['Slot'],
'Item' : self.canonicalise(entry['BuyItem']),
'On' : True,
'Priority' : 1,
'Health' : 1.0,
'Value' : entry['BuyPrice'],
self.state['Modules'][entry['Slot']] = {
'Slot' : entry['Slot'],
'Item' : self.canonicalise(entry['BuyItem']),
'On' : True,
'Priority' : 1,
'Health' : 1.0,
'Value' : entry['BuyPrice'],
}
elif entry['event'] == 'ModuleSell':
self.state['Modules'].pop(entry['Slot'], None)