等待玩家确实超时解散房间时, 释放玩家的游戏锁
This commit is contained in:
parent
e466c29524
commit
5b3746cc57
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user