From 11bb03fd2b1bb16c78185aa22e9c179c87f10c03 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 11 Jun 2021 10:18:38 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E3=80=90ID1016454=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=B7=B3=E8=BD=AC=E3=80=91=E5=AF=BB=E4=BB=99?= =?UTF-8?q?=E7=8E=89=E5=9C=A8=E6=B4=BB=E5=8A=A8=E6=9C=AA=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E4=BD=BF=E7=94=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=90=88=E7=90=86=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua index b23b66a257..f4a4ee71a3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua @@ -624,7 +624,7 @@ local jumpDic = { end, [JumpType.ZhuTiHuoDong] = function (data) if #data > 1 then - if ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LimitUpHero) then + if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitUpHero) then this.JumpActivity(JumpType.ZhuTiHuoDong,data[1]) elseif ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then this.JumpActivity(JumpType.ZhuTiHuoDong,data[2]) From 2419089ff496839f14eeadd06c6f482e7b4a6dbe Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 11 Jun 2021 10:30:57 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E3=80=90ID1016454=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=B7=B3=E8=BD=AC=E3=80=91=E5=AF=BB=E4=BB=99?= =?UTF-8?q?=E7=8E=89=E5=9C=A8=E6=B4=BB=E5=8A=A8=E6=9C=AA=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E4=BD=BF=E7=94=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=90=88=E7=90=86=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua index f4a4ee71a3..21dfd80cc2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua @@ -628,6 +628,8 @@ local jumpDic = { this.JumpActivity(JumpType.ZhuTiHuoDong,data[1]) elseif ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then this.JumpActivity(JumpType.ZhuTiHuoDong,data[2]) + else + PopupTipPanel.ShowTip("活动尚未开启") end else this.JumpActivity(JumpType.ZhuTiHuoDong,data[1]) From ed4472a298e27b6fa12596f5d7dbbd049e39f5d0 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 11 Jun 2021 10:48:11 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=8C=82=E6=9C=BA=E5=8D=A1=E6=AD=BB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Player/PlayerManager.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index 21db5d30ee..ff346d3627 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -953,8 +953,17 @@ function this.RandomFirendNPC(currankAllList) -- ----LogGreen("friend "..currankAllList[playerRandomNum].userName) end end - -function this.RandomNPC(currankAllList,curlist) +local currankAllList = {} +function this.RandomNPC(_currankAllList,curlist) + if _currankAllList then + currankAllList = {} + for i = 1,#_currankAllList do + table.insert(currankAllList,currankAllList[i]) + end + end + if not currankAllList or #currankAllList < 1 then + return + end local playerRandomNum = math.random(1, #currankAllList) local uid = 0 if currankAllList[playerRandomNum].id then @@ -965,7 +974,8 @@ function this.RandomNPC(currankAllList,curlist) uid = currankAllList[playerRandomNum].uid end if curlist[uid] or uid < 1 then - this.RandomNPC(currankAllList,curlist) + table.remove(currankAllList,playerRandomNum) + this.RandomNPC(nil,curlist) else curlist[uid] = {} curlist[uid] = currankAllList[playerRandomNum] From a9ce0d077e88f864a603ef8c31e5d424776bee34 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Fri, 11 Jun 2021 10:58:51 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E3=80=90=E7=AB=A0=E8=8A=82=E5=89=A7?= =?UTF-8?q?=E6=83=85=E3=80=91=E7=82=B9=E5=87=BB=E8=B7=B3=E8=BF=87=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=BF=94=E5=9B=9E=E6=8C=82=E6=9C=BA=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Story/StoryDialoguePanel.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua index 98820b96bf..3d6c39bbd8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua @@ -60,6 +60,10 @@ function StoryDialoguePanel:BindEvent() Util.AddClick(this.btnJump, function () if jumpId == 0 then self:ClosePanel() + if static_callBack then + static_callBack() + static_callBack = nil + end else self:GoNext(jumpId) end From 7cb79b4de36ea4713bc4961ff56b8ca29e104bb2 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 11 Jun 2021 12:46:14 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E3=80=90=E7=83=AD=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameEditor/FrameTool/HotFixWindow.cs | 79 ++++++++++++++++++- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs index 10d9331e5a..901fe651f5 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs @@ -177,6 +177,10 @@ namespace GameEditor.FrameTool public bool isCalSize = false; // 判断是否计算过大小了 public bool isChoose = false; // 是否被选中 + public string cdn_files_path = ""; + public string project_files_path = ""; + public string local_files_path = ""; + public decimal local_cdn_size = 0; // git与cdn比较 热更文件的文件大小 public decimal project_cdn_size = 0; // 工程与cdn比较 热更文件的文件大小 @@ -204,11 +208,11 @@ namespace GameEditor.FrameTool } // cdn上files文件保存的位置 - string cdn_files_path = path_cdn_setting + "__Download/"; + cdn_files_path = path_cdn_setting + "__Download/"; // 工程中的位置 - string project_files_path = Application.dataPath + "/../BuildABs/" + AppConst.PlatformPath + "/"; + project_files_path = Application.dataPath + "/../BuildABs/" + AppConst.PlatformPath + "/"; // GIT位置 - string local_files_path = HotfixWindow._HotFixProjectPath + "/Root/" + dir_name + "/" + AppConst.PlatformPath + "/"; + local_files_path = HotfixWindow._HotFixProjectPath + "/Root/" + dir_name + "/" + AppConst.PlatformPath + "/"; // 读取version文件 string json = File.ReadAllText(path_cdn_setting + AppConst.GameVersionFile); @@ -404,6 +408,13 @@ namespace GameEditor.FrameTool { hfs.CalHotFixSize(); } + if (GUILayout.Button("更新", GUILayout.Height(30f), GUILayout.Width(100f))) + { + HotfixConfimWindow.Create("是否要热更: " + hfs.desc, hfs.local_cdn_list, () => + { + UpdateUnity3dToCDN(hfs); + }); + } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); @@ -480,6 +491,68 @@ namespace GameEditor.FrameTool EditorUtility.ClearProgressBar(); } + //同步工程中的热更文件到git + private static void UpdateUnity3dToCDN(HotFixSetting hfs) + { + string logName; + string updateName; + string changeFileName; + List updateList; + List log = new List(); + updateList = hfs.local_cdn_list; + if (updateList.Count <= 0) + { + UnityEngine.Debug.Log("未检测到文件改动"); + return; + } + // 初始化数据 + updateName = hfs.dir_name + "_" + hfs.dir_cdn_setting + "_" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss"); + changeFileName = updateName.Replace("/", "$"); + logName = changeFileName + "_UpLoad"; + EditorUtility.DisplayProgressBar("正在获取数据:", updateName, 0f); + log.Add("热更文件版本:" + updateName); + log.Add("热更大小:" + hfs.local_cdn_size); + // copy unity3d + log.Add("热更文件:"); + List changeFile = new List(); + foreach (ResourceFile rf in updateList) + { + changeFile.Add(rf.fileName); + log.Add(rf.fileName); + } + // write ChangeList + EditorUtility.DisplayProgressBar("正在生成文件变化列表", changeFileName, 1f); + WriteLog(hfs.path_cdn_setting + "/__HotFixLog", changeFileName, changeFile.ToArray()); + // upload to cdn + EditorUtility.DisplayProgressBar("正在上传热更文件", changeFileName, 1f); + string setting = File.ReadAllText(hfs.path_cdn_setting + "Setting.txt", System.Text.Encoding.UTF8); + Hashtable info = MiniJSON.jsonDecode(setting) as Hashtable; + + if (!info.ContainsKey("cdn_type")) + { + UnityEngine.Debug.LogError("CDN配置错误"); + EditorUtility.ClearProgressBar(); + return; + } + log.Add("CDN TYPE: "+ info["cdn_type"]); + string toolsDir = _HotFixProjectPath + "/Tools/" + info["cdn_type"]; + string command = string.Format("python UpLoad.py {0} {1} {2}>>{3}", _HotFixProjectPath + "/Root/" + hfs.dir_name, hfs.dir_cdn_setting, changeFileName, hfs.path_cdn_setting + "__HotFixLog/" + logName + ".log"); + log.Add("TOOLS DIR: " + toolsDir); + log.Add("UPLOAD COMMAND: " + command); + ProcessUtil.ProcessCommand(toolsDir, command); + + // write log + EditorUtility.DisplayProgressBar("正在生成Log文件:", logName, 1f); + WriteLog(hfs.path_cdn_setting + "__HotFixLog", logName, log.ToArray()); + // git commit + string commitName = hfs.desc + "更新:" + updateName; + UnityEngine.Debug.LogError("git commit -m " + commitName); + EditorUtility.DisplayProgressBar("正在提交到GIT:", commitName, 1f); + ProcessUtil.ProcessCommand(hfs.path_cdn_setting, "git add ."); + ProcessUtil.ProcessCommand(hfs.path_cdn_setting, "git commit -m " + commitName); + EditorUtility.ClearProgressBar(); + } + private static void WriteLog(string path, string name, string[] contents) { From 65e7971693ede1bee43b19afc2441fe322682f83 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 11 Jun 2021 13:02:12 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E3=80=90=E7=83=AD=E6=9B=B4=E3=80=91?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E6=9C=8D=E5=92=8C=E5=96=9C?= =?UTF-8?q?=E6=89=91=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs index 901fe651f5..8b69f433df 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs @@ -245,7 +245,9 @@ namespace GameEditor.FrameTool static string[][] _SettingConfig = new string[][]{ new string[]{ "C轮测试v2", "mht_china/local", "cdn_v2", "china/dev-c" }, - new string[]{ "C轮测试v3", "mht_china/local", "cdn_v3", "china/dev-c" } + new string[]{ "C轮测试v3", "mht_china/local", "cdn_v3", "china/dev-c" }, + new string[]{ "喜扑", "mht_china/zf", "cdn_xipu", "china/zf_test" }, + new string[]{ "灵动-专服-测试", "mht_china/zf", "cdn_mht_zf_test", "china/zf_test" } }; static Dictionary _HotFixConfigDic = new Dictionary(); From ee8577248efe7795bbe2497501313f8a30fe0ded Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 11 Jun 2021 13:16:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E3=80=90=E7=83=AD=E6=9B=B4=E3=80=91?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=96=B0=20files=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs index 8b69f433df..133cdd62bf 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/HotFixWindow.cs @@ -481,6 +481,8 @@ namespace GameEditor.FrameTool File.Copy(fromPath + rf.fileName, toPath + rf.fileName, true); log.Add(rf.fileName); } + File.Copy(fromPath + UpdateConfigs.FILES, toPath + UpdateConfigs.FILES, true); + log.Add(UpdateConfigs.FILES); // write logf string logName = updateName.Replace("/", "$"); EditorUtility.DisplayProgressBar("正在生成Log文件:", logName, 1f); @@ -522,6 +524,8 @@ namespace GameEditor.FrameTool changeFile.Add(rf.fileName); log.Add(rf.fileName); } + changeFile.Add(UpdateConfigs.FILES); + log.Add(UpdateConfigs.FILES); // write ChangeList EditorUtility.DisplayProgressBar("正在生成文件变化列表", changeFileName, 1f); WriteLog(hfs.path_cdn_setting + "/__HotFixLog", changeFileName, changeFile.ToArray());