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(); } }