Files
SVSimServer/SVSim.EmulatedEntrypoint/Models/Dtos/Internal/DataHeaders.cs
gamer147 859980af02 wire: echo UDID in DataHeaders on every response
SignUpTask.Parse validates data_headers.udid against Certification.Udid;
mismatch discards the response. Sourced from the same mappedUdid the
translation middleware uses to decrypt — never controller state. Other
endpoints carry the extra key; SignUpTask is the only reader.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:11:47 -04:00

36 lines
1.2 KiB
C#

using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Internal;
[MessagePackObject]
public class DataHeaders
{
[JsonPropertyName("short_udid")]
[Key("short_udid")]
public long ShortUdid { get; set; }
[JsonPropertyName("viewer_id")]
[Key("viewer_id")]
public long ViewerId { get; set; }
[JsonPropertyName("sid")]
[Key("sid")]
public string Sid { get; set; }
[JsonPropertyName("servertime")]
[Key("servertime")]
public long Servertime { get; set; }
[JsonPropertyName("result_code")]
[Key("result_code")]
public int ResultCode { get; set; }
/// <summary>
/// Echoed UDID. Read by <c>SignUpTask.Parse</c> to validate response identity (client logs
/// <c>udid一致しません</c> and discards the response on mismatch); ignored by every other
/// client task. Always set by <c>ShadowverseTranslationMiddleware</c> from the request's
/// resolved UDID — never from controller state. Empty string when the SID→UDID lookup misses
/// (request without UDID/SID headers).
/// </summary>
[JsonPropertyName("udid")]
[Key("udid")]
public string Udid { get; set; } = "";
}