revert(battle-node): remove real-spin logic (CountHiddenDraws + per-frame spin)

Two-sided capture (data_dumps/captures/battle_test/rng, 2026-06-04) showed the
receiver already reproduces uList-relayed deck fetches (Hoverboard) and turn
draws on its own shared stream, so the emitted spin=1 double-cranked and desynced
the clients by 1. Residual spin is ~0 for the current card pool. Reverts 63cb324
and 617714e; back to the prior correct spin:0 behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-04 16:07:08 -04:00
parent 617714ebea
commit 75f3d8ea5b
5 changed files with 4 additions and 217 deletions

View File

@@ -48,17 +48,6 @@ internal sealed class PlayActionsHandler : IFrameHandler
// knownList in the same frame (capture line 75).
var uList = KnownListBuilder.RelayUList(entries.GetValueOrDefault("uList"));
// Hidden shared-RNG draws (a random deck→hand fetch the opponent can't reproduce) advance the
// sender's shared _stableRandom; the receiver doesn't re-run them, so it needs a spin crank to
// stay aligned for later visible randoms. Per-frame delivery (real-spin design §3.2): the count
// rides THIS PlayActions. A fetch we relay with an identity (uList cardId present) is already
// known to the opponent — exclude its idxs so it isn't counted. 0 → null (omitted; client
// assumes spin:0).
var revealed = uList is null
? (IReadOnlySet<int>)new HashSet<int>()
: uList.Where(u => u.CardId is not null).SelectMany(u => u.IdxList).ToHashSet();
var spin = KnownListBuilder.CountHiddenDraws(orderList, playIdx, revealed);
var body = new PlayActionsBroadcastBody(
PlayIdx: playIdx,
Type: type,
@@ -67,8 +56,7 @@ internal sealed class PlayActionsHandler : IFrameHandler
UList: uList,
// {type,cardId} forwarded so the opponent renders the choice token; selectCard dropped
// when open==0 (hidden draw-to-hand pick). Null for a vanilla play (no keyAction).
KeyAction: KnownListBuilder.StripKeyActionForOpponent(keyAction),
Spin: spin > 0 ? spin : null);
KeyAction: KnownListBuilder.StripKeyActionForOpponent(keyAction));
var frame = ctx.Env with { Body = body };
return new[] { new DispatchRoute(ctx.Other, frame, false) };