tienlen结算后可以离开房间

This commit is contained in:
sk 2024-10-29 17:09:36 +08:00
parent 5944345434
commit 84a9e39a26
1 changed files with 4 additions and 3 deletions

View File

@ -1632,6 +1632,9 @@ func (this *SceneBilledStateTienLen) CanChangeTo(s base.SceneState) bool {
func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
this.SceneBaseStateTienLen.OnEnter(s)
this.BroadcastRoomState(s, this.GetState())
defer func() {
s.SetGaming(false)
}()
//在这里执行结算
if sceneEx, ok := s.GetExtraData().(*TienLenSceneData); ok {
@ -2810,8 +2813,6 @@ func (this *SceneBilledStateTienLen) OnLeave(s *base.Scene) {
if len(sceneEx.tianHuSnids) != sceneEx.GetGameingPlayerCnt() { //非和局
sceneEx.lastWinSnid = sceneEx.winSnids[0]
}
sceneEx.SetGaming(false)
hasLeave := false
//剔除下线玩家
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
@ -2899,7 +2900,7 @@ func (this *SceneBilledStateTienLen) OnTick(s *base.Scene) {
n := len(sceneEx.tianHuSnids)
newTime += time.Duration(n) * rule.TIenLenTianhuTimeout
if sceneEx.IsCustom() {
if sceneEx.IsCustom() && sceneEx.NumOfGames >= int(sceneEx.TotalOfGames) {
newTime += time.Second * 20
}