Merge branch 'second' of http://git.kingsome.cn/node/card_svr into second
This commit is contained in:
commit
9acfaba329
@ -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);
|
||||
})
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user