using Microsoft.AspNetCore.Mvc; using RecRoomArchive.Services; namespace RecRoomArchive.Controllers.API.VersionCheck.V1 { /// /// Endpoints used to check if the version the player is playing on is up to date enough to play Rec Room, due to this being a custom server, it doesn't really matter /// [Route(template: "api/[controller]/v1")] [ApiController] public class VersionCheckController(AppVersionService appVersionService) : ControllerBase { /// /// Checks if the appVersion provided is allowed to play (which it most certainly will be unless its a weird build or someone messed with it) /// /// An Ok response if the version is valid, Forbid if it is not. Forbid will yield the client displaying "Rec Room Update Required" soo maybe don't [HttpGet] public async Task CheckVersion([FromHeader(Name = "X-Rec-Room-Version")] string appVersion) { if (appVersion == null) return Forbid(); return Ok(); } } }