GameConfig.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using ET;
  3. using LitJson;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class GameConfig
  8. {
  9. public static string LoginAddress;
  10. public static string PlatformName;
  11. public static string logApiReportUrl;
  12. public static int showGM;
  13. //开服时间
  14. public static long openTime = 0;
  15. public static void InitData(string json)
  16. {
  17. ET.Log.Debug($"gamecfg \n{json}");
  18. var result = JsonMapper.ToObject<Result>(json);
  19. LoginAddress = result.loginApiUrl;
  20. // LoginAddress = "http://login.gfg.com:10005";
  21. //LoginAddress = "127.0.0.1:10005";//测试地址
  22. PlatformName = result.platformName;
  23. showGM = int.Parse(result.showGM);
  24. if(!string.IsNullOrEmpty(result.openTime))
  25. {
  26. openTime = TimeUtil.GetTimestamp(result.openTime);
  27. }
  28. GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "ReportGet";
  29. }
  30. private struct Result
  31. {
  32. public string loginApiUrl;
  33. public string platformName;
  34. public string showGM;
  35. public string openTime;
  36. }
  37. }
  38. }