Skip to content

Refactor: Dynamic game support (SDR supported games only)#36

Merged
FN-FAL113 merged 3 commits into
FN-FAL113:mainfrom
SpoonMcForky:custom-game-support
Jun 19, 2026
Merged

Refactor: Dynamic game support (SDR supported games only)#36
FN-FAL113 merged 3 commits into
FN-FAL113:mainfrom
SpoonMcForky:custom-game-support

Conversation

@SpoonMcForky

Copy link
Copy Markdown
Contributor

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.

Comment thread ServerPickerX/ServerDefinitions.json
@FN-FAL113 FN-FAL113 changed the base branch from main to develop May 27, 2026 12:20
@FN-FAL113 FN-FAL113 changed the base branch from develop to main May 27, 2026 13:53
@SpoonMcForky

SpoonMcForky commented May 27, 2026

Copy link
Copy Markdown
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

@FN-FAL113

Copy link
Copy Markdown
Owner

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

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.

SpoonMcForky and others added 2 commits May 27, 2026 10:39
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.
@FN-FAL113

Copy link
Copy Markdown
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 FN-FAL113 changed the title Create new branch offering custom game support. Refactor: Dynamic game support (SDR supported games only) May 27, 2026
@FN-FAL113 FN-FAL113 added enhancement New feature or request testing required labels May 28, 2026
@FN-FAL113 FN-FAL113 merged commit e9157f9 into FN-FAL113:main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request testing required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants