Refactor: Dynamic game support (SDR supported games only)#36
Merged
Conversation
SpoonMcForky
commented
May 24, 2026
Contributor
Author
|
Writing a fix to get rid of the hard dependency on an existing JSON. It will create one if it is missing at runtime, which should fix the failed check |
Owner
I'm currently refactoring the code, I will push the changes in a moment. I fixed the error from git checks by providing the correct path to the JSON file. |
Major refactor of server definitions, provider and data service handling: - Convert ServerDefinitions.json from an object wrapper to a flat JSON array and adjust default creation/serialization. - Replace the GenericService abstraction (deleted GenericServer.cs) with a concrete ConfiguredServerDataService that takes a ServerDefinition, ILoggerService, IMessageBoxService and HttpClient; it now fetches/parses SDR JSON (System.Text.Json), builds ServerData, exposes GetFetchedRevision/GetServerData and includes improved error logging and user messages. - Update DI registration in App.axaml.cs to instantiate ConfiguredServerDataService via ActivatorUtilities and log failures. - Rewrite ServerDefinitionProvider to load a List<ServerDefinition>, add JSON (de)serialization options, create defaults when missing, and rename APIs to reflect appId usage: GetServerDefinitionByGameMode, GetAppIdByGameMode, GetGameModesByAppId. - Update consumers (JsonSetting, MainWindowViewModel, MainWindow.axaml.cs) to use appId-based APIs and revision storage keyed by appId. - Minor documentation edits in AGENTS.md (wording/formatting). This change centralizes server parsing logic, aligns definitions with a simpler JSON layout, and updates the codebase to use appId as the canonical key for revisions and group lookups.
Owner
|
@SpoonMcForky would you be able to test the changes to verify everything works as usual? I pushed the final changes and if there are no issues then I can merge this. Also would appreciate if you can test it on linux if you have one. |
FN-FAL113
approved these changes
Jun 19, 2026
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.
Removed hard-coded games, allowing new games to be added via a JSON in the program root directory. This change makes adding new games, whether officially or at the end-user level, much easier.