From 734c10290202daee73e81fe54b7ec72f650b5f93 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 30 Mar 2021 13:15:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0dice=5Fcard=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index a93cd89..327f8bc 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -27,6 +27,7 @@ import { PlayerStateConst } from '../constants/PlayerStateConst' import { PlayLeftCommand } from './commands/PlayLeftCommand' import { PauseCommand } from './commands/PauseCommand' import { ResumeCommand } from './commands/ResumeCommand' +import { DiceCommand } from './commands/DiceCommand' export class GeneralRoom extends Room { dispatcher = new Dispatcher(this) @@ -94,6 +95,13 @@ export class GeneralRoom extends Room { nums: message.nums }) }) + this.onMessage('dice_card_c2s', (client, message) => { + msgLog('dice_card_c2s from ', client.sessionId, JSON.stringify(message)) + this.dispatcher.dispatch(new DiceCommand(), { + client, + cards: message.cards, + }) + }) this.onMessage('eat_card_c2s', (client, message) => { msgLog('eat_card from ', client.sessionId, JSON.stringify(message)) this.dispatcher.dispatch(new EatCardCommand(), {