所有人就位后, 将房间设为private
This commit is contained in:
parent
d1bebaa017
commit
c3fdcf7a14
@ -11,7 +11,7 @@ export class PlayReadyCommand extends Command<CardGameState, {
|
|||||||
client: Client
|
client: Client
|
||||||
}> {
|
}> {
|
||||||
|
|
||||||
execute({client}: { client: Client }) {
|
async execute({client}: { client: Client }) {
|
||||||
this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_READY;
|
this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_READY;
|
||||||
this.room.broadcast("player_ready_s2c", {player: client.sessionId}, {except: client});
|
this.room.broadcast("player_ready_s2c", {player: client.sessionId}, {except: client});
|
||||||
let readyCount = 0;
|
let readyCount = 0;
|
||||||
@ -24,6 +24,7 @@ export class PlayReadyCommand extends Command<CardGameState, {
|
|||||||
if (readyCount >= this.room.maxClients) {
|
if (readyCount >= this.room.maxClients) {
|
||||||
// 比大小, 确定先手
|
// 比大小, 确定先手
|
||||||
// return [new PrepareCommand()];
|
// return [new PrepareCommand()];
|
||||||
|
await this.room.setPrivate(true);
|
||||||
this.room.state.gameState = GameStateConst.CHANGE_HERO;
|
this.room.state.gameState = GameStateConst.CHANGE_HERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user