修复房卡房离开和开始条件
This commit is contained in:
parent
97a6d363e7
commit
1b2a9c30e7
|
@ -163,7 +163,7 @@ func (this *TienLenSceneData) CanStart() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.IsCustom() {
|
if this.IsCustom() {
|
||||||
return this.IsAllReady() && this.GetPlayerCnt() >= this.GetPlayerNum()
|
return (this.IsAllReady() || this.GetNumOfGames() > 0) && this.GetPlayerCnt() >= this.GetPlayerNum()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 房间人数>=2开始,并且有真人或者是预创建房间,并且有房主
|
// 房间人数>=2开始,并且有真人或者是预创建房间,并且有房主
|
||||||
|
|
|
@ -603,6 +603,10 @@ func (this *SceneBaseStateTienLen) OnTick(s *base.Scene) {
|
||||||
s.RandRobotCnt()
|
s.RandRobotCnt()
|
||||||
s.SetTimerRandomRobot(s.GetRobotTime())
|
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 {
|
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 false
|
||||||
}
|
}
|
||||||
return true
|
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 {
|
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 false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue