From 65674542b3e2ff0331d7a3beb4b53a02d7bf14d1 Mon Sep 17 00:00:00 2001 From: Joywayer Date: Thu, 27 Aug 2026 17:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E4=B8=83=E7=8E=8B=EF=BC=9A=E8=A1=A5?= =?UTF-8?q?=E5=85=A8=20FORBIDDEN=20=E5=88=97=E8=A1=A8=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=8D=8F=E8=AE=AE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FORBIDDEN 列表扩充到覆盖协议中服务端→客户端的全部字段名, 作为回归网防止未来在发包方法中意外泄漏服务端计算结果。 Co-Authored-By: Claude Opus 5 (1M context) --- client/tests/test_rpc_send.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/tests/test_rpc_send.js b/client/tests/test_rpc_send.js index 50a7253..8b61940 100644 --- a/client/tests/test_rpc_send.js +++ b/client/tests/test_rpc_send.js @@ -43,8 +43,15 @@ t.eq('提示', call(() => EQW_Rpc.tishi(1)).data, { seat: 2, tip: 1 }); t.eq('准备', call(() => EQW_Rpc.zhunbei()).data, { seat: 2 }); // ---- 【核心】只带意图:所有发包的字段集合不含任何结论字段 ---- +// FORBIDDEN 列表:协议中服务端→客户端方向的字段名。原则上都不该出现在客户端→服务端的包里。 +// 作为回归网:新增发包方法时若引入了服务端字段名会被它拦下。 const FORBIDDEN = ['score', 'isWin', 'phase', 'nextSeat', 'nextseat', 'handCards', - 'grade', 'multiple', 'result', 'banker', 'curmultiple', 'upgrade']; + 'grade', 'multiple', 'result', 'banker', 'curmultiple', 'upgrade', + 'cardsinhand', 'mustcard', 'seatlist', 'baozhu', 'liangpai', 'bottomcards', 'burycards', + 'ancard3s', 'countdown', 'currcall', 'chongguan', 'wang', 'naward', + 'grade_aw', 'grade_cg', 'grade_bw', 'grade_jf', 'account', 'readystate', + 'shuai', 'shuaicuo', 'cardtype', 'maxseat', 'gradecards', 'others', 'zhucards', + 'playproc', 'pushlist', 'touxiang']; sent.length = 0; EQW_Rpc.jiaofen(60); EQW_Rpc.touxiang(); EQW_Rpc.xuanzhu(1); EQW_Rpc.maipai([1,2,3,4,5,6,7,8]); EQW_Rpc.chupai([9]);