Skip to content

Commit 6875d86

Browse files
AyymossRaidMax
authored andcommitted
Prevents Stats from loading twice
1 parent 807ea9b commit 6875d86

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Application/Plugin/PluginImporter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public PluginImporter(ILogger<PluginImporter> logger, ApplicationConfiguration a
100100
var dllFileNames = Directory.GetFiles(pluginDir, "*.dll");
101101
_logger.LogDebug("Discovered {Count} potential plugin assemblies", dllFileNames.Length);
102102

103-
if (!dllFileNames.Any())
103+
if (dllFileNames.Length is 0)
104104
{
105105
return (pluginTypes, commandTypes, configurationTypes);
106106
}
@@ -125,7 +125,7 @@ public PluginImporter(ILogger<PluginImporter> logger, ApplicationConfiguration a
125125
assembly.OrderByDescending(asm => asm.GetName().Version).First());
126126

127127
var eligibleAssemblyTypes = assemblies.Concat(AppDomain.CurrentDomain.GetAssemblies()
128-
.Where(asm => !new[] { "IW4MAdmin", "SharedLibraryCore" }.Contains(asm.GetName().Name)))
128+
.Where(asm => !new[] { "IW4MAdmin", "SharedLibraryCore", "Stats" }.Contains(asm.GetName().Name)))
129129
.SelectMany(asm =>
130130
{
131131
try
@@ -134,7 +134,7 @@ public PluginImporter(ILogger<PluginImporter> logger, ApplicationConfiguration a
134134
}
135135
catch
136136
{
137-
return Enumerable.Empty<Type>();
137+
return [];
138138
}
139139
}).Where(type =>
140140
FilterTypes.Any(filterType => type.GetInterface(filterType.Name, false) != null) ||

0 commit comments

Comments
 (0)