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