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

448 Commits

Author SHA1 Message Date
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
Athanasius
30b8a5eead Suits: Log if a buy/sell event doesn't contain Price 2021-04-30 10:49:39 +01:00
Athanasius
203fb051b0 Suits: Simplify BuySuit code. 2021-04-30 10:47:09 +01:00
Athanasius
ac4f052695 Suits: Update credits on BuyWeapon
Also cleaning out some verbose comments.
2021-04-29 12:38:01 +01:00
Athanasius
7b76e327ce Suits: Always set 'id' to None
Better to get a `None` value than a KeyError.
2021-04-29 12:32:31 +01:00
Athanasius
d27075cb38 Suits: Handle LoadoutEquipModule event
We're assuming weapons only at this point.  Might need adjustment when
we get access to engineering.
2021-04-29 12:28:45 +01:00
Athanasius
d35f64ebd5 Suits: Handle LoadoutRemoveModule
Currently this seems to only trigger if you 'overwrite' an equipped
weapon with another one.  The one being removed will be cited in this
event.
2021-04-29 12:21:08 +01:00
Athanasius
218073ed73 Suits: Remove weapon from all loadouts if sold.
Also update credits total for the sale.
2021-04-29 12:07:48 +01:00
Athanasius
2253e45c18 Suits: Add some paranoia around Loadouts
* Initialise to empty dict.
* try/except in case CAPI pull hasn't happened yet when parsing Journal
  events.
2021-04-29 11:45:06 +01:00
Athanasius
e796684fc6 Suits: Handle RenameSuitLoadout 2021-04-29 11:40:59 +01:00
Athanasius
e24e0b3547 Suits: Update DeleteSuitLoadout code with alpha4 example
Also slightly simplified this.  Leaving the try/except for now, although
it should no longer be necessary.
2021-04-29 11:34:29 +01:00