diff --git a/windows/WinUI/APIHandler.cs b/windows/WinUI/APIHandler.cs index ada7369a9..2968c963a 100644 --- a/windows/WinUI/APIHandler.cs +++ b/windows/WinUI/APIHandler.cs @@ -181,7 +181,7 @@ namespace WinUI using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var responseText = streamReader.ReadToEnd(); - + //Console.WriteLine(responseText); List peerList = null; try { diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml index b5365a371..660cbd9b8 100644 --- a/windows/WinUI/MainWindow.xaml +++ b/windows/WinUI/MainWindow.xaml @@ -19,7 +19,23 @@ + + + + + @@ -13,7 +20,7 @@ - + diff --git a/windows/WinUI/ZeroTierPeer.cs b/windows/WinUI/ZeroTierPeer.cs index 3153f7e26..06a8896ba 100644 --- a/windows/WinUI/ZeroTierPeer.cs +++ b/windows/WinUI/ZeroTierPeer.cs @@ -12,11 +12,43 @@ namespace WinUI [JsonProperty("address")] public string Address { get; set; } + private Int64 _lastUnicast; [JsonProperty("lastUnicastFrame")] - public UInt64 LastUnicastFrame { get; set; } + public Int64 LastUnicastFrame + { + get + { + if (_lastUnicast == 0) + return 0; + TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); + Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds; + return (millisecondsSinceEpoch - _lastUnicast) / 1000; + } + set + { + _lastUnicast = value; + } + } + + private Int64 _lastMulticast; [JsonProperty("lastMulticastFrame")] - public UInt64 LastMulticastFrame { get; set; } + public Int64 LastMulticastFrame + { + get + { + if (_lastMulticast == 0) + return 0; + + TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); + Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds; + return (millisecondsSinceEpoch - _lastMulticast) / 1000; + } + set + { + _lastMulticast = value; + } + } [JsonProperty("versionMajor")] public int VersionMajor { get; set; }