using LitJson; namespace GFGGame { public class LauncherConfig { public enum EnumNetType { DEV, LOCAL, TEMP, TISHEN } public static EnumNetType netType = EnumNetType.LOCAL; public static string cfgName; //热更代码存放位置 public const string DllDirHotfix = "Assets/ResIn/Dll/Update/"; public const string DllDirAOT = "Assets/ResIn/Dll/AOT/"; public const int HTTP_GET_TIME_OUT = 3; public const int HTTP_POST_TIME_OUT = 15; public static string SOUND_KEY = "sound"; public static string MUSIC_KEY = "music"; public const string SQL_FILE_NAME = "excelConfig.sqlite.bytes"; public static string CDN_ROOT; public static string loginApiUrl; public static string gameApiUrl; public static string cfgUrl; //平台id public static int platformId = 1; //渠道id public static int ChannelId = 1; public static string logApiRootUrl; public static string logApiReportLauncherUrl; public static string apkVersion; public static int serverStatus; public static int onDebug; public static string manifest_v; public static string resKey { get { #if PT_TEMP || PT_TISHEN || PT_DEV return "dfs"; #else return null; #endif } } public static void InitScriptCompilation() { #if PT_DEV //外网dev版本 netType = EnumNetType.DEV; cfgName = "cfg_dev"; #elif PT_TEMP netType = EnumNetType.TEMP; cfgName = "cfg_temp"; #elif PT_TISHEN netType = EnumNetType.TISHEN; cfgName = "cfg_ts"; #else netType = EnumNetType.LOCAL; cfgName = "cfg_local"; #endif #if QD_TAPTAP ChannelId = 1; #elif QD_HYKB ChannelId = 2; #elif QD_BILIBILI ChannelId = 3; #else ChannelId = 101; #endif if (cfgName == "cfg_local") { cfgUrl = "http://10.108.64.189:81/platform/{cfgName}.json"; } else { cfgUrl = "http://gfg1.obs.cn-north-4.myhuaweicloud.com/14/platform/{cfgName}.json"; } } public static void InitPlatform(string json) { var result = JsonMapper.ToObject(json); LauncherConfig.CDN_ROOT = result.cdnRoot; // CDN_ROOT = "http://10.108.64.143/"; LauncherConfig.logApiRootUrl = result.logApiUrl; //LauncherConfig.logApiRootUrl = "http://10.108.64.106:8080/api/Log/"; LauncherConfig.logApiReportLauncherUrl = LauncherConfig.logApiRootUrl + "ReportNode"; LauncherConfig.apkVersion = result.apkVersion; LauncherConfig.serverStatus = int.Parse(result.serverStatus); LauncherConfig.onDebug = int.Parse(result.onDebug); LauncherConfig.manifest_v = result.manifest_v; } private struct Result { public string cdnRoot; public string logApiUrl; public string logKey; public string apkVersion; public string serverStatus; public string platformId; public string onDebug; public string manifest_v; } } }