Added /mm sendinventory

This commit is contained in:
erik 2025-06-22 16:56:44 +02:00
parent ab425a04cc
commit e9a113abdd
8 changed files with 443 additions and 2 deletions

View file

@ -104,6 +104,11 @@ namespace MosswartMassacre
{
Views.VVSTabbedMainView.RefreshSettingsFromConfig();
}
public static void RefreshUpdateStatus()
{
Views.VVSTabbedMainView.RefreshUpdateStatus();
}
}
public static bool RemoteCommandsEnabled { get; set; } = false;
public static bool HttpServerEnabled { get; set; } = false;
@ -227,7 +232,9 @@ namespace MosswartMassacre
PluginSettings.Save();
if (TelemetryEnabled)
Telemetry.Stop(); // ensure no dangling timer / HttpClient
WriteToChat("Mosswart Massacre is shutting down!!!!!");
WriteToChat("Mosswart Massacre is shutting down. Bye!");
// Unsubscribe from chat message event
CoreManager.Current.ChatBoxMessage -= new EventHandler<ChatTextInterceptEventArgs>(OnChatText);
@ -1278,6 +1285,10 @@ namespace MosswartMassacre
WriteToChat("/mm testtaper - Test cached Prismatic Taper tracking");
WriteToChat("/mm debugtaper - Show detailed taper tracking debug info");
WriteToChat("/mm gui - Manually initialize/reinitialize GUI!!!");
WriteToChat("/mm checkforupdate - Check for plugin updates");
WriteToChat("/mm update - Download and install update (if available)");
WriteToChat("/mm debugupdate - Debug update UI controls");
WriteToChat("/mm sendinventory - Force inventory upload with ID requests");
break;
case "report":
TimeSpan elapsed = DateTime.Now - statsStartTime;
@ -1655,6 +1666,46 @@ namespace MosswartMassacre
}
break;
case "checkforupdate":
// Run the update check asynchronously
Task.Run(async () =>
{
await UpdateManager.CheckForUpdateAsync();
// Update UI if available
try
{
ViewManager.RefreshUpdateStatus();
}
catch (Exception ex)
{
WriteToChat($"Error refreshing UI: {ex.Message}");
}
});
break;
case "update":
// Run the update installation asynchronously
Task.Run(async () =>
{
await UpdateManager.DownloadAndInstallUpdateAsync();
});
break;
case "debugupdate":
Views.VVSTabbedMainView.DebugUpdateControls();
break;
case "sendinventory":
// Force inventory upload with ID requests
if (_inventoryLogger != null)
{
_inventoryLogger.ForceInventoryUpload();
}
else
{
WriteToChat("[INV] Inventory system not initialized");
}
break;
default:
WriteToChat($"Unknown /mm command: {subCommand}. Try /mm help");