玩家信息初始化
This commit is contained in:
parent
ce2c857ff3
commit
78feeb2595
|
|
@ -180,6 +180,9 @@ func NewPlayer(sid int64, pd *model.PlayerData, s *netlib.Session) *Player {
|
|||
func (this *Player) init() bool {
|
||||
this.SetOnline()
|
||||
this.isNewbie = this.CreateTime == this.LastLoginTime
|
||||
if this.WelfData == nil {
|
||||
this.WelfData = model.NewWelfareData()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -2284,6 +2287,9 @@ func (this *Player) ResetPermit() {
|
|||
if (this.PermitStartTs == 0 || this.PermitStartTs < permitStartTs) && permitStartTs > 0 {
|
||||
this.PermitStartTs = permitStartTs
|
||||
this.Permit = time.Time{}
|
||||
if this.WelfData == nil {
|
||||
this.WelfData = model.NewWelfareData()
|
||||
}
|
||||
this.WelfData.PermitAward = make(map[int32]int64)
|
||||
this.WelfData.PermitExchange = make(map[int32][]int64)
|
||||
this.dirty = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue