diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index 1b9a21f5..39657864 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -180,6 +180,9 @@ public object this[string propertyName] public decimal XmdsCollectionIntervalFactor() { + if (XmdsErrorCountSinceSuccessful == 0) + return 1; + return (XmdsErrorCountSinceSuccessful > 10) ? 5 : XmdsErrorCountSinceSuccessful / 2; } @@ -190,5 +193,8 @@ public void IncrementXmdsErrorCount() _xmdsErrorCountSinceSuccessful++; }; } + + // Settings HASH + public string Hash { get; set; } } } diff --git a/XiboClient.v11.suo b/XiboClient.v11.suo index fab00851..c1e504aa 100644 Binary files a/XiboClient.v11.suo and b/XiboClient.v11.suo differ diff --git a/XmdsAgents/RegisterAgent.cs b/XmdsAgents/RegisterAgent.cs index 6288625b..9b22cf03 100644 --- a/XmdsAgents/RegisterAgent.cs +++ b/XmdsAgents/RegisterAgent.cs @@ -111,12 +111,20 @@ public static string ProcessRegisterXml(string xml) { string message = ""; + // Work out if we need to do anything (have the settings changed since the last time) + string md5 = Hashes.MD5(xml); + try { // Load the result into an XML document XmlDocument result = new XmlDocument(); result.LoadXml(xml); + + // If the XML we received has not changed, then go no further. + if (ApplicationSettings.Default.Hash == md5) + return result.DocumentElement.Attributes["message"].Value; + // Test the XML if (result.DocumentElement.Attributes["code"].Value == "READY") { // Get the config element @@ -162,6 +170,8 @@ public static string ProcessRegisterXml(string xml) } } + // Store the MD5 hash and the save + ApplicationSettings.Default.Hash = md5; ApplicationSettings.Default.Save(); } else diff --git a/bin/x86/Release/Xibo.scr b/bin/x86/Release/Xibo.scr new file mode 100644 index 00000000..1c927212 Binary files /dev/null and b/bin/x86/Release/Xibo.scr differ diff --git a/bin/x86/Release/XiboClient.XmlSerializers.dll b/bin/x86/Release/XiboClient.XmlSerializers.dll index 50f6a34f..80af7c2d 100644 Binary files a/bin/x86/Release/XiboClient.XmlSerializers.dll and b/bin/x86/Release/XiboClient.XmlSerializers.dll differ diff --git a/bin/x86/Release/XiboClient.exe b/bin/x86/Release/XiboClient.exe index 3afb4fcd..1c927212 100644 Binary files a/bin/x86/Release/XiboClient.exe and b/bin/x86/Release/XiboClient.exe differ diff --git a/bin/x86/Release/XiboClient.pdb b/bin/x86/Release/XiboClient.pdb index f9cf2d78..93dad94e 100644 Binary files a/bin/x86/Release/XiboClient.pdb and b/bin/x86/Release/XiboClient.pdb differ