Files
RRAC/RecRoomArchive/Controllers/API/VersionCheck/V1/VersionCheckController.cs
T
splootybean 387ec7ba89 Initialize repository
Added basic info to get in game for like...August 2016 ;-;
It's not much but it's a start
2026-02-27 00:58:13 -08:00

26 lines
1.1 KiB
C#

using Microsoft.AspNetCore.Mvc;
using RecRoomArchive.Services;
namespace RecRoomArchive.Controllers.API.VersionCheck.V1
{
/// <summary>
/// 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
/// </summary>
[Route(template: "api/[controller]/v1")]
[ApiController]
public class VersionCheckController(AppVersionService appVersionService) : ControllerBase
{
/// <summary>
/// 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)
/// </summary>
/// <returns>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</returns>
[HttpGet]
public async Task<ActionResult> CheckVersion([FromHeader(Name = "X-Rec-Room-Version")] string appVersion)
{
if (appVersion == null)
return Forbid();
return Ok();
}
}
}