From 6875d864d69ce6239402c140653a1e522abd2e9e Mon Sep 17 00:00:00 2001 From: Ayymoss Date: Wed, 27 Nov 2024 19:20:40 +0000 Subject: [PATCH] Prevents Stats from loading twice --- Application/Plugin/PluginImporter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Plugin/PluginImporter.cs b/Application/Plugin/PluginImporter.cs index 2d221279..13b0fec8 100644 --- a/Application/Plugin/PluginImporter.cs +++ b/Application/Plugin/PluginImporter.cs @@ -100,7 +100,7 @@ public PluginImporter(ILogger logger, ApplicationConfiguration a var dllFileNames = Directory.GetFiles(pluginDir, "*.dll"); _logger.LogDebug("Discovered {Count} potential plugin assemblies", dllFileNames.Length); - if (!dllFileNames.Any()) + if (dllFileNames.Length is 0) { return (pluginTypes, commandTypes, configurationTypes); } @@ -125,7 +125,7 @@ public PluginImporter(ILogger logger, ApplicationConfiguration a assembly.OrderByDescending(asm => asm.GetName().Version).First()); var eligibleAssemblyTypes = assemblies.Concat(AppDomain.CurrentDomain.GetAssemblies() - .Where(asm => !new[] { "IW4MAdmin", "SharedLibraryCore" }.Contains(asm.GetName().Name))) + .Where(asm => !new[] { "IW4MAdmin", "SharedLibraryCore", "Stats" }.Contains(asm.GetName().Name))) .SelectMany(asm => { try @@ -134,7 +134,7 @@ public PluginImporter(ILogger logger, ApplicationConfiguration a } catch { - return Enumerable.Empty(); + return []; } }).Where(type => FilterTypes.Any(filterType => type.GetInterface(filterType.Name, false) != null) ||