From 5b9bd930313af397112abc499e81be006a76cd07 Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 25 Dec 2020 12:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=97=A5=E5=BF=97=E7=9A=84?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=BD=AC=E6=88=90string=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index e08e38f..74db303 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -46,49 +46,49 @@ export class GeneralRoom extends Room { this.clock.start(); this.state.gameState = GameStateConst.STATE_WAIT_JOIN; this.onMessage("play_ready_c2s", (client, message) => { - msgLog('play_ready from ', client.sessionId, message); + msgLog('play_ready from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new PlayReadyCommand(), {client}); }); this.onMessage("change_card_c2s", (client, message) => { - msgLog('change_card from ', client.sessionId, message); + msgLog('change_card from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new ChangeCardCommand(), {client, cards: message.cards}); }); this.onMessage("discard_card_c2s", (client, message) => { - msgLog('discard_card from ', client.sessionId, message); + msgLog('discard_card from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new DiscardCommand(), {client, cards: message.cards, dtype: 0}); }); this.onMessage("eat_card_c2s", (client, message) => { - msgLog('eat_card from ', client.sessionId, message); + msgLog('eat_card from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new EatCardCommand(), {client, cards: message.cards, target: message.target}); }); this.onMessage("give_up_eat_c2s", (client, message) => { - msgLog('give_up_take from ', client.sessionId, message); + msgLog('give_up_take from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new GiveUpCommand(), {client}); }); this.onMessage("select_pet_c2s", (client, message) => { - msgLog('select_pet from ', client.sessionId, message); + msgLog('select_pet from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new SelectPetCommand(), {client, cardId: message.card, playerId: message.player, pos: message.pos, effCards: message.effCards, oldpos: message.oldpos }); }); this.onMessage("select_hero_c2s", (client, message) => { - msgLog('select_hero from ', client.sessionId, message); + msgLog('select_hero from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new SelectHeroCommand(), {client, heroId: message.heroId}); }); this.onMessage("gm", (client, message) => { - msgLog('gm command from ', client.sessionId, message); + msgLog('gm command from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new GMCommand(), {client, message}); }); this.onMessage("restart_c2s", (client, message) => { - msgLog('restart game from ', client.sessionId, message); + msgLog('restart game from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new GameRestartCommand(), {client}); }); this.onMessage("change_pet_c2s", (client, message) => { - msgLog('change pet from ', client.sessionId, message); + msgLog('change pet from ', client.sessionId, JSON.stringify(message)); this.dispatcher.dispatch(new ChangePetCommand(), {client, pos: message.pos, petId: message.petId}); }); @@ -97,7 +97,7 @@ export class GeneralRoom extends Room { // Triggers when any other type of message is sent, // excluding "action", which has its own specific handler defined above. // - msgLog(client.sessionId, "sent", type, message); + msgLog(client.sessionId, "sent", type, JSON.stringify(message)); }); }