From d6a66c748d123de5c26080739dee90741b3f0288 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Tue, 4 Aug 2020 20:28:06 +0800 Subject: [PATCH] 校验失败也返回 --- src/actions/HangAction.lua | 8 ++++++-- src/actions/PvpAction.lua | 6 ++++-- src/actions/TowerAction.lua | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 3e1cfd1..44baef5 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -187,7 +187,8 @@ function _M.endBattleRpc(agent, data) local msg = MsgPack.unpack(data) local hangInfo = role:getProperty("hangInfo") if not msg.key or msg.key ~= _BattleKey then - return 1 + SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1})) + return true end local carbonId = msg.carbonId local carbonData = csvdb["idle_battleCsv"][carbonId] @@ -497,7 +498,10 @@ function _M.endBonusBattleRpc(agent, data) local starNum = msg.starNum if not role.__bonusBattleCache then return 1 end - if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then return 2 end + if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then + SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) + return true + end local bonusData = csvdb["bonus_battleCsv"][id] local reward, change diff --git a/src/actions/PvpAction.lua b/src/actions/PvpAction.lua index a4785c2..3c893a7 100644 --- a/src/actions/PvpAction.lua +++ b/src/actions/PvpAction.lua @@ -311,7 +311,8 @@ function _M.endBattleRpc(agent, data) local msg = MsgPack.unpack(data) if not msg.key or not _pvpStartBattleCacheC or msg.key ~= _pvpStartBattleCacheC.key then - return 1 + SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({errorCode = 1})) + return true end if not msg.idx or msg.idx ~= _pvpStartBattleCacheC.idx then @@ -539,7 +540,8 @@ function _M.endBattleHRpc(agent, data) local msg = MsgPack.unpack(data) if not msg.key or not _pvpStartBattleCacheH or msg.key ~= _pvpStartBattleCacheH.key then - return 1 + SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({errorCode = 1})) + return true end if not msg.idx or msg.idx ~= _pvpStartBattleCacheH.idx then diff --git a/src/actions/TowerAction.lua b/src/actions/TowerAction.lua index a39f602..f4230e7 100644 --- a/src/actions/TowerAction.lua +++ b/src/actions/TowerAction.lua @@ -90,7 +90,10 @@ function _M.endBattleRpc(agent, data) local passTime = msg.passTime local towerInfo = role:getProperty("towerInfo") - if towerInfo.l ~= id or not towerInfo.k or towerInfo.k ~= key then return 1 end + if towerInfo.l ~= id or not towerInfo.k or towerInfo.k ~= key then + SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({errorCode = 1})) + return true + end local curTower = csvdb["tower_battleCsv"][id] if not curTower then return 2 end -- libgit2 0.21.2