竞技馆

This commit is contained in:
sk 2024-09-02 10:08:23 +08:00
parent b7d4efb7a6
commit 1d9bfd5802
1 changed files with 6 additions and 6 deletions

View File

@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea
}
sceneEx.OnPlayerLeave(p, reason)
s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)})
if s.IsCustom() && len(s.Players) == 0 {
s.Destroy(true)
}
}
// 玩家掉线
@ -606,6 +603,9 @@ func (this *SceneBaseStateTienLen) OnTick(s *base.Scene) {
s.RandRobotCnt()
s.SetTimerRandomRobot(s.GetRobotTime())
}
if s.IsCustom() && len(s.Players) == 0 {
s.Destroy(true)
}
}
// 发送玩家操作情况
@ -2570,9 +2570,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
sceneEx.RoundEndTime = append(sceneEx.RoundEndTime, time.Now().Unix())
sceneEx.RoundLogId = append(sceneEx.RoundLogId, sceneEx.recordId)
if sceneEx.NumOfGames >= int(sceneEx.TotalOfGames) {
sceneEx.BilledList = make(map[int32]*[]*BilledInfo)
sceneEx.RoundEndTime = sceneEx.RoundEndTime[:0]
sceneEx.RoundLogId = sceneEx.RoundLogId[:0]
packBilled := &tienlen.SCTienLenCycleBilled{}
for snid, billedList := range sceneEx.BilledList {
info := &tienlen.TienLenCycleBilledInfo{
@ -2636,6 +2633,9 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
logger.Logger.Tracef("SCTienLenCycleBilled: %v", packBilled)
s.SyncSceneState(common.SceneStateEnd)
sceneEx.SaveCustomLog()
sceneEx.BilledList = make(map[int32]*[]*BilledInfo)
sceneEx.RoundEndTime = sceneEx.RoundEndTime[:0]
sceneEx.RoundLogId = sceneEx.RoundLogId[:0]
}
}