等待玩家确实超时解散房间时, 释放玩家的游戏锁

This commit is contained in:
zhl 2021-03-16 16:49:32 +08:00
parent e466c29524
commit 5b3746cc57

View File

@ -10,6 +10,7 @@ import { BaseConst } from '../../constants/BaseConst'
import { ClockNameConst } from '../../constants/ClockNameConst'
import { debugRoom } from '../../common/Debug'
import { Player } from '../schema/Player'
import { leftGame } from '../../common/WebApi'
/**
*
@ -43,6 +44,9 @@ export class PlayReadyCommand extends Command<CardGameState, {
}
}
if (robotCount === self.room.clientCount) {
for (let player of humans) {
await leftGame(player.accountId, self.room.roomId)
}
await self.room.disconnect()
} else {
for (let [, player] of self.state.players) {