From 1e1d5a3ebff50dbbe02ea4e68fc85e295bba4a16 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Thu, 13 Oct 2016 23:56:41 +0100 Subject: [PATCH] Add mandatory StarPos property to EDDN journal messages Ref jamesremuscat/EDDN#53 --- EDMarketConnector.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index ac5bab2a..8d2f9ae4 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -535,7 +535,7 @@ class AppWindow: if (config.getint('output') & config.OUT_SYS_EDDN and monitor.cmdr and (entry['event'] == 'FSDJump' and system_changed or entry['event'] == 'Docked' and station_changed or - entry['event'] == 'Scan' and monitor.system)): + entry['event'] == 'Scan' and monitor.system and monitor.coordinates)): # strip out properties disallowed by the schema for thing in ['CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist']: entry.pop(thing, None) @@ -543,9 +543,11 @@ class AppWindow: if thing.endswith('_Localised'): entry.pop(thing, None) - # add mandatory StarSystem property to Scan events + # add mandatory StarSystem and StarPos properties to Scan events if 'StarSystem' not in entry: entry['StarSystem'] = monitor.system + if 'StarPos' not in entry: + entry['StarPos'] = list(monitor.coordinates) self.status['text'] = _('Sending data to EDDN...') eddn.export_journal_entry(monitor.cmdr, monitor.is_beta, entry)