diff --git a/src/Plugin.Discord/Config.Designer.cs b/src/Plugin.Discord/Config.Designer.cs
index c7915f06..c8f3e102 100644
--- a/src/Plugin.Discord/Config.Designer.cs
+++ b/src/Plugin.Discord/Config.Designer.cs
@@ -25,7 +25,7 @@ namespace ServerManagerTool.Plugin.Discord {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("http://servermanager.azurewebsites.net/api/plugin/call/{0}/{1}/")]
+ [global::System.Configuration.DefaultSettingValueAttribute("http://servermanagers.azurewebsites.net/api/plugin/call/{0}/{1}/")]
public string PluginCallUrlFormat {
get {
return ((string)(this["PluginCallUrlFormat"]));
@@ -35,9 +35,9 @@ namespace ServerManagerTool.Plugin.Discord {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("12")]
- public int CallHomeDelay {
+ public int PluginCallUrlDelay {
get {
- return ((int)(this["CallHomeDelay"]));
+ return ((int)(this["PluginCallUrlDelay"]));
}
}
diff --git a/src/Plugin.Discord/Config.settings b/src/Plugin.Discord/Config.settings
index 3548315e..6d9cda9d 100644
--- a/src/Plugin.Discord/Config.settings
+++ b/src/Plugin.Discord/Config.settings
@@ -3,9 +3,9 @@
- http://servermanager.azurewebsites.net/api/plugin/call/{0}/{1}/
+ http://servermanagers.azurewebsites.net/api/plugin/call/{0}/{1}/
-
+
12
diff --git a/src/Plugin.Discord/DiscordPlugin.cs b/src/Plugin.Discord/DiscordPlugin.cs
index b11ea349..e7de1f35 100644
--- a/src/Plugin.Discord/DiscordPlugin.cs
+++ b/src/Plugin.Discord/DiscordPlugin.cs
@@ -89,18 +89,10 @@ namespace ServerManagerTool.Plugin.Discord
{
var publicIP = await NetworkUtils.DiscoverPublicIPAsync();
await NetworkUtils.PerformCallToAPIAsync(PluginCode, publicIP);
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordApiCalls.log");
- File.AppendAllLines(logFile, new[] { "CallHomeAsync successful" }, Encoding.Unicode);
-#endif
}
catch (Exception ex)
{
- Debug.WriteLine($"Failed calling home {ex.Message}");
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordErrors.log");
- File.AppendAllLines(logFile, new[] { $"Failed calling home {ex.Message}" }, Encoding.Unicode);
-#endif
+ Debug.WriteLine($"Failed calling home to API.\r\n{ex.Message}");
}
}
@@ -117,10 +109,6 @@ namespace ServerManagerTool.Plugin.Discord
&& !string.IsNullOrWhiteSpace(cp.DiscordWebhookUrl));
if (configProfiles == null || configProfiles.IsEmpty())
{
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordErrors.log");
- File.AppendAllLines(logFile, new[] { $"{alertType}; {profileName} - {alertMessage.Replace(Environment.NewLine, " ")} (No config profiles found)" }, Encoding.Unicode);
-#endif
return;
}
@@ -192,27 +180,15 @@ namespace ServerManagerTool.Plugin.Discord
if (httpResponse.StatusCode == HttpStatusCode.OK)
{
Debug.WriteLine($"{nameof(HandleAlert)}\r\nResponse: {responseString}");
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordSuccess.log");
- File.AppendAllLines(logFile, new[] { $"{alertType}; {profileName} - {alertMessage.Replace(Environment.NewLine, " ")} ({responseString})" }, Encoding.Unicode);
-#endif
}
else
{
Debug.WriteLine($"{nameof(HandleAlert)}\r\n{httpResponse.StatusCode}: {responseString}");
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordErrors.log");
- File.AppendAllLines(logFile, new[] { $"{alertType}; {profileName} - {alertMessage.Replace(Environment.NewLine, " ")} ({responseString})" }, Encoding.Unicode);
-#endif
}
}
catch (Exception ex)
{
Debug.WriteLine($"ERROR: {nameof(HandleAlert)}\r\n{ex.Message}");
-#if DEBUG
- var logFile = Path.Combine(PluginHelper.PluginFolder, "DiscordExceptions.log");
- File.AppendAllLines(logFile, new[] { $"{alertType}; {profileName} - {alertMessage.Replace(Environment.NewLine, " ")} ({ex.Message})" }, Encoding.Unicode);
-#endif
}
}
@@ -220,11 +196,11 @@ namespace ServerManagerTool.Plugin.Discord
{
LoadConfig();
- if (PluginConfig.LastCallHome.AddHours(Config.Default.CallHomeDelay) < DateTime.Now)
+ if (PluginConfig.PluginCallUrlLast.AddHours(Config.Default.PluginCallUrlDelay) < DateTime.Now)
{
- //CallHomeAsync().DoNotWait();
+ CallHomeAsync().DoNotWait();
- PluginConfig.LastCallHome = DateTime.Now;
+ PluginConfig.PluginCallUrlLast = DateTime.Now;
SaveConfig();
}
}
diff --git a/src/Plugin.Discord/Models/DiscordPluginConfig.cs b/src/Plugin.Discord/Models/DiscordPluginConfig.cs
index fbea383b..3b2531d4 100644
--- a/src/Plugin.Discord/Models/DiscordPluginConfig.cs
+++ b/src/Plugin.Discord/Models/DiscordPluginConfig.cs
@@ -9,12 +9,12 @@ namespace ServerManagerTool.Plugin.Discord
public DiscordPluginConfig()
: base()
{
- LastCallHome = DateTime.MinValue;
+ PluginCallUrlLast = DateTime.MinValue;
ConfigProfiles = new ObservableList();
}
[DataMember]
- public DateTime LastCallHome
+ public DateTime PluginCallUrlLast
{
get;
set;
diff --git a/src/Plugin.Discord/Utils/NetworkUtils.cs b/src/Plugin.Discord/Utils/NetworkUtils.cs
index 05acefcd..1a3a2b9b 100644
--- a/src/Plugin.Discord/Utils/NetworkUtils.cs
+++ b/src/Plugin.Discord/Utils/NetworkUtils.cs
@@ -90,7 +90,7 @@ namespace ServerManagerTool.Plugin.Discord
}
catch (Exception ex)
{
- Debug.WriteLine($"ERROR: {nameof(PerformCallToAPIAsync)} - {pluginCode}; {ipAddress}\r\n{ex.Message}");
+ Debug.WriteLine($"{nameof(PerformCallToAPIAsync)} - Failed calling API.\r\n{ex.Message}");
}
}
}
diff --git a/src/Plugin.Discord/VersionFeed.xml b/src/Plugin.Discord/VersionFeed.xml
index b41b1f32..b4f895a9 100644
--- a/src/Plugin.Discord/VersionFeed.xml
+++ b/src/Plugin.Discord/VersionFeed.xml
@@ -5,7 +5,30 @@
Discord Plugin Version Feed
This is the Discord Plugin release version feed.
- 2021-12-12T00:00:00Z
+ 2021-12-20T00:00:00Z
+
+
+ urn:uuid:F8987FDF-7A69-4E03-99D8-E04ADFFFF0BB
+ 1.0.20 (1.0.20.1)
+ 1.0.20.1
+
+ 2021-12-20T00:00:00Z
+
+
+
+ CHANGE
+
+
+ - Additional changes to config loading to prevent blanking the config file.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+
urn:uuid:A9EC2F32-E026-485F-BD7B-C657DBA95B54
diff --git a/src/Plugin.Discord/VersionFeedBeta.xml b/src/Plugin.Discord/VersionFeedBeta.xml
index 0ffd8b43..47057cba 100644
--- a/src/Plugin.Discord/VersionFeedBeta.xml
+++ b/src/Plugin.Discord/VersionFeedBeta.xml
@@ -5,120 +5,21 @@
Discord Plugin Version Feed
This is the Discord Plugin beta version feed.
- 2021-12-12T00:00:00Z
+ 2021-12-20T00:00:00Z
- urn:uuid:A0D7BFD2-F2F0-481A-A22D-3C193BFB4C99
- 1.0.19 (1.0.19.5)
- 1.0.19.5
+ urn:uuid:F8987FDF-7A69-4E03-99D8-E04ADFFFF0BB
+ 1.0.20 (1.0.20.1)
+ 1.0.20.1
- 2021-12-12T00:00:00Z
+ 2021-12-20T00:00:00Z
CHANGE
- - ru-RU Translation file updated.
-
-
-
-
-
- bletch
- bletch1971@hotmail.com
-
-
-
-
- urn:uuid:38A61493-CA4E-479E-A3FD-266565E83D90
- 1.0.19 (1.0.19.4)
- 1.0.19.4
-
- 2021-12-12T00:00:00Z
-
-
-
- CHANGE
-
-
- - ru-RU Translation file added.
-
-
-
-
-
- bletch
- bletch1971@hotmail.com
-
-
-
-
- urn:uuid:DDB25735-1D20-4580-B5FE-1AD4BD107376
- 1.0.19 (1.0.19.3)
- 1.0.19.3
-
- 2021-12-12T00:00:00Z
-
-
-
- CHANGE
-
-
- - fr-FR Translation file added.
- - pt-BR Translation file updated.
-
-
-
-
-
- bletch
- bletch1971@hotmail.com
-
-
-
-
- urn:uuid:FD4F56C3-9E44-4422-A761-87E7F957454F
- 1.0.19 (1.0.19.2)
- 1.0.19.2
-
- 2021-12-09T00:00:00Z
-
-
-
- CHANGE
-
-
- - Changed the plugin initialization so it throws an exception if unable to load config file, rather than creating a new config file.
-
-
-
-
-
- bletch
- bletch1971@hotmail.com
-
-
-
-
- urn:uuid:A9EC2F32-E026-485F-BD7B-C657DBA95B54
- 1.0.19 (1.0.19.1)
- 1.0.19.1
-
- 2021-12-09T00:00:00Z
-
-
-
- BUGFIX
-
-
- - Fixed alert test message to support globalization.
-
-
CHANGE
-
-
- - de-DE Translation file updated.
- - pt-BR Translation file updated.
+ - Additional changes to config loading to prevent blanking the config file.
diff --git a/src/Plugin.Discord/app.config b/src/Plugin.Discord/app.config
index 76682998..0f7fa26f 100644
--- a/src/Plugin.Discord/app.config
+++ b/src/Plugin.Discord/app.config
@@ -8,9 +8,9 @@
- http://servermanager.azurewebsites.net/api/plugin/call/{0}/{1}/
+ http://servermanagers.azurewebsites.net/api/plugin/call/{0}/{1}/
-
+
12