玩家缓存释放问题
This commit is contained in:
parent
d0072d40b4
commit
b497bd103a
|
@ -3173,20 +3173,14 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if msg.GuideId == common.GuideIdNewPlayer {
|
if msg.GuideId == common.GuideIdNewPlayer {
|
||||||
if p.GuideStep >= 0 && p.GuideStep < model.GameParamData.GuideStepMaxNum {
|
p.GuideStep = -1 // 跳过引导为 -1
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
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:
|
case common.AttributeGuideTest:
|
||||||
if !common.Config.IsDevMode {
|
if !common.Config.IsDevMode {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -1367,12 +1367,7 @@ func (this *Player) Time2Save() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
isForce := false
|
PlayerMgrSington.SavePlayer(this, true, false)
|
||||||
if common.Config.IsDevMode {
|
|
||||||
isForce = true // 开发模式下强制保存
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerMgrSington.SavePlayer(this, true, isForce)
|
|
||||||
|
|
||||||
if this.isDelete || (!this.IsOnLine() && !this.dirty && time.Now().Sub(this.lastSaved) > time.Minute*5 && this.scene == nil) {
|
if this.isDelete || (!this.IsOnLine() && !this.dirty && time.Now().Sub(this.lastSaved) > time.Minute*5 && this.scene == nil) {
|
||||||
PlayerMgrSington.DelPlayer(this.SnId)
|
PlayerMgrSington.DelPlayer(this.SnId)
|
||||||
|
|
|
@ -173,7 +173,6 @@ func (this *PlayerMgr) SavePlayer(p *Player, isCopy, force bool) {
|
||||||
|
|
||||||
t1 := time.Now()
|
t1 := time.Now()
|
||||||
|
|
||||||
p.dirty = true
|
|
||||||
// 跨天任务依赖LastLogoutTime的准确性,跨天任务是定时器common.ClockMgrSington触发的,所以这里要用定时器的触发时间
|
// 跨天任务依赖LastLogoutTime的准确性,跨天任务是定时器common.ClockMgrSington触发的,所以这里要用定时器的触发时间
|
||||||
p.LastLogoutTime = common.ClockMgrSingleton.LastTickTime
|
p.LastLogoutTime = common.ClockMgrSingleton.LastTickTime
|
||||||
pd.LastLogoutTime = common.ClockMgrSingleton.LastTickTime
|
pd.LastLogoutTime = common.ClockMgrSingleton.LastTickTime
|
||||||
|
|
Loading…
Reference in New Issue