1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-05-31 07:39:44 +03:00

Merge pull request #1484 from EDCD/fix/1482/approachsettlement-before-login-location

EDDN: approachsettlement/1: Bail if no System (name) yet
This commit is contained in:
Athanasius 2022-02-21 11:41:55 +00:00 committed by GitHub
commit d5d2577019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -829,7 +829,7 @@ class EDDN:
else:
logger.warning("Neither this_coordinates or this.coordinates set, can't add StarPos")
return 'No source for adding StarPos to approachsettlement/1 !'
return 'No source for adding StarPos to EDDN message !'
return entry
@ -1520,6 +1520,12 @@ def journal_entry( # noqa: C901, CCR001
return this.eddn.export_journal_navroute(cmdr, is_beta, entry)
elif event_name == 'approachsettlement':
# An `ApproachSettlement` can appear *before* `Location` if you
# logged at one. We won't have necessary augmentation data
# at this point, so bail.
if system is None:
return ""
return this.eddn.export_journal_approachsettlement(
cmdr,
system,
@ -1528,6 +1534,14 @@ def journal_entry( # noqa: C901, CCR001
entry
)
# NB: If adding FSSSignalDiscovered these absolutely come in at login
# time **BEFORE** the `Location` event, so we won't yet know things
# like SystemNane, or StarPos.
# We can either have the "now send the batch" code add such (but
# that has corner cases around changing systems in the meantime),
# drop those events, or if the schema allows, send without those
# augmentations.
elif event_name == 'fssallbodiesfound':
return this.eddn.export_journal_fssallbodiesfound(
cmdr,