Commit 576c791cb25cf908be8ed55bc2ccbbfac18329b3
1 parent
cf1d48e8
玛尼英雄帖活动通过任务bug 元旦挂机活动
Showing
3 changed files
with
16 additions
and
6 deletions
Show diff stats
src/actions/ActivityAction.lua
@@ -407,7 +407,13 @@ function _M.hangDropRpc(agent, data) | @@ -407,7 +407,13 @@ function _M.hangDropRpc(agent, data) | ||
407 | 407 | ||
408 | reward, change = role:award(reward, {log = {desc = "actHangDrop", int1 = actid, int2 = num}}) | 408 | reward, change = role:award(reward, {log = {desc = "actHangDrop", int1 = actid, int2 = num}}) |
409 | 409 | ||
410 | - role.activity:updateActData("HangDrop", timeNow) | 410 | + if num < 8 then |
411 | + actData = actData + num * period | ||
412 | + else | ||
413 | + actData = timeNow | ||
414 | + end | ||
415 | + | ||
416 | + role.activity:updateActData("HangDrop", actData) | ||
411 | 417 | ||
412 | SendPacket(actionCodes.Activity_hangDropRpc, MsgPack.pack(role:packReward(reward, change))) | 418 | SendPacket(actionCodes.Activity_hangDropRpc, MsgPack.pack(role:packReward(reward, change))) |
413 | 419 | ||
@@ -432,7 +438,6 @@ function _M.startBattleRpc(agent, data) | @@ -432,7 +438,6 @@ function _M.startBattleRpc(agent, data) | ||
432 | local id = msg.id | 438 | local id = msg.id |
433 | local count = msg.count | 439 | local count = msg.count |
434 | if not role.activity:isOpenById(actid) then return 1 end | 440 | if not role.activity:isOpenById(actid) then return 1 end |
435 | - role.activity:getBattleTicket(role, actid) | ||
436 | 441 | ||
437 | local actCfg = csvdb["activity_battleCsv"][actid] | 442 | local actCfg = csvdb["activity_battleCsv"][actid] |
438 | if not actCfg then return 2 end | 443 | if not actCfg then return 2 end |
@@ -457,6 +462,7 @@ function _M.startBattleRpc(agent, data) | @@ -457,6 +462,7 @@ function _M.startBattleRpc(agent, data) | ||
457 | local changeFlag = false | 462 | local changeFlag = false |
458 | local ticket = actData["ticket"] | 463 | local ticket = actData["ticket"] |
459 | if battleCfg.type ~= "" then | 464 | if battleCfg.type ~= "" then |
465 | + role.activity:getBattleTicket(actid) | ||
460 | local num = battleCfg.type:toArray(true, "=")[3] | 466 | local num = battleCfg.type:toArray(true, "=")[3] |
461 | if count and count > 0 then | 467 | if count and count > 0 then |
462 | if battleCfg.rank == 0 then | 468 | if battleCfg.rank == 0 then |
src/models/Activity.lua
@@ -420,7 +420,8 @@ activityFunc[Activity.ActivityType.CalendaTask] = { | @@ -420,7 +420,8 @@ activityFunc[Activity.ActivityType.CalendaTask] = { | ||
420 | local towerInfo = role:getProperty("towerInfo") | 420 | local towerInfo = role:getProperty("towerInfo") |
421 | role:checkTaskEnter("TowerPass", {level = towerInfo.l}) | 421 | role:checkTaskEnter("TowerPass", {level = towerInfo.l}) |
422 | --"PvpWin" | 422 | --"PvpWin" |
423 | - role:checkTaskEnter("HangPass", {}) | 423 | + --role:checkTaskEnter("HangPass", {id = 0}) |
424 | + role:checkCalendaTask(true, 15, 3) | ||
424 | role:checkTaskEnter("HeroStarCollect", {}) | 425 | role:checkTaskEnter("HeroStarCollect", {}) |
425 | role:checkTaskEnter("RuneQualityCollect", {}) | 426 | role:checkTaskEnter("RuneQualityCollect", {}) |
426 | 427 | ||
@@ -476,7 +477,8 @@ activityFunc[Activity.ActivityType.Gachakon] = { | @@ -476,7 +477,8 @@ activityFunc[Activity.ActivityType.Gachakon] = { | ||
476 | activityFunc[Activity.ActivityType.HangDrop] = { | 477 | activityFunc[Activity.ActivityType.HangDrop] = { |
477 | ["init"] = function(self, actType, isCrossDay, notify, actId) | 478 | ["init"] = function(self, actType, isCrossDay, notify, actId) |
478 | local actime = self:getProperty("actime") | 479 | local actime = self:getProperty("actime") |
479 | - local startTime = actime[actId] | 480 | + local ctime = self.owner:getProperty("ctime") |
481 | + local startTime = math.max(actime[actId], ctime) | ||
480 | local actData = self:getActData(actType) or 0 | 482 | local actData = self:getActData(actType) or 0 |
481 | local cfg = csvdb["activity_putCsv"][actId] | 483 | local cfg = csvdb["activity_putCsv"][actId] |
482 | if not cfg then return end | 484 | if not cfg then return end |
src/models/RolePlugin.lua
@@ -1931,13 +1931,15 @@ function RolePlugin.bind(Role) | @@ -1931,13 +1931,15 @@ function RolePlugin.bind(Role) | ||
1931 | end | 1931 | end |
1932 | 1932 | ||
1933 | local CommonRankTime = toUnixtime("2019010100") | 1933 | local CommonRankTime = toUnixtime("2019010100") |
1934 | + local CommonCoef1 = 10000 | ||
1935 | + local CommonCoef2 = 10000 | ||
1934 | function Role:updateRankCommon(rankType, rankVal, reserve) | 1936 | function Role:updateRankCommon(rankType, rankVal, reserve) |
1935 | if not rankType then return end | 1937 | if not rankType then return end |
1936 | reserve = reserve or 0 | 1938 | reserve = reserve or 0 |
1937 | local now = skynet.timex() | 1939 | local now = skynet.timex() |
1938 | local ct = math.ceil((now - CommonRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 | 1940 | local ct = math.ceil((now - CommonRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 |
1939 | ct = 10000 - ct -- 越早的排名越靠前 | 1941 | ct = 10000 - ct -- 越早的排名越靠前 |
1940 | - local score = (reserve * 10000 + ct) * 10000000 + rankVal | 1942 | + local score = (rankVal * CommonCoef1 + ct) * CommonCoef2 + reserve |
1941 | 1943 | ||
1942 | local roleId = self:getProperty("id") | 1944 | local roleId = self:getProperty("id") |
1943 | redisproxy:pipelining(function (red) | 1945 | redisproxy:pipelining(function (red) |
@@ -1953,7 +1955,7 @@ function RolePlugin.bind(Role) | @@ -1953,7 +1955,7 @@ function RolePlugin.bind(Role) | ||
1953 | for i = 1, #ids, 2 do | 1955 | for i = 1, #ids, 2 do |
1954 | local roleId = tonumber(ids[i]) | 1956 | local roleId = tonumber(ids[i]) |
1955 | local rankVal = tonumber(ids[i + 1]) | 1957 | local rankVal = tonumber(ids[i + 1]) |
1956 | - rankVal = rankVal % 10000000 | 1958 | + rankVal = math.floor(math.floor(rankVal / CommonCoef2) / CommonCoef1) |
1957 | table.insert(list, {roleId = roleId, player = rankVal}) | 1959 | table.insert(list, {roleId = roleId, player = rankVal}) |
1958 | end | 1960 | end |
1959 | 1961 |