Inventory logger

This commit is contained in:
erik 2025-05-12 20:27:00 +02:00
parent 29fba4b7cb
commit de2057789a
41 changed files with 12834 additions and 171 deletions

View file

@ -29,10 +29,13 @@ namespace MosswartMassacre
public static string CharTag { get; set; } = "";
public static bool TelemetryEnabled { get; set; } = false;
public bool WebSocketEnabled { get; set; } = false;
public bool InventoryLogEnabled { get; set; } = false;
private MossyInventory _inventoryLogger;
private static Queue<string> rareMessageQueue = new Queue<string>();
private static DateTime _lastSent = DateTime.MinValue;
private static readonly Queue<string> _chatQueue = new Queue<string>();
private InventoryMonitor _inv;
protected override void Startup()
{
@ -64,7 +67,11 @@ namespace MosswartMassacre
vTank.Enable();
//lyssna på commands
WebSocket.OnServerCommand += HandleServerCommand;
_inv = new InventoryMonitor();
//starta inventory. Hanterar subscriptions i den med
_inventoryLogger = new MossyInventory();
}
catch (Exception ex)
{
@ -103,7 +110,8 @@ namespace MosswartMassacre
// sluta lyssna på commands
WebSocket.OnServerCommand -= HandleServerCommand;
WebSocket.Stop();
_inv?.Dispose();
//shutdown inv
_inventoryLogger.Dispose();
MyHost = null;
}
@ -132,6 +140,7 @@ namespace MosswartMassacre
WebSocket.Start();
}
private async void OnSpawn(object sender, CreateObjectEventArgs e)
{