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;
}