Added Timezon to geolocation fallback

This commit is contained in:
MaxXor 2015-09-15 22:25:24 +02:00
parent 31232720c0
commit 41ece996b9
1 changed files with 6 additions and 0 deletions

View File

@ -139,6 +139,7 @@ namespace xClient.Core.Helper
string xmlCountryCode = doc.SelectSingleNode("Response//CountryCode").InnerXml; string xmlCountryCode = doc.SelectSingleNode("Response//CountryCode").InnerXml;
string xmlRegion = doc.SelectSingleNode("Response//RegionName").InnerXml; string xmlRegion = doc.SelectSingleNode("Response//RegionName").InnerXml;
string xmlCity = doc.SelectSingleNode("Response//City").InnerXml; string xmlCity = doc.SelectSingleNode("Response//City").InnerXml;
string timeZone = doc.SelectSingleNode("Response//TimeZone").InnerXml;
GeoInfo.ip = (!string.IsNullOrEmpty(xmlIp)) GeoInfo.ip = (!string.IsNullOrEmpty(xmlIp))
? xmlIp ? xmlIp
@ -155,6 +156,11 @@ namespace xClient.Core.Helper
GeoInfo.city = (!string.IsNullOrEmpty(xmlCity)) GeoInfo.city = (!string.IsNullOrEmpty(xmlCity))
? xmlCity ? xmlCity
: "Unknown"; : "Unknown";
GeoInfo.timezone = (!string.IsNullOrEmpty(timeZone))
? timeZone
: "Unknown";
GeoInfo.isp = "Unknown"; // freegeoip does not support ISP detection
} }
} }
} }