Files
SVSimServer/SVSim.BattleNode/Bridge/MatchContext.cs
gamer147 578d0a75ef refactor(battlenode): rename mode-id field off BattleType, add BattleModes (§D)
Behavior-preserving; 271 BattleNode/Matching/Services tests green, full solution builds.

"BattleType" meant two things: the Sessions.BattleType enum (Pvp/Bot) and an int
"mode id" field. Renamed the int field on MatchContext AND the BattleStartBody wire
DTO to BattleModeId (wire key stays "battleType" via JsonPropertyName), so BattleType
now means only the enum project-wide.

New Bridge/BattleModes.cs (TakeTwo = 11) replaces every 11 literal — both prod
MatchContextBuilder sites and the test fixtures/assertions. The arbitrary-passthrough
42 and bot 0 stay literal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:44:02 -04:00

33 lines
1.5 KiB
C#

namespace SVSim.BattleNode.Bridge;
/// <summary>
/// Per-battle player snapshot captured at do_matching time and replayed into the
/// server-authored frame 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.
/// </summary>
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<long> 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 (the prod do_matching mode id). Named BattleModeId, NOT BattleType, to
// avoid colliding with the <see cref="Sessions.BattleType"/> enum (Pvp/Bot) — a different axis.
// Known values live in <see cref="BattleModes"/> (currently just TK2 == 11). Future modes add
// their own constant.
int BattleModeId);