private static Default CreateClientFromSN(int sn) { if (sn <= 0) { return(null); } Default @default = Authenticator.CreateClient(); if (Config.Authenticator.Soap.UseSingleHost) { @default.Url = @default.Url.Replace("sso.nexon.com", Config.Authenticator.Soap.Host); if (Config.Authenticator.Soap.HostProxy.Length > 0) { @default.Proxy = new WebProxy(Config.Authenticator.Soap.HostProxy); } } else { byte index = Utility.ComputeHash(sn); @default.Url = @default.Url.Replace("sso.nexon.com", Config.Authenticator.Servers[(int)index].Host + "." + Config.Authenticator.Soap.Domain); if (Config.Authenticator.Soap.UseIP) { @default.Proxy = new WebProxy(Config.Authenticator.Servers[(int)index].IP); } } return(@default); }
private static Default CreateClientFromPassport(string passport) { Default @default = Authenticator.CreateClient(); if (Config.Authenticator.Soap.UseSingleHost) { @default.Url = @default.Url.Replace("sso.nexon.com", Config.Authenticator.Soap.Host); if (Config.Authenticator.Soap.HostProxy.Length > 0) { @default.Proxy = new WebProxy(Config.Authenticator.Soap.HostProxy); } } else { string hostFromPassport = Authenticator.GetHostFromPassport(passport); @default.Url = @default.Url.Replace("sso.nexon.com", hostFromPassport + "." + Config.Authenticator.Soap.Domain); if (Config.Authenticator.Soap.UseIP) { @default.Proxy = new WebProxy(Config.Authenticator.Servers[hostFromPassport].IP); } } return(@default); }