diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 27e8d957..f035e359 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -89,6 +89,7 @@ BIReport.ITEM_GET_TYPE = { SEVEN_DAY_STEP_REWARD = "SevenDayStepReward", DAILY_CHALLENGE = "DailyChallenge", DAILY_CHALLENGE_END = "DailyChallengeEnd", + DAILY_CHALLENGE_RESET = "DailyChallengeReset", } BIReport.ADS_CLICK_TYPE = { diff --git a/lua/app/module/daily_challenge/daily_challenge_manager.lua b/lua/app/module/daily_challenge/daily_challenge_manager.lua index acba9e0b..b133818e 100644 --- a/lua/app/module/daily_challenge/daily_challenge_manager.lua +++ b/lua/app/module/daily_challenge/daily_challenge_manager.lua @@ -1,7 +1,9 @@ local DailyChallengeManager = class("DailyChallengeManager", BaseModule) function DailyChallengeManager:init() - -- body + self.sid = self:scheduleGlobal(function() + self:onDayChange() + end, DataManager.DailyChallengeData:getTodaySurplusTime()) end function DailyChallengeManager:showBattleBuffUI() @@ -89,6 +91,16 @@ function DailyChallengeManager:endChallengeFinish(result) end end +function DailyChallengeManager:onDayChange() + self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterDailyChallengeResetReq, nil, {}, self.rspDayChange, BIReport.ITEM_GET_TYPE.DAILY_CHALLENGE_RESET) +end + +function DailyChallengeManager:rspDayChange(result) + if result.err_code == GConst.ERROR_STR.SUCCESS then + DataManager.DailyChallengeData:init(result.daily_challenge) + end +end + -- 获取波次(战斗)奖励 function DailyChallengeManager:getWaveReward() -- body