Merge branch 'second' of http://git.kingsome.cn/node/card_svr into second

This commit is contained in:
yuexin 2021-01-15 18:18:39 +08:00
commit 9acfaba329
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -52,12 +52,14 @@ export class OnJoinCommand extends Command<CardGameState, {
self.room.addScheduleTime(moreTime, 'play_join', 'waiting_player')
}
if (this.state.players.size >= 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();
}
}