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

203 Commits

Author SHA1 Message Date
Athanasius
aecf375138
EDDN: Record horizons flag in journal_entry()
So that we can then first check *this* in `is_horizons()`.
2021-10-17 14:55:43 +01:00
Athanasius
7fa0576c85
EDDN: Keep 'unknown schema' messages in replaylog
This still logs them, at DEBUG, which will get spammy as such messages
accumulate.

Uncommenting the:

`#  return  # Pretend it went OK so this message isn't retried`

at line 291 in EDDN.sendreplay(), in the:

`except requests.exceptions.HTTPError as e:`

block would cause them to not stay in the replaylog.
2021-10-17 14:41:25 +01:00
Athanasius
5ae953bf45
EDDN: Drop messages if EDDN says it doesn't know the schema
Currently Live EDDN doesn't yet have the new schemas such as navroute,
so will complain.  Rather than leaving such messages in our EDDN replay
queue and getting an error every time that is run, detect this error
case and drop the messages.
2021-10-17 14:24:23 +01:00
Athanasius
fc34d023b6
EDDN: tracking_ui_update(): check if this UI bit actually active 2021-10-17 14:10:30 +01:00
Athanasius
42594c9366
EDDN: Abbreviate tracking_ui_update() code 2021-10-15 11:57:09 +01:00
Athanasius
60f3b524e2
EDDN: codexentry: Always set BodyName from Status.json, ID if Journal matches
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.
2021-10-14 13:04:52 +01:00
Athanasius
2ef9d9e3c3
EDDN: BodyName/ID tracking tested for simple body
* 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.
2021-10-12 13:06:38 +01:00
Athanasius
dd8ec061d3
EDDN: Dummy tracking UI to determine layout 2021-10-10 15:40:41 +01:00
Athanasius
15ea858c6b
EDDN: codexentry: Use BodyID if available 2021-10-10 14:55:46 +01:00
Athanasius
d7eacd253c
EDDN: Track BodyID from Journal events
* Also renames all of the body name/ID 'this' variables to snake case.
2021-10-10 14:43:01 +01:00
Athanasius
50f03ae753
EDDN: codexentry: Set BodyName if available from Status.json 2021-10-10 14:37:20 +01:00
Athanasius
8700868724
EDDN: Rename this.planet to this.bodyname for consistency 2021-10-10 14:32:12 +01:00
Athanasius
b82d25ee07
EDDN: Start tracking Status.json BodyName 2021-10-10 14:31:40 +01:00
Athanasius
5546926776
EDDN: Use 'if key (not) in dict:' rather than .get() is (not) None 2021-10-10 14:23:24 +01:00
Athanasius
84ef77197d
EDDN: Use MutableMapping when needing to update a Mapping, not Dict 2021-10-10 14:23:24 +01:00
Athanasius
e1d547460b
EDDN: Add type hints back to new export_journal_entry() 2021-10-10 14:23:24 +01:00
Athanasius
ba20599511
EDDN: Make comment about removing odyssey flag a WORKAROUND
This is for the NavRoute handling.
2021-10-10 14:23:23 +01:00
Athanasius
0ffbb4dac9
EDDN: Send 'NavRoute' data on appropriate schema
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.
2021-10-10 14:23:23 +01:00
Athanasius
7081a5a3ab
EDDN: Send ScanBaryCentre on correct schema 2021-10-10 14:23:23 +01:00
Athanasius
f97cf0897a
EDDN: Add CodexEntry on its own schema
This requires a tweak to `entry_augment_system_data()` as we now also
have 'System' as a possible key for a system name.
2021-10-10 14:23:23 +01:00
Athanasius
9c611d73d5
EDDN: TODO for dropping messages if we get a clear HTTP error
i.e. message not matching schema
2021-10-10 14:23:22 +01:00
Athanasius
413f9049f5
EDDN: Add support for NavBeaconScan on its own schema
* Refactors the augmentation code for use by both fssdiscoveryscan and
  navbeaconscan.
