From d1dc6a64d94942b65d155e1581f32ab69939af45 Mon Sep 17 00:00:00 2001 From: MaxXor Date: Tue, 18 Aug 2015 07:33:35 +0200 Subject: [PATCH] Moved WanIp --- Client/Core/Commands/SystemHandler.cs | 2 +- Client/Core/Helper/GeoLocationHelper.cs | 10 ++++++---- Client/Core/SystemCore.cs | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Client/Core/Commands/SystemHandler.cs b/Client/Core/Commands/SystemHandler.cs index a02a4ab0..5a860fb1 100644 --- a/Client/Core/Commands/SystemHandler.cs +++ b/Client/Core/Commands/SystemHandler.cs @@ -383,7 +383,7 @@ namespace xClient.Core.Commands "LAN IP Address", SystemCore.GetLanIp(), "WAN IP Address", - SystemCore.WanIp, + GeoLocationHelper.GeoInfo.ip, "Antivirus", SystemCore.GetAntivirus(), "Firewall", diff --git a/Client/Core/Helper/GeoLocationHelper.cs b/Client/Core/Helper/GeoLocationHelper.cs index ae27b502..6a4c612e 100644 --- a/Client/Core/Helper/GeoLocationHelper.cs +++ b/Client/Core/Helper/GeoLocationHelper.cs @@ -76,6 +76,8 @@ namespace xClient.Core.Helper private static void TryLocate() { + LocationCompleted = false; + try { DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(GeoInformation)); @@ -100,7 +102,7 @@ namespace xClient.Core.Helper } } } - SystemCore.WanIp = GeoInfo.ip; + LastLocated = DateTime.UtcNow; LocationCompleted = true; } @@ -156,7 +158,7 @@ namespace xClient.Core.Helper } } } - SystemCore.WanIp = GeoInfo.ip; + LastLocated = DateTime.UtcNow; LocationCompleted = true; } @@ -169,7 +171,7 @@ namespace xClient.Core.Helper LocationCompleted = false; } - if (string.IsNullOrEmpty(SystemCore.WanIp)) + if (string.IsNullOrEmpty(GeoInfo.ip)) TryGetWanIp(); } @@ -199,7 +201,7 @@ namespace xClient.Core.Helper { } - SystemCore.WanIp = wanIp; + GeoInfo.ip = wanIp; } } diff --git a/Client/Core/SystemCore.cs b/Client/Core/SystemCore.cs index 254f203a..f356187c 100644 --- a/Client/Core/SystemCore.cs +++ b/Client/Core/SystemCore.cs @@ -42,7 +42,6 @@ namespace xClient.Core public static string OperatingSystem { get; set; } public static string MyPath { get; set; } public static string InstallPath { get; set; } - public static string WanIp { get; set; } public static string AccountType { get; set; } public static string GetOperatingSystem()