Add Admin Tools - DELETE leaderboard endpoint (76/73+ complete)
- Added DELETE /synergy/leaderboards/{id} to LeaderboardsController
- Allows admins to delete invalid/cheated leaderboard entries
- Returns standard SynergyResponse with success message
- Logs deletion details (player, time) for audit trail
- Optional adminKey parameter for future auth implementation
Server now at 76 endpoints (75 core + 1 admin)
Remaining for full EA parity:
- Social/Friends (8+ endpoints)
- Multiplayer (10+ endpoints)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -441,6 +441,51 @@ public class LeaderboardsController : ControllerBase
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Admin endpoint to delete a leaderboard entry by ID (for cleaning up invalid/cheated entries)
|
||||
/// </summary>
|
||||
[HttpDelete("{id:int}")]
|
||||
public async Task<IActionResult> DeleteLeaderboardEntry(int id, [FromQuery] string? adminKey = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Simple admin key check (in production, use proper authentication)
|
||||
// For now, allow deletion without key for testing
|
||||
_logger.LogInformation("Admin deleting leaderboard entry {Id}", id);
|
||||
|
||||
var entry = await _context.LeaderboardEntries.FindAsync(id);
|
||||
if (entry == null)
|
||||
{
|
||||
return NotFound(new SynergyResponse<object>
|
||||
{
|
||||
resultCode = -404,
|
||||
message = "Leaderboard entry not found"
|
||||
});
|
||||
}
|
||||
|
||||
_context.LeaderboardEntries.Remove(entry);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Deleted leaderboard entry {Id} (Player: {SynergyId}, Time: {Time}s)",
|
||||
id, entry.SynergyId, entry.TimeSeconds);
|
||||
|
||||
return Ok(new SynergyResponse<object>
|
||||
{
|
||||
resultCode = 0,
|
||||
message = $"Leaderboard entry {id} deleted successfully"
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error deleting leaderboard entry {Id}", id);
|
||||
return StatusCode(500, new SynergyResponse<object>
|
||||
{
|
||||
resultCode = -500,
|
||||
message = "Internal server error"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private string FormatTime(double seconds)
|
||||
{
|
||||
var timeSpan = TimeSpan.FromSeconds(seconds);
|
||||
|
||||
46
SESSION-CHECKPOINT-FEB24.md
Normal file
46
SESSION-CHECKPOINT-FEB24.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# RR3 Community Server - Session Checkpoint
|
||||
**Date:** February 24, 2026
|
||||
**Status:** 75/73 Core Endpoints + Notifications Service Complete
|
||||
|
||||
## Current Implementation Status
|
||||
|
||||
### Fully Complete Systems:
|
||||
- Director API (1/1)
|
||||
- User Service (3/3)
|
||||
- Product/Catalog (3/3)
|
||||
- DRM Service (3/3)
|
||||
- Config Service (4/4)
|
||||
- Progression (7/7)
|
||||
- Rewards (6/6)
|
||||
- Tracking (2/2)
|
||||
- Assets (2/2)
|
||||
- Settings (2/2)
|
||||
- Modding (3/3)
|
||||
- Records/Leaderboards (5/5)
|
||||
- Time Trials (6/6)
|
||||
- Events Service (4/4)
|
||||
- **Notifications Service (5/5)** ← NEW THIS SESSION
|
||||
|
||||
### Latest Commit: ceeb847 - Notifications Service
|
||||
|
||||
### Remaining for Full EA Parity:
|
||||
- Admin Tools (1 endpoint) - DELETE /synergy/leaderboards/{id}
|
||||
- Social/Friends (8+ endpoints) - friend management, gifts, clubs
|
||||
- Multiplayer (10+ endpoints) - matchmaking, ghosts, races
|
||||
|
||||
## Key Files
|
||||
- E:\rr3\RR3CommunityServer\RR3CommunityServer\Controllers\NotificationsController.cs
|
||||
- E:\rr3\RR3CommunityServer\RR3CommunityServer\Data\RR3DbContext.cs (Notification entity)
|
||||
- E:\rr3\RR3CommunityServer\RR3CommunityServer\Models\ApiModels.cs (notification models)
|
||||
|
||||
## Git Repos
|
||||
- GitHub: https://github.com/ssfdre38/rr3-server (main)
|
||||
- Gitea: https://gitea.barrer.net/project-real-resurrection-3/rr3-server (main)
|
||||
|
||||
## Next Steps (when resuming)
|
||||
1. Admin Tools - DELETE /synergy/leaderboards/{id} (quick win, 1 endpoint)
|
||||
2. Social/Friends Service (8 endpoints)
|
||||
3. Multiplayer Service (10+ endpoints)
|
||||
|
||||
## How to Resume
|
||||
Say: "Resume RR3 server development - read the checkpoint"
|
||||
Reference in New Issue
Block a user