From c3fdcf7a14e7b53aefc508b0d375d62b48130d08 Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 10 Dec 2020 12:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E4=BA=BA=E5=B0=B1=E4=BD=8D?= =?UTF-8?q?=E5=90=8E,=20=E5=B0=86=E6=88=BF=E9=97=B4=E8=AE=BE=E4=B8=BApriva?= =?UTF-8?q?te?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/commands/PlayReadyCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rooms/commands/PlayReadyCommand.ts b/src/rooms/commands/PlayReadyCommand.ts index 7214649..107e524 100644 --- a/src/rooms/commands/PlayReadyCommand.ts +++ b/src/rooms/commands/PlayReadyCommand.ts @@ -11,7 +11,7 @@ export class PlayReadyCommand extends Command { - execute({client}: { client: Client }) { + async execute({client}: { client: Client }) { this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_READY; this.room.broadcast("player_ready_s2c", {player: client.sessionId}, {except: client}); let readyCount = 0; @@ -24,6 +24,7 @@ export class PlayReadyCommand extends Command= this.room.maxClients) { // 比大小, 确定先手 // return [new PrepareCommand()]; + await this.room.setPrivate(true); this.room.state.gameState = GameStateConst.CHANGE_HERO; }