Commit dd328bd6dcd9809b08078fdac69e245f79a24936
1 parent
ec26aa3d
fix: 常规世界boss,防作弊
Showing
2 changed files
with
9 additions
and
7 deletions
Show diff stats
src/actions/ActivityAction.lua
@@ -1607,13 +1607,13 @@ function _M.startRegularWorldBossBattleRpc(agent, data) | @@ -1607,13 +1607,13 @@ function _M.startRegularWorldBossBattleRpc(agent, data) | ||
1607 | role:checkStoryStatus(false, 5, id) | 1607 | role:checkStoryStatus(false, 5, id) |
1608 | 1608 | ||
1609 | if not count then | 1609 | if not count then |
1610 | - role.__actBattleCache = { | 1610 | + role.__regularWorldBossBattleCache = { |
1611 | key = tostring(math.random()), | 1611 | key = tostring(math.random()), |
1612 | actid = actid, | 1612 | actid = actid, |
1613 | id = id, | 1613 | id = id, |
1614 | format = msg.format, | 1614 | format = msg.format, |
1615 | } | 1615 | } |
1616 | - SendPacket(actionCodes.Activity_startRegularWorldBossBattleRpc, MsgPack.pack({key = role.__actBattleCache.key})) | 1616 | + SendPacket(actionCodes.Activity_startRegularWorldBossBattleRpc, MsgPack.pack({key = role.__regularWorldBossBattleCache.key})) |
1617 | else | 1617 | else |
1618 | if count <= 0 then | 1618 | if count <= 0 then |
1619 | return | 1619 | return |
@@ -1634,7 +1634,7 @@ function _M.startRegularWorldBossBattleRpc(agent, data) | @@ -1634,7 +1634,7 @@ function _M.startRegularWorldBossBattleRpc(agent, data) | ||
1634 | for k, v in pairs(award) do | 1634 | for k, v in pairs(award) do |
1635 | award[k] = v * count | 1635 | award[k] = v * count |
1636 | end | 1636 | end |
1637 | - local reward, change = role:award(award, {log = {desc = "actBattle", int1 = actid, int2 = count or 0}}) | 1637 | + local reward, change = role:award(award, {log = {desc = "regularWorldBossBattle", int1 = actid, int2 = count or 0}}) |
1638 | 1638 | ||
1639 | changeFlag = true | 1639 | changeFlag = true |
1640 | actData["ticket"] = ticket - num | 1640 | actData["ticket"] = ticket - num |
@@ -1679,9 +1679,9 @@ function _M.endRegularWorldBossBattleRpc(agent, data) | @@ -1679,9 +1679,9 @@ function _M.endRegularWorldBossBattleRpc(agent, data) | ||
1679 | return true | 1679 | return true |
1680 | end | 1680 | end |
1681 | 1681 | ||
1682 | - if not role.__actBattleCache then return 2 end | 1682 | + if not role.__regularWorldBossBattleCache then return 2 end |
1683 | 1683 | ||
1684 | - if role.__actBattleCache.id ~= id or role.__actBattleCache.key ~= key and role.__actBattleCache.actid ~= actid then | 1684 | + if role.__regularWorldBossBattleCache.id ~= id or role.__regularWorldBossBattleCache.key ~= key and role.__regularWorldBossBattleCache.actid ~= actid then |
1685 | SendPacket(actionCodes.Activity_endRegularWorldBossBattleRpc, MsgPack.pack({errorCode = 1})) | 1685 | SendPacket(actionCodes.Activity_endRegularWorldBossBattleRpc, MsgPack.pack({errorCode = 1})) |
1686 | end | 1686 | end |
1687 | 1687 | ||
@@ -1690,12 +1690,12 @@ function _M.endRegularWorldBossBattleRpc(agent, data) | @@ -1690,12 +1690,12 @@ function _M.endRegularWorldBossBattleRpc(agent, data) | ||
1690 | id = id, | 1690 | id = id, |
1691 | isWin = isWin, | 1691 | isWin = isWin, |
1692 | info = msg.info, | 1692 | info = msg.info, |
1693 | - format = role.__actBattleCache.format | 1693 | + format = role.__regularWorldBossBattleCache.format |
1694 | }) then | 1694 | }) then |
1695 | SendPacket(actionCodes.Activity_endRegularWorldBossBattleRpc, MsgPack.pack({errorCode = 1})) | 1695 | SendPacket(actionCodes.Activity_endRegularWorldBossBattleRpc, MsgPack.pack({errorCode = 1})) |
1696 | return true | 1696 | return true |
1697 | end | 1697 | end |
1698 | - role.__actBattleCache = nil | 1698 | + role.__regularWorldBossBattleCache = nil |
1699 | 1699 | ||
1700 | local actCfg = csvdb["activity_battleCsv"][actid] | 1700 | local actCfg = csvdb["activity_battleCsv"][actid] |
1701 | if not actCfg then return 3 end | 1701 | if not actCfg then return 3 end |
src/models/RoleLog.lua
@@ -72,6 +72,8 @@ local ItemReason = { | @@ -72,6 +72,8 @@ local ItemReason = { | ||
72 | firstSMonthCardReward = 156, --首次订阅特刊奖励 | 72 | firstSMonthCardReward = 156, --首次订阅特刊奖励 |
73 | regularWorldBossReward = 157, -- 常规世界boss | 73 | regularWorldBossReward = 157, -- 常规世界boss |
74 | regularWorldBossMilestone = 158, -- 常规世界boss伤害里程碑 | 74 | regularWorldBossMilestone = 158, -- 常规世界boss伤害里程碑 |
75 | + regularWorldBossBattle = 159, -- 常规世界boss战斗奖励 | ||
76 | + | ||
75 | 77 | ||
76 | 78 | ||
77 | advHang = 301, -- 拾荒挂机 | 79 | advHang = 301, -- 拾荒挂机 |