diff --git a/MareSynchronos/FileCache/PeriodicFileScanner.cs b/MareSynchronos/FileCache/PeriodicFileScanner.cs index d692f45..ce9e649 100644 --- a/MareSynchronos/FileCache/PeriodicFileScanner.cs +++ b/MareSynchronos/FileCache/PeriodicFileScanner.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; @@ -203,13 +204,13 @@ public class PeriodicFileScanner : IDisposable Logger.Debug("Getting files from " + penumbraDir + " and " + _pluginConfiguration.CacheFolder); string[] ext = { ".mdl", ".tex", ".mtrl", ".tmb", ".pap", ".avfx", ".atex", ".sklb", ".eid", ".phyb", ".scd", ".skp" }; - var scannedFiles = Directory.EnumerateFiles(penumbraDir, "*.*", SearchOption.AllDirectories) + var scannedFiles = new ConcurrentDictionary(Directory.EnumerateFiles(penumbraDir, "*.*", SearchOption.AllDirectories) .Select(s => s.ToLowerInvariant()) .Where(f => ext.Any(e => f.EndsWith(e)) && !f.Contains(@"\bg\") && !f.Contains(@"\bgcommon\") && !f.Contains(@"\ui\")) .Concat(Directory.EnumerateFiles(_pluginConfiguration.CacheFolder, "*.*", SearchOption.TopDirectoryOnly) .Where(f => new FileInfo(f).Name.Length == 40) .Select(s => s.ToLowerInvariant()).ToList()) - .ToDictionary(c => c, c => false); + .Select(c => new KeyValuePair(c, false))); TotalFiles = scannedFiles.Count; diff --git a/MareSynchronos/Managers/OnlinePlayerManager.cs b/MareSynchronos/Managers/OnlinePlayerManager.cs index 3b99e51..efbda2b 100644 --- a/MareSynchronos/Managers/OnlinePlayerManager.cs +++ b/MareSynchronos/Managers/OnlinePlayerManager.cs @@ -37,8 +37,6 @@ public class OnlinePlayerManager : IDisposable _fileDbManager = fileDbManager; _apiController.PairedClientOnline += ApiControllerOnPairedClientOnline; _apiController.PairedClientOffline += ApiControllerOnPairedClientOffline; - _apiController.PairedWithOther += ApiControllerOnPairedWithOther; - _apiController.UnpairedFromOther += ApiControllerOnUnpairedFromOther; _apiController.Connected += ApiControllerOnConnected; _apiController.Disconnected += ApiControllerOnDisconnected; _apiController.CharacterReceived += ApiControllerOnCharacterReceived; @@ -137,8 +135,6 @@ public class OnlinePlayerManager : IDisposable _apiController.PairedClientOnline -= ApiControllerOnPairedClientOnline; _apiController.PairedClientOffline -= ApiControllerOnPairedClientOffline; - _apiController.PairedWithOther -= ApiControllerOnPairedWithOther; - _apiController.UnpairedFromOther -= ApiControllerOnUnpairedFromOther; _apiController.Disconnected -= ApiControllerOnDisconnected; _apiController.Connected -= ApiControllerOnConnected; @@ -169,20 +165,6 @@ public class OnlinePlayerManager : IDisposable return; } - private void ApiControllerOnPairedWithOther(string charHash) - { - if (string.IsNullOrEmpty(charHash)) return; - Logger.Debug("Pairing with " + charHash); - AddPlayer(charHash); - } - - private void ApiControllerOnUnpairedFromOther(string? characterHash) - { - if (string.IsNullOrEmpty(characterHash)) return; - Logger.Debug("Unpairing from " + characterHash); - RemovePlayer(characterHash); - } - private void AddPlayer(string characterNameHash) { if (_onlineCachedPlayers.TryGetValue(characterNameHash, out var cachedPlayer)) diff --git a/MareSynchronos/WebAPI/ApiController.cs b/MareSynchronos/WebAPI/ApiController.cs index e153559..ba22b0f 100644 --- a/MareSynchronos/WebAPI/ApiController.cs +++ b/MareSynchronos/WebAPI/ApiController.cs @@ -80,10 +80,6 @@ public partial class ApiController : IDisposable public event SimpleStringDelegate? PairedClientOffline; public event SimpleStringDelegate? PairedClientOnline; - - public event SimpleStringDelegate? PairedWithOther; - - public event SimpleStringDelegate? UnpairedFromOther; public event VoidDelegate? DownloadStarted; public event VoidDelegate? DownloadFinished;