1
0

3 Ревизии f90b585e70 ... 71c3da3b36

Автор SHA1 Съобщение Дата
  DESKTOP-5BUCSUT\LSR 71c3da3b36 Merge branch 'main' of http://139.155.244.27:822/LSR/gouhuo преди 1 година
  DESKTOP-5BUCSUT\LSR 7a2041e74f 白名单请求修改 преди 1 година
  DESKTOP-5BUCSUT\LSR 8723820826 1 преди 1 година

+ 27 - 1
SFGgouhuo/Assets/Scripts/Manager/GameManager.cs

@@ -1,6 +1,9 @@
+using Assets;
+using LitJson;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.Networking;
 using UnityEngine.SceneManagement;
 using YooAsset;
 
@@ -14,6 +17,11 @@ public class GameManager : MonoBehaviour
     private YooAssetManager m_YooAssetManager;
     private CharacterManager m_CharacterManager;
     private StepManager m_StepManager;
+    public WhiteList whiteList;
+    /// <summary>
+    /// °×Ãûµ¥URL
+    /// </summary>
+    string urlWhiteList = "https://sfgdemo-1303083714.cos.ap-hongkong.myqcloud.com/WhiteList.json";
     private async void Awake()
     {
         Debug.Log("½øÈëGameManager");
@@ -31,8 +39,26 @@ public class GameManager : MonoBehaviour
         m_AudioManager = gameObject.AddComponent<AudioManager>();
         m_CharacterManager = gameObject.AddComponent<CharacterManager>();
         m_StepManager= gameObject.AddComponent<StepManager>();
+        StartCoroutine(GetWhiteList());
+    }
+    /// <summary>
+    /// ÇëÇó°×Ãûµ¥
+    /// </summary>
+    /// <returns></returns>
+    IEnumerator GetWhiteList()
+    {
+        UnityWebRequest request = UnityWebRequest.Get(urlWhiteList);
+        yield return request.SendWebRequest();
+        if (request.result == UnityWebRequest.Result.Success)
+        {
+            whiteList = JsonMapper.ToObject<WhiteList>(request.downloadHandler.text);
+            StepManager.timeStamp = whiteList.TimeStamp;
+        }
+        else
+        {
+            Debug.Log(request.error);
+        }
 
     }
-   
     public GameManager GetGameManager() { return this; }
 }

+ 3 - 2
SFGgouhuo/Assets/Scripts/TimeCounting.cs

@@ -11,7 +11,7 @@ public class TimeCounting : MonoBehaviour
     public List<GameObject> tempNum;
     public List<Transform> pos;
     public GameObject door;
-    private long finishTime = 1705644720;
+    private long finishTime;
     private long nowTime;
     private double sum;
     private int hours;
@@ -24,7 +24,8 @@ public class TimeCounting : MonoBehaviour
         //TimeSpan st = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0);//»ñȡʱ¼ä´Á
         //nowTime = (long)st.TotalMilliseconds;
         //sum = finishTime - nowTime;
-
+        Debug.Log(StepManager.timeStamp);
+        finishTime = long.Parse(StepManager.timeStamp);
         nowTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
         sum = finishTime - nowTime;
     }

+ 1 - 1
SFGgouhuo/Assets/Scripts/UI/Component/MainPanel.cs

@@ -15,7 +15,7 @@ public class MainPanel : BasePanel
     public Button LanguageButton;
     public Button ExitBtn;
     public Image HashImage;
-    public TextMeshPro HashText;
+    public TextMeshProUGUI HashText;
 
     private void Awake()
     {

+ 3 - 3
SFGgouhuo/Assets/Scripts/UI/Loading/DlgLogin.cs

@@ -22,7 +22,7 @@ namespace Assets
         /// <summary>
         /// 白名单URL
         /// </summary>
-        string urlWhiteList = "http://172.18.10.22/WhiteList.json";
+        string urlWhiteList = "https://sfgdemo-1303083714.cos.ap-hongkong.myqcloud.com/WhiteList.json";
         /// <summary>
         /// 是否验证Mac地址
         /// </summary>
@@ -39,7 +39,7 @@ namespace Assets
         public override void OnInitWindow()
         {
             GetMacAddress();
-            StartCoroutine(GetWhiteList());
+            whiteList = GameManager.Instance.whiteList;
             confirmBtn.onClick.AddListener(async () =>
             {
                 if (isVerify)
@@ -237,7 +237,7 @@ namespace Assets
     /// <summary>
     /// 白名单数据
     /// </summary>
-    struct WhiteList
+    public struct WhiteList
     {
         public string[] table;
         public string TimeStamp;