mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Add mandatory StarPos property to EDDN journal messages
Ref jamesremuscat/EDDN#53
This commit is contained in:
parent
c7c105b427
commit
1e1d5a3ebf
@ -535,7 +535,7 @@ class AppWindow:
|
|||||||
if (config.getint('output') & config.OUT_SYS_EDDN and monitor.cmdr and
|
if (config.getint('output') & config.OUT_SYS_EDDN and monitor.cmdr and
|
||||||
(entry['event'] == 'FSDJump' and system_changed or
|
(entry['event'] == 'FSDJump' and system_changed or
|
||||||
entry['event'] == 'Docked' and station_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
|
# strip out properties disallowed by the schema
|
||||||
for thing in ['CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist']:
|
for thing in ['CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist']:
|
||||||
entry.pop(thing, None)
|
entry.pop(thing, None)
|
||||||
@ -543,9 +543,11 @@ class AppWindow:
|
|||||||
if thing.endswith('_Localised'):
|
if thing.endswith('_Localised'):
|
||||||
entry.pop(thing, None)
|
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:
|
if 'StarSystem' not in entry:
|
||||||
entry['StarSystem'] = monitor.system
|
entry['StarSystem'] = monitor.system
|
||||||
|
if 'StarPos' not in entry:
|
||||||
|
entry['StarPos'] = list(monitor.coordinates)
|
||||||
|
|
||||||
self.status['text'] = _('Sending data to EDDN...')
|
self.status['text'] = _('Sending data to EDDN...')
|
||||||
eddn.export_journal_entry(monitor.cmdr, monitor.is_beta, entry)
|
eddn.export_journal_entry(monitor.cmdr, monitor.is_beta, entry)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user