diff --git a/worldsrv/player.go b/worldsrv/player.go index 74b847e..cd393ca 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -374,24 +374,6 @@ func (this *Player) OnLogined() { TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏 this.LoadAfter() - //周卡领取奖励 - now := time.Now().Unix() - for id, endTime := range this.WeekCardTime { - if endTime < now { - this.WeekCardTime[id] = 0 - continue - } - if this.WeekCardTime[id] == 0 { - continue - } - if now > this.WeekCardTime[id] { - logger.Logger.Trace("周卡已过期,不能领取!") - continue - } - if !this.WeekCardAward[id] { - this.GetWeekCardAwary(id) - } - } } } @@ -2253,6 +2235,24 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) { this.WelfData.Task[common.TaskIDInviteFirstLogin] = &model.TaskData{} } } + //周卡领取奖励 + now := time.Now().Unix() + for id, endTime := range this.WeekCardTime { + if endTime < now { + this.WeekCardTime[id] = 0 + continue + } + if this.WeekCardTime[id] == 0 { + continue + } + if now > this.WeekCardTime[id] { + logger.Logger.Trace("周卡已过期,不能领取!") + continue + } + if !this.WeekCardAward[id] { + this.GetWeekCardAwary(id) + } + } TaskSubjectSingleton.Touch(common.TaskTypeFirstLogin, &TaskData{SnId: this.SnId, Num: 1}) // 首次登录游戏 TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏 }