瀏覽代碼

维护提示优化

guodong 1 年之前
父節點
當前提交
e82dd9125b

+ 0 - 8
GameClient/Assets/Game/HotUpdate/GameConfig.cs

@@ -24,9 +24,6 @@ namespace GFGGame
         //兑换码
         public static int hCode;
 
-        //0 正常,1 维护中
-        public static int serverStatus;
-        public static string statusPrompt;
 
 
         public static void InitData(string json)
@@ -53,11 +50,6 @@ namespace GFGGame
             {
                 hCode = int.Parse(result.hCode);
             }
-            if (!string.IsNullOrEmpty(result.serverStatus))
-            {
-                serverStatus = int.Parse(result.serverStatus);
-            }
-            statusPrompt = result.statusPrompt;
             GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "ReportGet";
         }
 

+ 10 - 9
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -3,6 +3,7 @@ using FairyGUI;
 using UI.Login;
 using ET;
 using GFGGame.Launcher;
+using System;
 
 namespace GFGGame
 {
@@ -196,19 +197,18 @@ namespace GFGGame
 
         private void TryLogin()
         {
-            var url = LauncherConfig.cfgUrl.Replace("{cfgName}", GameGlobal.cfgName);
-            url = url + "?t=" + TimeHelper.ClientNow();
-            HttpTool.Instance.Get(url, (string data) =>
+            var url = LauncherConfig.cfgUrl.Replace("{cfgName}", LauncherConfig.cfgName);
+            url = url + "?t=" + DateTime.Now.Ticks;
+            HttpTool.Instance.Get(url, (string json) =>
             {
-                //重新加载游戏配置
-                GameConfig.InitData(data);
-                if (GameConfig.serverStatus == 1)
+                LauncherConfig.InitPlatform(json);
+                if (LauncherConfig.serverStatus == 1)
                 {
-                    if (string.IsNullOrEmpty(GameConfig.statusPrompt))
+                    if (string.IsNullOrEmpty(LauncherConfig.statusPrompt))
                     {
-                        GameConfig.statusPrompt = "游戏正在更新维护中,请稍后再试。";
+                        LauncherConfig.statusPrompt = "游戏正在更新维护中,请稍后再试。";
                     }
-                    AlertSystem.Show(GameConfig.statusPrompt)
+                    AlertSystem.Show(LauncherConfig.statusPrompt)
                         .SetLeftButton(true, "知道了", (data) =>
                         {
                             Application.Quit();
@@ -230,6 +230,7 @@ namespace GFGGame
                     LoginController.GetRoles().Coroutine();
                 }
             });
+
         }
 
         private void ResetLoginButton()