Partial data is better than no data, or bad data. So if Status.json
BodyName is available, always use it. *Then* see if Journal BodyName
matches that, and if so set BodyID.
Close-orbiting bodies might therefore cause BodyName to be set without
BodyID, but then it's up to EDDN listeners to make a decision, rather
than making it for them.
* The Tracking UI is now up and running.
* Some of the tracking corrected:
- Set BodyID from ApproachBody.
- Do not clear values on SupercruiseEntry, allow either FSDJump or
LeaveBody to do this.
- Clear the values if we detect the Main Menu music track (when you
exit to the menu, not just when you look at the menu whilst
in-game).
* Various comments added to help with documenting the tracking for EDDN
uploaders.
This will only work on startup for now, with it present/active the EDDN
plugin will add a UI frame to show what it's tracking.
Intended for developer use only.
Yes, there's some lovely mis-match between Mapping and Dict type to work
around. Mapping complains about lack of __delitem__, so saying it's a
Dict instead and ensuring that matches at the call site.
* As we're now not sending *all* journal events on the journal schema
this refactors only the actual sending in export_journal_entry(), with
the other functionality in export_journal_generic(), so that the new
export_journal_fssdiscoveryscan() can use export_journal_entry() as
well.
In the future EDDN will move to a schema per event type, so we'll lose
_generic(). Factoring out some things like augmentations into their own
functions will come next.
This also entailed slightly reworking the way the EDDN code uses this
URL. It was very generalised, so as to allow for the debug "just send
and log locally" code, but as the only URL is the 'upload' one much of
that seemed un-necessary.
So that code has been simplified.
The ERROR log level is needlessly high for complaining about git not being installed, especially when we're running from an extracted source archive rather than a repo. Let's keep things calm and avoid polluting desktop session logs. The INFO log level is plenty.
This was wrong since 291fbf2908 due to the
check saying "only active if in CQC", when it needed to be "only active
NOT in CQC, along with these other conditions".
* Session.profile() was unused (used to be called from stats.py, but
that uses cached data now).
* Session.query() was unused, other than by itself. Normal calls will
currently be via companion.Session.station(). Future CAPI queries
like `/fleetcarrier` might add their own companion.Session function.
* And in doing so get --capi-pretend-down working again.
* Small tweak to EDMarketConnector to not throw extra exception if there
was a CAPI query exception.
NB: We can't use a generator here to make a python object of the data,
to then use json.dumps() on because the raw_data is a *string* (decoded
from what we received from the CAPI service), and thus it will get
encoded as such, i.e.
"raw_data": "{\"id\":322...
when we want:
"raw_data": {"id":322...
We do not want to json.loads() that string only to then json.dumps() it
because the whole point is that this is the **raw** data to help
diagnose any issues with the CAPI service/data. Such a conversion and
back could either throw an exception we don't want here (because we want
the raw data) or possibly distort things from what was actually
received.