Files
rr3-server/RR3CommunityServer/Controllers/DirectorController.cs
Daniel Elliott fbe421847e Add Daily Rewards & Time Trials features
NEW FEATURES:
- Daily login rewards with Gold and Cash
- Daily time trial racing events
- FREE gold purchase system
- Streak tracking for consecutive days
- Web panel for managing rewards and events

ENDPOINTS ADDED:
- GET/POST /synergy/rewards/daily/{id} - Daily rewards
- POST /synergy/rewards/gold/purchase - Buy gold (FREE)
- GET /synergy/rewards/timetrials - Active events
- POST /synergy/rewards/timetrials/{id}/submit - Submit times

DATABASE:
- DailyReward table - tracks claims and streaks
- TimeTrial table - racing events with rewards
- TimeTrialResult table - player submissions
- User.Gold and User.Cash - currency tracking

WEB PANEL:
- /admin/rewards - Manage all reward features
- Create/edit/activate time trial events
- View reward statistics and history
- Gold packages in catalog (100, 500, 1000, 5000)

FOCUS:
- Single-player progression features
- NO race teams or multiplayer
- Perfect for offline play
- All purchases are FREE in community server

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 22:14:03 -08:00

51 lines
1.6 KiB
C#

using Microsoft.AspNetCore.Mvc;
using RR3CommunityServer.Models;
namespace RR3CommunityServer.Controllers;
[ApiController]
[Route("director/api/android")]
public class DirectorController : ControllerBase
{
private readonly ILogger<DirectorController> _logger;
private readonly IConfiguration _configuration;
public DirectorController(ILogger<DirectorController> logger, IConfiguration configuration)
{
_logger = logger;
_configuration = configuration;
}
[HttpGet("getDirectionByPackage")]
public ActionResult<SynergyResponse<DirectorResponse>> GetDirection([FromQuery] string packageName)
{
_logger.LogInformation("Director request for package: {Package}", packageName);
var baseUrl = $"{Request.Scheme}://{Request.Host}";
var response = new SynergyResponse<DirectorResponse>
{
resultCode = 0,
message = "Success",
data = new DirectorResponse
{
serverUrls = new Dictionary<string, string>
{
{ "synergy.product", baseUrl },
{ "synergy.drm", baseUrl },
{ "synergy.user", baseUrl },
{ "synergy.tracking", baseUrl },
{ "synergy.rewards", baseUrl },
{ "synergy.s2s", baseUrl },
{ "nexus.portal", baseUrl },
{ "ens.url", baseUrl }
},
environment = "COMMUNITY",
version = "1.0.0"
}
};
return Ok(response);
}
}