diff --git a/MosswartMassacre/PluginCore.cs b/MosswartMassacre/PluginCore.cs index bbd640a..e99459c 100644 --- a/MosswartMassacre/PluginCore.cs +++ b/MosswartMassacre/PluginCore.cs @@ -66,6 +66,7 @@ namespace MosswartMassacre private static Timer vitalsTimer; private static System.Windows.Forms.Timer commandTimer; private static Timer characterStatsTimer; + private static Timer _updateCheckTimer; private static readonly Queue pendingCommands = new Queue(); private static RareTracker _staticRareTracker; public static bool RareMetaEnabled @@ -198,6 +199,12 @@ namespace MosswartMassacre commandTimer.Dispose(); commandTimer = null; } + if (_updateCheckTimer != null) + { + _updateCheckTimer.Stop(); + _updateCheckTimer.Dispose(); + _updateCheckTimer = null; + } // Initialize kill tracker (owns the 1-sec stats timer) _killTracker = new KillTracker( @@ -296,6 +303,17 @@ namespace MosswartMassacre } } + // Auto-update: check for updates 30s after startup + _updateCheckTimer = new Timer(30000); + _updateCheckTimer.AutoReset = false; + _updateCheckTimer.Elapsed += (s, ev) => + { + Task.Run(() => UpdateManager.CheckAndInstallAsync()); + _updateCheckTimer?.Dispose(); + _updateCheckTimer = null; + }; + _updateCheckTimer.Start(); + } catch (Exception ex) { @@ -361,6 +379,13 @@ namespace MosswartMassacre characterStatsTimer = null; } + if (_updateCheckTimer != null) + { + _updateCheckTimer.Stop(); + _updateCheckTimer.Dispose(); + _updateCheckTimer = null; + } + // Dispose quest manager if (questManager != null) { diff --git a/MosswartMassacre/bin/Release/MosswartMassacre.dll b/MosswartMassacre/bin/Release/MosswartMassacre.dll index 5e74667..57cb89b 100644 Binary files a/MosswartMassacre/bin/Release/MosswartMassacre.dll and b/MosswartMassacre/bin/Release/MosswartMassacre.dll differ