2021-10-10 14:23:22 +01:00
Athanasius
1dda61907b
EDDN: TODO on refactoring & return result of fssdiscoveryscan export 2021-10-10 14:23:22 +01:00
Athanasius
c4ba8acb17
EDDN: Add support for EDDN FSSDiscoveryScan schema from that event
* 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.
2021-10-10 14:23:09 +01:00
Athanasius
e11b357502
EDDN: DEFAULT URL requires / on the end
The EDDN server config does NOT redirect from /upload to /upload/
2021-10-01 08:34:50 +01:00
Athanasius
f9875b5b9a
EDDN: Make use of new CL arg to use custom upload URL
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.
2021-09-24 10:59:15 +01:00
Athanasius
c9d478222a
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.
2021-08-24 13:52:48 +01:00
A_D
6c7245ee3d
updated eddn to new killswitches 2021-08-19 20:37:39 +02:00
Athanasius
79a2003b53
plugins/eddn: Use logger.trace_if(...) 2021-08-13 15:14:02 +01:00
A_D
fe0e752c9b
Added support for arbitrary plugins for POST debug
This works by replacing --eddn-local with --debug-sender, and making the
webserver more generic. support has been added to EDSM, EDDN, and INARA.
2021-06-18 23:36:42 +02:00
A_D
57d7889da9
Sorted imports 2021-06-18 23:34:26 +02:00
A_D
4ef153b1b2
Added fake EDDN Listener
A simple HTTP handler has been added that will dump any and all POST
data it gets to EDMC's log.

Additionally, a new command line argument to switch EDMC to using this
as its EDDN target has been added.
2021-06-18 23:34:20 +02:00
Athanasius
a0b310f72e Translations: Amalgamate some LANG comments & en.template updated 2021-06-13 15:49:09 +01:00
A_D
8d77cc039b Added LANG comments for EDDN localisation 2021-06-10 20:29:11 +01:00
A_D
17980ac6ad
Added localisation 2021-06-07 18:10:25 +02:00
A_D
e6c8183bfc
made EDDN errors more verbose 2021-06-07 18:09:18 +02:00
Athanasius
4fa0521438 other core plugins: LANG comment pass 2021-06-07 15:43:32 +01:00
Athanasius
b862f6b00a Translations: Add killswitch 'disabled' messages. 2021-05-17 10:18:04 +01:00
Athanasius
cba2f32cef plugins/eddn: export_journal_entry didn't have is_odyssey arg added 2021-05-15 08:17:58 +01:00
Athanasius
58c740bc6c plugins/eddn: Set odyssey flag in extra messages
1. journal outfitting
2. journal shipyard
3. journal commodities

As these are sourced from the additional .json files via a load over
`entry` contents we need to re-set `entry['odyssey']` and then make sure
we use it.
2021-05-12 18:18:41 +01:00
Athanasius
86a17e5e4c plugins/eddn: Utilise this.odyssey to augment CAPI-sourced messages
NB: Currently EDDN gateway doesn't have the updated schemas, so the
export_commodities() throws an exception and thus neither outfitting or
shipyard exports are even attempted.
2021-05-12 17:55:20 +01:00
Athanasius
8dfd638f28 plugins/eddn: Store Odyssey boolean in This state.
This is so we can access it in cmdr_data() as well.
2021-05-12 17:29:15 +01:00
Athanasius
97a6d07c51 plugins/eddn: Send bool 'odyssey' in all event messages.
This is so listeners can make decision on if/how/when to store data that
might be from base/horizons or Odyssey.
2021-05-12 17:14:58 +01:00
Athanasius
22dbd4e048 EDDN: Fix building of "ships this station sells" list.
This likely hadn't been tested since a rewrite due to pre-Odyssey alpha
having broken CAPI without shipyard_list on normal stations.
2021-04-12 08:31:48 +01:00
Athanasius
5edf8d5b59 Change monitor.state['on_foot'] to 'OnFoot' for consistency 2021-04-12 08:30:51 +01:00
Athanasius
567cfdb9ca Will now send data to EDDN when on-foot in-station.
NB: No shipyard in tests because data['ships']['shipyard_list'] is an
empty list.  This might be the bug not having been fixed, or the station
might genuinely have no ships for sale.  We have no way to check in
Odyssey Alpha Phase 1.
2021-04-12 08:30:51 +01:00
Athanasius
b0bda6e982 EDDN: Convert appversion_nobuild() to str
Without this the JSON serialisation later on barfs on it.
2021-04-01 14:46:43 +01:00
Athanasius
567bda048d plugins/eddn: Ensure types on all 'this' variables. 2021-04-01 14:45:53 +01:00
Athanasius
501682c439 Split text following """ if entire docstring not single line. 2021-04-01 14:45:53 +01:00
Athanasius
7da15faaf3 plugins/eddn: Convert 'this' to a class for typing reasons.
* Typing hates the 'this' hack on module's __name__, so use a small
  class instead.
* Added missing `return None`s.
* Other typing cleanups.
2021-04-01 14:45:53 +01:00