feat(battle-node): BuildOpponentTurnEnd builder for v1.1 turn loop

Pairs with BuildOpponentTurnStart. Wire shape from prod capture
(turnState=0, resultCode=1). Single test locks uri, ViewerId, Cat,
and body shape.
This commit is contained in:
gamer147
2026-06-01 14:49:52 -04:00
parent d4926e31d6
commit f24fc7c643
2 changed files with 22 additions and 0 deletions

View File

@@ -107,6 +107,15 @@ public static class ScriptedLifecycle
EnvelopeForPush(NetworkBattleUri.TurnStart,
new OpponentTurnStartBody(Spin: ScriptedProfiles.OpponentTurnStartSpin));
/// <summary>
/// Server-pushed TurnEnd transition that closes the opponent's turn and hands control
/// back to the player. Paired with <see cref="BuildOpponentTurnStart"/> in the v1.1 loop.
/// Wire shape from prod capture battle-traffic_tk2_regular.ndjson L18:
/// <c>{"uri":"TurnEnd","turnState":0,"resultCode":1,"playSeq":N}</c>.
/// </summary>
public static MsgEnvelope BuildOpponentTurnEnd() =>
EnvelopeForPush(NetworkBattleUri.TurnEnd, new TurnEndBody(TurnState: 0));
private static IReadOnlyList<PosIdx> BuildPosIdxList(IReadOnlyList<long> hand)
{
var list = new List<PosIdx>(hand.Count);