Browse Source

显示服务器时间

guodong 1 year ago
parent
commit
f28c5b9e95
1 changed files with 4 additions and 10 deletions
  1. 4 10
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

+ 4 - 10
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -219,16 +219,10 @@ namespace GFGGame
             }
 
             //StorageSProxy.ReqSetClientValue(1012, 4).Coroutine();
+
             // 临时设置内网显示时间
-            if (LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL)
-            {
-                _ui.m_serverTime.visible = true;
-                Timers.inst.AddUpdate(ServerTimeUpdate);
-            }
-            else
-            {
-                _ui.m_serverTime.visible = false;
-            }
+            _ui.m_serverTime.visible = true;
+            Timers.inst.AddUpdate(ServerTimeUpdate);
         }
 
         protected override void OnHide()
@@ -1210,7 +1204,7 @@ namespace GFGGame
         private void ServerTimeUpdate(object param = null)
         {
             long timestamp = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds;
-            if (Math.Abs(TimeHelper.ServerNow() - timestamp) >= 50000)
+            if (Math.Abs(TimeHelper.ServerNow() - timestamp) >= 60000)
             {
                 dateTime = unixStartTime.AddMilliseconds(TimeHelper.ServerNow());
                 _ui.m_serverTime.text = dateTime.ToString();