Files
SVSimServer/SVSim.BattleNode/Lifecycle/ScriptedProfiles.cs
gamer147 b0488e3f2e feat(battle-node): BuildBattleStart consumes MatchContext for player half
ClassId/CharaId/CardMasterName/BattleType flow from ctx. PlayerBattleStart
Profile removed; Rank/BattlePoint remain as standalone consts pending real
per-viewer rank tracker. One test updated, one new test added.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 12:49:54 -04:00

55 lines
2.0 KiB
C#

using SVSim.BattleNode.Protocol.Bodies;
namespace SVSim.BattleNode.Lifecycle;
/// <summary>
/// Named constants and templates for the v1 scripted lifecycle. Every value here
/// originated in a real prod frame in
/// <c>data_dumps/captures/battle-traffic_tk2_regular.ndjson</c>; pulling them out
/// of <see cref="ScriptedLifecycle"/> makes the magic numerics navigable and gives
/// the seed a single source of truth instead of two duplicated literals.
/// </summary>
internal static class ScriptedProfiles
{
// Shared per the spec — selfInfo.seed and oppoInfo.seed always agree.
// From frame[2] (Matched).
public const long BattleSeed = 17_548_138L;
public static readonly MatchedOppoInfo OpponentMatchedProfile = new(
CountryCode: "JPN",
UserName: "Opponent",
SleeveId: "704141010",
EmblemId: "400001100",
DegreeId: "120027",
FieldId: 5,
IsOfficial: 0,
OppoId: 0,
Seed: BattleSeed,
OppoDeckCount: 30);
// From frame[5] (BattleStart). Hardcoded; see spec §Deferred plumbing — sourcing these
// from real per-viewer state needs a TK2 rank/battle-point tracker.
public const string PlayerRank = "10";
public const string PlayerBattlePoint = "6270";
public static readonly BattleStartOppoInfo OpponentBattleStartProfile = new(
Rank: "1",
IsMasterRank: "0",
BattlePoint: 0,
MasterPoint: "0",
ClassId: "8",
CharaId: "8",
CardMasterName: "card_master_node_10015");
// From frame[8] (Ready). Provenance is "what prod sent"; the client
// doesn't validate, but echoing matches the capture protects against
// a regression on a future tightening.
public const int ReadyIdxChangeSeed = 771_335_280;
public const int ReadySpin = 243;
// Generic non-zero spin that lands the client in "Opponent's turn..."
// display state. v1 doesn't simulate the opponent — once this lands,
// the client sits there indefinitely.
public const int OpponentTurnStartSpin = 100;
}