diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index b54a3c9d7f..410c7a30e6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -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' diff --git a/Assets/ManagedResources/~Lua/Modules/Main/GMPanel.lua b/Assets/ManagedResources/~Lua/Modules/Main/GMPanel.lua index 25c18f7275..747d104f5e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/GMPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/GMPanel.lua @@ -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)