DI completely reworked to keep status of singletons on multi type components
This commit is contained in:
+2
-8
@@ -1,6 +1,6 @@
|
|||||||
namespace SPTarkov.Common.Annotations;
|
namespace SPTarkov.DI.Annotations;
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
|
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
||||||
public class Injectable(InjectionType injectionType = InjectionType.Scoped, Type? type = null, int typePriority = int.MaxValue) : Attribute
|
public class Injectable(InjectionType injectionType = InjectionType.Scoped, Type? type = null, int typePriority = int.MaxValue) : Attribute
|
||||||
{
|
{
|
||||||
public InjectionType InjectionType
|
public InjectionType InjectionType
|
||||||
@@ -9,12 +9,6 @@ public class Injectable(InjectionType injectionType = InjectionType.Scoped, Type
|
|||||||
set;
|
set;
|
||||||
} = injectionType;
|
} = injectionType;
|
||||||
|
|
||||||
public Type? InjectableTypeOverride
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
} = type;
|
|
||||||
|
|
||||||
public int TypePriority
|
public int TypePriority
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
|
|
||||||
|
namespace SPTarkov.DI;
|
||||||
|
|
||||||
|
public class DependencyInjectionHandler
|
||||||
|
{
|
||||||
|
private static List<Type>? _allLoadedTypes;
|
||||||
|
private static List<ConstructorInfo>? _allConstructors;
|
||||||
|
|
||||||
|
private readonly Dictionary<string, Type> _injectedTypeNames = new();
|
||||||
|
private readonly IServiceCollection _serviceCollection;
|
||||||
|
|
||||||
|
private readonly Dictionary<string, object> _injectedValues = new();
|
||||||
|
private readonly object _injectedValuesLock = new();
|
||||||
|
|
||||||
|
private bool _oneTimeUseFlag;
|
||||||
|
|
||||||
|
|
||||||
|
public DependencyInjectionHandler(IServiceCollection serviceCollection)
|
||||||
|
{
|
||||||
|
_serviceCollection = serviceCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddInjectableTypesFromAssembly(Assembly assembly)
|
||||||
|
{
|
||||||
|
AddInjectableTypesFromTypeList(assembly.GetTypes());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddInjectableTypesFromAssemblies(IEnumerable<Assembly> assemblies)
|
||||||
|
{
|
||||||
|
foreach (var assembly in assemblies)
|
||||||
|
{
|
||||||
|
AddInjectableTypesFromAssembly(assembly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddInjectableTypesFromTypeAssembly(Type type)
|
||||||
|
{
|
||||||
|
AddInjectableTypesFromAssembly(type.Assembly);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddInjectableTypesFromTypeList(IEnumerable<Type> types)
|
||||||
|
{
|
||||||
|
var typesToInject = types.Where(type =>
|
||||||
|
Attribute.IsDefined(type, typeof(Injectable)) &&
|
||||||
|
!_injectedTypeNames.ContainsKey($"{type.Namespace}.{type.Name}"));
|
||||||
|
if (typesToInject.Any())
|
||||||
|
{
|
||||||
|
foreach (var type in typesToInject)
|
||||||
|
{
|
||||||
|
_injectedTypeNames.Add($"{type.Namespace}.{type.Name}", type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InjectAll()
|
||||||
|
{
|
||||||
|
if (_oneTimeUseFlag)
|
||||||
|
{
|
||||||
|
throw new Exception("Invalid usage of DependencyInjectionHandler, this is a one time use service!");
|
||||||
|
}
|
||||||
|
_oneTimeUseFlag = true;
|
||||||
|
var sortedInjectableTypes = _injectedTypeNames.Values
|
||||||
|
.Select(t =>
|
||||||
|
new TypeRefContainer(((Injectable[]) Attribute.GetCustomAttributes(t, typeof(Injectable)))[0], t, t))
|
||||||
|
.OrderBy(tRef => tRef.InjectableAttribute.TypePriority);
|
||||||
|
|
||||||
|
foreach (var typeRefToInject in sortedInjectableTypes)
|
||||||
|
{
|
||||||
|
var nodes = new Queue<TypeRefContainer>();
|
||||||
|
nodes.Enqueue(typeRefToInject);
|
||||||
|
foreach (var implementedInterface in typeRefToInject.Type.GetInterfaces()
|
||||||
|
.Where(t => !t.Namespace.StartsWith("System")))
|
||||||
|
{
|
||||||
|
nodes.Enqueue(new TypeRefContainer(typeRefToInject.InjectableAttribute, typeRefToInject.Type,
|
||||||
|
implementedInterface));
|
||||||
|
}
|
||||||
|
|
||||||
|
while (nodes.Any())
|
||||||
|
{
|
||||||
|
var node = nodes.Dequeue();
|
||||||
|
if (node.Type.BaseType != null && node.Type.BaseType != typeof(object))
|
||||||
|
{
|
||||||
|
nodes.Enqueue(new TypeRefContainer(node.InjectableAttribute, typeRefToInject.Type,
|
||||||
|
node.Type.BaseType));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.Type.IsGenericType)
|
||||||
|
{
|
||||||
|
RegisterGenericComponents(node);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegisterComponent(node.InjectableAttribute.InjectionType,
|
||||||
|
node.Type,
|
||||||
|
node.ParentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterGenericComponents(TypeRefContainer typeRef)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_allLoadedTypes ??= AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes()).ToList();
|
||||||
|
}
|
||||||
|
catch (ReflectionTypeLoadException ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"COULD NOT LOAD TYPE: {ex}");
|
||||||
|
}
|
||||||
|
|
||||||
|
_allConstructors ??= _allLoadedTypes.SelectMany(t => t.GetConstructors()).ToList();
|
||||||
|
|
||||||
|
var typeName = $"{typeRef.Type.Namespace}.{typeRef.Type.Name}";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var matchedConstructors = _allConstructors.Where(c => c.GetParameters()
|
||||||
|
.Any(p => p.ParameterType.IsGenericType &&
|
||||||
|
p.ParameterType.GetGenericTypeDefinition().FullName == typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
var constructorInfos = matchedConstructors.ToList();
|
||||||
|
if (constructorInfos.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var matchedConstructor in constructorInfos)
|
||||||
|
{
|
||||||
|
var constructorParams = matchedConstructor.GetParameters();
|
||||||
|
foreach (var parameterInfo in constructorParams.Where(x => IsMatchingGenericType(x, typeName)))
|
||||||
|
{
|
||||||
|
var parameters = parameterInfo.ParameterType.GetGenericArguments();
|
||||||
|
var typedGeneric = typeRef.ParentType.MakeGenericType(parameters);
|
||||||
|
RegisterComponent(
|
||||||
|
typeRef.InjectableAttribute.InjectionType,
|
||||||
|
parameterInfo.ParameterType,
|
||||||
|
typedGeneric
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsMatchingGenericType(ParameterInfo paramInfo, string typeName)
|
||||||
|
{
|
||||||
|
return paramInfo.ParameterType.IsGenericType &&
|
||||||
|
paramInfo.ParameterType.GetGenericTypeDefinition().FullName == typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterComponent(
|
||||||
|
InjectionType injectionType,
|
||||||
|
Type registrableInterface,
|
||||||
|
Type implementationType
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch (injectionType)
|
||||||
|
{
|
||||||
|
case InjectionType.Singleton:
|
||||||
|
HandleSingletonRegistration(registrableInterface, implementationType);
|
||||||
|
break;
|
||||||
|
case InjectionType.Transient:
|
||||||
|
_serviceCollection.AddTransient(registrableInterface, implementationType);
|
||||||
|
break;
|
||||||
|
case InjectionType.Scoped:
|
||||||
|
_serviceCollection.AddScoped(registrableInterface, implementationType);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(injectionType), "unknown injection type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleSingletonRegistration(Type registrableInterface, Type implementationType)
|
||||||
|
{
|
||||||
|
var serviceKey = $"{implementationType.Namespace}.{implementationType.Name}";
|
||||||
|
if (registrableInterface != implementationType)
|
||||||
|
{
|
||||||
|
_serviceCollection.AddSingleton(registrableInterface, (serviceProvider) =>
|
||||||
|
{
|
||||||
|
object service;
|
||||||
|
lock (_injectedValuesLock)
|
||||||
|
{
|
||||||
|
if (!_injectedValues.TryGetValue(serviceKey, out service))
|
||||||
|
{
|
||||||
|
service = serviceProvider.GetService(implementationType);
|
||||||
|
_injectedValues.Add(serviceKey, service);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return service;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_serviceCollection.AddSingleton(registrableInterface, implementationType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TypeRefContainer
|
||||||
|
{
|
||||||
|
public Injectable InjectableAttribute { get; }
|
||||||
|
public Type Type { get; }
|
||||||
|
public Type ParentType { get; }
|
||||||
|
|
||||||
|
public TypeRefContainer(Injectable injectable, Type parentType, Type type)
|
||||||
|
{
|
||||||
|
InjectableAttribute = injectable;
|
||||||
|
Type = type;
|
||||||
|
ParentType = parentType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using SPTarkov.Common.Annotations;
|
|
||||||
|
|
||||||
namespace SPTarkov.DI;
|
|
||||||
|
|
||||||
public static class DependencyInjectionRegistrator
|
|
||||||
{
|
|
||||||
private static List<Type>? _allLoadedTypes;
|
|
||||||
private static List<ConstructorInfo>? _allConstructors;
|
|
||||||
|
|
||||||
public static void RegisterModOverrideComponents(IServiceCollection builderServices, List<Assembly> assemblies)
|
|
||||||
{
|
|
||||||
// We get all the services from this assembly first, since mods will override them later
|
|
||||||
RegisterComponents(
|
|
||||||
builderServices,
|
|
||||||
assemblies.SelectMany(a => a.GetTypes())
|
|
||||||
.Where(type => Attribute.IsDefined(type, typeof(Injectable)))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RegisterComponents(IServiceCollection builderServices, IEnumerable<Type> types)
|
|
||||||
{
|
|
||||||
var groupedTypes = types.SelectMany(t =>
|
|
||||||
{
|
|
||||||
var attributes = (Injectable[]) Attribute.GetCustomAttributes(t, typeof(Injectable));
|
|
||||||
var registerableType = t;
|
|
||||||
var registerableComponents = new List<RegistrableType>();
|
|
||||||
foreach (var attribute in attributes)
|
|
||||||
{
|
|
||||||
// if we have a type override this takes priority
|
|
||||||
if (attribute.InjectableTypeOverride != null)
|
|
||||||
{
|
|
||||||
registerableType = attribute.InjectableTypeOverride;
|
|
||||||
}
|
|
||||||
// if this class only has 1 interface we register it on that interface
|
|
||||||
else if (registerableType.GetInterfaces().Length == 1)
|
|
||||||
{
|
|
||||||
registerableType = registerableType.GetInterfaces()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
registerableComponents.Add(new RegistrableType(registerableType, t, attribute));
|
|
||||||
}
|
|
||||||
|
|
||||||
return registerableComponents;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.GroupBy(t => $"{t.RegistrableInterface.Namespace}.{t.RegistrableInterface.Name}");
|
|
||||||
// We get all injectable services to register them on our services
|
|
||||||
foreach (var groupedInjectables in groupedTypes)
|
|
||||||
{
|
|
||||||
foreach (var valueTuple in groupedInjectables.OrderBy(t => t.InjectableAttribute.TypePriority))
|
|
||||||
{
|
|
||||||
if (valueTuple.TypeToRegister.IsGenericType)
|
|
||||||
{
|
|
||||||
RegisterGenericComponents(builderServices, valueTuple);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RegisterComponent(
|
|
||||||
builderServices,
|
|
||||||
valueTuple.InjectableAttribute.InjectionType,
|
|
||||||
valueTuple.RegistrableInterface,
|
|
||||||
valueTuple.TypeToRegister
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void RegisterGenericComponents(IServiceCollection builderServices, RegistrableType valueTuple)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_allLoadedTypes ??= AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes()).ToList();
|
|
||||||
}
|
|
||||||
catch (ReflectionTypeLoadException ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"COULD NOT LOAD TYPE: {ex}");
|
|
||||||
}
|
|
||||||
|
|
||||||
_allConstructors ??= _allLoadedTypes.SelectMany(t => t.GetConstructors()).ToList();
|
|
||||||
|
|
||||||
var typeName = $"{valueTuple.RegistrableInterface.Namespace}.{valueTuple.RegistrableInterface.Name}";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var matchedConstructors = _allConstructors.Where(c => c.GetParameters()
|
|
||||||
.Any(p => p.ParameterType.IsGenericType &&
|
|
||||||
p.ParameterType.GetGenericTypeDefinition().FullName == typeName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var constructorInfos = matchedConstructors.ToList();
|
|
||||||
if (constructorInfos.Count == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var matchedConstructor in constructorInfos)
|
|
||||||
{
|
|
||||||
var constructorParams = matchedConstructor.GetParameters();
|
|
||||||
foreach (var parameterInfo in constructorParams.Where(x => IsMatchingGenericType(x, typeName)))
|
|
||||||
{
|
|
||||||
var parameters = parameterInfo.ParameterType.GetGenericArguments();
|
|
||||||
var typedGeneric = valueTuple.TypeToRegister.MakeGenericType(parameters);
|
|
||||||
RegisterComponent(
|
|
||||||
builderServices,
|
|
||||||
valueTuple.InjectableAttribute.InjectionType,
|
|
||||||
parameterInfo.ParameterType,
|
|
||||||
typedGeneric
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsMatchingGenericType(ParameterInfo paramInfo, string typeName)
|
|
||||||
{
|
|
||||||
return paramInfo.ParameterType.IsGenericType &&
|
|
||||||
paramInfo.ParameterType.GetGenericTypeDefinition().FullName == typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void RegisterComponent(
|
|
||||||
IServiceCollection builderServices,
|
|
||||||
InjectionType injectionType,
|
|
||||||
Type registrableInterface,
|
|
||||||
Type implementationType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
switch (injectionType)
|
|
||||||
{
|
|
||||||
case InjectionType.Singleton:
|
|
||||||
builderServices.AddSingleton(registrableInterface, implementationType);
|
|
||||||
break;
|
|
||||||
case InjectionType.Transient:
|
|
||||||
builderServices.AddTransient(registrableInterface, implementationType);
|
|
||||||
break;
|
|
||||||
case InjectionType.Scoped:
|
|
||||||
builderServices.AddScoped(registrableInterface, implementationType);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(injectionType), "unknown injection type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RegisterSptComponents(
|
|
||||||
Assembly serverLauncherAssembly,
|
|
||||||
Assembly coreAssembly,
|
|
||||||
IServiceCollection builderServices
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// We get all the services from this assembly first, since mods will override them later
|
|
||||||
RegisterComponents(
|
|
||||||
builderServices,
|
|
||||||
serverLauncherAssembly.GetTypes().Where(type => Attribute.IsDefined(type, typeof(Injectable)))
|
|
||||||
.Concat(coreAssembly.GetTypes().Where(type => Attribute.IsDefined(type, typeof(Injectable))))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private sealed class RegistrableType(Type registrableInterface, Type typeToRegister, Injectable injectableAttribute)
|
|
||||||
{
|
|
||||||
public Type RegistrableInterface
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
} = registrableInterface;
|
|
||||||
|
|
||||||
public Type TypeToRegister
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
} = typeToRegister;
|
|
||||||
|
|
||||||
public Injectable InjectableAttribute
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
} = injectableAttribute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace SPTarkov.DI;
|
||||||
|
|
||||||
|
public class SingletonStateHolder<T>
|
||||||
|
{
|
||||||
|
public T State
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingletonStateHolder(T state)
|
||||||
|
{
|
||||||
|
State = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Utils;
|
using SPTarkov.Server.Core.Utils;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(AchievementCallbacks))]
|
[Injectable]
|
||||||
public class AchievementCallbacks(
|
public class AchievementCallbacks(
|
||||||
AchievementController _achievementController,
|
AchievementController _achievementController,
|
||||||
HttpResponseUtil _httpResponseUtil
|
HttpResponseUtil _httpResponseUtil
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Bot;
|
using SPTarkov.Server.Core.Models.Eft.Bot;
|
||||||
@@ -8,7 +8,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(BotCallbacks))]
|
[Injectable]
|
||||||
public class BotCallbacks(
|
public class BotCallbacks(
|
||||||
BotController _botController,
|
BotController _botController,
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Builds;
|
using SPTarkov.Server.Core.Models.Eft.Builds;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Loaders;
|
using SPTarkov.Server.Core.Loaders;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Utils;
|
using SPTarkov.Server.Core.Utils;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(BundleCallbacks))]
|
[Injectable]
|
||||||
public class BundleCallbacks(
|
public class BundleCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
BundleLoader _bundleLoader)
|
BundleLoader _bundleLoader)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Customization;
|
using SPTarkov.Server.Core.Models.Eft.Customization;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Services;
|
using SPTarkov.Server.Core.Services;
|
||||||
@@ -6,7 +6,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(DataCallbacks))]
|
[Injectable]
|
||||||
public class DataCallbacks(
|
public class DataCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
DatabaseService _databaseService,
|
DatabaseService _databaseService,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -8,8 +8,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.DialogueCallbacks)]
|
[Injectable(TypePriority = OnUpdateOrder.DialogueCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(DialogueCallbacks))]
|
|
||||||
public class DialogueCallbacks(
|
public class DialogueCallbacks(
|
||||||
HashUtil _hashUtil,
|
HashUtil _hashUtil,
|
||||||
TimeUtil _timeUtil,
|
TimeUtil _timeUtil,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -9,8 +9,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.GameCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.GameCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(GameCallbacks))]
|
|
||||||
public class GameCallbacks(
|
public class GameCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
Watermark _watermark,
|
Watermark _watermark,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.HandbookCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.HandbookCallbacks)]
|
||||||
public class HandbookCallbacks(HandBookController _handBookController) : IOnLoad
|
public class HandbookCallbacks(HandBookController _handBookController) : IOnLoad
|
||||||
{
|
{
|
||||||
public Task OnLoad()
|
public Task OnLoad()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -9,8 +9,7 @@ using SPTarkov.Server.Core.Servers;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.HideoutCallbacks)]
|
[Injectable(TypePriority = OnUpdateOrder.HideoutCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(HideoutCallbacks))]
|
|
||||||
public class HideoutCallbacks(
|
public class HideoutCallbacks(
|
||||||
HideoutController _hideoutController,
|
HideoutController _hideoutController,
|
||||||
ConfigServer _configServer
|
ConfigServer _configServer
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Servers;
|
using SPTarkov.Server.Core.Servers;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectionType.Singleton, InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.HttpCallbacks)]
|
[Injectable(InjectionType.Singleton, TypePriority = OnLoadOrder.HttpCallbacks)]
|
||||||
public class HttpCallbacks(HttpServer _httpServer, ApplicationContext _applicationContext) : IOnLoad
|
public class HttpCallbacks(HttpServer _httpServer, ApplicationContext _applicationContext) : IOnLoad
|
||||||
{
|
{
|
||||||
public Task OnLoad()
|
public Task OnLoad()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.InRaid;
|
using SPTarkov.Server.Core.Models.Eft.InRaid;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -11,8 +11,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.InsuranceCallbacks)]
|
[Injectable(TypePriority = OnUpdateOrder.InsuranceCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(InsuranceCallbacks))]
|
|
||||||
public class InsuranceCallbacks(
|
public class InsuranceCallbacks(
|
||||||
InsuranceController _insuranceController,
|
InsuranceController _insuranceController,
|
||||||
InsuranceService _insuranceService,
|
InsuranceService _insuranceService,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Inventory;
|
using SPTarkov.Server.Core.Models.Eft.Inventory;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
using SPTarkov.Server.Core.Routers;
|
using SPTarkov.Server.Core.Routers;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Launcher;
|
using SPTarkov.Server.Core.Models.Spt.Launcher;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Location;
|
using SPTarkov.Server.Core.Models.Eft.Location;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Match;
|
using SPTarkov.Server.Core.Models.Eft.Match;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -9,7 +9,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(NotifierCallbacks))]
|
[Injectable]
|
||||||
public class NotifierCallbacks(
|
public class NotifierCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
NotifierController _notifierController,
|
NotifierController _notifierController,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.PresetCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.PresetCallbacks)]
|
||||||
public class PresetCallbacks(PresetController _presetController) : IOnLoad
|
public class PresetCallbacks(PresetController _presetController) : IOnLoad
|
||||||
{
|
{
|
||||||
public Task OnLoad()
|
public Task OnLoad()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Prestige;
|
using SPTarkov.Server.Core.Models.Eft.Prestige;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -11,9 +11,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.RagfairCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.RagfairCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.RagfairCallbacks)]
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(RagfairCallbacks))]
|
|
||||||
public class RagfairCallbacks(
|
public class RagfairCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
RagfairServer _ragfairServer,
|
RagfairServer _ragfairServer,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
using SPTarkov.Server.Core.Servers;
|
using SPTarkov.Server.Core.Servers;
|
||||||
@@ -6,8 +6,7 @@ using SPTarkov.Server.Core.Services;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.SaveCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.SaveCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.SaveCallbacks)]
|
|
||||||
public class SaveCallbacks(
|
public class SaveCallbacks(
|
||||||
SaveServer _saveServer,
|
SaveServer _saveServer,
|
||||||
ConfigServer _configServer,
|
ConfigServer _configServer,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.DI;
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
@@ -8,9 +8,7 @@ using SPTarkov.Server.Core.Utils;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Callbacks;
|
namespace SPTarkov.Server.Core.Callbacks;
|
||||||
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.TraderCallbacks)]
|
[Injectable(TypePriority = OnLoadOrder.TraderCallbacks)]
|
||||||
[Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.TraderCallbacks)]
|
|
||||||
[Injectable(InjectableTypeOverride = typeof(TraderCallbacks))]
|
|
||||||
public class TraderCallbacks(
|
public class TraderCallbacks(
|
||||||
HttpResponseUtil _httpResponseUtil,
|
HttpResponseUtil _httpResponseUtil,
|
||||||
TraderController _traderController,
|
TraderController _traderController,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Utils;
|
using SPTarkov.Server.Core.Utils;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Controllers;
|
using SPTarkov.Server.Core.Controllers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Context;
|
namespace SPTarkov.Server.Core.Context;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Server.Core.Constants;
|
using SPTarkov.Server.Core.Constants;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Builds;
|
using SPTarkov.Server.Core.Models.Eft.Builds;
|
||||||
using SPTarkov.Server.Core.Models.Eft.PresetBuild;
|
using SPTarkov.Server.Core.Models.Eft.PresetBuild;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Logging;
|
using SPTarkov.Server.Core.Models.Logging;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Logging;
|
using SPTarkov.Server.Core.Models.Spt.Logging;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Helpers.Dialogue;
|
using SPTarkov.Server.Core.Helpers.Dialogue;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Controllers;
|
namespace SPTarkov.Server.Core.Controllers;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.InRaid;
|
using SPTarkov.Server.Core.Models.Eft.InRaid;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
using SPTarkov.Server.Core.Models.Eft.Launcher;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Location;
|
using SPTarkov.Server.Core.Models.Eft.Location;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Match;
|
using SPTarkov.Server.Core.Models.Eft.Match;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Notes;
|
using SPTarkov.Server.Core.Models.Eft.Notes;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Notifier;
|
using SPTarkov.Server.Core.Models.Eft.Notifier;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Ws;
|
using SPTarkov.Server.Core.Models.Eft.Ws;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Presets;
|
using SPTarkov.Server.Core.Models.Spt.Presets;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Prestige;
|
using SPTarkov.Server.Core.Models.Eft.Prestige;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Repair;
|
using SPTarkov.Server.Core.Models.Eft.Repair;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators;
|
using SPTarkov.Server.Core.Generators;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Weather;
|
using SPTarkov.Server.Core.Models.Eft.Weather;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Wishlist;
|
using SPTarkov.Server.Core.Models.Eft.Wishlist;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Server.Core.Constants;
|
using SPTarkov.Server.Core.Constants;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Bot;
|
using SPTarkov.Server.Core.Models.Eft.Bot;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Generators.WeaponGen;
|
using SPTarkov.Server.Core.Generators.WeaponGen;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Ragfair;
|
using SPTarkov.Server.Core.Models.Eft.Ragfair;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
using SPTarkov.Server.Core.Utils;
|
using SPTarkov.Server.Core.Utils;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Generators.WeaponGen;
|
namespace SPTarkov.Server.Core.Generators.WeaponGen;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Weather;
|
using SPTarkov.Server.Core.Models.Eft.Weather;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Bots;
|
using SPTarkov.Server.Core.Models.Spt.Bots;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Server.Core.Constants;
|
using SPTarkov.Server.Core.Constants;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Context;
|
using SPTarkov.Server.Core.Context;
|
||||||
|
using SPTarkov.Server.Core.DI;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Match;
|
using SPTarkov.Server.Core.Models.Eft.Match;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
@@ -15,8 +16,18 @@ using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel;
|
|||||||
|
|
||||||
namespace SPTarkov.Server.Core.Helpers;
|
namespace SPTarkov.Server.Core.Helpers;
|
||||||
|
|
||||||
[Injectable]
|
[Injectable(InjectionType.Singleton)]
|
||||||
public class BotGeneratorHelper
|
public class BotGeneratorHelper(
|
||||||
|
ISptLogger<BotGeneratorHelper> _logger,
|
||||||
|
RandomUtil _randomUtil,
|
||||||
|
DurabilityLimitsHelper _durabilityLimitsHelper,
|
||||||
|
ItemHelper _itemHelper,
|
||||||
|
InventoryHelper _inventoryHelper,
|
||||||
|
ContainerHelper _containerHelper,
|
||||||
|
ApplicationContext _applicationContext,
|
||||||
|
LocalisationService _localisationService,
|
||||||
|
ConfigServer _configServer
|
||||||
|
) : IOnLoad
|
||||||
{
|
{
|
||||||
// Equipment slot ids that do not conflict with other slots
|
// Equipment slot ids that do not conflict with other slots
|
||||||
private static readonly FrozenSet<string> _slotsWithNoCompatIssues = [
|
private static readonly FrozenSet<string> _slotsWithNoCompatIssues = [
|
||||||
@@ -27,38 +38,20 @@ public class BotGeneratorHelper
|
|||||||
EquipmentSlots.ArmBand.ToString()
|
EquipmentSlots.ArmBand.ToString()
|
||||||
];
|
];
|
||||||
|
|
||||||
private readonly BotConfig _botConfig;
|
private BotConfig _botConfig;
|
||||||
private readonly ISptLogger<BotGeneratorHelper> _logger;
|
private string[] _pmcTypes;
|
||||||
private readonly RandomUtil _randomUtil;
|
|
||||||
private readonly DurabilityLimitsHelper _durabilityLimitsHelper;
|
|
||||||
private readonly ItemHelper _itemHelper;
|
|
||||||
private readonly InventoryHelper _inventoryHelper;
|
|
||||||
private readonly ContainerHelper _containerHelper;
|
|
||||||
private readonly ApplicationContext _applicationContext;
|
|
||||||
private readonly LocalisationService _localisationService;
|
|
||||||
private readonly string[] _pmcTypes;
|
|
||||||
|
|
||||||
public BotGeneratorHelper(ISptLogger<BotGeneratorHelper> logger,
|
public Task OnLoad()
|
||||||
RandomUtil randomUtil,
|
|
||||||
DurabilityLimitsHelper durabilityLimitsHelper,
|
|
||||||
ItemHelper itemHelper,
|
|
||||||
InventoryHelper inventoryHelper,
|
|
||||||
ContainerHelper containerHelper,
|
|
||||||
ApplicationContext applicationContext,
|
|
||||||
LocalisationService localisationService,
|
|
||||||
ConfigServer configServer)
|
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_botConfig = _configServer.GetConfig<BotConfig>();
|
||||||
_randomUtil = randomUtil;
|
var pmcConfig = _configServer.GetConfig<PmcConfig>();
|
||||||
_durabilityLimitsHelper = durabilityLimitsHelper;
|
|
||||||
_itemHelper = itemHelper;
|
|
||||||
_inventoryHelper = inventoryHelper;
|
|
||||||
_containerHelper = containerHelper;
|
|
||||||
_applicationContext = applicationContext;
|
|
||||||
_localisationService = localisationService;
|
|
||||||
_botConfig = configServer.GetConfig<BotConfig>();
|
|
||||||
var pmcConfig = configServer.GetConfig<PmcConfig>();
|
|
||||||
_pmcTypes = [pmcConfig.UsecType.ToLower(), pmcConfig.BearType.ToLower()];
|
_pmcTypes = [pmcConfig.UsecType.ToLower(), pmcConfig.BearType.ToLower()];
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetRoute()
|
||||||
|
{
|
||||||
|
return "spt-botGeneratorHelper";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using SPTarkov.Common.Annotations;
|
|
||||||
using SPTarkov.Server.Core.Constants;
|
using SPTarkov.Server.Core.Constants;
|
||||||
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
using SPTarkov.Server.Core.Models.Enums;
|
using SPTarkov.Server.Core.Models.Enums;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Models.Utils;
|
using SPTarkov.Server.Core.Models.Utils;
|
||||||
using SPTarkov.Server.Core.Utils;
|
using SPTarkov.Server.Core.Utils;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Helpers;
|
namespace SPTarkov.Server.Core.Helpers;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using SPTarkov.Common.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers.Dialog.Commando.SptCommands;
|
using SPTarkov.Server.Core.Helpers.Dialog.Commando.SptCommands;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user