Add remaining project files

This commit is contained in:
Marco Baldwin
2026-07-23 18:21:43 -07:00
parent c12d8ac35d
commit 6e15e89a9d
453 changed files with 64265 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Runtime.InteropServices;
namespace DeluxeBackend.Controllers.Api
{
[Route("api/versioncheck")]
[ApiController]
public class VersioncheckController : ControllerBase
{
[HttpGet("v1")]//this is for 2016 builds
public IActionResult V1([FromHeader(Name = "X-Rec-Room-Version")] string appVersion = "")
{
if (appVersion != ServerConfig.AppVersion)
{
return StatusCode(403);
}
return Ok();
}
[HttpGet("v2")]//this is for 2017/2018 builds
[HttpGet("v3")]
public IActionResult V3([FromQuery(Name = "v")] string appVersion = "")
{
return Ok(new
{
ValidVersion = appVersion == ServerConfig.AppVersion
});
}
[HttpGet("v4")]//this is for 2019 and later builds
public IActionResult V4([FromQuery(Name = "v"), Required] string appVersion, [FromQuery(Name = "p")] int? platform = null, [FromQuery(Name = "pid")] string? platformId = null)
{
int versionStatus = 0;
if (appVersion != ServerConfig.AppVersion)
{
versionStatus = 1;
}
return Ok(new
{
VersionStatus = versionStatus,
UpdateNotificationStage = 0,
IsVersionIslanded = false,
IsCrossPlayDisabled = false
});
}
}
}