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(), {