using System; internal class Config_URL { #region ' server ' static Uri _appServerUrl; /// /// 服务器地址 /// public static string Server_URL { get { if (null == _appServerUrl) { var path = "/Gameserver/Amfphp/"; _appServerUrl = new UriBuilder(http_or_s, Server_Host, -1, RootPath + path).Uri; } return _appServerUrl.ToString(); } } private readonly static string http_or_s= GlobalConfig.netType == eNetType.LAN ? "http" : "https"; private readonly static string RootPath = GlobalConfig.netType switch { eNetType.TestOnline => "/TTTTTT", eNetType.T2Online => "/t2", eNetType.Online_dev => "/ylsj2019_dev", _ => "/ylsj2019" }; /// /// 服务器主机地址 /// public static string Server_Host { get { var host = "ylsjtt.game7000.com"; // 测试服 if (GlobalConfig.netType == eNetType.LAN) { host = "wanggang.com"; // 内网地址 } return host; } } /// /// 模拟支付请求地址URL /// public static string ImitatePayUrl => new UriBuilder(http_or_s, Server_Host, -1,RootPath+ "/Gameserver/Amfphp/service_call/pay/official/imitate/pay.php").Uri.ToString(); #endregion #region ' CDN ' static Uri _appCDNUrl; public static string CDN_Host { get { return Server_Host; } } /// /// 资源CDN服务器地址 /// public static string CND_CheckURL { get { if (null == _appCDNUrl) { string method = GlobalConfig.netType == eNetType.LAN ? "http" : "https"; string path = "/Gameserver/Amfphp/service_call/InquireApi/CheckUpdate.php"; string root = GlobalConfig.netType switch { eNetType.TestOnline => "/TTTTTT", eNetType.T2Online => "/t2", eNetType.Online_dev => "/ylsj2019_dev", _ => "/ylsj2019" }; _appCDNUrl = new UriBuilder(method, CDN_Host, -1, root + path).Uri; } return _appCDNUrl.ToString(); } } #endregion }