2020-10-24 18:49:32 +08:00
|
|
|
DynamicActivityManager = {}
|
|
|
|
local this = DynamicActivityManager
|
|
|
|
|
2020-10-24 16:18:57 +08:00
|
|
|
this.curLevel = 0
|
|
|
|
|
2020-10-24 18:49:32 +08:00
|
|
|
function this.Initialize()
|
|
|
|
end
|
|
|
|
|
|
|
|
function this.SheJiGetRankData(type,activityId,fun)
|
|
|
|
local allRankData,myRankData
|
|
|
|
RankingManager.InitData(type,function ()
|
|
|
|
allRankData,myRankData = RankingManager.GetRankingInfo()
|
|
|
|
if fun then
|
|
|
|
fun(allRankData,myRankData)
|
|
|
|
end
|
|
|
|
end,activityId)
|
|
|
|
end
|
|
|
|
|
2020-10-24 16:18:57 +08:00
|
|
|
function this.SetCurLevel(level)
|
|
|
|
this.curLevel = level
|
|
|
|
end
|
|
|
|
|
|
|
|
function this.SheJiCheckRedPoint()
|
|
|
|
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Celebration)--活动数据
|
|
|
|
local canGetRewardList={}
|
|
|
|
local curScore = ActInfo.mission[1].progress
|
|
|
|
local actReward = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActInfo.activityId)
|
|
|
|
local setting = ConfigManager.GetConfigDataByKey(ConfigName.GodSacrificeSetting,"ActivityId",ActInfo.activityId)
|
|
|
|
--检测宝箱是否有可领取
|
|
|
|
for i = 1, #ActInfo.mission do
|
|
|
|
local curLevel = curScore/actReward[1].Values[2][1]
|
|
|
|
if ActInfo.mission[i].state == 0 and curLevel >= i then
|
|
|
|
table.insert(canGetRewardList,ActInfo.mission[i])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local canGet = false
|
|
|
|
--检测中央大锅是否可领取
|
|
|
|
if GetTimeStamp() > ActInfo.value and GetTimeStamp() < (ActInfo.value + setting.LastTime * 60) then
|
|
|
|
--领过--进入倒计时
|
|
|
|
canGet = false
|
|
|
|
elseif GetTimeStamp() > ActInfo.value and GetTimeStamp() > (ActInfo.value + setting.LastTime * 60) then
|
|
|
|
--没到时间--进入倒计时
|
|
|
|
canGet = false
|
|
|
|
else
|
|
|
|
--可领取
|
|
|
|
canGet = true
|
|
|
|
end
|
|
|
|
|
|
|
|
if #canGetRewardList > 0 or canGet then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-10-24 18:49:32 +08:00
|
|
|
return this
|