Adding to the coriolis 'core' plugin, the ability to add an API key f…#2643
Open
alex-williams wants to merge 4 commits into
Open
Adding to the coriolis 'core' plugin, the ability to add an API key f…#2643alex-williams wants to merge 4 commits into
alex-williams wants to merge 4 commits into
Conversation
…or cmdr.coriolis.io and when added, the ability to send material, ship and module data to cmdr.coriolis.io with the users consent.
After EDMC restarts and replays the journal during catch-up, state['Modules'] is populated from any Loadout entries in the journal. However, plugins never see these historical events — only the synthesized StartUp event is forwarded. This means plugins that depend on receiving a Loadout event (e.g. Inara's shipswap handler, Coriolis CMDR) miss the current ship loadout after an EDMC restart. Fix: after synthesizing the StartUp event, also synthesize a Loadout event via self.ship() if state['Modules'] is populated. This gives every plugin the current ship loadout on startup without requiring any plugin-side changes.
This reverts commit f4245a0.
Add cmdr_data() hook and _build_loadout_from_capi() to the coriolis plugin. This sends the current ship loadout to the Coriolis CMDR API whenever EDMC fetches fresh data from Frontier's CAPI (on docking and manual sync button press). This is the primary mechanism for detecting ship changes after a ShipyardSwap, because the Loadout journal event may not be forwarded to plugins by EDMC after a catch-up replay. Also: - Remove unused json import - Extract _handle_ship_event and _handle_module_event helpers to reduce journal_entry complexity below flake8 threshold (C901) - Add datetime import for CAPI timestamp generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adding the ability to add an API key for cmdr.coriolis.io and when added, the ability to send material, ship and module data to cmdr.coriolis.io with the users consent.
Example Images
Type of Change
Enhancement to Existing Feature
How Tested
Run from source with the modifications in place, then played the game with it running, to ensure that data is sent back to cmdr.coriolis.io.