|
|
@@ -79,13 +79,22 @@ function onLogin(human)
|
|
|
end
|
|
|
-- 是否有新增活动
|
|
|
for k,v in pairs(absActConfig) do
|
|
|
- local ok = isStarted(human,k)
|
|
|
+ local ok,realEndTime = isStarted(human,k)
|
|
|
+ if ok and human.db.absAct[k] then
|
|
|
+ --- 同步结束时间
|
|
|
+ local nowTime = os.time()
|
|
|
+ local finishTime = human.db.absAct[k].finish or nowTime
|
|
|
+ if finishTime >= nowTime and finishTime ~= realEndTime then
|
|
|
+ human.db.absAct[k].finish = realEndTime
|
|
|
+ end
|
|
|
+ end
|
|
|
if ok and not human.db.absAct[k] then
|
|
|
human.db.absAct[k] = {}
|
|
|
local f = load("return require(\"" .. v.moduleFn .. "\")")()
|
|
|
if f and f.genAbsActData then
|
|
|
human.db.absAct[k] = f.genAbsActData()
|
|
|
end
|
|
|
+ human.db.absAct[k].finish = realEndTime -- 记录活动结束时间
|
|
|
end
|
|
|
end
|
|
|
-- 登录奖励重置
|
|
|
@@ -94,7 +103,7 @@ function onLogin(human)
|
|
|
if state and id then
|
|
|
if not human.db.absAct[id] then
|
|
|
human.db.absAct[id] = {}
|
|
|
- end
|
|
|
+ end
|
|
|
-- 每日登录领取
|
|
|
if config.type == AbsActDefine.ABS_LOGIN_REWARD_TYPE_2 then
|
|
|
local lastTime = human.db.absAct[id].loginDayGetTime or 0
|
|
|
@@ -176,7 +185,15 @@ function checkAbsActClean(human, id)
|
|
|
local config = AbsActExcel.absActivity[id]
|
|
|
local _,realEndTime = transTime(config)
|
|
|
local now = os.time()
|
|
|
- if human.db.absAct[id] and now >= realEndTime then
|
|
|
+ --临时处理积分兑换 下版本删掉
|
|
|
+ if human.db.absAct[id] and not human.db.absAct[id].finish then
|
|
|
+ if config.type == AbsActDefine.ABS_ACT_TYPE_7 then
|
|
|
+ human.db.absAct[id] = nil
|
|
|
+ else
|
|
|
+ human.db.absAct[id].finish = realEndTime
|
|
|
+ end
|
|
|
+ end
|
|
|
+ if human.db.absAct[id] and now >= human.db.absAct[id].finish then
|
|
|
-- 累计达标中的 累计充值到期 需要发送邮件
|
|
|
if config.type == AbsActDefine.ABS_ACT_TYPE_71 then
|
|
|
TotalReachLogic.clean(human,id)
|