Commit d6a66c748d123de5c26080739dee90741b3f0288

Authored by zhouhaihai
1 parent 7bb30dca

校验失败也返回

src/actions/HangAction.lua
... ... @@ -187,7 +187,8 @@ function _M.endBattleRpc(agent, data)
187 187 local msg = MsgPack.unpack(data)
188 188 local hangInfo = role:getProperty("hangInfo")
189 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 192 end
192 193 local carbonId = msg.carbonId
193 194 local carbonData = csvdb["idle_battleCsv"][carbonId]
... ... @@ -497,7 +498,10 @@ function _M.endBonusBattleRpc(agent, data)
497 498 local starNum = msg.starNum
498 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 505 local bonusData = csvdb["bonus_battleCsv"][id]
502 506  
503 507 local reward, change
... ...
src/actions/PvpAction.lua
... ... @@ -311,7 +311,8 @@ function _M.endBattleRpc(agent, data)
311 311 local msg = MsgPack.unpack(data)
312 312  
313 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 316 end
316 317  
317 318 if not msg.idx or msg.idx ~= _pvpStartBattleCacheC.idx then
... ... @@ -539,7 +540,8 @@ function _M.endBattleHRpc(agent, data)
539 540 local msg = MsgPack.unpack(data)
540 541  
541 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 545 end
544 546  
545 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 90 local passTime = msg.passTime
91 91  
92 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 97 local curTower = csvdb["tower_battleCsv"][id]
95 98 if not curTower then return 2 end
96 99  
... ...