diff --git a/LightlessSync/FileCache/CacheMonitor.cs b/LightlessSync/FileCache/CacheMonitor.cs index 3b41d85..ac4017d 100644 --- a/LightlessSync/FileCache/CacheMonitor.cs +++ b/LightlessSync/FileCache/CacheMonitor.cs @@ -150,7 +150,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase private void LightlessWatcher_FileChanged(object sender, FileSystemEventArgs e) { - Logger.LogTrace("Lightless FSW: FileChanged: {change} => {path}", e.ChangeType, e.FullPath); + Logger.LogInformation("Lightless FSW: FileChanged: {change} => {path}", e.ChangeType, e.FullPath); if (!AllowedFileExtensions.Any(ext => e.FullPath.EndsWith(ext, StringComparison.OrdinalIgnoreCase))) return; @@ -350,6 +350,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase public void InvokeScan() { + Logger.LogInformation("InvokeScan called"); TotalFiles = 0; _currentFileProgress = 0; _scanCancellationTokenSource = _scanCancellationTokenSource?.CancelRecreate() ?? new CancellationTokenSource(); @@ -388,6 +389,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase TotalFiles = 0; _currentFileProgress = 0; }, token); + Logger.LogInformation("InvokeScan finished"); } public void RecalculateFileCacheSize(CancellationToken token) diff --git a/LightlessSync/FileCache/FileCacheManager.cs b/LightlessSync/FileCache/FileCacheManager.cs index ed57656..1ba0a0a 100644 --- a/LightlessSync/FileCache/FileCacheManager.cs +++ b/LightlessSync/FileCache/FileCacheManager.cs @@ -152,6 +152,7 @@ public sealed class FileCacheManager : IHostedService _logger.LogTrace("Creating cache entry for {path}", path); var cacheFolder = _configService.Current.CacheFolder; if (string.IsNullOrEmpty(cacheFolder)) return null; + _logger.LogInformation("CreateCacheEntry finished for {path}", path); return CreateFileEntity(cacheFolder, CachePrefix, fi); } @@ -309,6 +310,8 @@ public sealed class FileCacheManager : IHostedService public Dictionary GetFileCachesByPaths(string[] paths) { + _logger.LogInformation("GetFileCachesByPaths called for {count} paths", paths.Length); + _getCachesByPathsSemaphore.Wait(); try @@ -365,6 +368,8 @@ public sealed class FileCacheManager : IHostedService } finally { + + _logger.LogInformation("GetFileCachesByPaths finished for {count} paths", paths.Length); _getCachesByPathsSemaphore.Release(); } } diff --git a/LightlessSync/Services/NameplateHandler.cs b/LightlessSync/Services/NameplateHandler.cs index dc761bb..7f1c9f5 100644 --- a/LightlessSync/Services/NameplateHandler.cs +++ b/LightlessSync/Services/NameplateHandler.cs @@ -201,6 +201,9 @@ public unsafe class NameplateHandler : IMediatorSubscriber private void UpdateNameplateNodes() { var framework = Framework.Instance(); + + if (framework == null) return; + var ui3DModule = framework->GetUIModule()->GetUI3DModule(); if (ui3DModule == null) @@ -208,7 +211,13 @@ public unsafe class NameplateHandler : IMediatorSubscriber for (int i = 0; i < ui3DModule->NamePlateObjectInfoCount; ++i) { - var objectInfo = ui3DModule->NamePlateObjectInfoPointers[i].Value; + if (ui3DModule->NamePlateObjectInfoPointers.IsEmpty) continue; + + var objectInfoPtr = ui3DModule->NamePlateObjectInfoPointers[i]; + + if (objectInfoPtr == null) continue; + + var objectInfo = objectInfoPtr.Value; if (objectInfo == null || objectInfo->GameObject == null) continue;