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

keep track of system location if fleet carrier jumps while docked

This commit is contained in:
Bernd Gollesch 2020-04-24 15:41:25 +02:00 committed by Athanasius
parent 148ea8d79c
commit 690ef067b0
3 changed files with 7 additions and 7 deletions

View File

@ -431,8 +431,8 @@ class EDLogs(FileSystemEventHandler):
self.station = None
self.stationtype = None
self.stationservices = None
elif entry['event'] in ['Location', 'FSDJump', 'Docked']:
if entry['event'] == 'Location':
elif entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
if entry['event'] in ('Location', 'CarrierJump'):
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
elif entry['event'] == 'FSDJump':
self.planet = None

View File

@ -396,8 +396,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
return filtered
# Track location
if entry['event'] in ['Location', 'FSDJump', 'Docked']:
if entry['event'] == 'Location':
if entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
if entry['event'] in ('Location', 'CarrierJump'):
this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
elif entry['event'] == 'FSDJump':
this.planet = None

View File

@ -298,7 +298,7 @@ def worker():
plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg))
else:
for e, r in zip(pending, reply['events']):
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump']:
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']:
# Update main window's system status
this.lastlookup = r
this.system.event_generate('<<EDSMStatus>>', when="tail") # calls update_status in main thread
@ -345,13 +345,13 @@ def should_send(entries):
return False
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event
def update_status(event=None):
for plugin in plug.provides('edsm_notify_system'):
plug.invoke(plugin, None, 'edsm_notify_system', this.lastlookup)
# Called with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event. https://www.edsm.net/en/api-journal-v1
# Called with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event. https://www.edsm.net/en/api-journal-v1
# msgnum: 1xx = OK, 2xx = fatal error, 3xx = error, 4xx = ignorable errors.
def edsm_notify_system(reply):
if not reply: