Commit d6a66c748d123de5c26080739dee90741b3f0288
1 parent
7bb30dca
校验失败也返回
Showing
3 changed files
with
14 additions
and
5 deletions
Show diff stats
src/actions/HangAction.lua
@@ -187,7 +187,8 @@ function _M.endBattleRpc(agent, data) | @@ -187,7 +187,8 @@ function _M.endBattleRpc(agent, data) | ||
187 | local msg = MsgPack.unpack(data) | 187 | local msg = MsgPack.unpack(data) |
188 | local hangInfo = role:getProperty("hangInfo") | 188 | local hangInfo = role:getProperty("hangInfo") |
189 | if not msg.key or msg.key ~= _BattleKey then | 189 | if not msg.key or msg.key ~= _BattleKey then |
190 | - return 1 | 190 | + SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1})) |
191 | + return true | ||
191 | end | 192 | end |
192 | local carbonId = msg.carbonId | 193 | local carbonId = msg.carbonId |
193 | local carbonData = csvdb["idle_battleCsv"][carbonId] | 194 | local carbonData = csvdb["idle_battleCsv"][carbonId] |
@@ -497,7 +498,10 @@ function _M.endBonusBattleRpc(agent, data) | @@ -497,7 +498,10 @@ function _M.endBonusBattleRpc(agent, data) | ||
497 | local starNum = msg.starNum | 498 | local starNum = msg.starNum |
498 | if not role.__bonusBattleCache then return 1 end | 499 | if not role.__bonusBattleCache then return 1 end |
499 | 500 | ||
500 | - if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then return 2 end | 501 | + if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then |
502 | + SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | ||
503 | + return true | ||
504 | + end | ||
501 | local bonusData = csvdb["bonus_battleCsv"][id] | 505 | local bonusData = csvdb["bonus_battleCsv"][id] |
502 | 506 | ||
503 | local reward, change | 507 | local reward, change |
src/actions/PvpAction.lua
@@ -311,7 +311,8 @@ function _M.endBattleRpc(agent, data) | @@ -311,7 +311,8 @@ function _M.endBattleRpc(agent, data) | ||
311 | local msg = MsgPack.unpack(data) | 311 | local msg = MsgPack.unpack(data) |
312 | 312 | ||
313 | if not msg.key or not _pvpStartBattleCacheC or msg.key ~= _pvpStartBattleCacheC.key then | 313 | if not msg.key or not _pvpStartBattleCacheC or msg.key ~= _pvpStartBattleCacheC.key then |
314 | - return 1 | 314 | + SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({errorCode = 1})) |
315 | + return true | ||
315 | end | 316 | end |
316 | 317 | ||
317 | if not msg.idx or msg.idx ~= _pvpStartBattleCacheC.idx then | 318 | if not msg.idx or msg.idx ~= _pvpStartBattleCacheC.idx then |
@@ -539,7 +540,8 @@ function _M.endBattleHRpc(agent, data) | @@ -539,7 +540,8 @@ function _M.endBattleHRpc(agent, data) | ||
539 | local msg = MsgPack.unpack(data) | 540 | local msg = MsgPack.unpack(data) |
540 | 541 | ||
541 | if not msg.key or not _pvpStartBattleCacheH or msg.key ~= _pvpStartBattleCacheH.key then | 542 | if not msg.key or not _pvpStartBattleCacheH or msg.key ~= _pvpStartBattleCacheH.key then |
542 | - return 1 | 543 | + SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({errorCode = 1})) |
544 | + return true | ||
543 | end | 545 | end |
544 | 546 | ||
545 | if not msg.idx or msg.idx ~= _pvpStartBattleCacheH.idx then | 547 | if not msg.idx or msg.idx ~= _pvpStartBattleCacheH.idx then |
src/actions/TowerAction.lua
@@ -90,7 +90,10 @@ function _M.endBattleRpc(agent, data) | @@ -90,7 +90,10 @@ function _M.endBattleRpc(agent, data) | ||
90 | local passTime = msg.passTime | 90 | local passTime = msg.passTime |
91 | 91 | ||
92 | local towerInfo = role:getProperty("towerInfo") | 92 | local towerInfo = role:getProperty("towerInfo") |
93 | - if towerInfo.l ~= id or not towerInfo.k or towerInfo.k ~= key then return 1 end | 93 | + if towerInfo.l ~= id or not towerInfo.k or towerInfo.k ~= key then |
94 | + SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({errorCode = 1})) | ||
95 | + return true | ||
96 | + end | ||
94 | local curTower = csvdb["tower_battleCsv"][id] | 97 | local curTower = csvdb["tower_battleCsv"][id] |
95 | if not curTower then return 2 end | 98 | if not curTower then return 2 end |
96 | 99 |