Commit Graph
203 Commits
Author SHA1 Message Date
Athanasius 210012a4a6 Merge pull request #1483 from EDCD/fix/1481/codexentry-can-have-empty-string-nearestdestination
EDDN: codexentry/1: Tighten up 'empty string' checks
2022-02-21 11:44:20 +00:00
Athanasius 562a224857 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.
2022-02-20 19:44:53 +00:00
Athanasius 6f8847e3e1 EDDN: approachsettlement/1: Don't claim entry_augment_system_data() as only for us 2022-02-20 19:30:45 +00:00
Athanasius de69b95b8a EDDN: codexentry/1: Tighten up 'empty string' checks
It turns out some of the other strings, that do not have minLength=1 in the
schema, can be empty and that's OK.   i.e. NearestDestination.

So, let's only check for the actual minLength=1 things.  Which is a few
top-level key:values, and then the contents of the Traits array.
2022-02-20 19:18:34 +00:00
Athanasius e51aba1cc3 EDDN: Handle ApproachSettlement missing planetary coords 2022-02-18 15:23:27 +00:00
Athanasius a93ee14c05 eddn: Implement schema fssallbodiesfound/1 2022-02-11 16:32:43 +00:00
Athanasius 6f0095e5fe eddn: Slightly rationalise passed StarSystem
* Call it system_name in `export_journal_fssdiscoveryscan()`, as `system`
  could be amigbuous.
* Might as well use `system` passed in to `journal_entry()` when calling
  `export_journal_approachsettlement()`.
2022-02-09 16:14:15 +00:00
Athanasius f1ba8ee5e1 eddn: Fix up approachsettlement & adjust other such function signatures
1. We need StarPos (as well as StarSystem)
2. Adding more state tracking in this plugin is misguided.
3. So added it in monitor instead, putting *copies* of data in the
  monitor.state dictionary.
4. So we reference those, but only available in journal_entry() itself, else
  we'd need to pass the whole of `state` in.
5. So instead pass in the bits of `state` only when we need them.
2022-02-09 16:07:16 +00:00
Athanasius 3a0dbb906a eddn: export_journal_approachsettlement() implementation 2022-02-09 15:01:56 +00:00
Athanasius 91c36a5b1a eddn: Change to the ".lower() Journal event name once" paradigm
Also, whilst the *current* code has the 'augment files' handled last in
then if/else tree we shouldn't assume that will always be the case.
So, be paranoid and use different variables for the augment-loaded entry
and its .lower event_name.

'cos you just know one of us will trip up on it later if there's ever some
'finally' code after that conditional tree.
2022-02-09 14:08:36 +00:00
Athanasius d59dc18b1b eddn: make the exclusive nature of 'own schema' events explicit 2022-02-09 13:50:42 +00:00
Athanasius 636bcd65bb Merge pull request #1432 from EDCD/fix/1403/eddn-upload-errors
eddn: Log if a 'location' event doesn't have SystemAddress
2022-02-04 12:08:09 +00:00
Athanasius d83a1c514d eddn: Log if a 'location' event doesn't have SystemAddress
It *really* shouldn't ever happen, and we'll want to see the full event
if it does somehow.
2022-02-03 15:33:34 +00:00
Athanasius 1bb48ed596 eddn/codexentry: Bail and show error if empty string in message 2022-02-03 13:59:52 +00:00
Athanasius 45b78f55c4 eddn: say 'is falsey' in error messages as well 2022-02-01 18:05:28 +00:00
Athanasius 2bf70aae14 eddn: Be paranoid about this.status_body_name type and value
As it was we'd blindly set codexentry['BodyName'] from it if not None.
2022-02-01 16:59:44 +00:00
Athanasius 4fa64eec40 eddn: warnings improvements
* Log the type of unexpected values.
* Say 'falsey' not 'None' when we only `if not ...`
2022-02-01 16:43:19 +00:00
Athanasius e2e34674c2 eddn: codexentry - add paranoia post-processing check of values 2022-02-01 16:22:59 +00:00
Athanasius f144c199ae eddn: Be paranoid about Status.json BodyName value 2022-02-01 16:22:59 +00:00
Athanasius 67019e91b2 eddn: Extra System (name) augmentation paranoia 2022-02-01 16:22:59 +00:00
Athanasius 87193b4a51 eddn: Be more paranoid about system name augmentation 2022-02-01 16:22:58 +00:00
Athanasius ac7cfb9b14 core plugins: Add big obvious comment about imports and windows installer 2022-02-01 14:45:30 +00:00
A_D 17c886af84 fix log 2022-01-27 16:03:41 +02:00
A_D d6dcebf545 Remove unused import 2022-01-27 14:59:27 +02:00
A_D e891ee4da0 log more contextual data if possible on a 413 2022-01-26 19:05:00 +02:00
A_D e6ffe7e520 refactor error logging 2022-01-26 18:58:34 +02:00
A_D 5f7234ce89 address PR comments 2022-01-26 18:58:32 +02:00
A_D 73f45e37cd always compress eddn data, comment rationale 2022-01-26 18:58:32 +02:00
A_D b780b1ab8e Compress outgoing EDDN data if its large
This is a sidestep solution to #1390. It doesn't attempt to directly
resend data, only compressing with gzip over a given size. If that STILL
returns a 413, its dropped, as without introspection of the message we
cannot make it any smaller
2022-01-26 18:58:31 +02:00
A_D 3814f9ebb9 Quick fix to a type warning 2022-01-26 18:58:30 +02:00
Athanasius 4ab6d62926 user_agent: Set this once in config.py and use it everywhere
* Also flake8/mypy pass on timeout_session.py
2021-11-29 18:04:56 +00:00
Athanasius 42fea4ec34 EDDN: Set custom User-Agent 2021-11-29 17:47:25 +00:00
Athanasius 33fbbd4da9 eddn/L10n: Use single quotes in translated strings 2021-11-12 15:36:26 +00:00
Athanasius f5a4469337 EDDN: Sanity check NavRoute contents & handle EDDN 400
* Closes #1342 - A user had a NavRoute message with no Route array.
  It's always from the file, so the file had to be missing it?
