From 20ff488eccdf7d68e70923b1c9af89fd912a2410 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 13 Jan 2021 14:03:44 +0800 Subject: [PATCH] =?UTF-8?q?select=20hero=E5=91=BD=E4=BB=A4=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8D=A1=E7=BB=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 2 +- src/rooms/commands/SelectHeroCommand.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index cc953f5..cabfbc1 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -74,7 +74,7 @@ export class GeneralRoom extends Room { this.onMessage("select_hero_c2s", (client, message) => { msgLog('select_hero from ', client.sessionId, JSON.stringify(message)); - this.dispatcher.dispatch(new SelectHeroCommand(), {client, heroId: message.heroId}); + this.dispatcher.dispatch(new SelectHeroCommand(), {client, heroId: message.heroId, cardGroup: message.cardgroup}); }); this.onMessage("gm", (client, message) => { diff --git a/src/rooms/commands/SelectHeroCommand.ts b/src/rooms/commands/SelectHeroCommand.ts index 2dde1f0..f30da47 100644 --- a/src/rooms/commands/SelectHeroCommand.ts +++ b/src/rooms/commands/SelectHeroCommand.ts @@ -11,8 +11,8 @@ import {StateTypeEnum} from "../enums/StateTypeEnum"; /** * 选择英雄 */ -export class SelectHeroCommand extends Command { - execute({client, heroId} = this.payload) { +export class SelectHeroCommand extends Command { + execute({client, heroId, cardGroup} = this.payload) { let player = this.state.players.get(client.sessionId); if (player.state != PlayerStateConst.PLAYER_READY) { return; @@ -48,6 +48,7 @@ export class SelectHeroCommand extends Command