【GM】演算后端战斗接口添加GM地址配置

dev_chengFeng
gaoxin 2021-06-28 11:50:10 +08:00
parent 57060f5bee
commit e46c1eb833
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
BattleManager = {}
BattleManager = {}
local this = BattleManager
local PassiveSkillLogicConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillLogicConfig)
local SkillLogicConfig = ConfigManager.GetConfig(ConfigName.SkillLogicConfig)
@ -1010,10 +1010,10 @@ end
--++++++++++++++++++++++++++++++++++++++++++
-- 通过接口获取战斗数据
function this.RequestBattleDataByFightId(fightId, func)
function this.RequestBattleDataByFightId(serverUrl, fightId, func)
local uid = string.split(fightId, "_")[1]
local requestUrl = string.format("http://119.28.114.198:8888/req/getFightRecord?uid=%s&fightid=%s", uid, fightId)
--LogGreen(requestUrl)
local requestUrl = string.format("http://%s/req/getFightRecord?uid=%s&fightid=%s", serverUrl, uid, fightId)
LogGreen(requestUrl)
networkMgr:SendGetHttp(requestUrl, function(str)
--LogGreen(str)
local json = require 'cjson'

View File

@ -101,7 +101,7 @@ function GMPanel:InitComponent()
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "挑战怪物", inputTip = {"输入怪物组id"}, callBack = this.ChallengeMonster},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "测试假战斗", inputTip = {"输入假战斗id"}, callBack = this.RunFakeBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = "演算战斗数据", inputTip = {"战斗数据", "时间戳"}, callBack = this.RunBattleData},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "演算后端战斗", inputTip = {"输入战斗id"}, callBack = this.RunServerBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = "演算后端战斗", inputTip = {"GM格式IP地址:端口", "输入战斗id"}, callBack = this.RunServerBattle},
}
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
@ -382,8 +382,8 @@ function this.RunFakeBattle(fakeId)
end
-- 请求服务器战斗数据
function this.RunServerBattle(fightId)
BattleManager.RequestBattleDataByFightId(fightId, function(fightData)
function this.RunServerBattle(serverUrl, fightId)
BattleManager.RequestBattleDataByFightId(serverUrl, fightId, function(fightData)
--LogGreen("战斗回调")
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.Test)
end)