feat(account): /account/update_region_code (accept-only)

This commit is contained in:
gamer147
2026-06-12 23:01:53 -04:00
parent 56ef994275
commit b4a87792dc
3 changed files with 47 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using SVSim.Database;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Account;
namespace SVSim.EmulatedEntrypoint.Controllers;
@@ -46,4 +47,14 @@ public class AccountController : SVSimController
// so the translation middleware emits the right msgpack shape.
return Ok(Array.Empty<object>());
}
[HttpPost("update_region_code")]
public ActionResult<EmptyResponse> UpdateRegionCode([FromBody] AccountUpdateRegionCodeRequest _)
{
if (!TryGetViewerId(out long __)) return Unauthorized();
// No-op: actual region value is sent in the REGION_CODE HTTP header, which we
// don't currently consume server-side. The body carries only initialize_flag,
// which is a first-set-vs-update signal we have no use for yet.
return new EmptyResponse();
}
}

View File

@@ -0,0 +1,12 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Account;
[MessagePackObject]
public class AccountUpdateRegionCodeRequest : BaseRequest
{
[JsonPropertyName("initialize_flag")]
[Key("initialize_flag")]
public int InitializeFlag { get; set; }
}