Commit c670faa00523d351636fd22cd1e16d6b620acd98

Authored by zhouhaihai
2 parents a5c44c41 8a57b603

Merge branch 'bugfix' into develop

* bugfix:
  初始化冒险重置时间
  被动新
Showing 2 changed files with 8 additions and 1 deletions   Show diff stats
src/models/Role.lua
@@ -29,6 +29,13 @@ function Role:ctor( properties ) @@ -29,6 +29,13 @@ function Role:ctor( properties )
29 self.activity = nil 29 self.activity = nil
30 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 30 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节
31 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 31 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳
  32 + if self.advOverTime == 0 then
  33 + local now = skynet.timex()
  34 + if math.floor(now / (3600 * 24 * 7)) % 2 == 1 then
  35 + self.advOverTime = 3600 * 24 * 7
  36 + end
  37 + self.advOverTime = self.advOverTime + specMonday(now) + 3600 * 24 * 6
  38 + end
32 self.sendMailFlag = false --发送邮件标识 39 self.sendMailFlag = false --发送邮件标识
33 end 40 end
34 41
src/utils/CommonFunc.lua
@@ -219,7 +219,7 @@ function specMonday(now) @@ -219,7 +219,7 @@ function specMonday(now)
219 local wday = (tm.wday + 6) % 7 219 local wday = (tm.wday + 6) % 7
220 if wday == 0 then wday = 7 end 220 if wday == 0 then wday = 7 end
221 221
222 - local time = os.time({year = tm.year, month = tm.month, day = tm.day}) 222 + local time = os.time({year = tm.year, month = tm.month, day = tm.day, hour = RESET_TIME})
223 return time - (wday - 1) * 86400 223 return time - (wday - 1) * 86400
224 end 224 end
225 225