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

458 Commits

Author SHA1 Message Date
Athanasius
20f373a37d Suits: Localise out suit symbol name -> display name (stage1) lookup
We'll need to localise the following 'shortname' lookup as well.
2021-05-25 18:27:10 +01:00
Athanasius
bac718aeff Store Fileheader language, gameversion and build in monitor.state 2021-05-25 17:56:11 +01:00
Athanasius
e9e5352e37 Suits: Set edmcName in BuySuit handling 2021-05-25 16:30:23 +01:00
Athanasius
43a7974da5 Suits: Make suit name regex's case-insensitive (and tweak a comment) 2021-05-25 16:05:34 +01:00
Athanasius
dba3fba8e3 Suits: Fully implement mapping to sane (English only for now) names 2021-05-25 15:24:21 +01:00
Athanasius
f85213b318 Suits: Initial stab at grabbing a usable name out of a $symbol; version 2021-05-25 14:52:43 +01:00
Athanasius
48c852ec1d Suits: Code scaffolding for sanitising suit names 2021-05-25 14:45:18 +01:00
Athanasius
68a0e6c7af Test for if suit is None rather than a boolean test.
This matches the explicit default in the .get()
2021-05-25 14:31:27 +01:00
Athanasius
00469384b4 Suits: Keep using CAPI-source Suit name if we have it.
* We were referring to *suit* 'slot id', when that's only for the
  loadouts.  For suits we have a full id, from Frontier, that we use.
* Comment that creating a suit loadout does *not* automatically equip
  it.

Now, **if we have CAPI data** we will use the CAPI-sourced localised
name for the suit display.  Where we don't (yet) have CAPI data we still
use the badly localised journal name for the suit.
2021-05-25 14:26:01 +01:00
Athanasius
da94b729bd Suits: Log if we try to set unknown suit/loadout 2021-05-21 12:31:08 +01:00
Athanasius
7e064374d2 Suits: Refactor suit/loadout set-current away from store
This way we can have common code for SuitLoadout, SwitchSuitLoadout and
CreateSuitLoadout, with the first two then calling the new
`self.suit_and_loadout_setcurrent()` to set the seen data as also the
currently in use suit/loadout.
2021-05-21 12:27:16 +01:00
Athanasius
43d261f290 CreateSuitLoadout: 4.0.0.101 example comment 2021-05-21 12:14:18 +01:00
Athanasius
f923ef64ca Suits: Refactor 'SuitLoadout' to also be used in 'SwitchSuitLoadout' 2021-05-21 12:08:22 +01:00
Athanasius
3a92ff9f96 SwitchSuitLoadout: Example from 4.0.0.101 added in comments 2021-05-21 11:42:59 +01:00
Athanasius
5e0bcb29a9
Merge pull request #1084 from EDCD/fix/1078/odyssey-partial-engineerprogress-event
EngineerProgress: Extra validation paranoia
2021-05-21 11:01:26 +01:00
Athanasius
bd56948f7d
Merge pull request #1086 from EDCD/enhancement/1083/edsm-backpack
Fix BackPack event support to actually work.
2021-05-21 11:00:07 +01:00
A_D
be100d97de
Update credits on SuitUpdate
Closes #1079
2021-05-21 08:24:00 +02:00
Athanasius
143a205fb9 Backpack: event name is CamelCase, stored in monitor.state, doc
* Surprise!  The new event is `BackPack`, not `Backpack`, although the
  filename *is* `Backpack.json`.
* Store the loaded JSON dict in `monitor.state['BackpackJSON']`.  That
  `p` is lower case to match with the filename, not the event name.
* Document this in PLUGINS.md.

Unless EDSM is telling us to discard this we should now be sending it.
2021-05-20 18:13:51 +01:00
Athanasius
2184afba9b EngineerProgress: Rank/RankProgress is complicated.
And, yes, flake8 checks, validating these events *is* complex.
2021-05-20 15:51:28 +01:00
Athanasius
a82099fe53 EngineerProgress: Don't need f=, just f here. 2021-05-20 15:38:06 +01:00
Athanasius
e650308e3d EngineerProgress: Extra validation paranoia
This is an example of just how icky it gets validating an event by hand.

Technically we need a function, many would probably be lengthier and
more complex than this one, for **every   single   journal   event
  type**.
2021-05-20 15:28:52 +01:00
Athanasius
35a0edde58 Use pass for "no code intended"
`...` is better suited to "under construction, more to come".
2021-05-20 11:28:15 +01:00
Athanasius
0fd2264d53 UseConsumable: Rely on BackpackChange instead, to avoid double-accounting 2021-05-20 11:26:04 +01:00
Athanasius
652fecc3e8 SuitLoadout: Attempt to get all state set correctly.
I think this is now correct, but not yet triggering the unhide of the
'Suit' UI line, will check that next.
2021-05-20 10:51:49 +01:00
Athanasius
eeed2cf7af Initial attempt at SuitLoadout event support
Need to see examples to be sure.
2021-05-18 22:42:27 +01:00
Athanasius
a50ed31450 Add note about maybe not wanting to use UseConsumable to track Backpack
*Hopefully* `BackpackChange` will be 100% reliable in place of this.
Test once live Odyssey is available!
2021-05-18 22:42:27 +01:00
Athanasius
bcbf37599e Odyssey Backpack: Add support for v31 Backpack and BackpackChange
Leaving the, meant to be defunct, `BackPackMaterials` code in for now,
as it's only one extra conditional that will never be stepped into if
the event never happens.

