玩家缓存释放问题

This commit is contained in:
sk 2024-11-15 11:18:28 +08:00
parent d0072d40b4
commit b497bd103a
3 changed files with 8 additions and 20 deletions

View File

@ -3173,20 +3173,14 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
return nil
}
if msg.GuideId == common.GuideIdNewPlayer {
if p.GuideStep >= 0 && p.GuideStep < model.GameParamData.GuideStepMaxNum {
p.GuideStep = -1 // 跳过引导为 -1
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
return nil
}
} else {
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
if len(msg.Param) > 0 {
p.GuideData[msg.GuideId] = int32(msg.Param[0])
}
send()
return nil
p.GuideStep = -1 // 跳过引导为 -1
}
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
if len(msg.Param) > 0 {
p.GuideData[msg.GuideId] = int32(msg.Param[0])
}
send()
return nil
case common.AttributeGuideTest:
if !common.Config.IsDevMode {
return nil

View File

@ -1367,12 +1367,7 @@ func (this *Player) Time2Save() {
return
}
isForce := false
if common.Config.IsDevMode {
isForce = true // 开发模式下强制保存
}
PlayerMgrSington.SavePlayer(this, true, isForce)
PlayerMgrSington.SavePlayer(this, true, false)
if this.isDelete || (!this.IsOnLine() && !this.dirty && time.Now().Sub(this.lastSaved) > time.Minute*5 && this.scene == nil) {
PlayerMgrSington.DelPlayer(this.SnId)

View File

@ -173,7 +173,6 @@ func (this *PlayerMgr) SavePlayer(p *Player, isCopy, force bool) {
t1 := time.Now()
p.dirty = true
// 跨天任务依赖LastLogoutTime的准确性跨天任务是定时器common.ClockMgrSington触发的所以这里要用定时器的触发时间
p.LastLogoutTime = common.ClockMgrSingleton.LastTickTime
pd.LastLogoutTime = common.ClockMgrSingleton.LastTickTime