791 Commits
Author SHA1 Message Date
Athanasius 424d5f023c EDDNReplay.add_message() is now functional
And that includes the code to handle legacy `replay.json` messages.
2022-11-22 14:02:01 +00:00
Athanasius 03e432034f EDDN: Moving replay functionality into its own class 2022-11-22 14:02:00 +00:00
Athanasius 072eadd893 EDDN: messages.id AUTOINCREMENT, and index created & cmdr
We'll definitely want to query against `cmdr`, and possibly `created`.

We shouldn't need to against other fields, they'll just be checked during
processing of an already selected message.
2022-11-22 14:01:59 +00:00
Athanasius 9faae8b9bc EDDN: Open & create sqlite3 db for replay
* sqlite3 open, and creation of table.
* Change `load_journal_replay()` to `load_journal_replay_file()` and change
  the semantics to just return the `list[str]` loaded from it.  It also now
  catches no exceptions.
* Remove the "lock the journal cache" on init as it's not necessary.

There's still a lot more changes to come on this.
2022-11-22 14:01:58 +00:00
Athanasius e530544ac5 eddn: fcmaterials: Now working for the two separate schemas 2022-09-02 17:27:16 +01:00
Athanasius 69ef3b7d39 eddn: fcmaterials: Actually send horizons and odyssey flags for CAPI data 2022-08-31 16:34:21 +01:00
Athanasius c77576f3d4 EDDN: fcmaterials/1 from CAPI /market data 2022-08-31 15:59:34 +01:00
Athanasius 37553d6bc7 EDDN: Add 'data-source' to Journal FCMaterials export 2022-08-31 15:19:54 +01:00
Athanasius a61829eaf7 EDDN: Implement Journal-based fcmaterials/1 schema
The EDDN schema is still a work in progress, unsure if we'll use the same
one for both Journal and CAPI sourced data, or separate schemas.

But, so far, this works.
2022-08-30 17:17:00 +01:00
Athanasius 5fa9bcd48e inara: Wrap the <var> := <dict get> in () so <var> isn't a bool
Because, yes, 'is not' binds more tightly than ':='.
2022-08-13 18:34:28 +01:00
Athanasius 7b47dab543 inara: ApproachSettlement: Only set marketID if present in event
At least 'Ancient Ruins' generate an `ApproachSettlement` event without a
`MarketID` in the event.  Not even a key with `null` value.
2022-08-12 13:57:31 +01:00
Athanasius f28228285a plugins/eddn: Do *NOT* alert user on 'no Route in NavRoute'
This can simply occur if the *first* load of `NavRoute.json` soft-fails,
meaning the plugin is receiving the bare Journal-file event, which has no
`Route` array.
2022-08-10 11:51:23 +01:00
Athanasius 9162b3a94d eddn/fsssignaldiscovered: For Horizons add check on tracked location 2022-06-23 10:34:13 +01:00
Athanasius e38ce639f0 eddn/fsssignaldiscovered: Catch where no signals pass checks
Else we attempt to send an empty `signals` array, which the schema prohibits.
2022-06-19 11:47:24 +01:00
Athanasius c5f53a8378 Merge pull request #1587 from chennin/EDMarketConnector-1496-EDSM-log-2
Change EDSM credentials() to log API keys under a different trace #1496
2022-06-17 12:52:38 +01:00
Athanasius 57953ef3f2 EDDN: Ensure *all* _Localised key/values removed
This has been missed, based on Journal examples, and has been causing issues
at least for `ApproachSettlement`.

So, `filter_localised()` now used in:

    `export_journal_navroute()`
    `export_journal_approachsettlement()`
    `export_journal_fssallbodiesfound()`
2022-06-17 12:46:46 +01:00
Athanasius 77203c7227 eddn/fsssignaldiscovered: Misc fixups
* Need to remove `event`, `horizons` and `odyssey` per signal.
* It's lower case `horizons` and `odyssey` in a(n augmented) journal event.
* It's `event`, not `entry` that `export_journal_entry()` will look for.
2022-06-15 14:34:06 +01:00
Athanasius 37c88aeefc eddn/fsssignaldiscovered: Further cleanup
* Move call to `export_journal_fsssignaldiscovered` to top-level of event
  processing.  This ensures we'd still have the *previous* system tracked
  when running under Odyssey.

  Also, we can't return any result from this, as we'd still need to process
  things like `Location` otherwise.
