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

426 Commits

Author SHA1 Message Date
Athanasius
8363e8c646
monitor: Don't re-init Enginers/Rank/Reputation on LoadGame
The order of Journal events changed from:

  1. LoadGame
  2. Rank
  3. Progress

to:

  1. Rank
  2. Progress
  3. LoadGame

in Odyssey, and in at least current 'base game' and Horizons clients as
well.  Also 'Reputation' event is before 'LoadGame' now.  So simply
allow those events to have populated the data, don't re-init on
LoadGame.

Yes, I'm preferring to leave the lines in, but commented, so it's clear
why those aren't being init'd, *and* why 'Statistics' still is, and as
of what game version.
2021-11-21 11:24:18 +00:00
Athanasius
919136874d
CAPI: Re-auth when Access Token expired: Need to .close() first
The old code did this, and without it we enter a loop of:

1. CAPI says unauthorized
2. We call login()
3. But companion.session.state == STATE_OK, so do nothing
4. Re-scheduled CAPI request goes back to 1.
2021-11-06 08:41:09 +00:00
Athanasius
2754385281
monitor: Use trace_if('journal.startup', ...) for game load-in 2021-08-13 15:14:03 +01:00
Athanasius
1378f765cc
monitor: Convert to logger.trace_if() 2021-08-13 15:14:02 +01:00
A_D
05e6838637
removed trace_on imports 2021-08-12 16:49:27 +02:00
A_D
fefa3d351d
replaced if x in trace_on with trace_if 2021-08-12 16:46:55 +02:00
Athanasius
97808f5561
monitor.py: Access trace_on via whole-config import
This is necessary so as to see the same instance of config.trace_on as
is set up by EDMarketConnector.py.
2021-08-11 12:33:22 +01:00
0bb06232b8
monitor.py: add default value to entry.get('GameMode') in CQC detection 2021-08-11 14:24:27 +03:00
bd32b44903
monitor.py: fix CQC to lower case 2021-08-11 13:50:09 +03:00
42ce2ad414
monitor.py: trace loadgames to CQC only if in trace_on 2021-08-10 14:27:47 +03:00
7b823dd64d
Remove commented out logger.debug() 2021-08-10 03:16:57 +03:00
e9ee65da14
Code style fix 2021-08-10 03:15:50 +03:00
3283439485
Code style fixes 2021-08-10 03:00:36 +03:00
a00a677746
monitor.py: use trace instead debug to log CQC loadgames 2021-08-10 02:49:58 +03:00
d7dd8c8990
Be more paranoid with GameMode and CQC 2021-08-09 17:15:54 +03:00
291fbf2908
Use both Ship and GameMode fields of LoadGame event to detect CQC
And freeze update button when in CQC
2021-08-09 15:59:30 +03:00
27fe43bf8c
WIP: implement journal_entry_cqc()
journal_entry_cqc function in plugin's api allow plugins to recieve
journal events when player are in CQC
2021-08-09 04:37:23 +03:00
Athanasius
cc6b52a9ed
Shiplocker: while/else a failure logging 2021-08-07 14:45:46 +01:00
Athanasius
dc953b49a6
shiplocker: Implement ShipLocker.json load/decoding retries
* Currently a maximum of 5 attempts, 10ms apart.
* I was going to blank `entry = {}` for this, but there's a chance the
  file load would fail when at startup and Embark the in-Journal event
  actually has all the data.  So we cross our fingers and hope that's
  the case if loading fails.
* Changed the "not all the categories" logging to WARN to call out the
  failure.
* Removed old comment about not touching Backpack here.
2021-08-07 14:38:03 +01:00
Athanasius
292b508985
monitor: Prepare for more-paranoid Shiplocker.json loading 2021-08-07 14:20:05 +01:00
Athanasius
ea88a57e18
monitor: Gate Commander/LoadGame TRACE on trace_on 'startup' 2021-08-05 13:46:20 +01:00
A_D
9466d8fc81
reorder new file checks
we want to finish our current file, if anything, before continuing onto a new file
2021-08-04 15:43:00 +02:00
A_D
7c78b40090
always update with journal data 2021-07-07 11:02:11 +02:00
A_D
dec2e07ce0
revert previous commit, handle \ in lang names 2021-07-03 17:23:30 +02:00
A_D
edbf1263a9
Dont store version on loadgame, its content is faulty 2021-07-03 17:14:25 +02:00
A_D
1e691d306e
Added support for resupply event
its a reskinned backpack, so thats how its being handled
2021-07-03 13:22:39 +02:00
A_D
d63b6ad782
removed suits["slots"] (for now) 2021-07-01 12:47:07 +02:00
A_D
67df2efc8a
DRY-ed setting version info
Also removed some uneeded type ignores
2021-07-01 12:27:15 +02:00
A_D
e11193110f
removed dashboard import 2021-06-30 14:26:45 +02:00
A_D
1a3dad34b7
Add support for SuitLoadout related added info
This is mostly classes and mods for weapons, and classes for suits. I
did not do any updating passed what we already did, I simply added the
fields where needed.

