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

559 Commits

Author SHA1 Message Date
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
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
30e9abb870
Inara: Change the comment for why we're using Progress, not Ranks 2022-02-08 13:34:03 +00:00
Athanasius
22f90e23aa
Inara: Trigger off 'Progress' for sending setCommanderRankPilot
Doing so from 'Rank' means the 'Progress' event hadn't happened yet, so of
course we only ever sent all zeroes for progress.

NB: Journal-v32 doc makes *no guarantee* about the order of the events.
  Is it worth trying to be paranoid about that ?  For a 100% new player
  everything would be "all zeroes", so we would likely need to tweak things
  to store `None` as default values, and check for such.
2022-02-08 13:31:00 +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
Athanasius
adb8055f08
Inara: Be paranoid in case of -ve credits balance 2022-01-31 15:22:36 +00:00
Athanasius
02dd800c57
Inara: Change the way we determine if a credits delta is interesting
Now based on the *minimum* of a fractional or absolute change.  See
<https://github.com/EDCD/EDMarketConnector/issues/1255> for discussion.
2022-01-31 14:50:12 +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
a5317e984f
Merge pull request #1412 from EDCD/fix/1378/inara-sync-ranks-onfoot
Inara: send setCommanderRankPilot message when on-foot
2022-01-26 16:43:17 +00:00
Athanasius
0c938bddfc
Inara: API stated to not support compression 2022-01-25 17:43:04 +00:00
Athanasius
28cbd6e0ea
Inara: queue 'Rank'/'setCommanderRankPilot' as soon as seen
This means we *will* send a message when logging in on foot, rather than
waiting for a `Cargo` event that never arrives.
2022-01-25 15:27:35 +00:00
Athanasius
ded86c2ff5
inara: Rename to current_credentials to avoid 'creds' ambiguity
Every time I see `current_creds` my first though is "creds means
credits".
2022-01-25 15:00:33 +00:00
Athanasius
c4f734734e
inara: snake_case lastcredits variable 2022-01-25 14:59:53 +00:00
Athanasius
7ac248be7a
inara: Utilise Statistics Current_Wealth for commanderAssets
Inara itself seems to be doing this if it has access to CAPI-sourced
Journals.  If we don't send commanderAssets as part of
setCommanderCredits then it does ... something else ... and ends up with
your total assets value bouncing between what EDMC is causing and what
it sees from the CAPI-sourced journals.

So, don't send this from LoadGame any more, instead wait for Statistics,
and if it has the relevant data, also send commanderAssets.
2022-01-20 17:45:23 +00: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