public ApolloHelper() { this.info = new ApolloInfo(ApolloConfig.QQAppID, ApolloConfig.WXAppID, ApolloConfig.maxMessageBufferSize, string.Empty); IApollo.Instance.Initialize(this.info); IApollo.Instance.SetApolloLogger(ApolloLogPriority.None, null); this.accountService = IApollo.Instance.GetAccountService(); this.payService = null; this.registerInfo = new RegisterInfo(); this.snsService = (IApollo.Instance.GetService(1) as IApolloSnsService); this.reportService = (IApollo.Instance.GetService(3) as IApolloReportService); this.quickLoginService = (IApollo.Instance.GetService(7) as IApolloQuickLoginService); this.m_IsSwitchToLoginPlatform = false; this.m_IsLoginEventHandlerRegistered = false; this.m_IsLoginReturn = false; this.CurPlatform = ApolloPlatform.None; this.m_LastOpenID = null; this.m_LastTriedPlatform = ApolloPlatform.None; this.m_IsLastTriedPlatformSet = false; this.IsLastLaunchFrom3rdAPP = false; if (File.Exists(Application.persistentDataPath + "/customOpenId.txt")) { this.IsNoneModeSupport = true; } else { this.IsNoneModeSupport = false; } HttpDnsPolicy.Init(); }
public void DealWithHttpDNS() { this.httpDns = HttpDnsPolicy.GetHostByName(this.ip); if (this.bIsUDP) { this.url = string.Format("lwip://{0}:{1}", this.httpDns, this.vPort); } else { this.url = string.Format("tcp://{0}:{1}", this.httpDns, this.vPort); } }
public static string GetHostByName(string domain) { IPAddress iPAddress; if (IPAddress.TryParse(domain, ref iPAddress)) { return(domain); } if (!MonoSingleton <TdirMgr> .GetInstance().isUseHttpDns) { return(domain); } string httpDnsIP = HttpDnsPolicy.GetHttpDnsIP(domain); if (string.IsNullOrEmpty(httpDnsIP)) { return(domain); } return(httpDnsIP); }