This means that if our tracking is incorrect it will still be incorrect,
but full on tracking will wait for OO based state storage to prevent
whoopsies and other silliness.
2021-06-30 14:23:25 +02:00
A_D
aa4e17c846
Add support for new fields on LoadGame
These are the same as the ones on FileHeader, but it wont hurt to update
them here anyway, if they exist. Likely they wont have changed, but just
in case
2021-06-30 14:07:16 +02:00
Athanasius
9280b902d1 monitor: Use original event type string for keying into monitor.state 2021-06-18 14:09:19 +01:00
Athanasius
c6a42a3877 monitor: entry_type lower-case pass & one note to fix
* This is after rebase on `develop`, so some 'new' events needed
  lowering.
* But there's one instance of entry_type being used as a key into
  monitor.state, so will need to rework that.
2021-06-18 14:06:49 +01:00
A_D
6de13b9c4d Re-cased mistakenly lowered field 2021-06-18 13:56:45 +01:00
Athanasius
6ad22541fe Made most event lookups case insensitive
Slightly more than `s/((el)?if event_type (in|==) \(?('(?:.*[A-Z].*).*')\)?:)$/\L$1`.

Closes #1087
2021-06-18 10:42:13 +01:00
Athanasius
2c8d70f67d ShipLocker: Always load from the file, but be paranoid about it
We'll log the "missing keys, file?" line at TRACE for now, until we're
sure all this code is OK.
2021-06-10 14:45:41 +01:00
Athanasius
e754568b28 ShipLocker: Fix the all() generator 2021-06-10 14:31:26 +01:00
Athanasius
2353889ed2 monitor: Make 'empty ShipLocker event' log be TRACE 2021-06-10 14:21:33 +01:00
Athanasius
937aaccec4 ShipLockerJSON: Ensure initialised, and document it. 2021-06-10 14:20:27 +01:00
Athanasius
7051aba656 ShipLocker/Backpack: Use one event for the now-pass'ed ones.
Also, just dropped `TransferMicroResources` entirely as it's no longer
present (and would be irrelevant).
2021-06-10 14:08:57 +01:00
Athanasius
a7722f70fe No need for [] if it's a generator inside all() anyway. 2021-06-10 14:04:38 +01:00
Athanasius
3ea0bcce5e BackPack: No need to worry about Resurrect. 2021-06-10 12:44:46 +01:00
Athanasius
ae18071f13 Backpack: Factor out the "make it empty" code. 2021-06-10 12:39:53 +01:00
Athanasius
8b6c0e50ac Backpack: Zero out when we Embark, as it's all then in ShipLocker 2021-06-10 12:37:59 +01:00
Athanasius
09c81a21f6 ShipLocker: do *NOT* zero out BackPack when handling this event
Just need to ensure we do on Embark (or Death? but likely fresh events
then anyway?).

Certainly if Journal event order is ever Backpack *then* ShipLocker this
would erroneously zero out the backpack.
2021-06-10 12:34:30 +01:00
Athanasius
b02729ebdc Backpack/ShipLocker: TransferMicroResources is gone as of 4.0.0.400 2021-06-10 12:32:40 +01:00
Athanasius
f942e76313 monitor: BackPackMaterials shouldn't be a thing any more 2021-06-10 12:28:37 +01:00
Athanasius
c2d75e7f1d Credits: UpgradeWeapon should now include a credits cost.
Need to see 4.0.0.400 event for this and UpgradeSuit to be sure they
don't also cite materials costs.  But the hope is there'd be a new
empty/file `ShipLocker` event anyway.
2021-06-10 12:24:13 +01:00
Athanasius
59b410341c ShipLocker: Can now ignore SellMicroResources for inventory purposes
`ShipLocker` empty/file event has full new inventory.
2021-06-10 12:22:56 +01:00
Athanasius
db43442504 ShipLocker: Ignore TradeMicroResources for inventory purposes
We get `ShipLocker`/file with full new inventory.
2021-06-10 12:21:40 +01:00