tienlen结算后可以离开房间
This commit is contained in:
parent
5944345434
commit
84a9e39a26
|
@ -1632,6 +1632,9 @@ func (this *SceneBilledStateTienLen) CanChangeTo(s base.SceneState) bool {
|
||||||
func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
this.SceneBaseStateTienLen.OnEnter(s)
|
this.SceneBaseStateTienLen.OnEnter(s)
|
||||||
this.BroadcastRoomState(s, this.GetState())
|
this.BroadcastRoomState(s, this.GetState())
|
||||||
|
defer func() {
|
||||||
|
s.SetGaming(false)
|
||||||
|
}()
|
||||||
//在这里执行结算
|
//在这里执行结算
|
||||||
if sceneEx, ok := s.GetExtraData().(*TienLenSceneData); ok {
|
if sceneEx, ok := s.GetExtraData().(*TienLenSceneData); ok {
|
||||||
|
|
||||||
|
@ -2810,8 +2813,6 @@ func (this *SceneBilledStateTienLen) OnLeave(s *base.Scene) {
|
||||||
if len(sceneEx.tianHuSnids) != sceneEx.GetGameingPlayerCnt() { //非和局
|
if len(sceneEx.tianHuSnids) != sceneEx.GetGameingPlayerCnt() { //非和局
|
||||||
sceneEx.lastWinSnid = sceneEx.winSnids[0]
|
sceneEx.lastWinSnid = sceneEx.winSnids[0]
|
||||||
}
|
}
|
||||||
sceneEx.SetGaming(false)
|
|
||||||
|
|
||||||
hasLeave := false
|
hasLeave := false
|
||||||
//剔除下线玩家
|
//剔除下线玩家
|
||||||
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
|
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
|
||||||
|
@ -2899,7 +2900,7 @@ func (this *SceneBilledStateTienLen) OnTick(s *base.Scene) {
|
||||||
n := len(sceneEx.tianHuSnids)
|
n := len(sceneEx.tianHuSnids)
|
||||||
newTime += time.Duration(n) * rule.TIenLenTianhuTimeout
|
newTime += time.Duration(n) * rule.TIenLenTianhuTimeout
|
||||||
|
|
||||||
if sceneEx.IsCustom() {
|
if sceneEx.IsCustom() && sceneEx.NumOfGames >= int(sceneEx.TotalOfGames) {
|
||||||
newTime += time.Second * 20
|
newTime += time.Second * 20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue