Client configuration file (server URLs + environment profiles) #13

Closed
opened 2026-07-16 23:11:17 +02:00 by marco · 1 comment
Owner

Give the client a configuration file so the Auth/GameServer URLs (and future settings) aren't hardcoded. Today they live as constants in Net/Session.cs (AuthBaseUrl, GameServerWsUrl), so pointing the client at staging vs prod means a recompile.

Detailed realization of the "externalize client endpoints" bullet in the cross-cutting epic #11; part of the roadmap #12. Not for the current MonoGame-migration PR.

Scope

  • A client config file loaded at startup, holding at least the Auth base URL and the GameServer WS URL.
  • Environment profiles (dev / staging / prod) selectable without editing code.
  • Baked-in dev defaults so the client runs with no config file present (localhost).
  • Extensible for future settings (window/resolution, volume, log level, keybinds, ...).
  • Cross-platform file location and loading (Windows + macOS).

Open questions

  • Format & mechanism: Microsoft.Extensions.Configuration + appsettings.json / appsettings.{env}.json, or a lighter hand-rolled JSON?
  • Environment selection: env var, CLI arg, or separate profile files?
  • File location: next to the executable vs a per-user config dir?

Definition of Done

Base DoD applies on top (tests green, whole solution builds, zero warnings, multi-platform preserved); the criteria below are the delta.

  • The client reads the Auth/GameServer URLs from the config file; changing the file points the client at a different server with no rebuild.
  • At least a dev profile and one non-dev profile (staging or prod) are selectable without code changes.
  • With no config file present, the client starts on baked-in dev defaults.
  • Config loading works on both Windows and macOS; documented in the README.
Give the client a configuration file so the Auth/GameServer URLs (and future settings) aren't hardcoded. Today they live as constants in `Net/Session.cs` (`AuthBaseUrl`, `GameServerWsUrl`), so pointing the client at staging vs prod means a recompile. Detailed realization of the "externalize client endpoints" bullet in the cross-cutting epic #11; part of the roadmap #12. Not for the current MonoGame-migration PR. ## Scope - [ ] A client config file loaded at startup, holding at least the Auth base URL and the GameServer WS URL. - [ ] Environment profiles (dev / staging / prod) selectable without editing code. - [ ] Baked-in dev defaults so the client runs with no config file present (localhost). - [ ] Extensible for future settings (window/resolution, volume, log level, keybinds, ...). - [ ] Cross-platform file location and loading (Windows + macOS). ## Open questions - Format & mechanism: `Microsoft.Extensions.Configuration` + `appsettings.json` / `appsettings.{env}.json`, or a lighter hand-rolled JSON? - Environment selection: env var, CLI arg, or separate profile files? - File location: next to the executable vs a per-user config dir? ## Definition of Done _Base DoD applies on top (tests green, whole solution builds, zero warnings, multi-platform preserved); the criteria below are the delta._ - [ ] The client reads the Auth/GameServer URLs from the config file; changing the file points the client at a different server with no rebuild. - [ ] At least a dev profile and one non-dev profile (staging or prod) are selectable without code changes. - [ ] With no config file present, the client starts on baked-in dev defaults. - [ ] Config loading works on both Windows and macOS; documented in the README.
Author
Owner

Done: the client loads the Auth/GameServer URLs from config.json (ships config.dev.json; Session.ConfigPath/IsConfigured, no hardcoded URLs). Delivered in #24. Closing.

Done: the client loads the Auth/GameServer URLs from `config.json` (ships `config.dev.json`; `Session.ConfigPath`/`IsConfigured`, no hardcoded URLs). Delivered in #24. Closing.
marco closed this issue 2026-07-17 16:39:11 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#13
No description provided.