Compare commits

...

2 Commits

Author SHA1 Message Date
by 42302a32a5 Merge branch 'develop' of https://git.pogorockgames.com/mango-games/server/game into develop 2024-05-06 00:00:47 +08:00
by 948c209a2c 周卡礼包 2024-05-06 00:00:35 +08:00
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}) // 登录游戏
}