1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using LitJson;
- namespace GFGGame
- {
- public class LauncherConfig
- {
- public enum EnumNetType { DEV, LOCAL, TEMP, TISHEN, PUBLIC }
- 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 static string VOICE_KEY = "voice";
- public static string SOUND_VOLUMN_KEY = "sound_volumn";
- public static string MUSIC_VOLUMN_KEY = "music_volumn";
- public static string VOICE_VOLUMN_KEY = "voice_volumn";
- public const string SQL_FILE_NAME = "excelConfig.sqlite.bytes";
- public const string LAST_LOGIN_IS_AGREE_KEY = "LAST_LOGIN_IS_AGREE_KEY_6";//上次登录是否同意隐私政策
- public static string CDN_ROOT;
- public static string loginApiUrl;
- public static string gameApiUrl;
- public static string launcherRootUrl;
- public static string cfgUrl;
- //平台id
- public static int platformId = 1;
- //渠道id
- public static int ChannelId = 101;
- 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 privacy_v;
- public static void InitScriptCompilation()
- {
- launcherRootUrl = "http://gfg1.obs.cn-north-4.myhuaweicloud.com/gameRes/";
- #if PT_DEV
- //外网dev版本
- netType = EnumNetType.PUBLIC;
- cfgName = "cfg_dev";
- #elif PT_TEMP
- netType = EnumNetType.PUBLIC;
- cfgName = "cfg_temp";
- #elif PT_IOS
- netType = EnumNetType.PUBLIC;
- cfgName = "cfg_ios_1";
- platformId = 2;
- ChannelId = (int)ChannelID.AppStore;
- #elif PT_TISHEN
- netType = EnumNetType.TISHEN;
- cfgName = "cfg_ts";
- #else
- netType = EnumNetType.LOCAL;
- cfgName = "cfg_local";
- launcherRootUrl = "http://10.108.64.189:81/";
- #endif
- cfgUrl = launcherRootUrl + "platform/{cfgName}.json";
- }
- public static void InitPlatform(string json)
- {
- var result = JsonMapper.ToObject<Result>(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;
- LauncherConfig.privacy_v = result.privacy_v;
- }
- private struct Result
- {
- public string cdnRoot;
- public string logApiUrl;
- public string apkVersion;
- public string serverStatus;
- public string onDebug;
- public string manifest_v;
- public string privacy_v;
- }
- }
- }
|