二七王:前端删掉 9 处阶段/控制权推导,一律读服务端包字段

I-3 前端不再持有对局状态机(配合服务端上一提交的下发面补齐):
- 删掉 5 处按 rpc 名硬编码的 aset.step(Deal=1 / Call=2 / Main=3 / Bury=5 / Result=6),
  一律改 _apply 读包里的 step
- 删掉 4 处 turn.seat = aset.banker(CallHandler / MainHandler / ResyncHandler×2),
  增量路径读 nextseat、重连路径读分组里的 seat;同一条规则不再有 4 个写入处

I-2 ResyncHandler._applyBalance 由只接 aset 扩为接 aset/bottom/account,
结算面板开着时重连/硬刷新不再丢抠底明细与末局大结算。
一致性测试 EXCLUDE 随之从 4 条收缩为 2 条(去掉 result.bottom / result.account,
只留一次性事件 table.ancard3s 与归下一轮的 result.chupai),未新增任何豁免条目。

夹具按新包结构重跑(种子不变,牌局不变):diff 纯为 67 行新增字段、0 行删除;
test_fixture 补上 step/nextseat/Balance 同源断言(68→82 checks)。
export_packets.js 里关于 playproc/seatlist 活引用的注释已过时,更正为仍存在的
Balance.readystate 与三份结算快照。

各 handler 单测补齐新字段并新增守卫用例:刻意构造 nextseat != banker、
step 为非预期值的包,使「退回硬编码/banker 反推」的写法必然转红(11/11 已验证)。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 21:31:20 +08:00
co-authored by Claude Opus 5
parent 5d981a722e
commit 8b2cfdaf27
14 changed files with 284 additions and 55 deletions
+67
View File
@@ -169,6 +169,7 @@
"success": true,
"asetidx": 1,
"asetcount": 6,
"step": 1,
"seat": 0,
"countdown": 15,
"cards": [
@@ -211,6 +212,7 @@
"call": 65,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 1,
"countdown": 15
}
@@ -223,6 +225,7 @@
"call": 0,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 2,
"countdown": 15
}
@@ -236,6 +239,8 @@
"banker": 0,
"grade": 65,
"multiple": 2,
"step": 2,
"nextseat": 0,
"countdown": 20,
"touxiang": 0,
"curmultiple": 3,
@@ -295,6 +300,8 @@
"success": true,
"banker": 0,
"flower": 1,
"step": 3,
"nextseat": 0,
"countdown": 25,
"cards": [
52,
@@ -340,6 +347,7 @@
"rpc": "maipai",
"data": {
"success": true,
"step": 5,
"seat": 0,
"countdown": 30,
"seatlist": [
@@ -5908,6 +5916,7 @@
71
]
},
"step": 6,
"aset": {
"banker": 0,
"call": 65,
@@ -5973,6 +5982,7 @@
"success": true,
"asetidx": 1,
"asetcount": 6,
"step": 1,
"seat": 0,
"countdown": 15,
"cards": [
@@ -6015,6 +6025,7 @@
"call": 65,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 1,
"countdown": 15
}
@@ -6027,6 +6038,7 @@
"call": 0,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 2,
"countdown": 15
}
@@ -6040,6 +6052,8 @@
"banker": 0,
"grade": 65,
"multiple": 2,
"step": 2,
"nextseat": 0,
"countdown": 20,
"touxiang": 0,
"curmultiple": 3
@@ -6051,6 +6065,8 @@
"success": true,
"banker": 0,
"flower": 1,
"step": 3,
"nextseat": 0,
"countdown": 25,
"cards": [
106,
@@ -6088,6 +6104,7 @@
"rpc": "maipai",
"data": {
"success": true,
"step": 5,
"seat": 0,
"countdown": 30,
"seatlist": [
@@ -11622,6 +11639,7 @@
71
]
},
"step": 6,
"aset": {
"banker": 0,
"call": 65,
@@ -11687,6 +11705,7 @@
"success": true,
"asetidx": 1,
"asetcount": 6,
"step": 1,
"seat": 0,
"countdown": 15,
"cards": [
@@ -11729,6 +11748,7 @@
"call": 65,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 1,
"countdown": 15
}
@@ -11741,6 +11761,7 @@
"call": 0,
"currcall": 65,
"multiple": 2,
"step": 1,
"nextseat": 2,
"countdown": 15
}
@@ -11754,6 +11775,8 @@
"banker": 0,
"grade": 65,
"multiple": 2,
"step": 2,
"nextseat": 0,
"countdown": 20,
"touxiang": 0,
"curmultiple": 3
@@ -11765,6 +11788,8 @@
"success": true,
"banker": 0,
"flower": 1,
"step": 3,
"nextseat": 0,
"countdown": 25,
"cards": [
53,
@@ -11802,6 +11827,7 @@
"rpc": "maipai",
"data": {
"success": true,
"step": 5,
"seat": 0,
"countdown": 30,
"seatlist": [
@@ -17335,6 +17361,7 @@
71
]
},
"step": 6,
"aset": {
"banker": 0,
"call": 65,
@@ -17615,6 +17642,7 @@
59
],
"ChooseMain": {
"seat": 0,
"banker": 0,
"call": 65,
"multiple": 2,
@@ -17678,6 +17706,7 @@
4
],
"ChooseMain": {
"seat": 0,
"banker": 0,
"call": 65,
"multiple": 2,
@@ -17731,6 +17760,7 @@
61
],
"ChooseMain": {
"seat": 0,
"banker": 0,
"call": 65,
"multiple": 2,
@@ -17792,6 +17822,7 @@
71
],
"BuryCards": {
"seat": 0,
"banker": 0,
"call": 65,
"multiple": 2,
@@ -19438,6 +19469,18 @@
"score": -2
}
]
},
"bottom": {
"cards": [
67,
79,
23,
75,
20,
18,
72,
71
]
}
}
}
@@ -19516,6 +19559,18 @@
"score": -2
}
]
},
"bottom": {
"cards": [
67,
79,
23,
75,
20,
18,
72,
71
]
}
}
}
@@ -19594,6 +19649,18 @@
"score": -2
}
]
},
"bottom": {
"cards": [
67,
79,
23,
75,
20,
18,
72,
71
]
}
}
}