* This results in an EDDN '400', and now we'll drop such messages from
  the replaylog so they're not constantly retried.
2021-11-12 15:06:27 +00:00
Athanasius 3ec9c81e19 EDDN: Drop any 'unknown schema' messages so they're not retried 2021-10-19 16:01:54 +01:00
Athanasius 7dcb275e9b EDDN: Document HORIZONS_SKU, and to NOT use the others 2021-10-18 14:18:11 +01:00
Athanasius c97b539ac3 EDDN: Revert to using capi_is_horizons() in export_commodities() 2021-10-18 12:25:35 +01:00
Athanasius 694321064d EDDN: Rename is_horizons() and document that it's for CAPI data only
OK, it has `data` passed in, so this should be obvious, but let's make
it explicit both by name and in the docstring.

The docstring now also emphasies that *this* check **MUST** be used for
CAPI data, as it's dependent only on the availability of Horizons on the
account, and not on the `LoadGame` flags.
2021-10-18 12:20:06 +01:00
Athanasius d8689e5b9b Revert "EDDN: If this.horizons is true, use that in is_horizons() check"
This reverts commit ca80edd34d.
2021-10-18 12:10:09 +01:00
Athanasius 90aa2698cd Revert "EDDN: Just use this.horizons for CAPI data sending"
This reverts commit bd183efbd4.
2021-10-18 12:09:55 +01:00
Athanasius e148197971 Revert "EDDN: use this.odyssey for Journal outfitting and shipyard"
This reverts commit 4fef4257bd.
2021-10-18 12:08:32 +01:00
Athanasius 98f215e6ad EDDN: Remove horizons flag from navroute messages
As with `odyssey` this isn't currently in the not-yet-live schema.
2021-10-17 16:46:11 +01:00
Athanasius 29b69745f3 EDDN: document that some EDDN messages aren't retried 2021-10-17 16:32:38 +01:00
Athanasius 4fef4257bd EDDN: use this.odyssey for Journal outfitting and shipyard
For consistency with the horizons flag.  They *are* placed *from* the
`this` versions into `entry`, but we might as well go the direct route.
They have to be set explicitly here as we process the `entry` to make a
wholly new `message` rather than the `message` just being `entry` with
some changes.
2021-10-17 16:20:46 +01:00
Athanasius b3419ec548 EDDN: Also set commodity/3->horizons for journal-sourced data 2021-10-17 16:17:58 +01:00
Athanasius a32546b001 EDDN: Set horizons on commodity/3 messages as per schema 2021-10-17 16:14:35 +01:00
Athanasius 556ace5306 EDDN: Use this.odyssey rather than passing to functions 2021-10-17 15:47:12 +01:00
Athanasius bd183efbd4 EDDN: Just use this.horizons for CAPI data sending 2021-10-17 15:41:15 +01:00
Athanasius 488fdf4976 Merge pull request #1306 from EDCD/fix/eddn-quieten-unknown-schema-errors
EDDN: Quieten "unknown schema" errors
2021-10-17 15:35:25 +01:00
Athanasius ca80edd34d EDDN: If this.horizons is true, use that in is_horizons() check 2021-10-17 15:01:51 +01:00