Skip to content

Commit

Permalink
Prevents Stats from loading twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayymoss authored and RaidMax committed Nov 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 807ea9b commit 6875d86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Application/Plugin/PluginImporter.cs
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ public PluginImporter(ILogger<PluginImporter> 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<PluginImporter> 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<PluginImporter> logger, ApplicationConfiguration a
}
catch
{
return Enumerable.Empty<Type>();
return [];
}
}).Where(type =>
FilterTypes.Any(filterType => type.GetInterface(filterType.Name, false) != null) ||

0 comments on commit 6875d86

Please sign in to comment.