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

Merge branch 'master' of http://git.gfggame.com:3000/gfg/client

zhaoyang 3 жил өмнө
parent
commit
0486a04a9a

+ 5 - 2
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -130,8 +130,11 @@ namespace GFGGame
             GameGlobal.userId = 0;
             GameGlobal.userAge = 0;
             GameGlobal.skipGuide = false;
-            GameGlobal.myUnit.Dispose();
-            GameGlobal.myUnit = null;
+            if(GameGlobal.myUnit != null)
+            {
+                GameGlobal.myUnit.Dispose();
+                GameGlobal.myUnit = null;
+            }
             RoleDataHandler.StopUpdate();
             CardDataManager.Clear();
             DecomposeDataManager.Instance.Clear();

+ 0 - 16
GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs

@@ -1,18 +1,12 @@
 using ET;
 using FairyGUI;
-using static UnityEngine.UI.CanvasScaler;
 
 namespace GFGGame
 {
     public class RoleDataHandler
     {
-        //单位秒
-        private const int INTERVAL_HEARTBEAT = 20;
-        private static int _heartbeatCDEnd = 0;
         public static void StartUpdate()
         {
-            int currentTimeSecs = (int)(Game.TimeInfo.ServerNow() / 1000);
-            _heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
             StopUpdate();
             //每秒检测
             Timers.inst.Add(1, 0, OnUpdate);
@@ -36,20 +30,10 @@ namespace GFGGame
                     NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene, NumericType.Power).Coroutine();
                 }
             }
-            if (currentTimeSecs >= _heartbeatCDEnd)
-            {
-                //GameProxy.ReqUpdateTime();
-                _heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
-            }
             int dailyResetSecs = GameGlobal.myNumericComponent.GetAsInt(NumericType.DailyResetSecs);
             if (TimeHelper.ServerNowSecs >= dailyResetSecs)
             {
                 CommonSProxy.ResetDailyData().Coroutine();
-                RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
-                RechargeSProxy.ReqExchangeInfo().Coroutine();
-                DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
-                SuitFosterProxy.SendGetSuitInfos().Coroutine();
-                FieldSProxy.ReqFieldInstanceInfos().Coroutine();
             }
         }
 

+ 5 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/CommonSProxy.cs

@@ -39,6 +39,11 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
+                    RechargeSProxy.ReqExchangeInfo().Coroutine();
+                    DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
+                    SuitFosterProxy.SendGetSuitInfos().Coroutine();
+                    FieldSProxy.ReqFieldInstanceInfos().Coroutine();
                     PromptController.Instance.ShowFloatTextPrompt("每日次数已重置", MessageType.SUCCESS);
                 }
             }

+ 17 - 1
GameClient/Assets/Game/Launcher/GameLauncher.cs

@@ -51,10 +51,26 @@ public class GameLauncher : MonoBehaviour
             LauncherView.Instance.SetDesc("正在初始化...");
             //第一个节点必须放在平台配置加载之后
             LogServerHelperHttp.SendNodeLog((int)LogNode.OnStart);
-            CheckApkVersion();
+            CheckGameStatus();
         });
     }
 
+    public void CheckGameStatus()
+    {
+        if(LauncherConfig.serverStatus == 1)
+        {
+            Alert.Show("游戏正在维护中,请稍后再试。")
+                .SetLeftButton(true, "知道了", (data) => {
+
+                    Application.Quit();
+                });
+        }
+        else
+        {
+            CheckApkVersion();
+        }
+    }
+
     private void CheckApkVersion()
     {
         LauncherView.Instance.SetDesc("正在校验应用版本...");

+ 6 - 1
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -1,5 +1,4 @@
 using LitJson;
-using UnityEngine;
 
 namespace GFGGame
 {
@@ -25,6 +24,7 @@ namespace GFGGame
         public static string logKey;
         public static string logApiUrl;
         public static string apkVersion;
+        public static int serverStatus;
 
         public static string resKey
         {
@@ -65,6 +65,9 @@ namespace GFGGame
             LauncherConfig.logApiUrl = result.logApiUrl;
             LauncherConfig.logKey = result.logKey;
             LauncherConfig.apkVersion = result.apkVersion;
+            LauncherConfig.serverStatus = int.Parse(result.serverStatus);
+            LauncherConfig.platformId = int.Parse(result.platformId);
+            ET.Log.Debug($"platformId {LauncherConfig.platformId}");
         }
 
         private struct Result
@@ -74,6 +77,8 @@ namespace GFGGame
             public string logApiUrl;
             public string logKey;
             public string apkVersion;
+            public string serverStatus;
+            public string platformId;
         }
 
     }