diff --git a/gamesrv/tienlen/scenedata_tienlen.go b/gamesrv/tienlen/scenedata_tienlen.go index e06b45f..d01ee18 100644 --- a/gamesrv/tienlen/scenedata_tienlen.go +++ b/gamesrv/tienlen/scenedata_tienlen.go @@ -163,7 +163,7 @@ func (this *TienLenSceneData) CanStart() bool { } if this.IsCustom() { - return this.IsAllReady() && this.GetPlayerCnt() >= this.GetPlayerNum() + return (this.IsAllReady() || this.GetNumOfGames() > 0) && this.GetPlayerCnt() >= this.GetPlayerNum() } // 房间人数>=2开始,并且有真人或者是预创建房间,并且有房主 diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 2cbd208..efa7157 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -603,6 +603,10 @@ func (this *SceneBaseStateTienLen) OnTick(s *base.Scene) { s.RandRobotCnt() s.SetTimerRandomRobot(s.GetRobotTime()) } + // 房卡房长时间没人解散房间 + if s.IsCustom() && s.GetRealPlayerCnt() == 0 && this.GetTimeout(s) > 5 { + s.Destroy(true) + } } // 发送玩家操作情况 @@ -719,7 +723,7 @@ func (this *SceneWaitPlayerStateTienLen) CanChangeTo(s base.SceneState) bool { // 当前状态能否换桌 func (this *SceneWaitPlayerStateTienLen) CanChangeCoinScene(s *base.Scene, p *base.Player) bool { - if s.IsMatchScene() { + if s.IsMatchScene() || (s.IsCustom() && s.GetNumOfGames() > 0) { return false } return true @@ -810,7 +814,7 @@ func (this *SceneWaitStartStateTienLen) CanChangeTo(s base.SceneState) bool { // 当前状态能否换桌 func (this *SceneWaitStartStateTienLen) CanChangeCoinScene(s *base.Scene, p *base.Player) bool { - if s.IsMatchScene() { + if s.IsMatchScene() || (s.IsCustom() && s.GetNumOfGames() > 0) { return false } return true