二七王:result.chupai 移出 GameState,本墩结果改走 EQW_TRICK_END 事件载荷

谁最大、这墩闲家得几分是【一次性表现】(收牌动画、得分飘字),任何 deskinfo 都不下发它,
写进 GameState 就多出一处「只活在前端、服务端不知道」的对局态——出牌中途断线重连即归零,
违反红线「丢弃 this.data、仅凭最近一次服务端快照重画,界面必须一致」。

三处一起改,缺一不可:
- PlayHandler chupai3:删 result.chupai 写入,改随 EQW_TRICK_END 下发 {seat,cards,maxseat?,grade?};
  aset.grade 的累加保留(它有服务端来源 PushCards.grade / chupai3.grade,是镜像量)
- ResultHandler:_apply 的 map 删掉 chupai。收尾墩不发 chupai3、整包换成 jiesuan,
  不改这里则删 EXCLUDE 后必转红。收尾墩改为与 chupai3 走同一对事件、同一份载荷字段
  (补 emit EQW_TRICK_END 并带上 grade),否则最后一墩的得分没有出口
- GameState:删掉 result.chupai 字段本身(声明 + reset),不留永远为 null 的死字段

test_consistency 的 EXCLUDE 随之删到只剩 table.ancard3s 一条,27 checks 仍全绿;
该条改注释标明「当前夹具(65 分坐庄、单局)无法触发,此条未经验证」,不假装它在守什么。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 22:06:41 +08:00
co-authored by Claude Opus 5
parent b9a423071b
commit f8a154ff7a
7 changed files with 61 additions and 29 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ var EQW_Events = EQW_Events || {
EQW_MAIN_SET: 'eqw.main_set', //选主
EQW_BURY_DONE: 'eqw.bury_done', //埋牌完成
EQW_CARD_PLAYED: 'eqw.card_played', //有人出牌
EQW_TRICK_END: 'eqw.trick_end', //一轮结束(chupai3 带 maxseat)
EQW_TRICK_END: 'eqw.trick_end', //一墩结束;载荷 {seat,cards,maxseat[,grade]},不落 GameState
EQW_TURN_CHANGED: 'eqw.turn_changed', //控制权或倒计时变化
EQW_MINGPAI: 'eqw.mingpai', //收到明牌数据
EQW_TIP: 'eqw.tip', //收到对家提示
@@ -68,8 +68,10 @@ var EQW_GameState = EQW_GameState || {
},
//—— 结算 ——
//字段集与 deskinfo step6 的 Balance 严格对齐(aset / bottom / account)。
//【不存 chupai】收尾墩的「谁最大、得几分」是一次性表现,随 EQW_TRICK_END 事件载荷走,
//任何 deskinfo 都不下发它——存进来就是一处服务端不知道的私有对局态(见 ResultHandler / PlayHandler)
result: {
chupai: null,
bottom: null,
aset: null,
account: null
@@ -87,7 +89,7 @@ var EQW_GameState = EQW_GameState || {
this.my = { cards: [], mustCard: [], bottomCards: [], buryCards: [] };
this.table = { ancard3s: 0, playproc: null, pushlist: [], seatlist: [],
liangpai: null, mingpai: null };
this.result = { chupai: null, bottom: null, aset: null, account: null };
this.result = { bottom: null, aset: null, account: null };
},
//深拷贝快照(只含数据分组,不含方法),供测试做「增量 vs 全量」比对