From 576c791cb25cf908be8ed55bc2ccbbfac18329b3 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Tue, 15 Dec 2020 11:51:47 +0800 Subject: [PATCH] 玛尼英雄帖活动通过任务bug 元旦挂机活动 --- src/actions/ActivityAction.lua | 10 ++++++++-- src/models/Activity.lua | 6 ++++-- src/models/RolePlugin.lua | 6 ++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/actions/ActivityAction.lua b/src/actions/ActivityAction.lua index 5211a0d..d9c745c 100644 --- a/src/actions/ActivityAction.lua +++ b/src/actions/ActivityAction.lua @@ -407,7 +407,13 @@ function _M.hangDropRpc(agent, data) reward, change = role:award(reward, {log = {desc = "actHangDrop", int1 = actid, int2 = num}}) - role.activity:updateActData("HangDrop", timeNow) + if num < 8 then + actData = actData + num * period + else + actData = timeNow + end + + role.activity:updateActData("HangDrop", actData) SendPacket(actionCodes.Activity_hangDropRpc, MsgPack.pack(role:packReward(reward, change))) @@ -432,7 +438,6 @@ function _M.startBattleRpc(agent, data) local id = msg.id local count = msg.count if not role.activity:isOpenById(actid) then return 1 end - role.activity:getBattleTicket(role, actid) local actCfg = csvdb["activity_battleCsv"][actid] if not actCfg then return 2 end @@ -457,6 +462,7 @@ function _M.startBattleRpc(agent, data) local changeFlag = false local ticket = actData["ticket"] if battleCfg.type ~= "" then + role.activity:getBattleTicket(actid) local num = battleCfg.type:toArray(true, "=")[3] if count and count > 0 then if battleCfg.rank == 0 then diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 3effef4..5f9b299 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -420,7 +420,8 @@ activityFunc[Activity.ActivityType.CalendaTask] = { local towerInfo = role:getProperty("towerInfo") role:checkTaskEnter("TowerPass", {level = towerInfo.l}) --"PvpWin" - role:checkTaskEnter("HangPass", {}) + --role:checkTaskEnter("HangPass", {id = 0}) + role:checkCalendaTask(true, 15, 3) role:checkTaskEnter("HeroStarCollect", {}) role:checkTaskEnter("RuneQualityCollect", {}) @@ -476,7 +477,8 @@ activityFunc[Activity.ActivityType.Gachakon] = { activityFunc[Activity.ActivityType.HangDrop] = { ["init"] = function(self, actType, isCrossDay, notify, actId) local actime = self:getProperty("actime") - local startTime = actime[actId] + local ctime = self.owner:getProperty("ctime") + local startTime = math.max(actime[actId], ctime) local actData = self:getActData(actType) or 0 local cfg = csvdb["activity_putCsv"][actId] if not cfg then return end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 9fafd76..e1612f9 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1931,13 +1931,15 @@ function RolePlugin.bind(Role) end local CommonRankTime = toUnixtime("2019010100") + local CommonCoef1 = 10000 + local CommonCoef2 = 10000 function Role:updateRankCommon(rankType, rankVal, reserve) if not rankType then return end reserve = reserve or 0 local now = skynet.timex() local ct = math.ceil((now - CommonRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 ct = 10000 - ct -- 越早的排名越靠前 - local score = (reserve * 10000 + ct) * 10000000 + rankVal + local score = (rankVal * CommonCoef1 + ct) * CommonCoef2 + reserve local roleId = self:getProperty("id") redisproxy:pipelining(function (red) @@ -1953,7 +1955,7 @@ function RolePlugin.bind(Role) for i = 1, #ids, 2 do local roleId = tonumber(ids[i]) local rankVal = tonumber(ids[i + 1]) - rankVal = rankVal % 10000000 + rankVal = math.floor(math.floor(rankVal / CommonCoef2) / CommonCoef1) table.insert(list, {roleId = roleId, player = rankVal}) end -- libgit2 0.21.2