mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 21:58:06 -05:00
Prevents Stats from loading twice
This commit is contained in:
parent
807ea9bc3e
commit
6875d864d6
@ -100,7 +100,7 @@ namespace IW4MAdmin.Application.Plugin
|
|||||||
var dllFileNames = Directory.GetFiles(pluginDir, "*.dll");
|
var dllFileNames = Directory.GetFiles(pluginDir, "*.dll");
|
||||||
_logger.LogDebug("Discovered {Count} potential plugin assemblies", dllFileNames.Length);
|
_logger.LogDebug("Discovered {Count} potential plugin assemblies", dllFileNames.Length);
|
||||||
|
|
||||||
if (!dllFileNames.Any())
|
if (dllFileNames.Length is 0)
|
||||||
{
|
{
|
||||||
return (pluginTypes, commandTypes, configurationTypes);
|
return (pluginTypes, commandTypes, configurationTypes);
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ namespace IW4MAdmin.Application.Plugin
|
|||||||
assembly.OrderByDescending(asm => asm.GetName().Version).First());
|
assembly.OrderByDescending(asm => asm.GetName().Version).First());
|
||||||
|
|
||||||
var eligibleAssemblyTypes = assemblies.Concat(AppDomain.CurrentDomain.GetAssemblies()
|
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 =>
|
.SelectMany(asm =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -134,7 +134,7 @@ namespace IW4MAdmin.Application.Plugin
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return Enumerable.Empty<Type>();
|
return [];
|
||||||
}
|
}
|
||||||
}).Where(type =>
|
}).Where(type =>
|
||||||
FilterTypes.Any(filterType => type.GetInterface(filterType.Name, false) != null) ||
|
FilterTypes.Any(filterType => type.GetInterface(filterType.Name, false) != null) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user