From c9d478222ac087bc16948d7f5dac05ce7eb99ad3 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 24 Aug 2021 13:52:48 +0100 Subject: [PATCH] EDMC: Provide EDDN Odyssey flag from monitor state This should have been set from the latest Journal file, and the key/value is in LoadGame in Odyssey. It's only documented as: "Whether the sending Cmdr has an Odyssey expansion." in the current EDDN Journal schema. Thus sending this as False if the Cmdr last logged into Horizons/base game should be OK. --- EDMC.py | 6 +++--- plugins/eddn.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EDMC.py b/EDMC.py index 5568b19f..4e0428f0 100755 --- a/EDMC.py +++ b/EDMC.py @@ -441,9 +441,9 @@ sys.path: {sys.path}''' try: eddn_sender = eddn.EDDN(None) logger.debug('Sending Market, Outfitting and Shipyard data to EDDN...') - eddn_sender.export_commodities(data, monitor.is_beta) - eddn_sender.export_outfitting(data, monitor.is_beta) - eddn_sender.export_shipyard(data, monitor.is_beta) + eddn_sender.export_commodities(data, monitor.is_beta, monitor.state['Odyssey']) + eddn_sender.export_outfitting(data, monitor.is_beta, monitor.state['Odyssey']) + eddn_sender.export_shipyard(data, monitor.is_beta, monitor.state['Odyssey']) except Exception: logger.exception('Failed to send data to EDDN') diff --git a/plugins/eddn.py b/plugins/eddn.py index 3d0307fa..36a4cb94 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -310,6 +310,7 @@ Msg:\n{msg}''' :param data: a dict containing the starport data :param is_beta: whether or not we're currently in beta mode + :param is_odyssey: whether the account shows as having Odyssey expansion. """ commodities: List[OrderedDictT[str, Any]] = [] for commodity in data['lastStarport'].get('commodities') or []: @@ -790,7 +791,6 @@ def journal_entry( # noqa: C901, CCR001 :param state: `dict` - Current `monitor.state` data. :return: `str` - Error message, or `None` if no errors. """ - should_return, new_data = killswitch.check_killswitch('plugins.eddn.journal', entry) if should_return: plug.show_error(_('EDDN journal handler disabled. See Log.')) # LANG: Killswitch disabled EDDN