|
@@ -7,7 +7,7 @@ using Newtonsoft.Json;
|
|
|
|
|
|
namespace WinUI
|
|
|
{
|
|
|
- public class ZeroTierPeer
|
|
|
+ public class ZeroTierPeer : IEquatable<ZeroTierPeer>
|
|
|
{
|
|
|
[JsonProperty("address")]
|
|
|
public string Address { get; set; }
|
|
@@ -57,7 +57,7 @@ namespace WinUI
|
|
|
public int VersionMinor { get; set; }
|
|
|
|
|
|
[JsonProperty("versionRev")]
|
|
|
- public int Versionrev { get; set; }
|
|
|
+ public int VersionRev { get; set; }
|
|
|
|
|
|
[JsonProperty("version")]
|
|
|
public string Version { get; set; }
|
|
@@ -94,5 +94,23 @@ namespace WinUI
|
|
|
return pathStr;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public bool Equals(ZeroTierPeer other)
|
|
|
+ {
|
|
|
+ return this.Address.Equals(other.Address, StringComparison.InvariantCultureIgnoreCase);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Update(ZeroTierPeer other)
|
|
|
+ {
|
|
|
+ _lastUnicast = other._lastUnicast;
|
|
|
+ _lastMulticast = other._lastMulticast;
|
|
|
+ VersionMajor = other.VersionMajor;
|
|
|
+ VersionMinor = other.VersionMinor;
|
|
|
+ VersionRev = other.VersionRev;
|
|
|
+ Version = other.Version;
|
|
|
+ Latency = other.Latency;
|
|
|
+ Role = other.Role;
|
|
|
+ Paths = other.Paths;
|
|
|
+ }
|
|
|
}
|
|
|
}
|