Add Phase 1 critical endpoints: Config & Save/Load system
- Added ConfigController with 4 endpoints:
- getGameConfig: Server config, feature flags, URLs
- getServerTime: UTC timestamps
- getFeatureFlags: Feature toggles
- getServerStatus: Health check
- Added save/load system to ProgressionController:
- POST /save/{synergyId}: Save JSON blob
- GET /save/{synergyId}/load: Load JSON blob
- Version tracking and timestamps
- Added PlayerSave entity to database:
- Stores arbitrary JSON game state
- Version tracking (increments on save)
- LastModified timestamps
- Updated appsettings.json:
- ServerSettings section (version, URLs, MOTD)
- FeatureFlags section (7 feature toggles)
- Created migration: AddPlayerSavesAndConfig
- Updated ApiModels with new DTOs
- All endpoints tested and working
Phase 1 objectives complete:
✅ Synergy ID generation (already existed)
✅ Configuration endpoints (new)
✅ Save/load system (new)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ public class RR3DbContext : DbContext
|
||||
public DbSet<GameAsset> GameAssets { get; set; }
|
||||
public DbSet<ModPack> ModPacks { get; set; }
|
||||
public DbSet<UserSettings> UserSettings { get; set; }
|
||||
public DbSet<PlayerSave> PlayerSaves { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -407,6 +408,16 @@ public class GameAsset
|
||||
public string? CustomAuthor { get; set; }
|
||||
}
|
||||
|
||||
public class PlayerSave
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string SynergyId { get; set; } = string.Empty;
|
||||
public string SaveDataJson { get; set; } = "{}";
|
||||
public long Version { get; set; } = 1;
|
||||
public DateTime LastModified { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
// Mod Pack entity - bundles of custom content
|
||||
public class ModPack
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user