From d2f5fc8315bb143f77a6d4764162f86244f4a381 Mon Sep 17 00:00:00 2001 From: zhl Date: Mon, 30 Nov 2020 15:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=8F=E8=AE=AE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 8 ++++---- src/rooms/commands/DrawCommand.ts | 2 +- src/rooms/commands/PlayReadyCommand.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index 2c8f479..7347671 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -19,22 +19,22 @@ export class GeneralRoom extends Room { onCreate (options: any) { this.setState(new CardGameState()); this.state.gameSate = 0; - this.onMessage("play_ready", (client, message) => { + this.onMessage("play_ready_c2s", (client, message) => { console.log('play_ready from ', client.sessionId, message); this.dispatcher.dispatch(new PlayReadyCommand(), {client}); }); - this.onMessage("discard_card", (client, message) => { + this.onMessage("discard_card_c2s", (client, message) => { console.log('discard_card from ', client.sessionId, message); this.dispatcher.dispatch(new DiscardCommand(), {client, cards: message.cards}); }); - this.onMessage("give_up_take", (client, message) => { + this.onMessage("give_up_take_c2s", (client, message) => { console.log('give_up_take from ', client.sessionId, message); this.dispatcher.dispatch(new NextSubCommand(), {}); }); - this.onMessage("select_pet", (client, message) => { + this.onMessage("select_pet_c2s", (client, message) => { console.log('select_pet from ', client.sessionId, message); this.dispatcher.dispatch(new SelectPetCommand(), {client, cardId: message.cardId}); }); diff --git a/src/rooms/commands/DrawCommand.ts b/src/rooms/commands/DrawCommand.ts index 0527e57..675b1f3 100644 --- a/src/rooms/commands/DrawCommand.ts +++ b/src/rooms/commands/DrawCommand.ts @@ -19,6 +19,6 @@ export class DrawCommand extends Command { curPlayer.cards.set(card.id, card); curPlayer.cardSet.add(card.id); } - curClient.send('draw_card', cards); + curClient.send('draw_card_s2c', cards); } } diff --git a/src/rooms/commands/PlayReadyCommand.ts b/src/rooms/commands/PlayReadyCommand.ts index 4ab7ea3..ee9bd7a 100644 --- a/src/rooms/commands/PlayReadyCommand.ts +++ b/src/rooms/commands/PlayReadyCommand.ts @@ -10,7 +10,7 @@ export class PlayReadyCommand extends Command