Files
SVSimServer/SVSim.EmulatedEntrypoint/Models/Dtos/Responses/GameStartResponse.cs
2026-05-23 14:18:01 -04:00

85 lines
3.5 KiB
C#

using MessagePack;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses;
/// <summary>
/// Wire-shape mirrors production's <c>/check/game_start</c> response. Several fields here are
/// NOT read by <c>Cute/GameStartCheckTask.Parse</c> (<c>now_viewer_id</c>, <c>now_name</c>,
/// <c>now_rank</c> — those are consumed by sibling tasks); they're included because prod sends
/// them and the boot worked when we matched prod exactly. Removing them is a regression risk
/// even though the parse-time decompile says they're unused.
/// </summary>
[MessagePackObject]
public class GameStartResponse
{
/// <summary>The signed-in viewer's internal id. Prod always sends.</summary>
[Key("now_viewer_id")]
public long NowViewerId { get; set; }
/// <summary>
/// Whether the user has set a data-transfer password. Prod sends a non-null bool;
/// <c>GameStartCheckTask.Parse</c> gates the read with <c>Keys.Contains</c>.
/// </summary>
[Key("is_set_transition_password")]
public bool IsSetTransitionPassword { get; set; }
/// <summary>Viewer display name. Not read by GameStartCheckTask but sent by prod.</summary>
[Key("now_name")]
public string NowName { get; set; } = string.Empty;
/// <summary>
/// Per-format rank-name map keyed by deck-format id ("1", "2", "4" observed in prod).
/// Stub for now until rank state is persisted; pinned to RankName_010 / RankName_017
/// (matches prod's shape).
/// </summary>
[Key("now_rank")]
public Dictionary<string, string> NowRank { get; set; } = new();
/// <summary>
/// Tutorial progress — **sent as a string on the wire** ("100" = tutorial complete).
/// <c>GameStartCheckTask.Parse</c> calls <c>.ToInt()</c> so LitJson coerces.
/// </summary>
[Key("now_tutorial_step")]
public string NowTutorialStep { get; set; } = "100";
/// <summary>
/// Linked social accounts. Per-entry shape in <see cref="TransitionAccountData"/>.
/// </summary>
[Key("transition_account_data")]
public List<TransitionAccountData> TransitionAccountData { get; set; } = new();
// INTENTIONALLY OMITTED: `rewrite_viewer_id` and `account_delete_reservation_status`.
// Both are presence-checked by the client via `Keys.Contains(...)` + `.ToInt()` with no
// null guard. MessagePack-CSharp writes [Key] properties unconditionally (null → Nil),
// and the System.Text.Json `WhenWritingNull` ignore only affects the plain-JSON path.
// So including these as nullable properties is a guaranteed NRE on the encrypted client
// path. We don't need them — the client tolerates their absence — so don't declare them.
// Re-add only if we have a real value to send.
// --- Agreement / consent state (all required) ---
/// <summary><c>PlayerStaticData.AgreementState</c> enum.</summary>
[Key("tos_state")]
public int TosState { get; set; }
/// <summary><c>PlayerStaticData.AgreementState</c> enum.</summary>
[Key("policy_state")]
public int PolicyState { get; set; }
/// <summary><c>PlayerStaticData.AgreementState</c> enum.</summary>
[Key("kor_authority_state")]
public int KorAuthorityState { get; set; }
/// <summary>Current Terms of Service document id.</summary>
[Key("tos_id")]
public int TosId { get; set; }
/// <summary>Current Privacy Policy document id.</summary>
[Key("policy_id")]
public int PolicyId { get; set; }
/// <summary>Current Korean authority consent document id.</summary>
[Key("kor_authority_id")]
public int KorAuthorityId { get; set; }
}