mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
add ability to register custom event generators for event parsers / truncate long client names fix
This commit is contained in:
@ -321,6 +321,18 @@ namespace IW4MAdmin.Application
|
||||
serviceCollection.AddSingleton(scriptPlugin);
|
||||
}
|
||||
|
||||
// register any eventable types
|
||||
foreach (var assemblyType in typeof(Program).Assembly.GetTypes()
|
||||
.Where(_asmType => typeof(IRegisterEvent).IsAssignableFrom(_asmType))
|
||||
.Union(pluginImplementations
|
||||
.Item1.SelectMany(_asm => _asm.Assembly.GetTypes())
|
||||
.Distinct()
|
||||
.Where(_asmType => typeof(IRegisterEvent).IsAssignableFrom(_asmType))))
|
||||
{
|
||||
var instance = Activator.CreateInstance(assemblyType) as IRegisterEvent;
|
||||
serviceCollection.AddSingleton(instance);
|
||||
}
|
||||
|
||||
return serviceCollection;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user