ModernUO/Projects/UOContent/Engines/FeatureFlags
Kamron Batman 35e3a31b4c
fix(feature-flags): define stock flag defaults in code so JSONs exist on first boot (#2653)
### Summary

`default-flags.json` was never shipped — `Configuration/` is gitignored — so the predefined-flag loader has been dead since #2328. A fresh shard boots with 0 flags and writes no JSON until an admin changes something, so `[FeatureList` is empty on first run.

Stock flags are now defined in code. `Initialize()` runs `Load()` first, then `LoadDefaultFlags()` seeds any of the 14 stock keys the save is missing, reading each default from the static it syncs (`ServerFeatureFlags` / `ContentFeatureFlags`) rather than a duplicated boolean — so `speedhack_detection` stays off and `insurance` honors `Insurance.Configure` (`insurance.enable`). Existing entries are never overwritten, so admin state survives upgrades and saves predating a flag pick it up. `Save()` runs only when something was seeded, so all five JSON files exist from first boot.

Verified: `dotnet build Projects/UOContent/UOContent.csproj -c Release`, 0 warnings 0 errors.
2026-09-16 00:42:12 -07:00
..
ContentFeatureFlags.cs feat: expand cache to nearly all mobiles + dynamic-obstacle pass (#2447) 2026-05-06 00:14:08 -07:00
FeatureFlagAdminGump.cs feat: Adds Feature Flag System (#2328) 2026-02-07 12:02:57 -08:00
FeatureFlagCommands.cs feat: Adds Feature Flag System (#2328) 2026-02-07 12:02:57 -08:00
FeatureFlagManager.cs fix(feature-flags): define stock flag defaults in code so JSONs exist on first boot (#2653) 2026-09-16 00:42:12 -07:00
FeatureFlagSettings.cs feat: Adds Feature Flag System (#2328) 2026-02-07 12:02:57 -08:00