* Use `logger.trace_if("plugin.eddn.fsssignaldiscovered", ...)`
* Perform all sanity checks, elisions and augmentations in the "not
  FSSSignalDiscovered event" sending code.
2022-06-15 13:19:13 +01:00
Athanasius d5ec54dbea eddn/fsssignaldiscovered: Start on cleaning up chennin's work 2022-06-15 12:11:01 +01:00
Chris Henning afda16853b Change this log to debug level 2022-06-12 17:59:18 -04:00
Chris Henning e8b8cf81d5 Change EDSM credentials() to log API keys under a different trace #1496 2022-06-12 17:51:38 -04:00
Chris Henning 4bf2965cc5 remove unnecessarily committed debug messages 2022-06-12 17:12:08 -04:00
Chris Henning 4dfcd91bcd fix more flake8 errors 2022-06-12 16:19:25 -04:00
Chris Henning 1b37991016 fix flake8 errors 2022-06-12 16:16:54 -04:00
Chris Henning df9f0bfc7c Implement FSSSignalDiscovered sender v1 2022-06-12 15:26:50 -04:00
Athanasius 52cc71a217 eddn: Clear bodyname/id on supercruiseexit, if at orbital station 2022-06-05 15:31:28 +01:00
Athanasius 62c8af4dc0 eddn: Use if '<key>' not in <dict>: idiom. 2022-06-04 14:55:27 +01:00
Athanasius 1349b2bca1 eddn: codexentry: Ody Update 12 will add BodyID
* So add a check to see if the event already has it, and leave it if so.
* And might as well have a check on BodyName in case that gets added as well.
2022-06-01 16:24:51 +01:00
Athanasius 020aa325a7 eddn: Cite event name in some logging
Not needed where we're in an event-specific function, but is in generic
event handling.
2022-06-01 16:17:34 +01:00
Athanasius 9fd3c3852a eddn: journal: Add SystemAddress cross-check to StarSystem augmentation 2022-05-29 15:36:42 +01:00
Athanasius 4fcd2ae3f3 eddn: journal: Make SystemAddress a check, not an augmentation
On checking, all of the events valid for the journal schema (and CodexEntry
has its own schema and separate EDMC code) already contain SystemAddress, so
it would never be added as an augmentation.

Instead, turn this into a sanity check.
2022-05-29 15:30:20 +01:00
Athanasius 4a207429cd eddn: journal schema: Add notes about present/missing fields 2022-05-29 15:20:45 +01:00
Athanasius 2e6d6b8c02 eddn: scanbarycentre: Location cross-check paranoia 2022-05-29 15:07:25 +01:00
Athanasius e38ea28ba6 eddn: navbeaconscan: Location cross-check paranoia 2022-05-29 15:05:11 +01:00
Athanasius 3702b465e5 eddn: fssdiscoveryscan: Location cross-check paranoia 2022-05-29 15:03:02 +01:00
Athanasius 4baa2490af eddn: fssallbodiesfound: Location cross-check paranoia 2022-05-29 15:00:19 +01:00
Athanasius 834debde98 eddn: codexentry: Location cross-check paranoia 2022-05-29 14:56:33 +01:00
Athanasius 6b54f721b0 eddn: approachsettlement: Location cross-check paranoia 2022-05-29 14:49:43 +01:00
Athanasius 8bb7f9d9ba EDDN/fssbodysignals: Add location paranoia check 2022-05-29 12:28:58 +01:00
Gareth Harper 88b3dc27e5 Added fssbodysignals 2022-05-29 12:14:34 +01:00
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 dd6c6fbc36 Inara: Do not update credits from CAPI data
CAPI only has the Cmdr wallet value (and loan if applicable), without anything
for 'total assets'.  If we send Inara setCommanderCredits without
`commanderAssets` then Inara makes a bad judgement on it and sets an
incorrect total assets value.

Also:

> Do NOT set credits/assets unless you are absolutely sure they are correct. The journals currently doesn't contain crew wage cuts, so credit gains are very probably off for most of the players. Also, please, do not send each minor credits change, as it will spam player's credits log with unusable data and they won't be most likely very happy about it. It may be good to set credits just on the session start, session end and on the big changes or in hourly intervals.

So, let's just not.
2022-02-11 12:20:06 +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