From 0e8f5427c3a9ceeafeffc6e241e8a63a60aabe2b Mon Sep 17 00:00:00 2001 From: gamer147 Date: Mon, 1 Jun 2026 12:35:43 -0400 Subject: [PATCH] feat(battle-node): add MatchContext record for per-mode player snapshot Public contract between HTTP-side do_matching controllers (assemble) and SVSim.BattleNode (consume). First piece of the real-drafted-deck wiring; nothing references it yet. Co-Authored-By: Claude Opus 4.7 --- SVSim.BattleNode/Bridge/MatchContext.cs | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 SVSim.BattleNode/Bridge/MatchContext.cs diff --git a/SVSim.BattleNode/Bridge/MatchContext.cs b/SVSim.BattleNode/Bridge/MatchContext.cs new file mode 100644 index 0000000..b5b81d2 --- /dev/null +++ b/SVSim.BattleNode/Bridge/MatchContext.cs @@ -0,0 +1,29 @@ +namespace SVSim.BattleNode.Bridge; + +/// +/// Per-battle player snapshot captured at do_matching time and replayed into the scripted +/// lifecycle on WS connect. SVSim.BattleNode does not know how to build this — the HTTP-side +/// per-mode controller is the source. Snapshot semantics: cosmetic changes between matching +/// and WS connect have no effect on the in-battle render. +/// +public sealed record MatchContext( + // Player's drafted deck — exactly 30 entries, idx 1..30 paired with the chosen cardIds + // in the order this list provides them. Producer is responsible for the count. + IReadOnlyList SelfDeckCardIds, + + // Player class + leader (BattleStartSelfInfo) + string ClassId, // "1".."8" + string CharaId, // "1".."8" — equals ClassId when no leader skin chosen + string CardMasterName, // current card-master, e.g. "card_master_node_10015" + + // Player cosmetics (MatchedSelfInfo) + string CountryCode, // "KOR", "JPN", ... + string UserName, + string SleeveId, + string EmblemId, + string DegreeId, + int FieldId, + int IsOfficial, // 0 or 1 + + // Battle-mode hint, currently TK2 == 11. Future modes populate their own value. + int BattleType);