周卡礼包

This commit is contained in:
by 2024-05-06 00:00:35 +08:00
parent 0595d999f4
commit 948c209a2c
1 changed files with 18 additions and 18 deletions

View File

@ -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}) // 登录游戏
}