using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.AspNetCore.Mvc; namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/plain")] public class StatisticsController : ControllerBase { private readonly Database database; public StatisticsController(Database database) { this.database = database; } [HttpGet("playersInPodCount")] [HttpGet("totalPlayerCount")] public async Task TotalPlayerCount() => this.Ok((await StatisticsHelper.RecentMatches(this.database)).ToString()); [HttpGet("planetStats")] public async Task PlanetStats() { int totalSlotCount = await StatisticsHelper.SlotCount(this.database); int mmPicksCount = await StatisticsHelper.TeamPickCount(this.database); return this.Ok ( LbpSerializer.StringElement ("planetStats", LbpSerializer.StringElement("totalSlotCount", totalSlotCount) + LbpSerializer.StringElement("mmPicksCount", mmPicksCount)) ); } [HttpGet("planetStats/totalLevelCount")] public async Task TotalLevelCount() => this.Ok((await StatisticsHelper.SlotCount(this.database)).ToString()); }