Эх сурвалжийг харах

Merge branch 'master' of https://e.coding.net/shenyou-gfg/gfgclient/client

zhaoyang 3 жил өмнө
parent
commit
588ece9d17

+ 3 - 0
GameClient/Assets/Editor/Bat/commitBundles.bat

@@ -0,0 +1,3 @@
+cd ../../../Bundles
+svn add . --force
+svn ci -m "¹«ÓûúÌá½»"

+ 7 - 0
GameClient/Assets/Editor/Bat/commitBundles.bat.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0921dce128c6bba4aa7e3dc48de55622
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 7
GameClient/Assets/Editor/Bat/commitGame.bat

@@ -13,10 +13,3 @@ git add .
 git commit -am "公用机提交"
 git pull
 git push
-
-cd GameClient/Bundles
-svn add . --force
-svn ci -m "公用机提交"
-
-echo 请检查是否有冲突,如有请联系程序!
-pause

+ 6 - 2
GameClient/Assets/Editor/Bat/updateGame.bat

@@ -2,9 +2,13 @@ cd ../../../Assets/Res
 svn up --force --accept tc
 
 cd ../../../
+git clean -df
+git reset --hard
+git status
 git pull
 
 cd GameClient/Assets/Game/CSShare
+git clean -df
+git reset --hard
+git status
 git pull
-
-pause

+ 26 - 2
GameClient/Assets/Editor/ToolsMenu.cs

@@ -2,6 +2,7 @@
 using GFGGame;
 using System;
 using System.IO;
+using System.Threading;
 using UnityEditor;
 using UnityEditor.Compilation;
 using UnityEngine;
@@ -31,6 +32,10 @@ namespace GFGEditor
             UpdateProject();
             UpdateAndImportArtRes();
             UpdateAndImportExcel();
+            if (CommitWhenRelease)
+            {
+                CommitProject();
+            }
         }
 
         [MenuItem("策划/更新并导入Excel", false, (int)TOOL_MENU_PRIORITY.UpdateAndImportExcel)]
@@ -38,6 +43,10 @@ namespace GFGEditor
         {
             UpdateExcel();
             ImportExcel();
+            if (CommitWhenRelease)
+            {
+                CommitProject();
+            }
         }
 
         [MenuItem("策划/更新并导入美术资源", false, (int)TOOL_MENU_PRIORITY.UpdateAndImportArtRes)]
@@ -45,6 +54,10 @@ namespace GFGEditor
         {
             UpdateArtRes();
             ImportArtRes();
+            if (CommitWhenRelease)
+            {
+                CommitProject();
+            }
         }
 
         [MenuItem("策划/更新至内网版本", false, (int)TOOL_MENU_PRIORITY.BuildBundlesRes)]
@@ -55,13 +68,16 @@ namespace GFGEditor
             EditorUtility.ClearProgressBar();
             if (CommitWhenRelease)
             {
-                CommitProject();
+                CommitBundles();
             }
         }
 
-        [MenuItem("策划/其它/更新项目", false, (int)TOOL_MENU_PRIORITY.UpdateProject)]
+        [MenuItem("策划/其它/更新项目(会丢弃未推送内容)", false, (int)TOOL_MENU_PRIORITY.UpdateProject)]
         static void UpdateProject()
         {
+            //关闭sqlite连接并延迟,否则sqlite文件会被占用导致不能通过命令行还原
+            SQLiteHelper.Instance.CloseConnection();
+            Thread.Sleep(1000);
             EditorUtility.DisplayProgressBar("进度", "正在更新项目", 1);
             ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "updateGame.bat");
             EditorUtility.ClearProgressBar();
@@ -93,6 +109,13 @@ namespace GFGEditor
             EditorUtility.ClearProgressBar();
         }
 
+        static void CommitBundles()
+        {
+            EditorUtility.DisplayProgressBar("进度", "正在提交Bundles", 1);
+            ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "commitBundles.bat");
+            EditorUtility.ClearProgressBar();
+        }
+
         [MenuItem("策划/其它/导入配置表", false, (int)TOOL_MENU_PRIORITY.ImportExcel)]
         public static void ImportExcel()
         {
@@ -133,6 +156,7 @@ namespace GFGEditor
             File.Copy(ResPathUtil.SQLITE_FILE_PATH, ExcelConfig.sqliteFilePathCSShare, true);
             AssetDatabase.Refresh();
             EditorUtility.ClearProgressBar();
+            SQLiteHelper.Instance.CloseConnection();
         }
 
         [MenuItem("策划/检查配置表", false, (int)TOOL_MENU_PRIORITY.CheckExcel)]

+ 17 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs

@@ -10,7 +10,23 @@ namespace ET
     {
         protected override async ETTask Run(Session session, A2C_Disconnect message)
         {
-            Alert.Show("你已被迫下线!");
+            switch(message.Error)
+            {
+                case ErrorCode.ERR_loginTimeOut:
+                    Alert.Show("登录超时,请重新登录!")
+                        .SetLeftButton(true, "返回登录", (obj) =>
+                        {
+                            GameController.QuitToLoginView(false);
+                        });
+                    break;
+                case ErrorCode.ERR_loginByOther:
+                case ErrorCode.ERR_OtherAccountLogin:
+                    Alert.Show("账号已在其他地方登录!");
+                    break;
+                default:
+                    Alert.Show("您已被迫下线!");
+                    break;
+            }
             await ETTask.CompletedTask;
         }
     }

+ 5 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/DisConnected/DisConnectedCompnentSystem.cs

@@ -10,7 +10,11 @@ namespace ET
     {
         public override void Destroy(DisConnectedCompnent self)
         {
-            Alert.Show("服务器连接已断开!");
+            Alert.Show("服务器连接已断开!")
+                .SetLeftButton(true, "返回登录",(obj) =>
+                {
+                    GameController.QuitToLoginView(false);
+                });
         }
     }
 

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes