diff --git a/src/actions/PvpAction.lua b/src/actions/PvpAction.lua index 94f8840..95ce565 100644 --- a/src/actions/PvpAction.lua +++ b/src/actions/PvpAction.lua @@ -13,9 +13,8 @@ local _pvpStartBattleCache = nil -- local _pvpRecordInfoCache = {} -- 记录缓存 local _pvpRecordBattleInfoCache = {} -- 记录战斗数据缓存 -local _responseRecord = {} -- 复仇对单人1分钟间隔 - -local ResponseWaitTime = 60 +local _revengeRecord = {} -- 复仇对单人1分钟间隔 +local RevengeWaitTime = 60 function _M.formatCommonRpc(agent , data) local role = agent.role @@ -164,7 +163,7 @@ function _M.startBattleRpc(agent, data) local temp = _pvpRecordInfoCache[idx] if not temp then return 2 end - if not _responseRecord[temp.id] or now >= _responseRecord[temp.id] then + if not _revengeRecord[temp.id] or now >= _revengeRecord[temp.id] then if temp.t == 1 then matchInfo = _pvpRecordBattleInfoCache[temp.id] elseif temp.t == 2 then @@ -172,7 +171,7 @@ function _M.startBattleRpc(agent, data) end else result = 1 - wait = _responseRecord[temp.id] - now + wait = _revengeRecord[temp.id] - now end else --打正常 local pvpMC = role:getProperty("pvpMC") @@ -227,7 +226,7 @@ function _M.endBattleRpc(agent, data) local match if revenge then match = _pvpRecordInfoCache[msg.idx] - _responseRecord[match.id] = now + ResponseWaitTime -- 1分钟内不能再打 + _revengeRecord[match.id] = now + RevengeWaitTime -- 1分钟内不能再打 else local pvpMC = role:getProperty("pvpMC") match = pvpMC[msg.idx] @@ -306,6 +305,7 @@ end function _M.rankListRpc(agent, data) local role = agent.role local roleId = role:getProperty("id") + local msg = MsgPack.unpack(data) local ptype = msg.ptype or 1 local response = {} @@ -322,8 +322,8 @@ function _M.rankListRpc(agent, data) end local rankList = {} for i = 1, #redret[3], 2 do - local roleId = tonumber(redret[i]) - local score = role:unpackPvpScore(redret[i + 1]) + local roleId = tonumber(redret[3][i]) + local score = role:unpackPvpScore(redret[3][i + 1]) local online, curInfo = rpcRole(roleId, "friendSInfo") curInfo.score = score curInfo.roleId = roleId diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 8c53ae9..8c34c09 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -620,6 +620,7 @@ function RolePlugin.bind(Role) end function Role:getRealBattleValue(heros, activeRelation) -- 获取队伍战斗力 羁绊加成 + heros = heros or {} local activeRelation = activeRelation or self:getHeroActiveRelation(heros) local battleValue = 0 for _, id in pairs(heros) do -- libgit2 0.21.2