From 948c209a2c3215343b910c08d37e47b184c6c7a4 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Mon, 6 May 2024 00:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E5=8D=A1=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) 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}) // 登录游戏 }