Files
erqiwang_youle/client/js/01_SubGame/codes/net/handlers/QueryHandler.js
T
joywayerandClaude Opus 5 070ff37db1 二七王:明牌、提示、准备 handler
明牌数据进 GameState(面板可反复开关查看);提示不进——它是一次性通知、
不是对局状态,重连也不重放,存下来只会变成幽灵数据,故只随事件带出。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 18:04:33 +08:00

34 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
///////////////////////////////////////////////////////////////
////////// EQW_QueryHandler: 明牌(mingpai)与提示(tishi)///
///////////////////////////////////////////////////////////////
// 协议 §13.6 mingpai(只回给请求者):
// seat 请求者 / others 另外两家各自未出的全部主牌 [{seat, zhucards}]
// 受理条件:可查牌模式 + 出牌阶段 + 已有【任一】玩家报无主(design §9.3)
//
// 协议 §13.8 tishi(只转发给对家,即另一闲家):
// seat 发出提示的闲家 / tip 1=踩 2=没分 3=有分
// 注意:成功时【不给发送者回执】,只转发给对家;只有失败才回给发送者。
//
// 明牌数据进 GameState(面板可反复开关查看),提示不进——
// 提示是一次性的通知、不是对局状态,重连也不重放,存下来只会变成幽灵数据。
var EQW_QueryHandler = EQW_QueryHandler || {
handleMingpai: function (data) {
if (!data.hasOwnProperty('others')) {
console.error('[EQW_QueryHandler] mingpai 缺 others,已跳过该包');
return;
}
EQW_GameState.table.mingpai = data.others;
EventBus.emit(EQW_Events.EQW_MINGPAI);
},
handleTishi: function (data) {
if (!data.hasOwnProperty('seat') || !data.hasOwnProperty('tip')) {
console.error('[EQW_QueryHandler] tishi 缺 seat 或 tip,已跳过该包');
return;
}
//一次性通知:不进 GameState,随事件把内容带给订阅者
EventBus.emit(EQW_Events.EQW_TIP, { seat: data.seat, tip: data.tip });
}
};