feat(battle-node): relay uList on PvP PlayActions
Forwards the sender's deck-sourced summons/fetches to the opponent (closes the spin-independent slice of direct-to-field summons). uList coexists with the synthesized knownList in the same frame. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -249,6 +249,58 @@ public class BattleSessionDispatchTests
|
||||
Assert.That(pb.OppoTargetList[0].IsSelf, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Pvp_PlayActions_relays_uList_verbatim()
|
||||
{
|
||||
// A deck-fetch rides the uList (battle-traffic_tk2_regular.ndjson:75); the node forwards it
|
||||
// verbatim alongside the synthesized knownList for the played card.
|
||||
var (s, a, b) = NewPvpSession();
|
||||
DriveToAfterReady(s, a);
|
||||
DriveToAfterReady(s, b);
|
||||
|
||||
var body = MoveOrderList(idx: 3, from: 10, to: 20);
|
||||
body["playIdx"] = 3L;
|
||||
body["type"] = 30L;
|
||||
body["uList"] = new List<object?>
|
||||
{
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["idxList"] = new List<object?> { 16L, 22L },
|
||||
["from"] = 0L, ["to"] = 10L, ["isSelf"] = 1L, ["skill"] = "37|36|0",
|
||||
},
|
||||
};
|
||||
|
||||
var routes = s.ComputeFrames(a, EnvWith(NetworkBattleUri.PlayActions, body));
|
||||
Assert.That(routes.Count, Is.EqualTo(1));
|
||||
Assert.That(routes[0].Target, Is.SameAs(b));
|
||||
var pb = (PlayActionsBroadcastBody)routes[0].Frame.Body;
|
||||
|
||||
Assert.That(pb.KnownList!.Count, Is.EqualTo(1), "played card still synthesized in the same frame");
|
||||
Assert.That(pb.UList, Is.Not.Null);
|
||||
Assert.That(pb.UList!.Count, Is.EqualTo(1));
|
||||
Assert.That(pb.UList[0].IdxList, Is.EqualTo(new[] { 16, 22 }));
|
||||
Assert.That(pb.UList[0].From, Is.EqualTo(0));
|
||||
Assert.That(pb.UList[0].To, Is.EqualTo(10));
|
||||
Assert.That(pb.UList[0].IsSelf, Is.EqualTo(1));
|
||||
Assert.That(pb.UList[0].Skill, Is.EqualTo("37|36|0"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Pvp_PlayActions_without_uList_leaves_it_null()
|
||||
{
|
||||
var (s, a, b) = NewPvpSession();
|
||||
DriveToAfterReady(s, a);
|
||||
DriveToAfterReady(s, b);
|
||||
|
||||
var body = MoveOrderList(idx: 3, from: 10, to: 20);
|
||||
body["playIdx"] = 3L;
|
||||
body["type"] = 30L;
|
||||
|
||||
var routes = s.ComputeFrames(a, EnvWith(NetworkBattleUri.PlayActions, body));
|
||||
var pb = (PlayActionsBroadcastBody)routes[0].Frame.Body;
|
||||
Assert.That(pb.UList, Is.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Pvp_PlayActions_ungenerated_token_idx_degrades_to_no_knownList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user