123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- internal class Config_URL
- {
- #region ' server '
- static Uri _appServerUrl;
- /// <summary>
- /// 服务器地址
- /// </summary>
- 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"
- };
- /// <summary>
- /// 服务器主机地址
- /// </summary>
- public static string Server_Host
- {
- get
- {
- var host = "ylsjtt.game7000.com"; // 测试服
- if (GlobalConfig.netType == eNetType.LAN)
- {
- host = "wanggang.com"; // 内网地址
- }
- return host;
- }
- }
- /// <summary>
- /// 模拟支付请求地址URL
- /// </summary>
- 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; }
- }
- /// <summary>
- /// 资源CDN服务器地址
- /// </summary>
- 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
- }
|