吃别人卡确定吃卡玩家后, 向loser发送失败的消息

This commit is contained in:
zhl 2020-12-08 17:01:02 +08:00
parent 1a735bca6d
commit e3eb6f5a46

View File

@ -57,7 +57,6 @@ export class EatConfirmCommand extends Command<CardGameState, { timeUp: boolean
}
}
/**
* 3
* 1.
@ -96,6 +95,13 @@ export class EatConfirmCommand extends Command<CardGameState, { timeUp: boolean
}
// 成功后广播吃牌成功消息
this.room.broadcast('eat_card_s2c', {player: player.id, errocode: 0, errmsg: ''});
// 向其他玩家发送吃卡失败的消息
for (let [key, val] of tmpActionMap) {
if (typeof val != 'number' && key !== player.id) {
let client = this.room.getClient(key);
client.send('eat_card_s2c', {errcode: 9, errmsg: '吃卡失败'});
}
}
}
}