Adds the portal pair (shadowverse-portal.com deck-builder endpoints) as anonymous routes on the app server. The translation middleware learns a new [NoWireEncryption] attribute that skips both AES calls but keeps the rest of the msgpack + base64 + envelope pipeline intact, matching prod's portal wire profile observed in data_dumps/traffic_prod_deckcode.ndjson. Storage is a 3-minute IMemoryCache — codes are anonymous-global, 4-char lowercase alphanumeric (matches the shortest prod sample). Foil bit is stripped on mint to match prod's normalize-on-encode behaviour. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using MessagePack;
|
|
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses.DeckBuilder;
|
|
|
|
[MessagePackObject]
|
|
public class GetDeckFromCodeResponse
|
|
{
|
|
[JsonPropertyName("text")]
|
|
[Key("text")]
|
|
public string Text { get; set; } = "OK";
|
|
|
|
[JsonPropertyName("deck")]
|
|
[Key("deck")]
|
|
public DeckPayload Deck { get; set; } = new();
|
|
|
|
[JsonPropertyName("errors")]
|
|
[Key("errors")]
|
|
public PortalErrors Errors { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Wire shape inside the <c>deck</c> envelope. Prod emits <c>clan</c> / <c>deck_format</c> as
|
|
/// strings but <c>sub_clan</c> / <c>rotation_id</c> as ints — mirror that quirk so the client
|
|
/// `.ToInt()` / `.ToString()` paths see what they expect. <c>RotationId</c> is typed as
|
|
/// <c>object</c> so we can emit the int literal <c>0</c> on standard decks (matches prod) and a
|
|
/// string on MyRotation decks.
|
|
/// </summary>
|
|
[MessagePackObject]
|
|
public class DeckPayload
|
|
{
|
|
[JsonPropertyName("deck_format")]
|
|
[Key("deck_format")]
|
|
public string DeckFormat { get; set; } = "1";
|
|
|
|
[JsonPropertyName("clan")]
|
|
[Key("clan")]
|
|
public string Clan { get; set; } = "0";
|
|
|
|
[JsonPropertyName("sub_clan")]
|
|
[Key("sub_clan")]
|
|
public int SubClan { get; set; }
|
|
|
|
[JsonPropertyName("rotation_id")]
|
|
[Key("rotation_id")]
|
|
public object RotationId { get; set; } = 0;
|
|
|
|
[JsonPropertyName("card_id")]
|
|
[Key("card_id")]
|
|
public List<long> CardID { get; set; } = new();
|
|
}
|