mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Don't attempt to set user's ship if in Fighter or SRV
This commit is contained in:
parent
e2d79b9191
commit
fdd770fe64
@ -360,7 +360,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.systemaddress = None
|
self.systemaddress = None
|
||||||
self.missioncargo = {}
|
self.missioncargo = {}
|
||||||
self.started = timegm(strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%SZ'))
|
self.started = timegm(strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%SZ'))
|
||||||
self.state.update({
|
self.state.update({ # Don't set Ship, ShipID etc since this will reflect Fighter or SRV if starting in those
|
||||||
'Captain' : None,
|
'Captain' : None,
|
||||||
'Credits' : entry['Credits'],
|
'Credits' : entry['Credits'],
|
||||||
'Loan' : entry['Loan'],
|
'Loan' : entry['Loan'],
|
||||||
@ -396,7 +396,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.state['ModulesValue'] = None
|
self.state['ModulesValue'] = None
|
||||||
self.state['Rebuy'] = None
|
self.state['Rebuy'] = None
|
||||||
self.state['Modules'] = None
|
self.state['Modules'] = None
|
||||||
elif entry['event'] == 'Loadout':
|
elif entry['event'] == 'Loadout': # Not generated if in Fighter or SRV
|
||||||
self.state['ShipID'] = entry['ShipID']
|
self.state['ShipID'] = entry['ShipID']
|
||||||
self.state['ShipIdent'] = entry['ShipIdent']
|
self.state['ShipIdent'] = entry['ShipIdent']
|
||||||
self.state['ShipName'] = entry['ShipName']
|
self.state['ShipName'] = entry['ShipName']
|
||||||
|
@ -250,13 +250,14 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
|||||||
]))
|
]))
|
||||||
|
|
||||||
# Update ship
|
# Update ship
|
||||||
if (entry['event'] in ['StartUp', 'Cargo'] or
|
if (state['ShipID'] and # Unknown if started in Fighter or SRV
|
||||||
(entry['event'] == 'Loadout' and this.shipswap) or
|
(entry['event'] in ['StartUp', 'Cargo'] or
|
||||||
this.newuser):
|
(entry['event'] == 'Loadout' and this.shipswap) or
|
||||||
|
this.newuser)):
|
||||||
data = OrderedDict([
|
data = OrderedDict([
|
||||||
('shipType', state['ShipType']),
|
('shipType', state['ShipType']),
|
||||||
('shipGameID', state['ShipID']),
|
('shipGameID', state['ShipID']),
|
||||||
('shipName', state['ShipName']), # Can be None
|
('shipName', state['ShipName']), # Can be None
|
||||||
('shipIdent', state['ShipIdent']), # Can be None
|
('shipIdent', state['ShipIdent']), # Can be None
|
||||||
('isCurrentShip', True),
|
('isCurrentShip', True),
|
||||||
])
|
])
|
||||||
@ -278,8 +279,6 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
|||||||
OrderedDict([
|
OrderedDict([
|
||||||
('starsystemName', system),
|
('starsystemName', system),
|
||||||
('stationName', station), # Can be None
|
('stationName', station), # Can be None
|
||||||
('shipType', state['ShipType']),
|
|
||||||
('shipGameID', state['ShipID']),
|
|
||||||
]))
|
]))
|
||||||
|
|
||||||
elif entry['event'] == 'Docked':
|
elif entry['event'] == 'Docked':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user