mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
keep track of system location if fleet carrier jumps while docked
This commit is contained in:
parent
148ea8d79c
commit
690ef067b0
@ -431,8 +431,8 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.station = None
|
self.station = None
|
||||||
self.stationtype = None
|
self.stationtype = None
|
||||||
self.stationservices = None
|
self.stationservices = None
|
||||||
elif entry['event'] in ['Location', 'FSDJump', 'Docked']:
|
elif entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
|
||||||
if entry['event'] == 'Location':
|
if entry['event'] in ('Location', 'CarrierJump'):
|
||||||
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
||||||
elif entry['event'] == 'FSDJump':
|
elif entry['event'] == 'FSDJump':
|
||||||
self.planet = None
|
self.planet = None
|
||||||
|
@ -396,8 +396,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
|||||||
return filtered
|
return filtered
|
||||||
|
|
||||||
# Track location
|
# Track location
|
||||||
if entry['event'] in ['Location', 'FSDJump', 'Docked']:
|
if entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
|
||||||
if entry['event'] == 'Location':
|
if entry['event'] in ('Location', 'CarrierJump'):
|
||||||
this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
||||||
elif entry['event'] == 'FSDJump':
|
elif entry['event'] == 'FSDJump':
|
||||||
this.planet = None
|
this.planet = None
|
||||||
|
@ -298,7 +298,7 @@ def worker():
|
|||||||
plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg))
|
plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg))
|
||||||
else:
|
else:
|
||||||
for e, r in zip(pending, reply['events']):
|
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
|
# Update main window's system status
|
||||||
this.lastlookup = r
|
this.lastlookup = r
|
||||||
this.system.event_generate('<<EDSMStatus>>', when="tail") # calls update_status in main thread
|
this.system.event_generate('<<EDSMStatus>>', when="tail") # calls update_status in main thread
|
||||||
@ -345,13 +345,13 @@ def should_send(entries):
|
|||||||
return False
|
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):
|
def update_status(event=None):
|
||||||
for plugin in plug.provides('edsm_notify_system'):
|
for plugin in plug.provides('edsm_notify_system'):
|
||||||
plug.invoke(plugin, None, 'edsm_notify_system', this.lastlookup)
|
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.
|
# msgnum: 1xx = OK, 2xx = fatal error, 3xx = error, 4xx = ignorable errors.
|
||||||
def edsm_notify_system(reply):
|
def edsm_notify_system(reply):
|
||||||
if not reply:
|
if not reply:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user