1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

EDDN: approachsettlement/1: Bail if no System (name) yet

* A login-time `ApproachSettlement` happens before `Location`, if
  appropriate.
* Also add a future comment about FSSSignalDiscovered, for if EDDN ever adds
  the schema.
This commit is contained in:
Athanasius 2022-02-20 19:44:53 +00:00
parent 6f8847e3e1
commit 562a224857
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -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,