From f569e19bfd02b0bc7d96c5be8abb6736b602b9b0 Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 15 Jan 2021 16:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/WebApi.ts | 3 +-- src/rooms/commands/OnJoinCommand.ts | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/WebApi.ts b/src/common/WebApi.ts index 4ba8039..3bfdd56 100644 --- a/src/common/WebApi.ts +++ b/src/common/WebApi.ts @@ -68,8 +68,7 @@ export function createRobot(data: any) { axios.get('http://127.0.0.1:2500/robot/create', { params: data }).then((res) => { - debugRoom(res.status); - debugRoom(res.data); + debugRoom(`caeate robot result: `,res.data); }).catch((err) => { error(err); }) diff --git a/src/rooms/commands/OnJoinCommand.ts b/src/rooms/commands/OnJoinCommand.ts index f983af5..cd48ce1 100644 --- a/src/rooms/commands/OnJoinCommand.ts +++ b/src/rooms/commands/OnJoinCommand.ts @@ -52,12 +52,14 @@ export class OnJoinCommand extends Command= this.room.maxClients) { + this.room.stopSchedule('waiting_player'); this.room.lock().then(() => { }); this.state.updateGameState(GameStateConst.STATE_WAIT_PREPARE); } else if (this.state.players.size < this.room.maxClients && this.state.players.size >= this.room.maxClients - this.room.robotCount) { for (let i = 0; i < this.room.robotCount; i++) { + this.room.robotCount --; self.room.addRobot(); } }