【战报系统】接口uid改为通过战斗id获取,兼容pve战斗数据

dev_chengFeng
gaoxin 2020-12-18 16:27:24 +08:00
parent ef1ced3ef7
commit ec47ec2b1c
1 changed files with 12 additions and 5 deletions

View File

@ -387,6 +387,13 @@ function this.GetBattleServerData(msg, isFightPlayer)
local skin=tonumber(data2.fightUnitList[j].skinId)
skills = string.split(data2.fightUnitList[j].unitSkillIds, "#")
propertys = string.split(data2.fightUnitList[j].property, "#")
-- 如果找不到去怪物里面找
if not HeroConfig[rid] then
rid = MonsterConfig[rid].MonsterId
end
if not rid then
LogRed("怪物数据错误")
end
role = {
roleId = rid,
position = position,
@ -398,7 +405,7 @@ function this.GetBattleServerData(msg, isFightPlayer)
element = HeroConfig[rid].PropertyName,
professionId = HeroConfig[rid].Profession,
passivity = { },
property = { },
property = { },
}
end
if skills[1] then
@ -966,16 +973,16 @@ end
--++++++++++++++++++++++++++++++++++++++++++
-- 通过接口获取战斗数据
function this.RequestBattleDataByFightId(fightId, func)
local requestUrl = string.format("http://60.1.1.244:8888/req/getFightRecord?uid=%s&fightid=%s", PlayerManager.uid, fightId)
local uid = string.split(fightId, "_")[1]
local requestUrl = string.format("http://60.1.1.244:8888/req/getFightRecord?uid=%s&fightid=%s", uid, fightId)
LogGreen(requestUrl)
networkMgr:SendGetHttp(requestUrl, function(str)
LogGreen(str)
local json = require 'cjson'
local data = json.decode(str)
local fightData = this.GetBattleServerData({fightData = data})
local fightData = this.GetBattleServerData({fightData = data}, 1)
if func then
func(fightData)
end