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 | 407 | |
| 408 | 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 | 418 | SendPacket(actionCodes.Activity_hangDropRpc, MsgPack.pack(role:packReward(reward, change))) |
| 413 | 419 | |
| ... | ... | @@ -432,7 +438,6 @@ function _M.startBattleRpc(agent, data) |
| 432 | 438 | local id = msg.id |
| 433 | 439 | local count = msg.count |
| 434 | 440 | if not role.activity:isOpenById(actid) then return 1 end |
| 435 | - role.activity:getBattleTicket(role, actid) | |
| 436 | 441 | |
| 437 | 442 | local actCfg = csvdb["activity_battleCsv"][actid] |
| 438 | 443 | if not actCfg then return 2 end |
| ... | ... | @@ -457,6 +462,7 @@ function _M.startBattleRpc(agent, data) |
| 457 | 462 | local changeFlag = false |
| 458 | 463 | local ticket = actData["ticket"] |
| 459 | 464 | if battleCfg.type ~= "" then |
| 465 | + role.activity:getBattleTicket(actid) | |
| 460 | 466 | local num = battleCfg.type:toArray(true, "=")[3] |
| 461 | 467 | if count and count > 0 then |
| 462 | 468 | if battleCfg.rank == 0 then | ... | ... |
src/models/Activity.lua
| ... | ... | @@ -420,7 +420,8 @@ activityFunc[Activity.ActivityType.CalendaTask] = { |
| 420 | 420 | local towerInfo = role:getProperty("towerInfo") |
| 421 | 421 | role:checkTaskEnter("TowerPass", {level = towerInfo.l}) |
| 422 | 422 | --"PvpWin" |
| 423 | - role:checkTaskEnter("HangPass", {}) | |
| 423 | + --role:checkTaskEnter("HangPass", {id = 0}) | |
| 424 | + role:checkCalendaTask(true, 15, 3) | |
| 424 | 425 | role:checkTaskEnter("HeroStarCollect", {}) |
| 425 | 426 | role:checkTaskEnter("RuneQualityCollect", {}) |
| 426 | 427 | |
| ... | ... | @@ -476,7 +477,8 @@ activityFunc[Activity.ActivityType.Gachakon] = { |
| 476 | 477 | activityFunc[Activity.ActivityType.HangDrop] = { |
| 477 | 478 | ["init"] = function(self, actType, isCrossDay, notify, actId) |
| 478 | 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 | 482 | local actData = self:getActData(actType) or 0 |
| 481 | 483 | local cfg = csvdb["activity_putCsv"][actId] |
| 482 | 484 | if not cfg then return end | ... | ... |
src/models/RolePlugin.lua
| ... | ... | @@ -1931,13 +1931,15 @@ function RolePlugin.bind(Role) |
| 1931 | 1931 | end |
| 1932 | 1932 | |
| 1933 | 1933 | local CommonRankTime = toUnixtime("2019010100") |
| 1934 | + local CommonCoef1 = 10000 | |
| 1935 | + local CommonCoef2 = 10000 | |
| 1934 | 1936 | function Role:updateRankCommon(rankType, rankVal, reserve) |
| 1935 | 1937 | if not rankType then return end |
| 1936 | 1938 | reserve = reserve or 0 |
| 1937 | 1939 | local now = skynet.timex() |
| 1938 | 1940 | local ct = math.ceil((now - CommonRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 |
| 1939 | 1941 | ct = 10000 - ct -- 越早的排名越靠前 |
| 1940 | - local score = (reserve * 10000 + ct) * 10000000 + rankVal | |
| 1942 | + local score = (rankVal * CommonCoef1 + ct) * CommonCoef2 + reserve | |
| 1941 | 1943 | |
| 1942 | 1944 | local roleId = self:getProperty("id") |
| 1943 | 1945 | redisproxy:pipelining(function (red) |
| ... | ... | @@ -1953,7 +1955,7 @@ function RolePlugin.bind(Role) |
| 1953 | 1955 | for i = 1, #ids, 2 do |
| 1954 | 1956 | local roleId = tonumber(ids[i]) |
| 1955 | 1957 | local rankVal = tonumber(ids[i + 1]) |
| 1956 | - rankVal = rankVal % 10000000 | |
| 1958 | + rankVal = math.floor(math.floor(rankVal / CommonCoef2) / CommonCoef1) | |
| 1957 | 1959 | table.insert(list, {roleId = roleId, player = rankVal}) |
| 1958 | 1960 | end |
| 1959 | 1961 | ... | ... |