Yes, Frontier now uses 'Backpack' not 'BackPack', but we've already
published our plugin API as using the CamelCase version, so not changing
the monitor.state key.
2021-05-18 22:42:27 +01:00
Athanasius
286060a796 monitor: Add state flag 'Odyssey' for if LoadGame states we're running under Odyssey 2021-05-12 17:54:39 +01:00
Athanasius
aaf1fda1a1 Credits: Be paranoid about all related Journal events
MissionCompleted doesn't contain 'Reward' if you pick an option without
a credits amount (rather than being there but with zero value).

Let's not wait to find out about other exceptions, just utilise
entry.get(<field>, 0) on them all.
2021-05-08 19:25:38 +01:00
Athanasius
f1ca2b8283 Separate 'Docked' processing to own conditional.
A taxi 'Docked' event has much less data than an own-ship one.  Rather
than put tortured conditionals into the
Location/FSDJump/CarrierJump/Docked conditional I've split Docked into
its own.

There should always be one of the other events to set things like
SystemAddress before a 'Docked' event, so limiting the new conditional
to setting/changing only the station-related state variables.
2021-05-05 12:20:24 +01:00
Athanasius
692856bbe1 Disembark: Use the alpha4-new flag to detect if on-station 2021-05-05 11:42:29 +01:00
Athanasius
5f29c866e7 Dropship: Set OnFoot for DropshipDeploy, but ignore BookDropship
See the comment added to BookDropship code for why we're ignoring it.
2021-05-05 11:34:10 +01:00
Athanasius
543e0477c2 Don't assume ModuleRetrieve/Store have a Cost.
The Journal doc says they do, but one report of ModuleRetrieve saying it
doesn't, and ModuleStore does say "Cost (if any)".
2021-05-05 10:01:07 +01:00
Athanasius
f6cb69ebad Embark: Keep monitor.station set when Embarking OnStation. 2021-05-01 13:12:14 +01:00
Athanasius
7c7609f2ee Cargo: Update ship cargo on CargoTransfer event
We missed this when it was brought in with Fleet Carriers in 2020.
2021-05-01 12:15:57 +01:00
Athanasius
812398ee0d Credits: Review and add/tweak code for all Journal events
There are a few where either the v30 Journal doc is wrong/has an
ommision, or we genuinely don't get the required information.
2021-05-01 12:03:45 +01:00
Athanasius
77d96f61c7 Odyssey Credits: Update for book/cancel Taxi/Dropship 2021-05-01 10:50:20 +01:00
Athanasius
d74b886587 Update credits for SellOrganicData 2021-05-01 10:46:25 +01:00
Athanasius
751002bf1a Suits: Guards for if we don't have CAPI data yet
We still need each try/except in case:

1. Journal has you buying a suit, or creating a SuitLoadout.
2. It then has you selling/deleting a different one.
3. But no CAPI data yet, so we don't know about that different one.
2021-05-01 10:42:54 +01:00
Athanasius
81104ca973 Suits: Only debug log if we can't find loadout for DeleteSuitLoadout 2021-05-01 10:31:08 +01:00
Athanasius
0e18666054 Suits: Only process SwitchSuitLoadout if we know about Suits and Loadouts 2021-05-01 10:25:39 +01:00
Athanasius
3ab8b97562 Suits: We might not know about SuitLoadout being switched to 2021-05-01 10:19:10 +01:00
Athanasius
6d58863a40 Suits: Fix 'mame' typo 2021-04-30 15:42:10 +01:00
Athanasius
60b2045ea4 Items: Fix DropItems and CollectItems
Tested as actually working.
2021-04-30 15:21:47 +01:00
Athanasius
e1a63c2879 Items: Correct UseConsumable code 2021-04-30 15:12:12 +01:00
Athanasius
f89ed7999e Items: Implement CollectItems, DropItems and UseConsumable
The paranoia when subtracting from counts is because of the lack of
fresh `BackPackMaterials` if relogging whilst on foot.
2021-04-30 14:44:20 +01:00
Athanasius
422b766586 Items: Decrement BackPack Consumable on UseConsumable 2021-04-30 14:30:37 +01:00
Athanasius
1f8215ed92 Items: ShipLockerMaterials now has Data
But also, we're not getting a `BackPackMaterials` at the same time to be
sure of the state of things.
2021-04-30 13:56:26 +01:00
Athanasius
8e8c9fa3ff Items: Data is now in BackPackMaterials as well 2021-04-30 13:50:52 +01:00
Athanasius
eed4402340 Suits: Init monitor.state['Suits'] to empty dict 2021-04-30 10:53:38 +01:00