mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
feat: Add support for 2018 client API endpoints and data models
- Implemented new search endpoints for rooms to accommodate the 2018 client. - Added support for retrieving room details and featured rooms in a format compatible with the 2018 client. - Introduced new data models for login responses and player presence specific to the 2018 client. - Created mappers to convert between internal entities and the 2018 wire formats for players and rooms. - Updated existing storefront APIs to include versioned endpoints for the 2018 client. - Enhanced the version controller to return dual-format responses for compatibility with both 2018 and 2020 clients. - Refactored the configuration service to ensure trailing slashes in URLs for the 2018 client.
This commit is contained in:
@@ -6,7 +6,16 @@ namespace DorkNet.Server.Controllers.API.Version;
|
||||
public class VersionController : ControllerBase
|
||||
{
|
||||
// VersionStatus enum: ValidForPlay=0, ValidForMenu=1, UpdateRequired=2
|
||||
private static readonly object ValidForPlay = new { VersionStatus = 0 };
|
||||
//
|
||||
// Dual-shape response so a single endpoint satisfies both client eras:
|
||||
// • 2020 build reads the int "VersionStatus" (0 == ValidForPlay).
|
||||
// • 2018.06 build (api/versioncheck/v3) reads the bool "ValidVersion"
|
||||
// via a case-sensitive dict index (RecNet.cs BPPMLPMDHCI.Deserialize
|
||||
// -> Util.GetKey<bool>("ValidVersion")). A MISSING key throws
|
||||
// KeyNotFoundException -> the connect coroutine shows "Rec Room
|
||||
// update required" and aborts boot before login. Emitting both keys
|
||||
// keeps each era reading only the field it knows.
|
||||
private static readonly object ValidForPlay = new { VersionStatus = 0, ValidVersion = true };
|
||||
|
||||
[HttpGet("api/version/v1")]
|
||||
[HttpGet("api/version")]
|
||||
|
||||
Reference in New Issue
Block a user