Merge branch 'china/local' into china/test

dev_chengFeng hotfix/mht_china/xq/cdn_xq_test/0.1.41
JieLing 2021-06-28 13:35:29 +08:00
commit 863dabcd1e
4 changed files with 108 additions and 24 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

@ -86,13 +86,19 @@ end
function this.UpdateHongMengDataHeroInfos(hongmengHeroInfos)
this.hongmengHeroInfos = hongmengHeroInfos
--LogGreen("hongmengHeroInfos "..#this.hongmengHeroInfos)
-- LogGreen("hongmengHeroInfos "..#this.hongmengHeroInfos)
for i = 1, #this.hongmengHeroInfos do
if this.hongmengHeroInfos[i].time ~= 0 then
-- body
this.hongmengHeroInfos[i].time = this.hongmengHeroInfos[i].time + GetTimeStamp()
end
-- print(HeroManager.)
--鸿蒙阵共鸣后直接大于20级 后没有赋值大闹天宫英雄血量 大闹天宫一键上阵报错
-- LogYellow("this.hongmengHeroInfos[i].heroId "..this.hongmengHeroInfos[i].heroId)
if not ExpeditionManager.heroInfo[this.hongmengHeroInfos[i].heroId] then
-- LogRed("this.hongmengHeroInfos[i].heroId "..this.hongmengHeroInfos[i].heroId)
ExpeditionManager.InitHeroHpValue(this.hongmengHeroInfos[i].heroId)
end
end
if this.hongmengAdditions[1] then
@ -350,7 +356,11 @@ end
function this:SetGongMingList(Id)
local data = HeroManager.GetSingleHeroData(Id)
table.insert(this.hongmengGongMingList,data)
-- LogYellow("Id "..Id)
if not ExpeditionManager.heroInfo[Id] then
-- LogRed("Id "..Id)
ExpeditionManager.InitHeroHpValue(Id)
end
end
function this:RemoveGongMingList(Id)

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)

View File

@ -1,7 +1,10 @@
using GameCore;
using GameEditor.Util;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using UnityEditor;
using UnityEngine;
@ -13,18 +16,36 @@ namespace GameEditor.Core.DataConfig
{
static string m_ExcelPath;
static string m_BattleConfigPath;
static string m_BattleConfigRootPath;
static string m_Bench;
static string[] m_Files;
static bool[] m_Choose;
static string shellPath;
static string m_CurGitBench;
static string m_CurServerBattlePath;
static Dictionary<string, string> ServerBattleConfig = new Dictionary<string, string>();
//{
// new string[]{ "china/test", "master_zh_test"},
// new string[]{ "china/zf_test", "master_zh_online_special"},
//};
[MenuItem("Data Config/Export")]
private static void ShowConfigWin()
{
ServerBattleConfig.Clear();
ServerBattleConfig.Add("china/dev", "test");
ServerBattleConfig.Add("china/test", "master_zh_test");
ServerBattleConfig.Add("china/zf_test", "master_zh_online_special");
m_CurGitBench = GitUtil.GetCurBenchName();
ServerBattleConfig.TryGetValue(m_CurGitBench, out m_CurServerBattlePath);
m_ExcelPath = EditorPrefs.GetString("m_ExcelPath");
m_BattleConfigPath = EditorPrefs.GetString("m_BattleConfigPath");
m_BattleConfigRootPath = EditorPrefs.GetString("m_BattleConfigRootPath");
m_Bench = EditorPrefs.GetString("m_Bench");
LoadDic();
var win = GetWindow<ConfigExportWindow>();
@ -67,11 +88,10 @@ namespace GameEditor.Core.DataConfig
// 保存数据
EditorPrefs.SetString("m_ExcelPath", m_ExcelPath);
EditorPrefs.SetString("m_BattleConfigPath", m_BattleConfigPath);
EditorPrefs.SetString("m_BattleConfigRootPath",m_BattleConfigRootPath);
EditorPrefs.SetString("m_Bench", m_Bench);
}
public static void OpenDirectory(string path)
{
if (string.IsNullOrEmpty(path)) return;
@ -114,13 +134,13 @@ namespace GameEditor.Core.DataConfig
p.Close();
}
private string[] battleConfigList = new string[]
private static string[] battleConfigList = new string[]
{
"PassiveSkillLogicConfig",
"HardStage",
"HardStageCondition",
};
public static bool isUpDateOnline = false;
private void OnGUI()
{
@ -168,25 +188,73 @@ namespace GameEditor.Core.DataConfig
// 导表
DataConfigWindow.excelALLConfig(true, m_Bench + "/base_data");
}
if(m_CurServerBattlePath!= null)
{
EditorGUILayout.LabelField("战斗数据表同步根路径:");
m_BattleConfigRootPath = EditorGUILayout.TextField("", m_BattleConfigRootPath);
EditorGUILayout.LabelField("目标战斗校验服文件夹为:"+m_CurServerBattlePath);
if (GUILayout.Button("同步到战斗校验服并提交", GUILayout.Height(40f)))
{
UpdateSVNBattleData();
SaveLocalConfig();
// 导表
//isUpDateOnline = true;
//DataConfigWindow.excelALLConfig(false, m_Bench + "/base_data");
}
}
EditorGUILayout.LabelField("战斗数据表同步路径:");
m_BattleConfigPath = EditorGUILayout.TextField("", m_BattleConfigPath);
if (GUILayout.Button("同步战斗数据表", GUILayout.Height(40f)))
{
string sourcePath = Application.dataPath + "/ManagedResources/~lua/Config/Data/";
for(int i = 0; i < battleConfigList.Length; i++)
{
string luaFile = sourcePath + battleConfigList[i] + ".lua";
string targetPath = m_BattleConfigPath +"/"+ battleConfigList[i] + ".lua";
UnityEngine.Debug.Log(battleConfigList[i]);
File.Copy(luaFile, targetPath, true);
}
// 同步
UnityEngine.Debug.Log("同步成功");
CopyBattleFiles(m_BattleConfigPath);
// 保存数据
SaveLocalConfig();
}
}
void UpdateSVNBattleData()
{
string targetPath = Path.Combine(m_BattleConfigRootPath, m_CurServerBattlePath);
string svnPath = targetPath + "\\Modules";
// 拉取一次
ProcessUtil.ProcessCommand(svnPath, "svn update");
//
CopyBattleFiles(targetPath + "/Modules/Battle/Config/Data");
//
string PackTime = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss");
string commitMsg = string.Format("{0}同步数据表{1}", m_CurServerBattlePath, PackTime);
// 重写Readme文件
string readMePath = svnPath + "/Battle/Readme.txt";
string[] flines = File.ReadAllLines(readMePath, System.Text.Encoding.UTF8);
List<string> wlines = flines.ToList();
wlines.Insert(0, commitMsg);
File.WriteAllLines(readMePath, wlines.ToArray(), System.Text.Encoding.UTF8);
// 提交到SVN
ProcessUtil.ProcessCommand(svnPath, "svn add . --force");
ProcessUtil.ProcessCommand(svnPath, "svn commit -m " + commitMsg);
UnityEngine.Debug.Log("同步SVN完成");
}
// 将战斗相关数据表文件同步到目标文件夹
void CopyBattleFiles(string targetPath)
{
UnityEngine.Debug.Log("同步战斗文件到目标路径:"+ targetPath);
string sourcePath = Application.dataPath + "/ManagedResources/~lua/Config/Data/";
for (int i = 0; i < battleConfigList.Length; i++)
{
string luaFile = sourcePath + battleConfigList[i] + ".lua";
string path = targetPath + "/" + battleConfigList[i] + ".lua";
UnityEngine.Debug.Log(battleConfigList[i]);
File.Copy(luaFile, path, true);
}
// 同步
UnityEngine.Debug.Log("同步完成!");
}
}
@ -287,6 +355,12 @@ namespace GameEditor.Core.DataConfig
UnityEngine.Debug.LogError("耗时:" + time.ElapsedMilliseconds);
EditorUtil.ShowSureDialog("配置表数据导入完毕!");
//if (ConfigExportWindow.isUpDateOnline)
//{
// ConfigExportWindow.UpdateSVNBattleData();
// ConfigExportWindow.isUpDateOnline = false;
//}
}
};
@ -347,7 +421,7 @@ namespace GameEditor.Core.DataConfig
{
excelALLConfig(true, DataConfigSetting.execlDir);
}
private static void exportSheet(DataConfigSetting setting, string path, bool isIncrement)
{
string fileExt = Path.GetExtension(path).ToLower();