AcManager.Tools.Helpers.Api.KunosApiProvider.TryToGetInformation C# (CSharp) Метод

TryToGetInformation() приватный Метод

private TryToGetInformation ( string ip, int port ) : ServerInformation
ip string
port int
Результат AcManager.Tools.Helpers.Api.Kunos.ServerInformation
        public static ServerInformation TryToGetInformation(string ip, int port) {
            if (SteamIdHelper.Instance.Value == null) throw new InformativeException(ToolsStrings.Common_SteamIdIsMissing);

            while (ServerUri != null) {
                var requestUri = $"http://{ServerUri}/lobby.ashx/single?ip={ip}&port={port}&guid={SteamIdHelper.Instance.Value}";
                try {
                    var result = JsonConvert.DeserializeObject<ServerInformation>(Load(requestUri));
                    if (result.Ip == string.Empty) {
                        result.Ip = ip;
                    }
                    return result;
                } catch (WebException e) {
                    Logging.Warning($"Cannot get server information: {requestUri}, {e.Message}");
                } catch (Exception e) {
                    Logging.Warning($"Cannot get server information: {requestUri}\n{e}");
                }

                NextServer();
            }

            return null;
        }