diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index 948e2e4e..390dcd26 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -1,12 +1,9 @@ - - Exe enable - @@ -15,11 +12,9 @@ - PreserveNewest - diff --git a/Benchmarks/ClonerBenchmarks.cs b/Benchmarks/ClonerBenchmarks.cs index e5eb646b..5e4e8992 100644 --- a/Benchmarks/ClonerBenchmarks.cs +++ b/Benchmarks/ClonerBenchmarks.cs @@ -20,9 +20,8 @@ public class ClonerBenchmarks [GlobalSetup] public void Setup() { - var jsonUtil = new JsonUtil([ new SptJsonConverterRegistrator() ]); - var importer = new ImporterUtil(new MockLogger(), new FileUtil(), - jsonUtil); + var jsonUtil = new JsonUtil([new SptJsonConverterRegistrator()]); + var importer = new ImporterUtil(new MockLogger(), new FileUtil(), jsonUtil); var loadTask = importer.LoadRecursiveAsync("./Assets/database/templates/"); loadTask.Wait(); _templates = loadTask.Result; diff --git a/Benchmarks/Mock/MockLogger.cs b/Benchmarks/Mock/MockLogger.cs index 25a6ee1d..c750857c 100644 --- a/Benchmarks/Mock/MockLogger.cs +++ b/Benchmarks/Mock/MockLogger.cs @@ -6,7 +6,12 @@ namespace Benchmarks.Mock; public class MockLogger : ISptLogger { - public void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, Exception? ex = null) + public void LogWithColor( + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ) { throw new NotImplementedException(); } diff --git a/Build.props b/Build.props index 8e5e1d26..1817a6a7 100644 --- a/Build.props +++ b/Build.props @@ -1,11 +1,9 @@ - - - 4.0.0-prerelease2 - net9.0 - latest - enable - Git - - + + 4.0.0-prerelease2 + net9.0 + latest + enable + Git + diff --git a/Libraries/SPTarkov.Common/Extensions/MemberInfoExtensions.cs b/Libraries/SPTarkov.Common/Extensions/MemberInfoExtensions.cs index 7a70ae8c..eb52bbe4 100644 --- a/Libraries/SPTarkov.Common/Extensions/MemberInfoExtensions.cs +++ b/Libraries/SPTarkov.Common/Extensions/MemberInfoExtensions.cs @@ -8,7 +8,10 @@ public static class MemberInfoExtensions public static string GetJsonName(this MemberInfo memberInfo) { return Attribute.IsDefined(memberInfo, typeof(JsonPropertyNameAttribute)) - ? (Attribute.GetCustomAttribute(memberInfo, typeof(JsonPropertyNameAttribute)) as JsonPropertyNameAttribute).Name + ? ( + Attribute.GetCustomAttribute(memberInfo, typeof(JsonPropertyNameAttribute)) + as JsonPropertyNameAttribute + ).Name : memberInfo.Name; } } diff --git a/Libraries/SPTarkov.Common/Extensions/ObjectExtensions.cs b/Libraries/SPTarkov.Common/Extensions/ObjectExtensions.cs index 2c75f7cd..33a33af3 100644 --- a/Libraries/SPTarkov.Common/Extensions/ObjectExtensions.cs +++ b/Libraries/SPTarkov.Common/Extensions/ObjectExtensions.cs @@ -6,7 +6,8 @@ namespace SPTarkov.Common.Extensions; public static class ObjectExtensions { - private static readonly Dictionary> _indexedProperties = new(); + private static readonly Dictionary> _indexedProperties = + new(); private static readonly Lock _indexedPropertiesLockObject = new(); private static bool TryGetCachedProperty(Type type, string key, out PropertyInfo cachedProperty) @@ -15,7 +16,8 @@ public static class ObjectExtensions { if (!_indexedProperties.TryGetValue(type, out var properties)) { - properties = type.GetProperties().ToDictionary(prop => prop.GetJsonName(), prop => prop); + properties = type.GetProperties() + .ToDictionary(prop => prop.GetJsonName(), prop => prop); _indexedProperties.Add(type, properties); } @@ -49,7 +51,7 @@ public static class ObjectExtensions return default; } - return (T?) cachedProperty.GetValue(obj); + return (T?)cachedProperty.GetValue(obj); } public static List GetAllPropValuesAsList(this object? obj) diff --git a/Libraries/SPTarkov.Common/Extensions/StringExtensions.cs b/Libraries/SPTarkov.Common/Extensions/StringExtensions.cs index c444e332..5cfea17f 100644 --- a/Libraries/SPTarkov.Common/Extensions/StringExtensions.cs +++ b/Libraries/SPTarkov.Common/Extensions/StringExtensions.cs @@ -8,7 +8,11 @@ public static class StringExtensions private static readonly Dictionary _regexCache = new(); private static readonly Lock _regexCacheLock = new(); - public static string RegexReplace(this string source, [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, string newValue) + public static string RegexReplace( + this string source, + [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, + string newValue + ) { Regex regex; lock (_regexCacheLock) @@ -23,7 +27,11 @@ public static class StringExtensions return regex.Replace(source, newValue); } - public static bool RegexMatch(this string source, [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, out Match? matchedString) + public static bool RegexMatch( + this string source, + [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, + out Match? matchedString + ) { Regex regex; lock (_regexCacheLock) diff --git a/Libraries/SPTarkov.Common/SPTarkov.Common.csproj b/Libraries/SPTarkov.Common/SPTarkov.Common.csproj index 43bc8a11..50dfd597 100644 --- a/Libraries/SPTarkov.Common/SPTarkov.Common.csproj +++ b/Libraries/SPTarkov.Common/SPTarkov.Common.csproj @@ -1,7 +1,5 @@ - - - + SPTarkov.Common Single Player Tarkov @@ -14,13 +12,10 @@ Library true - - + - - + - diff --git a/Libraries/SPTarkov.DI/Annotations/Injectable.cs b/Libraries/SPTarkov.DI/Annotations/Injectable.cs index 111991bc..4ad0fb9a 100644 --- a/Libraries/SPTarkov.DI/Annotations/Injectable.cs +++ b/Libraries/SPTarkov.DI/Annotations/Injectable.cs @@ -1,30 +1,22 @@ namespace SPTarkov.DI.Annotations; [AttributeUsage(AttributeTargets.Class, Inherited = false)] -public class Injectable(InjectionType injectionType = InjectionType.Scoped, Type? typeOverride = null, int typePriority = int.MaxValue) : Attribute +public class Injectable( + InjectionType injectionType = InjectionType.Scoped, + Type? typeOverride = null, + int typePriority = int.MaxValue +) : Attribute { - public InjectionType InjectionType - { - get; - set; - } = injectionType; + public InjectionType InjectionType { get; set; } = injectionType; - public int TypePriority - { - get; - set; - } = typePriority; + public int TypePriority { get; set; } = typePriority; - public Type? TypeOverride - { - get; - set; - } = typeOverride; + public Type? TypeOverride { get; set; } = typeOverride; } public enum InjectionType { Singleton, Transient, - Scoped + Scoped, } diff --git a/Libraries/SPTarkov.DI/DependencyInjectionHandler.cs b/Libraries/SPTarkov.DI/DependencyInjectionHandler.cs index a7dddc46..e3e74b5f 100644 --- a/Libraries/SPTarkov.DI/DependencyInjectionHandler.cs +++ b/Libraries/SPTarkov.DI/DependencyInjectionHandler.cs @@ -16,7 +16,6 @@ public class DependencyInjectionHandler private bool _oneTimeUseFlag; - public DependencyInjectionHandler(IServiceCollection serviceCollection) { _serviceCollection = serviceCollection; @@ -43,8 +42,9 @@ public class DependencyInjectionHandler public void AddInjectableTypesFromTypeList(IEnumerable types) { var typesToInject = types.Where(type => - Attribute.IsDefined(type, typeof(Injectable)) && - !_injectedTypeNames.ContainsKey($"{type.Namespace}.{type.Name}")); + Attribute.IsDefined(type, typeof(Injectable)) + && !_injectedTypeNames.ContainsKey($"{type.Namespace}.{type.Name}") + ); if (typesToInject.Any()) { foreach (var type in typesToInject) @@ -58,16 +58,24 @@ public class DependencyInjectionHandler { if (_oneTimeUseFlag) { - throw new Exception("Invalid usage of DependencyInjectionHandler, this is a one time use service!"); + throw new Exception( + "Invalid usage of DependencyInjectionHandler, this is a one time use service!" + ); } _oneTimeUseFlag = true; - var typeRefValues = _injectedTypeNames.Values - .Select(t => new TypeRefContainer(((Injectable[]) Attribute.GetCustomAttributes(t, typeof(Injectable)))[0], t, t)); + var typeRefValues = _injectedTypeNames.Values.Select(t => new TypeRefContainer( + ((Injectable[])Attribute.GetCustomAttributes(t, typeof(Injectable)))[0], + t, + t + )); // All the components that have a type override, we need to find them and remove them before injecting everything - var componentsToRemove = typeRefValues.Where(tr => tr.InjectableAttribute.TypeOverride != null).Select(tr => - string.IsNullOrEmpty(tr.InjectableAttribute.TypeOverride!.FullName) - ? $"{tr.InjectableAttribute.TypeOverride.Namespace}.{tr.InjectableAttribute.TypeOverride.Name}" - : tr.InjectableAttribute.TypeOverride.FullName!) + var componentsToRemove = typeRefValues + .Where(tr => tr.InjectableAttribute.TypeOverride != null) + .Select(tr => + string.IsNullOrEmpty(tr.InjectableAttribute.TypeOverride!.FullName) + ? $"{tr.InjectableAttribute.TypeOverride.Namespace}.{tr.InjectableAttribute.TypeOverride.Name}" + : tr.InjectableAttribute.TypeOverride.FullName! + ) .ToHashSet(); // All the components without the removed overrides var cleanedComponents = typeRefValues.Where(tr => @@ -78,17 +86,27 @@ public class DependencyInjectionHandler return !componentsToRemove.Contains(name); }); // All the components sorted and ready to be inserted into the DI container - var sortedInjectableTypes = cleanedComponents.OrderBy(tRef => tRef.InjectableAttribute.TypePriority); + var sortedInjectableTypes = cleanedComponents.OrderBy(tRef => + tRef.InjectableAttribute.TypePriority + ); foreach (var typeRefToInject in sortedInjectableTypes) { var nodes = new Queue(); nodes.Enqueue(typeRefToInject); - foreach (var implementedInterface in typeRefToInject.Type.GetInterfaces() - .Where(t => !t.Namespace.StartsWith("System"))) + foreach ( + var implementedInterface in typeRefToInject + .Type.GetInterfaces() + .Where(t => !t.Namespace.StartsWith("System")) + ) { - nodes.Enqueue(new TypeRefContainer(typeRefToInject.InjectableAttribute, typeRefToInject.Type, - implementedInterface)); + nodes.Enqueue( + new TypeRefContainer( + typeRefToInject.InjectableAttribute, + typeRefToInject.Type, + implementedInterface + ) + ); } while (nodes.Any()) @@ -96,8 +114,13 @@ public class DependencyInjectionHandler 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)); + nodes.Enqueue( + new TypeRefContainer( + node.InjectableAttribute, + typeRefToInject.Type, + node.Type.BaseType + ) + ); } if (node.Type.IsGenericType) @@ -106,9 +129,11 @@ public class DependencyInjectionHandler } else { - RegisterComponent(node.InjectableAttribute.InjectionType, + RegisterComponent( + node.InjectableAttribute.InjectionType, node.Type, - node.ParentType); + node.ParentType + ); } } } @@ -118,7 +143,10 @@ public class DependencyInjectionHandler { try { - _allLoadedTypes ??= AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes()).ToList(); + _allLoadedTypes ??= AppDomain + .CurrentDomain.GetAssemblies() + .SelectMany(t => t.GetTypes()) + .ToList(); } catch (ReflectionTypeLoadException ex) { @@ -130,10 +158,12 @@ public class DependencyInjectionHandler 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 matchedConstructors = _allConstructors.Where(c => + c.GetParameters() + .Any(p => + p.ParameterType.IsGenericType + && p.ParameterType.GetGenericTypeDefinition().FullName == typeName + ) ); var constructorInfos = matchedConstructors.ToList(); @@ -145,7 +175,11 @@ public class DependencyInjectionHandler foreach (var matchedConstructor in constructorInfos) { var constructorParams = matchedConstructor.GetParameters(); - foreach (var parameterInfo in constructorParams.Where(x => IsMatchingGenericType(x, typeName))) + foreach ( + var parameterInfo in constructorParams.Where(x => + IsMatchingGenericType(x, typeName) + ) + ) { var parameters = parameterInfo.ParameterType.GetGenericArguments(); var typedGeneric = typeRef.ParentType.MakeGenericType(parameters); @@ -166,8 +200,8 @@ public class DependencyInjectionHandler private static bool IsMatchingGenericType(ParameterInfo paramInfo, string typeName) { - return paramInfo.ParameterType.IsGenericType && - paramInfo.ParameterType.GetGenericTypeDefinition().FullName == typeName; + return paramInfo.ParameterType.IsGenericType + && paramInfo.ParameterType.GetGenericTypeDefinition().FullName == typeName; } private void RegisterComponent( @@ -188,7 +222,10 @@ public class DependencyInjectionHandler _serviceCollection.AddScoped(registrableInterface, implementationType); break; default: - throw new ArgumentOutOfRangeException(nameof(injectionType), $"Unknown injection type on {implementationType.Namespace}.{implementationType.Name}"); + throw new ArgumentOutOfRangeException( + nameof(injectionType), + $"Unknown injection type on {implementationType.Namespace}.{implementationType.Name}" + ); } } @@ -197,20 +234,23 @@ public class DependencyInjectionHandler var serviceKey = $"{implementationType.Namespace}.{implementationType.Name}"; if (registrableInterface != implementationType) { - _serviceCollection.AddSingleton(registrableInterface, (serviceProvider) => - { - object service; - lock (_injectedValuesLock) + _serviceCollection.AddSingleton( + registrableInterface, + (serviceProvider) => { - if (!_injectedValues.TryGetValue(serviceKey, out service)) + object service; + lock (_injectedValuesLock) { - service = serviceProvider.GetService(implementationType); - _injectedValues.Add(serviceKey, service); + if (!_injectedValues.TryGetValue(serviceKey, out service)) + { + service = serviceProvider.GetService(implementationType); + _injectedValues.Add(serviceKey, service); + } } - } - return service; - }); + return service; + } + ); } else { diff --git a/Libraries/SPTarkov.DI/SPTarkov.DI.csproj b/Libraries/SPTarkov.DI/SPTarkov.DI.csproj index 0a7bf557..05682ad2 100644 --- a/Libraries/SPTarkov.DI/SPTarkov.DI.csproj +++ b/Libraries/SPTarkov.DI/SPTarkov.DI.csproj @@ -1,7 +1,5 @@ - - SPTarkov.DI Single Player Tarkov @@ -14,17 +12,16 @@ Library true - - + - - - diff --git a/Libraries/SPTarkov.DI/SingletonStateHolder.cs b/Libraries/SPTarkov.DI/SingletonStateHolder.cs index 77f10fab..c3c651a9 100644 --- a/Libraries/SPTarkov.DI/SingletonStateHolder.cs +++ b/Libraries/SPTarkov.DI/SingletonStateHolder.cs @@ -2,10 +2,7 @@ public class SingletonStateHolder { - public T State - { - get; - } + public T State { get; } public SingletonStateHolder(T state) { diff --git a/Libraries/SPTarkov.Reflection/CodeWrapper/CodeGenerator.cs b/Libraries/SPTarkov.Reflection/CodeWrapper/CodeGenerator.cs index 7854a94c..270c6162 100644 --- a/Libraries/SPTarkov.Reflection/CodeWrapper/CodeGenerator.cs +++ b/Libraries/SPTarkov.Reflection/CodeWrapper/CodeGenerator.cs @@ -27,35 +27,76 @@ public class CodeGenerator return new CodeInstruction(code.OpCode) { labels = GetLabelList(code) }; } - if (code.OpCode == OpCodes.Ldfld || code.OpCode == OpCodes.Ldflda || code.OpCode == OpCodes.Stfld) + if ( + code.OpCode == OpCodes.Ldfld + || code.OpCode == OpCodes.Ldflda + || code.OpCode == OpCodes.Stfld + ) { - return new CodeInstruction(code.OpCode, AccessTools.Field(code.CallerType, code.OperandTarget as string)) { labels = GetLabelList(code) }; + return new CodeInstruction( + code.OpCode, + AccessTools.Field(code.CallerType, code.OperandTarget as string) + ) + { + labels = GetLabelList(code), + }; } if (code.OpCode == OpCodes.Call || code.OpCode == OpCodes.Callvirt) { - return new CodeInstruction(code.OpCode, AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters)) { labels = GetLabelList(code) }; + return new CodeInstruction( + code.OpCode, + AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters) + ) + { + labels = GetLabelList(code), + }; } if (code.OpCode == OpCodes.Box) { - return new CodeInstruction(code.OpCode, code.CallerType) { labels = GetLabelList(code) }; + return new CodeInstruction(code.OpCode, code.CallerType) + { + labels = GetLabelList(code), + }; } - if (code.OpCode == OpCodes.Br || code.OpCode == OpCodes.Brfalse || code.OpCode == OpCodes.Brtrue || code.OpCode == OpCodes.Brtrue_S - || code.OpCode == OpCodes.Brfalse_S || code.OpCode == OpCodes.Br_S) + if ( + code.OpCode == OpCodes.Br + || code.OpCode == OpCodes.Brfalse + || code.OpCode == OpCodes.Brtrue + || code.OpCode == OpCodes.Brtrue_S + || code.OpCode == OpCodes.Brfalse_S + || code.OpCode == OpCodes.Br_S + ) { - return new CodeInstruction(code.OpCode, code.OperandTarget) { labels = GetLabelList(code) }; + return new CodeInstruction(code.OpCode, code.OperandTarget) + { + labels = GetLabelList(code), + }; } if (code.OpCode == OpCodes.Ldftn) { - return new CodeInstruction(code.OpCode, AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters)) { labels = GetLabelList(code) }; + return new CodeInstruction( + code.OpCode, + AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters) + ) + { + labels = GetLabelList(code), + }; } if (code.OpCode == OpCodes.Newobj) { - return new CodeInstruction(code.OpCode, code.CallerType.GetConstructors().FirstOrDefault(x => x.GetParameters().Length == code.Parameters.Length)) { labels = GetLabelList(code) }; + return new CodeInstruction( + code.OpCode, + code.CallerType.GetConstructors() + .FirstOrDefault(x => x.GetParameters().Length == code.Parameters.Length) + ) + { + labels = GetLabelList(code), + }; } throw new ArgumentException($"Code with OpCode {code.OpCode.ToString()} is not supported."); @@ -68,6 +109,6 @@ public class CodeGenerator return []; } - return [ (Label)code.GetLabel() ]; + return [(Label)code.GetLabel()]; } } diff --git a/Libraries/SPTarkov.Reflection/CodeWrapper/CodeWithLabel.cs b/Libraries/SPTarkov.Reflection/CodeWrapper/CodeWithLabel.cs index b6b7ba6a..3304c3c7 100644 --- a/Libraries/SPTarkov.Reflection/CodeWrapper/CodeWithLabel.cs +++ b/Libraries/SPTarkov.Reflection/CodeWrapper/CodeWithLabel.cs @@ -6,22 +6,32 @@ public class CodeWithLabel : Code { public Label Label { get; } - public CodeWithLabel(OpCode opCode, Label label) : base(opCode) + public CodeWithLabel(OpCode opCode, Label label) + : base(opCode) { Label = label; } - public CodeWithLabel(OpCode opCode, Label label, object operandTarget) : base(opCode, operandTarget) + public CodeWithLabel(OpCode opCode, Label label, object operandTarget) + : base(opCode, operandTarget) { Label = label; } - public CodeWithLabel(OpCode opCode, Label label, Type callerType) : base(opCode, callerType) + public CodeWithLabel(OpCode opCode, Label label, Type callerType) + : base(opCode, callerType) { Label = label; } - public CodeWithLabel(OpCode opCode, Label label, Type callerType, object operandTarget, Type[] parameters = null) : base(opCode, callerType, operandTarget, parameters) + public CodeWithLabel( + OpCode opCode, + Label label, + Type callerType, + object operandTarget, + Type[] parameters = null + ) + : base(opCode, callerType, operandTarget, parameters) { Label = label; } diff --git a/Libraries/SPTarkov.Reflection/Patching/AbstractPatch.cs b/Libraries/SPTarkov.Reflection/Patching/AbstractPatch.cs index 13975f56..2015dd7d 100644 --- a/Libraries/SPTarkov.Reflection/Patching/AbstractPatch.cs +++ b/Libraries/SPTarkov.Reflection/Patching/AbstractPatch.cs @@ -25,13 +25,17 @@ public abstract class AbstractPatch _finalizerList = GetPatchMethods(typeof(PatchFinalizerAttribute)); _ilManipulatorList = GetPatchMethods(typeof(PatchIlManipulatorAttribute)); - if (_prefixList.Count == 0 + if ( + _prefixList.Count == 0 && _postfixList.Count == 0 && _transpilerList.Count == 0 && _finalizerList.Count == 0 - && _ilManipulatorList.Count == 0) + && _ilManipulatorList.Count == 0 + ) { - throw new Exception($"{_harmony.Id}: At least one of the patch methods must be specified"); + throw new Exception( + $"{_harmony.Id}: At least one of the patch methods must be specified" + ); } } @@ -51,8 +55,14 @@ public abstract class AbstractPatch var T = GetType(); var methods = new List(); - foreach (var method in T.GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | - BindingFlags.DeclaredOnly)) + foreach ( + var method in T.GetMethods( + BindingFlags.Static + | BindingFlags.NonPublic + | BindingFlags.Public + | BindingFlags.DeclaredOnly + ) + ) { if (method.GetCustomAttribute(attributeType) != null) { diff --git a/Libraries/SPTarkov.Reflection/Patching/Attributes.cs b/Libraries/SPTarkov.Reflection/Patching/Attributes.cs index b0d84af9..f539d407 100644 --- a/Libraries/SPTarkov.Reflection/Patching/Attributes.cs +++ b/Libraries/SPTarkov.Reflection/Patching/Attributes.cs @@ -1,27 +1,17 @@ namespace SPTarkov.Reflection.Patching { [AttributeUsage(AttributeTargets.Method)] - public class PatchPrefixAttribute : Attribute - { - } + public class PatchPrefixAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] - public class PatchPostfixAttribute : Attribute - { - } + public class PatchPostfixAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] - public class PatchTranspilerAttribute : Attribute - { - } + public class PatchTranspilerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] - public class PatchFinalizerAttribute : Attribute - { - } + public class PatchFinalizerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] - public class PatchIlManipulatorAttribute : Attribute - { - } + public class PatchIlManipulatorAttribute : Attribute { } } diff --git a/Libraries/SPTarkov.Reflection/SPTarkov.Reflection.csproj b/Libraries/SPTarkov.Reflection/SPTarkov.Reflection.csproj index af6045fc..8528823b 100644 --- a/Libraries/SPTarkov.Reflection/SPTarkov.Reflection.csproj +++ b/Libraries/SPTarkov.Reflection/SPTarkov.Reflection.csproj @@ -1,26 +1,21 @@  - - - - - SPTarkov.Reflection - Single Player Tarkov - Reflection library for the Single Player Tarkov server. - Copyright (c) Single Player Tarkov 2025 - LICENSE - https://sp-tarkov.com - https://github.com/sp-tarkov/server-csharp - enable - Library - true - - - - - - - - - - + + + SPTarkov.Reflection + Single Player Tarkov + Reflection library for the Single Player Tarkov server. + Copyright (c) Single Player Tarkov 2025 + LICENSE + https://sp-tarkov.com + https://github.com/sp-tarkov/server-csharp + enable + Library + true + + + + + + + diff --git a/Libraries/SPTarkov.Server.Assets/SPTarkov.Server.Assets.csproj b/Libraries/SPTarkov.Server.Assets/SPTarkov.Server.Assets.csproj index 9a280fe0..8489d17d 100644 --- a/Libraries/SPTarkov.Server.Assets/SPTarkov.Server.Assets.csproj +++ b/Libraries/SPTarkov.Server.Assets/SPTarkov.Server.Assets.csproj @@ -1,7 +1,5 @@ - - - + SPTarkov.Server.Assets Single Player Tarkov @@ -16,21 +14,16 @@ content SptAssets - - Always True - - - + - diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs index e7c71adb..726c7385 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs @@ -17,7 +17,9 @@ public class AchievementCallbacks( /// public ValueTask GetAchievements(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_achievementController.GetAchievements(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_achievementController.GetAchievements(sessionID)) + ); } /// @@ -26,6 +28,8 @@ public class AchievementCallbacks( /// public ValueTask Statistic(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_achievementController.GetAchievementStatics(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_achievementController.GetAchievementStatics(sessionID)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/BotCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/BotCallbacks.cs index edd654f6..593e532b 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/BotCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/BotCallbacks.cs @@ -7,10 +7,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Callbacks; [Injectable] -public class BotCallbacks( - BotController _botController, - HttpResponseUtil _httpResponseUtil -) +public class BotCallbacks(BotController _botController, HttpResponseUtil _httpResponseUtil) { /// /// Handle singleplayer/settings/bot/limit @@ -21,7 +18,9 @@ public class BotCallbacks( { var splitUrl = url.Split('/'); var type = splitUrl[^1]; - return new ValueTask(_httpResponseUtil.NoBody(_botController.GetBotPresetGenerationLimit(type))); + return new ValueTask( + _httpResponseUtil.NoBody(_botController.GetBotPresetGenerationLimit(type)) + ); } /// @@ -35,10 +34,14 @@ public class BotCallbacks( var difficulty = splitUrl[^1]; if (difficulty == "core") { - return new ValueTask(_httpResponseUtil.NoBody(_botController.GetBotCoreDifficulty())); + return new ValueTask( + _httpResponseUtil.NoBody(_botController.GetBotCoreDifficulty()) + ); } - return new ValueTask(_httpResponseUtil.NoBody(_botController.GetBotDifficulty(sessionID, type, difficulty))); + return new ValueTask( + _httpResponseUtil.NoBody(_botController.GetBotDifficulty(sessionID, type, difficulty)) + ); } /// @@ -47,16 +50,24 @@ public class BotCallbacks( /// public ValueTask GetAllBotDifficulties(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.NoBody(_botController.GetAllBotDifficulties())); + return new ValueTask( + _httpResponseUtil.NoBody(_botController.GetAllBotDifficulties()) + ); } /// /// Handle client/game/bot/generate /// /// - public ValueTask GenerateBots(string url, GenerateBotsRequestData info, string sessionID) + public ValueTask GenerateBots( + string url, + GenerateBotsRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_botController.Generate(sessionID, info))); + return new ValueTask( + _httpResponseUtil.GetBody(_botController.Generate(sessionID, info)) + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/BtrDeliveryCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/BtrDeliveryCallbacks.cs index 7431d2c6..a935e9ed 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/BtrDeliveryCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/BtrDeliveryCallbacks.cs @@ -20,10 +20,10 @@ public class BtrDeliveryCallbacks( SaveServer _saveServer, HashUtil _hashUtil, ItemHelper _itemHelper -) - : IOnUpdate +) : IOnUpdate { - private readonly BtrDeliveryConfig _btrDeliveryConfig = _configServer.GetConfig(); + private readonly BtrDeliveryConfig _btrDeliveryConfig = + _configServer.GetConfig(); public Task OnUpdate(long secondsSinceLastRun) { @@ -81,9 +81,13 @@ public class BtrDeliveryCallbacks( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Found {deliveryList.Count} BTR delivery package(s) in profile {sessionId}"); + _logger.Debug( + $"Found {deliveryList.Count} BTR delivery package(s) in profile {sessionId}" + ); } - return deliveryList.Where(toBeDelivered => currentTime >= toBeDelivered.ScheduledTime).ToList(); + return deliveryList + .Where(toBeDelivered => currentTime >= toBeDelivered.ScheduledTime) + .ToList(); } return []; diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/BuildsCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/BuildsCallbacks.cs index 7b292663..b67e0fe0 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/BuildsCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/BuildsCallbacks.cs @@ -8,10 +8,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Callbacks; [Injectable] -public class BuildsCallbacks( - HttpResponseUtil _httpResponseUtil, - BuildController _buildController -) +public class BuildsCallbacks(HttpResponseUtil _httpResponseUtil, BuildController _buildController) { /// /// Handle client/builds/list @@ -19,7 +16,9 @@ public class BuildsCallbacks( /// public ValueTask GetBuilds(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_buildController.GetUserBuilds(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_buildController.GetUserBuilds(sessionID)) + ); } /// @@ -29,7 +28,11 @@ public class BuildsCallbacks( /// /// Session/player id /// - public ValueTask CreateMagazineTemplate(string url, SetMagazineRequest request, string sessionID) + public ValueTask CreateMagazineTemplate( + string url, + SetMagazineRequest request, + string sessionID + ) { _buildController.CreateMagazineTemplate(sessionID, request); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -39,7 +42,11 @@ public class BuildsCallbacks( /// Handle client/builds/weapon/save /// /// - public ValueTask SetWeapon(string url, PresetBuildActionRequestData request, string sessionID) + public ValueTask SetWeapon( + string url, + PresetBuildActionRequestData request, + string sessionID + ) { _buildController.SaveWeaponBuild(sessionID, request); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -49,7 +56,11 @@ public class BuildsCallbacks( /// Handle client/builds/equipment/save /// /// - public ValueTask SetEquipment(string url, PresetBuildActionRequestData request, string sessionID) + public ValueTask SetEquipment( + string url, + PresetBuildActionRequestData request, + string sessionID + ) { _buildController.SaveEquipmentBuild(sessionID, request); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -59,7 +70,11 @@ public class BuildsCallbacks( /// Handle client/builds/delete /// /// - public ValueTask DeleteBuild(string url, RemoveBuildRequestData request, string sessionID) + public ValueTask DeleteBuild( + string url, + RemoveBuildRequestData request, + string sessionID + ) { _buildController.RemoveBuild(sessionID, request); return new ValueTask(_httpResponseUtil.NullResponse()); diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/BundleCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/BundleCallbacks.cs index 5404f68a..e95e051e 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/BundleCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/BundleCallbacks.cs @@ -6,9 +6,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Callbacks; [Injectable] -public class BundleCallbacks( - HttpResponseUtil _httpResponseUtil, - BundleLoader _bundleLoader) +public class BundleCallbacks(HttpResponseUtil _httpResponseUtil, BundleLoader _bundleLoader) { /// /// Handle singleplayer/bundles diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs index f6371664..972d5e0b 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs @@ -41,15 +41,26 @@ public class ClientLogCallbacks( ? _localisationService.GetText("release-beta-disclaimer-mods-enabled") : _localisationService.GetText("release-beta-disclaimer"); - data.BetaDisclaimerAcceptText = _localisationService.GetText("release-beta-disclaimer-accept"); + data.BetaDisclaimerAcceptText = _localisationService.GetText( + "release-beta-disclaimer-accept" + ); data.ServerModsLoadedText = _localisationService.GetText("release-server-mods-loaded"); - data.ServerModsLoadedDebugText = _localisationService.GetText("release-server-mods-debug-message"); + data.ServerModsLoadedDebugText = _localisationService.GetText( + "release-server-mods-debug-message" + ); data.ClientModsLoadedText = _localisationService.GetText("release-plugins-loaded"); - data.ClientModsLoadedDebugText = _localisationService.GetText("release-plugins-loaded-debug-message"); - data.IllegalPluginsLoadedText = _localisationService.GetText("release-illegal-plugins-loaded"); - data.IllegalPluginsExceptionText = _localisationService.GetText("release-illegal-plugins-exception"); + data.ClientModsLoadedDebugText = _localisationService.GetText( + "release-plugins-loaded-debug-message" + ); + data.IllegalPluginsLoadedText = _localisationService.GetText( + "release-illegal-plugins-loaded" + ); + data.IllegalPluginsExceptionText = _localisationService.GetText( + "release-illegal-plugins-exception" + ); data.ReleaseSummaryText = _localisationService.GetText("release-summary"); - data.IsBeta = ProgramStatics.ENTRY_TYPE() is EntryType.BLEEDING_EDGE or EntryType.BLEEDING_EDGE_MODS; + data.IsBeta = + ProgramStatics.ENTRY_TYPE() is EntryType.BLEEDING_EDGE or EntryType.BLEEDING_EDGE_MODS; data.IsModdable = ProgramStatics.MODS(); data.IsModded = _loadedMods.Count > 0; diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/CustomizationCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/CustomizationCallbacks.cs index a723362c..72d3c2e9 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/CustomizationCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/CustomizationCallbacks.cs @@ -19,9 +19,15 @@ public class CustomizationCallbacks( /// Handle client/trading/customization/storage /// /// - public ValueTask GetCustomisationUnlocks(string url, EmptyRequestData _, string sessionID) + public ValueTask GetCustomisationUnlocks( + string url, + EmptyRequestData _, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_saveServer.GetProfile(sessionID).CustomisationUnlocks)); + return new ValueTask( + _httpResponseUtil.GetBody(_saveServer.GetProfile(sessionID).CustomisationUnlocks) + ); } /// @@ -33,14 +39,20 @@ public class CustomizationCallbacks( var splitUrl = url.Split('/'); var traderId = splitUrl[^3]; - return new ValueTask(_httpResponseUtil.GetBody(_customizationController.GetTraderSuits(traderId, sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_customizationController.GetTraderSuits(traderId, sessionID)) + ); } /// /// Handle CustomizationBuy event /// /// - public ItemEventRouterResponse BuyCustomisation(PmcData pmcData, BuyClothingRequestData request, string sessionID) + public ItemEventRouterResponse BuyCustomisation( + PmcData pmcData, + BuyClothingRequestData request, + string sessionID + ) { return _customizationController.BuyCustomisation(pmcData, request, sessionID); } @@ -49,9 +61,15 @@ public class CustomizationCallbacks( /// Handle client/hideout/customization/offer/list /// /// - public ValueTask GetHideoutCustomisation(string url, EmptyRequestData _, string sessionID) + public ValueTask GetHideoutCustomisation( + string url, + EmptyRequestData _, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_customizationController.GetHideoutCustomisation(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_customizationController.GetHideoutCustomisation(sessionID)) + ); } /// @@ -60,14 +78,20 @@ public class CustomizationCallbacks( /// public ValueTask GetStorage(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_customizationController.GetCustomisationStorage(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_customizationController.GetCustomisationStorage(sessionID)) + ); } /// /// Handle CustomizationSet /// /// - public ItemEventRouterResponse SetCustomisation(PmcData pmcData, CustomizationSetRequest request, string sessionID) + public ItemEventRouterResponse SetCustomisation( + PmcData pmcData, + CustomizationSetRequest request, + string sessionID + ) { return _customizationController.SetCustomisation(sessionID, request, pmcData); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/DataCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/DataCallbacks.cs index 791ae1ac..d657b3e5 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/DataCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/DataCallbacks.cs @@ -43,7 +43,9 @@ public class DataCallbacks( /// public ValueTask GetTemplateItems(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetUnclearedBody(_databaseService.GetItems())); + return new ValueTask( + _httpResponseUtil.GetUnclearedBody(_databaseService.GetItems()) + ); } /// @@ -61,7 +63,9 @@ public class DataCallbacks( /// public ValueTask GetTemplateSuits(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetTemplates().Customization)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetTemplates().Customization) + ); } /// @@ -70,7 +74,9 @@ public class DataCallbacks( /// public ValueTask GetTemplateCharacter(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetTemplates().Character)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetTemplates().Character) + ); } /// @@ -79,7 +85,9 @@ public class DataCallbacks( /// public ValueTask GetHideoutSettings(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetHideout().Settings)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetHideout().Settings) + ); } /// @@ -88,7 +96,9 @@ public class DataCallbacks( /// public ValueTask GetHideoutAreas(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetHideout().Areas)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetHideout().Areas) + ); } /// @@ -97,7 +107,9 @@ public class DataCallbacks( /// public ValueTask GetHideoutProduction(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetHideout().Production)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetHideout().Production) + ); } /// @@ -106,7 +118,9 @@ public class DataCallbacks( /// public ValueTask GetLocalesLanguages(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetLocales().Languages)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetLocales().Languages) + ); } /// @@ -117,7 +131,8 @@ public class DataCallbacks( { var localeId = url.Replace("/client/menu/locale/", ""); var locales = _databaseService.GetLocales(); - var result = locales.Menu?[localeId] ?? locales.Menu?.FirstOrDefault(m => m.Key == "en").Value; + var result = + locales.Menu?[localeId] ?? locales.Menu?.FirstOrDefault(m => m.Key == "en").Value; if (result == null) { @@ -145,7 +160,9 @@ public class DataCallbacks( /// public ValueTask GetQteList(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetUnclearedBody(_hideoutController.GetQteList(sessionID))); + return new ValueTask( + _httpResponseUtil.GetUnclearedBody(_hideoutController.GetQteList(sessionID)) + ); } /// @@ -156,6 +173,8 @@ public class DataCallbacks( { var traderId = url.Replace("/client/items/prices/", ""); - return new ValueTask(_httpResponseUtil.GetBody(_traderController.GetItemPrices(sessionID, traderId))); + return new ValueTask( + _httpResponseUtil.GetBody(_traderController.GetItemPrices(sessionID, traderId)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/DialogueCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/DialogueCallbacks.cs index 574d7c3d..ca0f20cd 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/DialogueCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/DialogueCallbacks.cs @@ -14,8 +14,7 @@ public class DialogueCallbacks( TimeUtil _timeUtil, HttpResponseUtil _httpResponseUtil, DialogueController _dialogueController -) - : IOnUpdate +) : IOnUpdate { public Task OnUpdate(long timeSinceLastRun) { @@ -29,14 +28,20 @@ public class DialogueCallbacks( /// public virtual ValueTask GetFriendList(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.GetFriendList(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_dialogueController.GetFriendList(sessionID)) + ); } /// /// Handle client/chatServer/list /// /// - public virtual ValueTask GetChatServerList(string url, GetChatServerListRequestData request, string sessionID) + public virtual ValueTask GetChatServerList( + string url, + GetChatServerListRequestData request, + string sessionID + ) { var chatServer = new List { @@ -50,15 +55,8 @@ public class DialogueCallbacks( VersionId = "bgkidft87ddd", Ip = "", Port = 0, - Chats = - [ - new Chat - { - Id = "0", - Members = 0 - } - ] - } + Chats = [new Chat { Id = "0", Members = 0 }], + }, }; return new ValueTask(_httpResponseUtil.GetBody(chatServer)); @@ -69,9 +67,20 @@ public class DialogueCallbacks( /// TODO: request properties are not handled /// /// - public virtual ValueTask GetMailDialogList(string url, GetMailDialogListRequestData request, string sessionID) + public virtual ValueTask GetMailDialogList( + string url, + GetMailDialogListRequestData request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.GenerateDialogueList(sessionID), 0, null, false)); + return new ValueTask( + _httpResponseUtil.GetBody( + _dialogueController.GenerateDialogueList(sessionID), + 0, + null, + false + ) + ); } /// @@ -81,25 +90,48 @@ public class DialogueCallbacks( /// /// Session/player id /// - public virtual ValueTask GetMailDialogView(string url, GetMailDialogViewRequestData request, string sessionID) + public virtual ValueTask GetMailDialogView( + string url, + GetMailDialogViewRequestData request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.GenerateDialogueView(request, sessionID), 0, null, false)); + return new ValueTask( + _httpResponseUtil.GetBody( + _dialogueController.GenerateDialogueView(request, sessionID), + 0, + null, + false + ) + ); } /// /// Handle client/mail/dialog/info /// /// - public virtual ValueTask GetMailDialogInfo(string url, GetMailDialogInfoRequestData request, string sessionID) + public virtual ValueTask GetMailDialogInfo( + string url, + GetMailDialogInfoRequestData request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.GetDialogueInfo(request.DialogId, sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody( + _dialogueController.GetDialogueInfo(request.DialogId, sessionID) + ) + ); } /// /// Handle client/mail/dialog/remove /// /// - public virtual ValueTask RemoveDialog(string url, RemoveDialogRequestData request, string sessionID) + public virtual ValueTask RemoveDialog( + string url, + RemoveDialogRequestData request, + string sessionID + ) { _dialogueController.RemoveDialogue(request.DialogId, sessionID); return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); @@ -109,7 +141,11 @@ public class DialogueCallbacks( /// Handle client/mail/dialog/pin /// /// - public virtual ValueTask PinDialog(string url, PinDialogRequestData request, string sessionID) + public virtual ValueTask PinDialog( + string url, + PinDialogRequestData request, + string sessionID + ) { _dialogueController.SetDialoguePin(request.DialogId, true, sessionID); return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); @@ -119,7 +155,11 @@ public class DialogueCallbacks( /// Handle client/mail/dialog/unpin /// /// - public virtual ValueTask UnpinDialog(string url, PinDialogRequestData request, string sessionID) + public virtual ValueTask UnpinDialog( + string url, + PinDialogRequestData request, + string sessionID + ) { _dialogueController.SetDialoguePin(request.DialogId, false, sessionID); return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); @@ -129,7 +169,11 @@ public class DialogueCallbacks( /// Handle client/mail/dialog/read /// /// - public virtual ValueTask SetRead(string url, SetDialogReadRequestData request, string sessionID) + public virtual ValueTask SetRead( + string url, + SetDialogReadRequestData request, + string sessionID + ) { _dialogueController.SetRead(request.Dialogs, sessionID); return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); @@ -139,18 +183,32 @@ public class DialogueCallbacks( /// Handle client/mail/dialog/getAllAttachments /// /// - public virtual ValueTask GetAllAttachments(string url, GetAllAttachmentsRequestData request, string sessionID) + public virtual ValueTask GetAllAttachments( + string url, + GetAllAttachmentsRequestData request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.GetAllAttachments(request.DialogId, sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody( + _dialogueController.GetAllAttachments(request.DialogId, sessionID) + ) + ); } /// /// Handle client/mail/msg/send /// /// - public virtual ValueTask SendMessage(string url, SendMessageRequest request, string sessionID) + public virtual ValueTask SendMessage( + string url, + SendMessageRequest request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.SendMessage(sessionID, request))); + return new ValueTask( + _httpResponseUtil.GetBody(_dialogueController.SendMessage(sessionID, request)) + ); } /// @@ -175,16 +233,26 @@ public class DialogueCallbacks( /// Handle client/friend/request/send /// /// - public virtual ValueTask SendFriendRequest(string url, FriendRequestData request, string sessionID) + public virtual ValueTask SendFriendRequest( + string url, + FriendRequestData request, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_dialogueController.SendFriendRequest(sessionID, request))); + return new ValueTask( + _httpResponseUtil.GetBody(_dialogueController.SendFriendRequest(sessionID, request)) + ); } /// /// Handle client/friend/request/accept-all /// /// - public virtual ValueTask AcceptAllFriendRequests(string url, EmptyRequestData _, string sessionID) + public virtual ValueTask AcceptAllFriendRequests( + string url, + EmptyRequestData _, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } @@ -193,7 +261,11 @@ public class DialogueCallbacks( /// Handle client/friend/request/accept /// /// - public virtual ValueTask AcceptFriendRequest(string url, AcceptFriendRequestData request, string sessionID) + public virtual ValueTask AcceptFriendRequest( + string url, + AcceptFriendRequestData request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody(true)); } @@ -202,7 +274,11 @@ public class DialogueCallbacks( /// Handle client/friend/request/decline /// /// - public virtual ValueTask DeclineFriendRequest(string url, DeclineFriendRequestData request, string sessionID) + public virtual ValueTask DeclineFriendRequest( + string url, + DeclineFriendRequestData request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody(true)); } @@ -211,7 +287,11 @@ public class DialogueCallbacks( /// Handle client/friend/request/cancel /// /// - public virtual ValueTask CancelFriendRequest(string url, CancelFriendRequestData request, string sessionID) + public virtual ValueTask CancelFriendRequest( + string url, + CancelFriendRequestData request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody(true)); } @@ -220,7 +300,11 @@ public class DialogueCallbacks( /// Handle client/friend/delete /// /// - public virtual ValueTask DeleteFriend(string url, DeleteFriendRequest request, string sessionID) + public virtual ValueTask DeleteFriend( + string url, + DeleteFriendRequest request, + string sessionID + ) { _dialogueController.DeleteFriend(sessionID, request); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -230,7 +314,11 @@ public class DialogueCallbacks( /// Handle client/friend/ignore/set /// /// - public virtual ValueTask IgnoreFriend(string url, UIDRequestData request, string sessionID) + public virtual ValueTask IgnoreFriend( + string url, + UIDRequestData request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } @@ -239,34 +327,58 @@ public class DialogueCallbacks( /// Handle client/friend/ignore/remove /// /// - public virtual ValueTask UnIgnoreFriend(string url, UIDRequestData request, string sessionID) + public virtual ValueTask UnIgnoreFriend( + string url, + UIDRequestData request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } - public virtual ValueTask ClearMail(string url, ClearMailMessageRequest request, string sessionID) + public virtual ValueTask ClearMail( + string url, + ClearMailMessageRequest request, + string sessionID + ) { _dialogueController.ClearMessages(sessionID, request); return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); } - public virtual ValueTask CreateGroupMail(string url, CreateGroupMailRequest request, string sessionID) + public virtual ValueTask CreateGroupMail( + string url, + CreateGroupMailRequest request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.EmptyArrayResponse()); } - public virtual ValueTask ChangeMailGroupOwner(string url, ChangeGroupMailOwnerRequest request, string sessionID) + public virtual ValueTask ChangeMailGroupOwner( + string url, + ChangeGroupMailOwnerRequest request, + string sessionID + ) { return new ValueTask("Not Implemented!"); // Not implemented in Node } - public virtual ValueTask AddUserToMail(string url, AddUserGroupMailRequest request, string sessionID) + public virtual ValueTask AddUserToMail( + string url, + AddUserGroupMailRequest request, + string sessionID + ) { return new ValueTask("Not Implemented!"); // Not implemented in Node } - public virtual ValueTask RemoveUserFromMail(string url, RemoveUserGroupMailRequest request, string sessionID) + public virtual ValueTask RemoveUserFromMail( + string url, + RemoveUserGroupMailRequest request, + string sessionID + ) { return new ValueTask("Not Implemented!"); // Not implemented in Node } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/GameCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/GameCallbacks.cs index 99739a08..d8c61105 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/GameCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/GameCallbacks.cs @@ -28,7 +28,11 @@ public class GameCallbacks( /// Handle client/game/version/validate /// /// - public ValueTask VersionValidate(string url, VersionValidateRequestData info, string sessionID) + public ValueTask VersionValidate( + string url, + VersionValidateRequestData info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } @@ -41,12 +45,9 @@ public class GameCallbacks( { var startTimestampSec = _timeUtil.GetTimeStamp(); _gameController.GameStart(url, sessionID, startTimestampSec); - return new ValueTask(_httpResponseUtil.GetBody( - new GameStartResponse - { - UtcTime = startTimestampSec - } - )); + return new ValueTask( + _httpResponseUtil.GetBody(new GameStartResponse { UtcTime = startTimestampSec }) + ); } /// @@ -57,21 +58,22 @@ public class GameCallbacks( public async ValueTask GameLogout(string url, EmptyRequestData _, string sessionID) { await _saveServer.SaveProfileAsync(sessionID); - return _httpResponseUtil.GetBody( - new GameLogoutResponseData - { - Status = "ok" - } - ); + return _httpResponseUtil.GetBody(new GameLogoutResponseData { Status = "ok" }); } /// /// Handle client/game/config /// /// - public ValueTask GetGameConfig(string url, GameEmptyCrcRequestData info, string sessionID) + public ValueTask GetGameConfig( + string url, + GameEmptyCrcRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetGameConfig(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetGameConfig(sessionID)) + ); } /// @@ -80,7 +82,9 @@ public class GameCallbacks( /// public ValueTask GetGameMode(string url, GameModeRequestData info, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetGameMode(sessionID, info))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetGameMode(sessionID, info)) + ); } /// @@ -89,7 +93,9 @@ public class GameCallbacks( /// public ValueTask GetServer(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetServer(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetServer(sessionID)) + ); } /// @@ -98,7 +104,9 @@ public class GameCallbacks( /// public ValueTask GetCurrentGroup(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetCurrentGroup(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetCurrentGroup(sessionID)) + ); } /// @@ -107,7 +115,9 @@ public class GameCallbacks( /// public ValueTask ValidateGameVersion(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetValidGameVersion(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetValidGameVersion(sessionID)) + ); } /// @@ -116,7 +126,9 @@ public class GameCallbacks( /// public ValueTask GameKeepalive(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetKeepAlive(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetKeepAlive(sessionID)) + ); } /// @@ -126,12 +138,9 @@ public class GameCallbacks( public ValueTask GetVersion(string url, EmptyRequestData _, string sessionID) { // change to be a proper type - return new ValueTask(_httpResponseUtil.NoBody( - new - { - Version = _watermark.GetInGameVersionLabel() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody(new { Version = _watermark.GetInGameVersionLabel() }) + ); } /// @@ -149,7 +158,9 @@ public class GameCallbacks( /// public ValueTask GetRaidTime(string url, GetRaidTimeRequest request, string sessionID) { - return new ValueTask(_httpResponseUtil.NoBody(_gameController.GetRaidTime(sessionID, request))); + return new ValueTask( + _httpResponseUtil.NoBody(_gameController.GetRaidTime(sessionID, request)) + ); } /// @@ -158,14 +169,20 @@ public class GameCallbacks( /// public ValueTask GetSurvey(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_gameController.GetSurvey(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_gameController.GetSurvey(sessionID)) + ); } /// /// Handle client/survey/view /// /// - public ValueTask GetSurveyView(string url, SendSurveyOpinionRequest request, string sessionID) + public ValueTask GetSurveyView( + string url, + SendSurveyOpinionRequest request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } @@ -174,7 +191,11 @@ public class GameCallbacks( /// Handle client/survey/opinion /// /// - public ValueTask SendSurveyOpinion(string url, SendSurveyOpinionRequest request, string sessionID) + public ValueTask SendSurveyOpinion( + string url, + SendSurveyOpinionRequest request, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/HealthCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/HealthCallbacks.cs index a14f51cc..48508419 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/HealthCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/HealthCallbacks.cs @@ -24,7 +24,11 @@ public class HealthCallbacks( /// empty response, no data sent back to client public ValueTask HandleWorkoutEffects(string url, WorkoutData info, string sessionID) { - _healthController.ApplyWorkoutChanges(_profileHelper.GetPmcProfile(sessionID), info, sessionID); + _healthController.ApplyWorkoutChanges( + _profileHelper.GetPmcProfile(sessionID), + info, + sessionID + ); return new ValueTask(_httpResponseUtil.EmptyResponse()); } @@ -35,7 +39,11 @@ public class HealthCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse OffraidEat(PmcData pmcData, OffraidEatRequestData info, string sessionID) + public ItemEventRouterResponse OffraidEat( + PmcData pmcData, + OffraidEatRequestData info, + string sessionID + ) { return _healthController.OffRaidEat(pmcData, info, sessionID); } @@ -47,7 +55,11 @@ public class HealthCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse OffraidHeal(PmcData pmcData, OffraidHealRequestData info, string sessionID) + public ItemEventRouterResponse OffraidHeal( + PmcData pmcData, + OffraidHealRequestData info, + string sessionID + ) { return _healthController.OffRaidHeal(pmcData, info, sessionID); } @@ -59,7 +71,11 @@ public class HealthCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse HealthTreatment(PmcData pmcData, HealthTreatmentRequestData info, string sessionID) + public ItemEventRouterResponse HealthTreatment( + PmcData pmcData, + HealthTreatmentRequestData info, + string sessionID + ) { return _healthController.HealthTreatment(pmcData, info, sessionID); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/HideoutCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/HideoutCallbacks.cs index c11a9ce4..32fb8ea0 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/HideoutCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/HideoutCallbacks.cs @@ -10,10 +10,8 @@ using SPTarkov.Server.Core.Servers; namespace SPTarkov.Server.Core.Callbacks; [Injectable(TypePriority = OnUpdateOrder.HideoutCallbacks)] -public class HideoutCallbacks( - HideoutController _hideoutController, - ConfigServer _configServer -) : IOnUpdate +public class HideoutCallbacks(HideoutController _hideoutController, ConfigServer _configServer) + : IOnUpdate { private readonly HideoutConfig _hideoutConfig = _configServer.GetConfig(); @@ -33,7 +31,12 @@ public class HideoutCallbacks( /// /// Handle HideoutUpgrade event /// - public ItemEventRouterResponse Upgrade(PmcData pmcData, HideoutUpgradeRequestData request, string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse Upgrade( + PmcData pmcData, + HideoutUpgradeRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { _hideoutController.StartUpgrade(pmcData, request, sessionID, output); @@ -43,7 +46,12 @@ public class HideoutCallbacks( /// /// Handle HideoutUpgradeComplete event /// - public ItemEventRouterResponse UpgradeComplete(PmcData pmcData, HideoutUpgradeCompleteRequestData request, string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse UpgradeComplete( + PmcData pmcData, + HideoutUpgradeCompleteRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { _hideoutController.UpgradeComplete(pmcData, request, sessionID, output); @@ -53,7 +61,11 @@ public class HideoutCallbacks( /// /// Handle HideoutPutItemsInAreaSlots /// - public ItemEventRouterResponse PutItemsInAreaSlots(PmcData pmcData, HideoutPutItemInRequestData request, string sessionID) + public ItemEventRouterResponse PutItemsInAreaSlots( + PmcData pmcData, + HideoutPutItemInRequestData request, + string sessionID + ) { return _hideoutController.PutItemsInAreaSlots(pmcData, request, sessionID); } @@ -61,7 +73,11 @@ public class HideoutCallbacks( /// /// Handle HideoutTakeItemsFromAreaSlots event /// - public ItemEventRouterResponse TakeItemsFromAreaSlots(PmcData pmcData, HideoutTakeItemOutRequestData request, string sessionID) + public ItemEventRouterResponse TakeItemsFromAreaSlots( + PmcData pmcData, + HideoutTakeItemOutRequestData request, + string sessionID + ) { return _hideoutController.TakeItemsFromAreaSlots(pmcData, request, sessionID); } @@ -69,7 +85,11 @@ public class HideoutCallbacks( /// /// Handle HideoutToggleArea event /// - public ItemEventRouterResponse ToggleArea(PmcData pmcData, HideoutToggleAreaRequestData request, string sessionID) + public ItemEventRouterResponse ToggleArea( + PmcData pmcData, + HideoutToggleAreaRequestData request, + string sessionID + ) { return _hideoutController.ToggleArea(pmcData, request, sessionID); } @@ -77,7 +97,11 @@ public class HideoutCallbacks( /// /// Handle HideoutSingleProductionStart event /// - public ItemEventRouterResponse SingleProductionStart(PmcData pmcData, HideoutSingleProductionStartRequestData request, string sessionID) + public ItemEventRouterResponse SingleProductionStart( + PmcData pmcData, + HideoutSingleProductionStartRequestData request, + string sessionID + ) { return _hideoutController.SingleProductionStart(pmcData, request, sessionID); } @@ -85,7 +109,11 @@ public class HideoutCallbacks( /// /// Handle HideoutScavCaseProductionStart event /// - public ItemEventRouterResponse ScavCaseProductionStart(PmcData pmcData, HideoutScavCaseStartRequestData request, string sessionID) + public ItemEventRouterResponse ScavCaseProductionStart( + PmcData pmcData, + HideoutScavCaseStartRequestData request, + string sessionID + ) { return _hideoutController.ScavCaseProductionStart(pmcData, request, sessionID); } @@ -93,7 +121,11 @@ public class HideoutCallbacks( /// /// Handle HideoutContinuousProductionStart /// - public ItemEventRouterResponse ContinuousProductionStart(PmcData pmcData, HideoutContinuousProductionStartRequestData request, string sessionID) + public ItemEventRouterResponse ContinuousProductionStart( + PmcData pmcData, + HideoutContinuousProductionStartRequestData request, + string sessionID + ) { return _hideoutController.ContinuousProductionStart(pmcData, request, sessionID); } @@ -101,7 +133,11 @@ public class HideoutCallbacks( /// /// Handle HideoutTakeProduction event /// - public ItemEventRouterResponse TakeProduction(PmcData pmcData, HideoutTakeProductionRequestData request, string sessionID) + public ItemEventRouterResponse TakeProduction( + PmcData pmcData, + HideoutTakeProductionRequestData request, + string sessionID + ) { return _hideoutController.TakeProduction(pmcData, request, sessionID); } @@ -109,7 +145,12 @@ public class HideoutCallbacks( /// /// Handle HideoutQuickTimeEvent /// - public ItemEventRouterResponse HandleQTEEvent(PmcData pmcData, HandleQTEEventRequestData request, string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse HandleQTEEvent( + PmcData pmcData, + HandleQTEEventRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { _hideoutController.HandleQTEEventOutcome(sessionID, pmcData, request, output); @@ -119,8 +160,12 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - RecordShootingRangePoints /// - public ItemEventRouterResponse RecordShootingRangePoints(PmcData pmcData, RecordShootingRangePoints request, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse RecordShootingRangePoints( + PmcData pmcData, + RecordShootingRangePoints request, + string sessionID, + ItemEventRouterResponse output + ) { _hideoutController.RecordShootingRangePoints(sessionID, pmcData, request); @@ -130,7 +175,11 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - RecordShootingRangePoints /// - public ItemEventRouterResponse ImproveArea(PmcData pmcData, HideoutImproveAreaRequestData request, string sessionID) + public ItemEventRouterResponse ImproveArea( + PmcData pmcData, + HideoutImproveAreaRequestData request, + string sessionID + ) { return _hideoutController.ImproveArea(sessionID, pmcData, request); } @@ -138,7 +187,11 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - HideoutCancelProductionCommand /// - public ItemEventRouterResponse CancelProduction(PmcData pmcData, HideoutCancelProductionRequestData request, string sessionID) + public ItemEventRouterResponse CancelProduction( + PmcData pmcData, + HideoutCancelProductionRequestData request, + string sessionID + ) { return _hideoutController.CancelProduction(sessionID, pmcData, request); } @@ -146,7 +199,11 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart /// - public ItemEventRouterResponse CicleOfCultistProductionStart(PmcData pmcData, HideoutCircleOfCultistProductionStartRequestData request, string sessionID) + public ItemEventRouterResponse CicleOfCultistProductionStart( + PmcData pmcData, + HideoutCircleOfCultistProductionStartRequestData request, + string sessionID + ) { return _hideoutController.CicleOfCultistProductionStart(sessionID, pmcData, request); } @@ -154,7 +211,11 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - HideoutDeleteProductionCommand /// - public ItemEventRouterResponse HideoutDeleteProductionCommand(PmcData pmcData, HideoutDeleteProductionRequestData request, string sessionID) + public ItemEventRouterResponse HideoutDeleteProductionCommand( + PmcData pmcData, + HideoutDeleteProductionRequestData request, + string sessionID + ) { return _hideoutController.HideoutDeleteProductionCommand(sessionID, pmcData, request); } @@ -162,7 +223,11 @@ public class HideoutCallbacks( /// /// Handle client/game/profile/items/moving - HideoutCustomizationApply /// - public ItemEventRouterResponse HideoutCustomizationApplyCommand(PmcData pmcData, HideoutCustomizationApplyRequestData request, string sessionID) + public ItemEventRouterResponse HideoutCustomizationApplyCommand( + PmcData pmcData, + HideoutCustomizationApplyRequestData request, + string sessionID + ) { return _hideoutController.HideoutCustomizationApply(sessionID, pmcData, request); } @@ -171,7 +236,11 @@ public class HideoutCallbacks( /// Handle client/game/profile/items/moving - hideoutCustomizationSetMannequinPose /// /// - public ItemEventRouterResponse HideoutCustomizationSetMannequinPose(PmcData pmcData, HideoutCustomizationSetMannequinPoseRequest request, string sessionId) + public ItemEventRouterResponse HideoutCustomizationSetMannequinPose( + PmcData pmcData, + HideoutCustomizationSetMannequinPoseRequest request, + string sessionId + ) { return _hideoutController.HideoutCustomizationSetMannequinPose(sessionId, pmcData, request); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/HttpCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/HttpCallbacks.cs index 1461e016..624542d6 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/HttpCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/HttpCallbacks.cs @@ -3,6 +3,7 @@ using SPTarkov.Server.Core.DI; using SPTarkov.Server.Core.Servers; namespace SPTarkov.Server.Core.Callbacks; + [Injectable(InjectionType.Singleton, TypePriority = OnLoadOrder.HttpCallbacks)] public class HttpCallbacks(HttpServer _httpServer) : IOnLoad { diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/InraidCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/InraidCallbacks.cs index 98758d1b..052a1231 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/InraidCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/InraidCallbacks.cs @@ -7,10 +7,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Callbacks; [Injectable] -public class InraidCallbacks( - InRaidController _inRaidController, - HttpResponseUtil _httpResponseUtil -) +public class InraidCallbacks(InRaidController _inRaidController, HttpResponseUtil _httpResponseUtil) { /// /// Handle client/location/getLocalloot @@ -20,7 +17,11 @@ public class InraidCallbacks( /// register player request /// Session id /// Null http response - public ValueTask RegisterPlayer(string url, RegisterPlayerRequestData info, string sessionID) + public ValueTask RegisterPlayer( + string url, + RegisterPlayerRequestData info, + string sessionID + ) { _inRaidController.AddPlayer(sessionID, info); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -45,16 +46,24 @@ public class InraidCallbacks( /// JSON as string public ValueTask GetRaidMenuSettings() { - return new ValueTask(_httpResponseUtil.NoBody(_inRaidController.GetInRaidConfig().RaidMenuSettings)); + return new ValueTask( + _httpResponseUtil.NoBody(_inRaidController.GetInRaidConfig().RaidMenuSettings) + ); } /// /// Handle singleplayer/scav/traitorscavhostile /// /// - public ValueTask GetTraitorScavHostileChance(string url, EmptyRequestData _, string sessionID) + public ValueTask GetTraitorScavHostileChance( + string url, + EmptyRequestData _, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.NoBody(_inRaidController.GetTraitorScavHostileChance(url, sessionID))); + return new ValueTask( + _httpResponseUtil.NoBody(_inRaidController.GetTraitorScavHostileChance(url, sessionID)) + ); } /// @@ -63,6 +72,8 @@ public class InraidCallbacks( /// public ValueTask GetBossTypes(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.NoBody(_inRaidController.GetBossTypes(url, sessionID))); + return new ValueTask( + _httpResponseUtil.NoBody(_inRaidController.GetBossTypes(url, sessionID)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/InsuranceCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/InsuranceCallbacks.cs index f37c9e87..48461ad6 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/InsuranceCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/InsuranceCallbacks.cs @@ -17,8 +17,7 @@ public class InsuranceCallbacks( InsuranceService _insuranceService, HttpResponseUtil _httpResponseUtil, ConfigServer _configServer -) - : IOnUpdate +) : IOnUpdate { private readonly InsuranceConfig _insuranceConfig = _configServer.GetConfig(); @@ -41,9 +40,15 @@ public class InsuranceCallbacks( /// /// Session/player id /// - public ValueTask GetInsuranceCost(string url, GetInsuranceCostRequestData info, string sessionID) + public ValueTask GetInsuranceCost( + string url, + GetInsuranceCostRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_insuranceController.Cost(info, sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_insuranceController.Cost(info, sessionID)) + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/InventoryCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/InventoryCallbacks.cs index a373bea3..5f84b764 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/InventoryCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/InventoryCallbacks.cs @@ -21,8 +21,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse MoveItem(PmcData pmcData, InventoryMoveRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse MoveItem( + PmcData pmcData, + InventoryMoveRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.MoveItem(pmcData, info, sessionID, output); return output; @@ -36,8 +40,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse RemoveItem(PmcData pmcData, InventoryRemoveRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse RemoveItem( + PmcData pmcData, + InventoryRemoveRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.DiscardItem(pmcData, info, sessionID, output); return output; @@ -51,8 +59,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse SplitItem(PmcData pmcData, InventorySplitRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse SplitItem( + PmcData pmcData, + InventorySplitRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.SplitItem(pmcData, info, sessionID, output); return output; @@ -65,8 +77,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse MergeItem(PmcData pmcData, InventoryMergeRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse MergeItem( + PmcData pmcData, + InventoryMergeRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.MergeItem(pmcData, info, sessionID, output); return output; @@ -79,8 +95,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse TransferItem(PmcData pmcData, InventoryTransferRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse TransferItem( + PmcData pmcData, + InventoryTransferRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.TransferItem(pmcData, info, sessionID, output); return output; @@ -93,7 +113,11 @@ public class InventoryCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse SwapItem(PmcData pmcData, InventorySwapRequestData info, string sessionID) + public ItemEventRouterResponse SwapItem( + PmcData pmcData, + InventorySwapRequestData info, + string sessionID + ) { return _inventoryController.SwapItem(pmcData, info, sessionID); } @@ -104,7 +128,11 @@ public class InventoryCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse FoldItem(PmcData pmcData, InventoryFoldRequestData info, string sessionID) + public ItemEventRouterResponse FoldItem( + PmcData pmcData, + InventoryFoldRequestData info, + string sessionID + ) { return _inventoryController.FoldItem(pmcData, info, sessionID); } @@ -115,7 +143,11 @@ public class InventoryCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse ToggleItem(PmcData pmcData, InventoryToggleRequestData info, string sessionID) + public ItemEventRouterResponse ToggleItem( + PmcData pmcData, + InventoryToggleRequestData info, + string sessionID + ) { return _inventoryController.ToggleItem(pmcData, info, sessionID); } @@ -126,7 +158,11 @@ public class InventoryCallbacks( /// /// Session/Player id /// - public ItemEventRouterResponse TagItem(PmcData pmcData, InventoryTagRequestData request, string sessionId) + public ItemEventRouterResponse TagItem( + PmcData pmcData, + InventoryTagRequestData request, + string sessionId + ) { return _inventoryController.TagItem(pmcData, request, sessionId); } @@ -138,8 +174,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse BindItem(PmcData pmcData, InventoryBindRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse BindItem( + PmcData pmcData, + InventoryBindRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.BindItem(pmcData, info, sessionID, output); return output; @@ -152,8 +192,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse UnBindItem(PmcData pmcData, InventoryBindRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse UnBindItem( + PmcData pmcData, + InventoryBindRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.UnBindItem(pmcData, info, sessionID, output); return output; @@ -166,8 +210,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse ExamineItem(PmcData pmcData, InventoryExamineRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse ExamineItem( + PmcData pmcData, + InventoryExamineRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.ExamineItem(pmcData, info, sessionID, output); return output; @@ -180,8 +228,11 @@ public class InventoryCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse ReadEncyclopedia(PmcData pmcData, InventoryReadEncyclopediaRequestData info, - string sessionID) + public ItemEventRouterResponse ReadEncyclopedia( + PmcData pmcData, + InventoryReadEncyclopediaRequestData info, + string sessionID + ) { return _inventoryController.ReadEncyclopedia(pmcData, info, sessionID); } @@ -194,8 +245,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse SortInventory(PmcData pmcData, InventorySortRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse SortInventory( + PmcData pmcData, + InventorySortRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.SortInventory(pmcData, info, sessionID, output); return output; @@ -208,8 +263,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse CreateMapMarker(PmcData pmcData, InventoryCreateMarkerRequestData info, - string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse CreateMapMarker( + PmcData pmcData, + InventoryCreateMarkerRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.CreateMapMarker(pmcData, info, sessionID, output); return output; @@ -222,8 +281,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse DeleteMapMarker(PmcData pmcData, InventoryDeleteMarkerRequestData info, - string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse DeleteMapMarker( + PmcData pmcData, + InventoryDeleteMarkerRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.DeleteMapMarker(pmcData, info, sessionID, output); return output; @@ -236,8 +299,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse EditMapMarker(PmcData pmcData, InventoryEditMarkerRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse EditMapMarker( + PmcData pmcData, + InventoryEditMarkerRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.EditMapMarker(pmcData, info, sessionID, output); return output; @@ -251,9 +318,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse OpenRandomLootContainer(PmcData pmcData, OpenRandomLootContainerRequestData info, + public ItemEventRouterResponse OpenRandomLootContainer( + PmcData pmcData, + OpenRandomLootContainerRequestData info, string sessionID, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { _inventoryController.OpenRandomLootContainer(pmcData, info, sessionID, output); return output; @@ -266,8 +336,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse RedeemProfileReward(PmcData pmcData, RedeemProfileRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse RedeemProfileReward( + PmcData pmcData, + RedeemProfileRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.RedeemProfileReward(pmcData, info, sessionID); return output; @@ -281,8 +355,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse SetFavoriteItem(PmcData pmcData, SetFavoriteItems info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse SetFavoriteItem( + PmcData pmcData, + SetFavoriteItems info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.SetFavoriteItem(pmcData, info, sessionID); return output; @@ -297,8 +375,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse FailQuest(PmcData pmcData, FailQuestRequestData info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse FailQuest( + PmcData pmcData, + FailQuestRequestData info, + string sessionID, + ItemEventRouterResponse output + ) { _questController.FailQuest(pmcData, info, sessionID, output); return output; @@ -311,8 +393,12 @@ public class InventoryCallbacks( /// Session/player id /// Client response /// - public ItemEventRouterResponse PinOrLock(PmcData pmcData, PinOrLockItemRequest info, string sessionID, - ItemEventRouterResponse output) + public ItemEventRouterResponse PinOrLock( + PmcData pmcData, + PinOrLockItemRequest info, + string sessionID, + ItemEventRouterResponse output + ) { _inventoryController.PinOrLock(pmcData, info, sessionID, output); return output; diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/ItemEventCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/ItemEventCallbacks.cs index 165f6f91..8043e40b 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/ItemEventCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/ItemEventCallbacks.cs @@ -7,13 +7,24 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Callbacks; [Injectable] -public class ItemEventCallbacks(HttpResponseUtil _httpResponseUtil, ItemEventRouter _itemEventRouter) +public class ItemEventCallbacks( + HttpResponseUtil _httpResponseUtil, + ItemEventRouter _itemEventRouter +) { - public async ValueTask HandleEvents(string url, ItemEventRouterRequest info, string sessionID) + public async ValueTask HandleEvents( + string url, + ItemEventRouterRequest info, + string sessionID + ) { var eventResponse = await _itemEventRouter.HandleEvents(info, sessionID); var result = IsCriticalError(eventResponse.Warnings) - ? _httpResponseUtil.GetBody(eventResponse, GetErrorCode(eventResponse.Warnings), eventResponse.Warnings[0].ErrorMessage) + ? _httpResponseUtil.GetBody( + eventResponse, + GetErrorCode(eventResponse.Warnings), + eventResponse.Warnings[0].ErrorMessage + ) : _httpResponseUtil.GetBody(eventResponse); return result; @@ -34,7 +45,7 @@ public class ItemEventCallbacks(HttpResponseUtil _httpResponseUtil, ItemEventRou // List of non-critical error codes, we return true if any error NOT included is passed in var nonCriticalErrorCodes = new HashSet { - BackendErrorCodes.NotEnoughSpace + BackendErrorCodes.NotEnoughSpace, }; foreach (var warning in warnings) @@ -51,6 +62,8 @@ public class ItemEventCallbacks(HttpResponseUtil _httpResponseUtil, ItemEventRou public static BackendErrorCodes GetErrorCode(List warnings) { // Cast int to string to get the error code of 220 for Unknown Error. - return warnings.FirstOrDefault()?.Code is null ? BackendErrorCodes.UnknownError : warnings.FirstOrDefault()?.Code ?? BackendErrorCodes.UnknownError; + return warnings.FirstOrDefault()?.Code is null + ? BackendErrorCodes.UnknownError + : warnings.FirstOrDefault()?.Code ?? BackendErrorCodes.UnknownError; } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/LauncherCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/LauncherCallbacks.cs index 7bef8fcd..c5ab28e0 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/LauncherCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/LauncherCallbacks.cs @@ -68,21 +68,33 @@ public class LauncherCallbacks( public ValueTask RemoveProfile(string url, RemoveProfileData info, string sessionID) { - return new ValueTask(_httpResponseUtil.NoBody(_saveServer.RemoveProfile(sessionID))); + return new ValueTask( + _httpResponseUtil.NoBody(_saveServer.RemoveProfile(sessionID)) + ); } public ValueTask GetCompatibleTarkovVersion() { - return new ValueTask(_httpResponseUtil.NoBody(_launcherController.GetCompatibleTarkovVersion())); + return new ValueTask( + _httpResponseUtil.NoBody(_launcherController.GetCompatibleTarkovVersion()) + ); } public ValueTask GetLoadedServerMods() { - return new ValueTask(_httpResponseUtil.NoBody(_launcherController.GetLoadedServerMods())); + return new ValueTask( + _httpResponseUtil.NoBody(_launcherController.GetLoadedServerMods()) + ); } - public ValueTask GetServerModsProfileUsed(string url, EmptyRequestData _, string sessionID) + public ValueTask GetServerModsProfileUsed( + string url, + EmptyRequestData _, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.NoBody(_launcherController.GetServerModsProfileUsed(sessionID))); + return new ValueTask( + _httpResponseUtil.NoBody(_launcherController.GetServerModsProfileUsed(sessionID)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/LauncherV2Callbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/LauncherV2Callbacks.cs index a66b36a4..5f21ed73 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/LauncherV2Callbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/LauncherV2Callbacks.cs @@ -15,32 +15,29 @@ public class LauncherV2Callbacks( { public ValueTask Ping() { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2PingResponse - { - Response = _launcherV2Controller.Ping() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2PingResponse { Response = _launcherV2Controller.Ping() } + ) + ); } public ValueTask Types() { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2TypesResponse - { - Response = _launcherV2Controller.Types() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2TypesResponse { Response = _launcherV2Controller.Types() } + ) + ); } public ValueTask Login(LoginRequestData info) { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2LoginResponse - { - Response = _launcherV2Controller.Login(info) - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2LoginResponse { Response = _launcherV2Controller.Login(info) } + ) + ); } public async ValueTask Register(RegisterData info) @@ -49,7 +46,7 @@ public class LauncherV2Callbacks( new LauncherV2RegisterResponse { Response = await _launcherV2Controller.Register(info), - Profiles = _profileController.GetMiniProfiles() + Profiles = _profileController.GetMiniProfiles(), } ); } @@ -60,63 +57,67 @@ public class LauncherV2Callbacks( new LauncherV2PasswordChangeResponse { Response = await _launcherV2Controller.PasswordChange(info), - Profiles = _profileController.GetMiniProfiles() + Profiles = _profileController.GetMiniProfiles(), } ); } public ValueTask Remove(LoginRequestData info) { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2RemoveResponse - { - Response = _launcherV2Controller.Remove(info), - Profiles = _profileController.GetMiniProfiles() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2RemoveResponse + { + Response = _launcherV2Controller.Remove(info), + Profiles = _profileController.GetMiniProfiles(), + } + ) + ); } public ValueTask CompatibleVersion() { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2VersionResponse - { - Response = new LauncherV2CompatibleVersion + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2VersionResponse { - SptVersion = _launcherV2Controller.SptVersion(), - EftVersion = _launcherV2Controller.EftVersion() + Response = new LauncherV2CompatibleVersion + { + SptVersion = _launcherV2Controller.SptVersion(), + EftVersion = _launcherV2Controller.EftVersion(), + }, } - } - )); + ) + ); } public ValueTask Mods() { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2ModsResponse - { - Response = _launcherV2Controller.LoadedMods() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2ModsResponse { Response = _launcherV2Controller.LoadedMods() } + ) + ); } public ValueTask Profiles() { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2ProfilesResponse - { - Response = _profileController.GetMiniProfiles() - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2ProfilesResponse { Response = _profileController.GetMiniProfiles() } + ) + ); } public ValueTask Profile(string? sessionId) { - return new ValueTask(_httpResponseUtil.NoBody( - new LauncherV2ProfileResponse - { - Response = _launcherV2Controller.GetProfile(sessionId) - } - )); + return new ValueTask( + _httpResponseUtil.NoBody( + new LauncherV2ProfileResponse + { + Response = _launcherV2Controller.GetProfile(sessionId), + } + ) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/LocationCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/LocationCallbacks.cs index 7f45dfd7..be3b004d 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/LocationCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/LocationCallbacks.cs @@ -18,15 +18,23 @@ public class LocationCallbacks( /// public ValueTask GetLocationData(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_locationController.GenerateAll(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_locationController.GenerateAll(sessionID)) + ); } /// /// Handle client/airdrop/loot /// /// - public ValueTask GetAirdropLoot(string url, GetAirdropLootRequest info, string sessionID) + public ValueTask GetAirdropLoot( + string url, + GetAirdropLootRequest info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_locationController.GetAirDropLoot(info))); + return new ValueTask( + _httpResponseUtil.GetBody(_locationController.GetAirDropLoot(info)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/MatchCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/MatchCallbacks.cs index 46e5c582..8a314a24 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/MatchCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/MatchCallbacks.cs @@ -54,12 +54,9 @@ public class MatchCallbacks( /// public ValueTask GroupCurrent(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody( - new MatchGroupCurrentResponse - { - Squad = [] - } - )); + return new ValueTask( + _httpResponseUtil.GetBody(new MatchGroupCurrentResponse { Squad = [] }) + ); } /// @@ -84,7 +81,11 @@ public class MatchCallbacks( /// Handle client/match/group/invite/send /// /// - public ValueTask SendGroupInvite(string url, MatchGroupInviteSendRequest info, string sessionID) + public ValueTask SendGroupInvite( + string url, + MatchGroupInviteSendRequest info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody("2427943f23698ay9f2863735")); } @@ -95,12 +96,7 @@ public class MatchCallbacks( /// public ValueTask AcceptGroupInvite(string url, RequestIdRequest info, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody( - new List - { - new() - } - )); + return new ValueTask(_httpResponseUtil.GetBody(new List { new() })); } /// @@ -134,7 +130,11 @@ public class MatchCallbacks( /// /// Session/player id /// - public ValueTask TransferGroup(string url, MatchGroupTransferRequest info, string sessionID) + public ValueTask TransferGroup( + string url, + MatchGroupTransferRequest info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody(true)); } @@ -161,7 +161,11 @@ public class MatchCallbacks( /// Handle client/analytics/event-disconnect /// /// - public ValueTask EventDisconnect(string url, PutMetricsRequestData info, string sessionID) + public ValueTask EventDisconnect( + string url, + PutMetricsRequestData info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } @@ -179,9 +183,15 @@ public class MatchCallbacks( /// Handle match/group/start_game /// /// - public ValueTask JoinMatch(string url, MatchGroupStartGameRequest info, string sessionID) + public ValueTask JoinMatch( + string url, + MatchGroupStartGameRequest info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_matchController.JoinMatch(info, sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_matchController.JoinMatch(info, sessionID)) + ); } /// @@ -190,7 +200,9 @@ public class MatchCallbacks( /// public ValueTask GetMetrics(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_databaseService.GetMatch().Metrics)); + return new ValueTask( + _httpResponseUtil.GetBody(_databaseService.GetMatch().Metrics) + ); } /// @@ -198,9 +210,15 @@ public class MatchCallbacks( /// Handle client/match/group/status /// /// - public ValueTask GetGroupStatus(string url, MatchGroupStatusRequest info, string sessionID) + public ValueTask GetGroupStatus( + string url, + MatchGroupStatusRequest info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_matchController.GetGroupStatus(info))); + return new ValueTask( + _httpResponseUtil.GetBody(_matchController.GetGroupStatus(info)) + ); } /// @@ -226,7 +244,11 @@ public class MatchCallbacks( /// Handle client/match/group/player/remove /// /// - public ValueTask RemovePlayerFromGroup(string url, MatchGroupPlayerRemoveRequest info, string sessionID) + public ValueTask RemovePlayerFromGroup( + string url, + MatchGroupPlayerRemoveRequest info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.GetBody(true)); } @@ -235,16 +257,26 @@ public class MatchCallbacks( /// Handle client/match/local/start /// /// - public ValueTask StartLocalRaid(string url, StartLocalRaidRequestData info, string sessionID) + public ValueTask StartLocalRaid( + string url, + StartLocalRaidRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_matchController.StartLocalRaid(sessionID, info))); + return new ValueTask( + _httpResponseUtil.GetBody(_matchController.StartLocalRaid(sessionID, info)) + ); } /// /// Handle client/match/local/end /// /// - public ValueTask EndLocalRaid(string url, EndLocalRaidRequestData info, string sessionID) + public ValueTask EndLocalRaid( + string url, + EndLocalRaidRequestData info, + string sessionID + ) { _matchController.EndLocalRaid(sessionID, info); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -254,7 +286,11 @@ public class MatchCallbacks( /// Handle client/raid/configuration /// /// - public ValueTask GetRaidConfiguration(string url, GetRaidConfigurationRequestData info, string sessionID) + public ValueTask GetRaidConfiguration( + string url, + GetRaidConfigurationRequestData info, + string sessionID + ) { _matchController.ConfigureOfflineRaid(info, sessionID); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -267,7 +303,11 @@ public class MatchCallbacks( /// /// Session/player id /// - public ValueTask GetConfigurationByProfile(string url, GetRaidConfigurationRequestData info, string sessionID) + public ValueTask GetConfigurationByProfile( + string url, + GetRaidConfigurationRequestData info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/NoteCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/NoteCallbacks.cs index cf9c71b7..bcd220c8 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/NoteCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/NoteCallbacks.cs @@ -16,7 +16,11 @@ public class NoteCallbacks(NoteController _noteController) /// Add note request /// Session/player id /// ItemEventRouterResponse - public ItemEventRouterResponse AddNote(PmcData pmcData, NoteActionRequest request, string sessionID) + public ItemEventRouterResponse AddNote( + PmcData pmcData, + NoteActionRequest request, + string sessionID + ) { return _noteController.AddNote(pmcData, request, sessionID); } @@ -28,7 +32,11 @@ public class NoteCallbacks(NoteController _noteController) /// Edit note request /// Session/player id /// ItemEventRouterResponse - public ItemEventRouterResponse EditNote(PmcData pmcData, NoteActionRequest request, string sessionID) + public ItemEventRouterResponse EditNote( + PmcData pmcData, + NoteActionRequest request, + string sessionID + ) { return _noteController.EditNote(pmcData, request, sessionID); } @@ -40,7 +48,11 @@ public class NoteCallbacks(NoteController _noteController) /// Delete note request /// Session/player id /// ItemEventRouterResponse - public ItemEventRouterResponse DeleteNote(PmcData pmcData, NoteActionRequest request, string sessionID) + public ItemEventRouterResponse DeleteNote( + PmcData pmcData, + NoteActionRequest request, + string sessionID + ) { return _noteController.DeleteNote(pmcData, request, sessionID); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/NotifierCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/NotifierCallbacks.cs index 824389a6..c42bcd4d 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/NotifierCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/NotifierCallbacks.cs @@ -32,12 +32,14 @@ public class NotifierCallbacks( * Take our array of JSON message objects and cast them to JSON strings, so that they can then * be sent to client as NEWLINE separated strings... yup. */ - _notifierController.NotifyAsync(tmpSessionID) - .ContinueWith(messages => messages.Result.Select(message => string.Join("\n", jsonUtil.Serialize(message)))) + _notifierController + .NotifyAsync(tmpSessionID) + .ContinueWith(messages => + messages.Result.Select(message => string.Join("\n", jsonUtil.Serialize(message))) + ) .ContinueWith(text => httpServerHelper.SendTextJson(resp, text.Result)); } - /// /// TODO: removed from client? /// Handle push/notifier/get @@ -55,7 +57,9 @@ public class NotifierCallbacks( /// public ValueTask CreateNotifierChannel(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_notifierController.GetChannel(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_notifierController.GetChannel(sessionID)) + ); } /// @@ -64,12 +68,9 @@ public class NotifierCallbacks( /// public ValueTask SelectProfile(string url, UIDRequestData info, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody( - new SelectProfileResponse - { - Status = "ok" - } - )); + return new ValueTask( + _httpResponseUtil.GetBody(new SelectProfileResponse { Status = "ok" }) + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/PrestigeCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/PrestigeCallbacks.cs index 78e8d4be..b7acf6ad 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/PrestigeCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/PrestigeCallbacks.cs @@ -21,7 +21,9 @@ public class PrestigeCallbacks( /// public ValueTask GetPrestige(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_prestigeController.GetPrestige(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_prestigeController.GetPrestige(sessionID)) + ); } /// @@ -31,7 +33,11 @@ public class PrestigeCallbacks( /// /// Session/player id /// - public async ValueTask ObtainPrestige(string url, ObtainPrestigeRequestList info, string sessionID) + public async ValueTask ObtainPrestige( + string url, + ObtainPrestigeRequestList info, + string sessionID + ) { await _prestigeController.ObtainPrestige(sessionID, info); diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/ProfileCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/ProfileCallbacks.cs index 17c5bd88..9925b3e1 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/ProfileCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/ProfileCallbacks.cs @@ -22,15 +22,14 @@ public class ProfileCallbacks( /// Handle client/game/profile/create /// /// - public async ValueTask CreateProfile(string url, ProfileCreateRequestData info, string sessionID) + public async ValueTask CreateProfile( + string url, + ProfileCreateRequestData info, + string sessionID + ) { var id = await _profileController.CreateProfile(info, sessionID); - return _httpResponse.GetBody( - new CreateProfileResponse - { - UserId = id - } - ); + return _httpResponse.GetBody(new CreateProfileResponse { UserId = id }); } /// @@ -40,7 +39,9 @@ public class ProfileCallbacks( /// public ValueTask GetProfileData(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponse.GetBody(_profileController.GetCompleteProfile(sessionID))); + return new ValueTask( + _httpResponse.GetBody(_profileController.GetCompleteProfile(sessionID)) + ); } /// @@ -51,19 +52,22 @@ public class ProfileCallbacks( /// public ValueTask RegenerateScav(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponse.GetBody( - new List - { - _profileController.GeneratePlayerScav(sessionID) - } - )); + return new ValueTask( + _httpResponse.GetBody( + new List { _profileController.GeneratePlayerScav(sessionID) } + ) + ); } /// /// Handle client/game/profile/voice/change event /// /// - public ValueTask ChangeVoice(string url, ProfileChangeVoiceRequestData info, string sessionID) + public ValueTask ChangeVoice( + string url, + ProfileChangeVoiceRequestData info, + string sessionID + ) { _profileController.ChangeVoice(info, sessionID); return new ValueTask(_httpResponse.NullResponse()); @@ -74,21 +78,35 @@ public class ProfileCallbacks( /// Client allows player to adjust their profile name /// /// Client response as string - public ValueTask ChangeNickname(string url, ProfileChangeNicknameRequestData info, string sessionId) + public ValueTask ChangeNickname( + string url, + ProfileChangeNicknameRequestData info, + string sessionId + ) { var output = _profileController.ChangeNickname(info, sessionId); return output switch { - NicknameValidationResult.Taken => new ValueTask(_httpResponse.GetBody(null, BackendErrorCodes.NicknameNotUnique, $"{BackendErrorCodes.NicknameNotUnique} - ")), - NicknameValidationResult.Short => new ValueTask(_httpResponse.GetBody(null, BackendErrorCodes.NicknameNotValid, $"{BackendErrorCodes.NicknameNotValid} - ")), - _ => new ValueTask(_httpResponse.GetBody( - new - { - status = 0, - NicknameChangeDate = _timeUtil.GetTimeStamp() - } - )) + NicknameValidationResult.Taken => new ValueTask( + _httpResponse.GetBody( + null, + BackendErrorCodes.NicknameNotUnique, + $"{BackendErrorCodes.NicknameNotUnique} - " + ) + ), + NicknameValidationResult.Short => new ValueTask( + _httpResponse.GetBody( + null, + BackendErrorCodes.NicknameNotValid, + $"{BackendErrorCodes.NicknameNotValid} - " + ) + ), + _ => new ValueTask( + _httpResponse.GetBody( + new { status = 0, NicknameChangeDate = _timeUtil.GetTimeStamp() } + ) + ), }; } @@ -96,18 +114,29 @@ public class ProfileCallbacks( /// Handle client/game/profile/nickname/validate /// /// Client response as string - public ValueTask ValidateNickname(string url, ValidateNicknameRequestData info, string sessionId) + public ValueTask ValidateNickname( + string url, + ValidateNicknameRequestData info, + string sessionId + ) { return _profileController.ValidateNickname(info, sessionId) switch { - NicknameValidationResult.Taken => new ValueTask(_httpResponse.GetBody(null, BackendErrorCodes.NicknameNotUnique, $"{BackendErrorCodes.NicknameNotUnique} - ")), - NicknameValidationResult.Short => new ValueTask(_httpResponse.GetBody(null, BackendErrorCodes.NicknameNotValid, $"{BackendErrorCodes.NicknameNotValid} - ")), - _ => new ValueTask(_httpResponse.GetBody( - new - { - status = "ok" - } - )) + NicknameValidationResult.Taken => new ValueTask( + _httpResponse.GetBody( + null, + BackendErrorCodes.NicknameNotUnique, + $"{BackendErrorCodes.NicknameNotUnique} - " + ) + ), + NicknameValidationResult.Short => new ValueTask( + _httpResponse.GetBody( + null, + BackendErrorCodes.NicknameNotValid, + $"{BackendErrorCodes.NicknameNotValid} - " + ) + ), + _ => new ValueTask(_httpResponse.GetBody(new { status = "ok" })), }; } @@ -134,7 +163,9 @@ public class ProfileCallbacks( /// public ValueTask GetProfileStatus(string url, EmptyRequestData _, string sessionId) { - return new ValueTask(_httpResponse.GetBody(_profileController.GetProfileStatus(sessionId))); + return new ValueTask( + _httpResponse.GetBody(_profileController.GetProfileStatus(sessionId)) + ); } /// @@ -142,36 +173,60 @@ public class ProfileCallbacks( /// Called when viewing another players profile /// /// - public ValueTask GetOtherProfile(string url, GetOtherProfileRequest request, string sessionID) + public ValueTask GetOtherProfile( + string url, + GetOtherProfileRequest request, + string sessionID + ) { - return new ValueTask(_httpResponse.GetBody(_profileController.GetOtherProfile(sessionID, request))); + return new ValueTask( + _httpResponse.GetBody(_profileController.GetOtherProfile(sessionID, request)) + ); } /// /// Handle client/profile/settings /// /// - public ValueTask GetProfileSettings(string url, GetProfileSettingsRequest info, string sessionID) + public ValueTask GetProfileSettings( + string url, + GetProfileSettingsRequest info, + string sessionID + ) { - return new ValueTask(_httpResponse.GetBody(_profileController.SetChosenProfileIcon(sessionID, info))); + return new ValueTask( + _httpResponse.GetBody(_profileController.SetChosenProfileIcon(sessionID, info)) + ); } /// /// Handle client/game/profile/search /// /// - public ValueTask SearchProfiles(string url, SearchProfilesRequestData info, string sessionID) + public ValueTask SearchProfiles( + string url, + SearchProfilesRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponse.GetBody(_profileController.SearchProfiles(info, sessionID))); + return new ValueTask( + _httpResponse.GetBody(_profileController.SearchProfiles(info, sessionID)) + ); } /// /// Handle launcher/profile/info /// /// - public ValueTask GetMiniProfile(string url, GetMiniProfileRequestData info, string sessionID) + public ValueTask GetMiniProfile( + string url, + GetMiniProfileRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponse.NoBody(_profileController.GetMiniProfile(sessionID))); + return new ValueTask( + _httpResponse.NoBody(_profileController.GetMiniProfile(sessionID)) + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/QuestCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/QuestCallbacks.cs index 5866423d..0e64ff28 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/QuestCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/QuestCallbacks.cs @@ -21,7 +21,11 @@ public class QuestCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse ChangeRepeatableQuest(PmcData pmcData, RepeatableQuestChangeRequest info, string sessionID) + public ItemEventRouterResponse ChangeRepeatableQuest( + PmcData pmcData, + RepeatableQuestChangeRequest info, + string sessionID + ) { return _repeatableQuestController.ChangeRepeatableQuest(pmcData, info, sessionID); } @@ -33,7 +37,11 @@ public class QuestCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse AcceptQuest(PmcData pmcData, AcceptQuestRequestData info, string sessionID) + public ItemEventRouterResponse AcceptQuest( + PmcData pmcData, + AcceptQuestRequestData info, + string sessionID + ) { if (info.Type == "repeatable") { @@ -50,7 +58,11 @@ public class QuestCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse CompleteQuest(PmcData pmcData, CompleteQuestRequestData info, string sessionID) + public ItemEventRouterResponse CompleteQuest( + PmcData pmcData, + CompleteQuestRequestData info, + string sessionID + ) { return _questController.CompleteQuest(pmcData, info, sessionID); } @@ -62,7 +74,11 @@ public class QuestCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse HandoverQuest(PmcData pmcData, HandoverQuestRequestData info, string sessionID) + public ItemEventRouterResponse HandoverQuest( + PmcData pmcData, + HandoverQuestRequestData info, + string sessionID + ) { return _questController.HandoverQuest(pmcData, info, sessionID); } @@ -76,7 +92,9 @@ public class QuestCallbacks( /// public ValueTask ListQuests(string url, ListQuestsRequestData info, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_questController.GetClientQuests(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_questController.GetClientQuests(sessionID)) + ); } /// @@ -88,6 +106,10 @@ public class QuestCallbacks( /// public ValueTask ActivityPeriods(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_repeatableQuestController.GetClientRepeatableQuests(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody( + _repeatableQuestController.GetClientRepeatableQuests(sessionID) + ) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/RagfairCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/RagfairCallbacks.cs index 09c67278..8a4e86fb 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/RagfairCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/RagfairCallbacks.cs @@ -61,7 +61,9 @@ public class RagfairCallbacks( /// public ValueTask Search(string url, SearchRequestData info, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_ragfairController.GetOffers(sessionID, info))); + return new ValueTask( + _httpResponseUtil.GetBody(_ragfairController.GetOffers(sessionID, info)) + ); } /// @@ -71,9 +73,15 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ValueTask GetMarketPrice(string url, GetMarketPriceRequestData info, string sessionID) + public ValueTask GetMarketPrice( + string url, + GetMarketPriceRequestData info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_ragfairController.GetItemMinAvgMaxFleaPriceValues(info))); + return new ValueTask( + _httpResponseUtil.GetBody(_ragfairController.GetItemMinAvgMaxFleaPriceValues(info)) + ); } /// @@ -83,7 +91,11 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse AddOffer(PmcData pmcData, AddOfferRequestData info, string sessionID) + public ItemEventRouterResponse AddOffer( + PmcData pmcData, + AddOfferRequestData info, + string sessionID + ) { return _ragfairController.AddPlayerOffer(pmcData, info, sessionID); } @@ -95,7 +107,11 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse RemoveOffer(PmcData pmcData, RemoveOfferRequestData info, string sessionID) + public ItemEventRouterResponse RemoveOffer( + PmcData pmcData, + RemoveOfferRequestData info, + string sessionID + ) { return _ragfairController.FlagOfferForRemoval(info.OfferId, sessionID); } @@ -107,7 +123,11 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ItemEventRouterResponse ExtendOffer(PmcData pmcData, ExtendOfferRequestData info, string sessionID) + public ItemEventRouterResponse ExtendOffer( + PmcData pmcData, + ExtendOfferRequestData info, + string sessionID + ) { return _ragfairController.ExtendOffer(info, sessionID); } @@ -122,7 +142,9 @@ public class RagfairCallbacks( /// public ValueTask GetFleaPrices(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_ragfairController.GetAllFleaPrices())); + return new ValueTask( + _httpResponseUtil.GetBody(_ragfairController.GetAllFleaPrices()) + ); } /// @@ -132,12 +154,20 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ValueTask SendReport(string url, SendRagfairReportRequestData info, string sessionID) + public ValueTask SendReport( + string url, + SendRagfairReportRequestData info, + string sessionID + ) { return new ValueTask(_httpResponseUtil.NullResponse()); } - public ValueTask StorePlayerOfferTaxAmount(string url, StorePlayerOfferTaxAmountRequestData info, string sessionID) + public ValueTask StorePlayerOfferTaxAmount( + string url, + StorePlayerOfferTaxAmountRequestData info, + string sessionID + ) { _ragfairTaxService.StoreClientOfferTaxValue(sessionID, info); return new ValueTask(_httpResponseUtil.NullResponse()); @@ -150,8 +180,14 @@ public class RagfairCallbacks( /// /// Session/player id /// - public ValueTask GetFleaOfferById(string url, GetRagfairOfferByIdRequest info, string sessionID) + public ValueTask GetFleaOfferById( + string url, + GetRagfairOfferByIdRequest info, + string sessionID + ) { - return new ValueTask(_httpResponseUtil.GetBody(_ragfairController.GetOfferByInternalId(sessionID, info))); + return new ValueTask( + _httpResponseUtil.GetBody(_ragfairController.GetOfferByInternalId(sessionID, info)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/RepairCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/RepairCallbacks.cs index 6bad8f9d..14195c1f 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/RepairCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/RepairCallbacks.cs @@ -17,7 +17,11 @@ public class RepairCallbacks(RepairController _repairController) /// /// Session/player id /// - public ItemEventRouterResponse TraderRepair(PmcData pmcData, TraderRepairActionDataRequest info, string sessionID) + public ItemEventRouterResponse TraderRepair( + PmcData pmcData, + TraderRepairActionDataRequest info, + string sessionID + ) { return _repairController.TraderRepair(sessionID, info, pmcData); } @@ -30,7 +34,11 @@ public class RepairCallbacks(RepairController _repairController) /// /// Session/player id /// - public ItemEventRouterResponse Repair(PmcData pmcData, RepairActionDataRequest info, string sessionID) + public ItemEventRouterResponse Repair( + PmcData pmcData, + RepairActionDataRequest info, + string sessionID + ) { return _repairController.RepairWithKit(sessionID, info, pmcData); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/SaveCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/SaveCallbacks.cs index 9b8c427c..b66c7c93 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/SaveCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/SaveCallbacks.cs @@ -11,8 +11,7 @@ public class SaveCallbacks( SaveServer _saveServer, ConfigServer _configServer, BackupService _backupService -) - : IOnLoad, IOnUpdate +) : IOnLoad, IOnUpdate { private readonly CoreConfig _coreConfig = _configServer.GetConfig(); diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/TradeCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/TradeCallbacks.cs index c8e7ba3e..c16042ee 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/TradeCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/TradeCallbacks.cs @@ -16,7 +16,11 @@ public class TradeCallbacks(TradeController _tradeController) /// /// Session/player id /// - public ItemEventRouterResponse ProcessTrade(PmcData pmcData, ProcessBaseTradeRequestData info, string sessionID) + public ItemEventRouterResponse ProcessTrade( + PmcData pmcData, + ProcessBaseTradeRequestData info, + string sessionID + ) { return _tradeController.ConfirmTrading(pmcData, info, sessionID); } @@ -28,7 +32,11 @@ public class TradeCallbacks(TradeController _tradeController) /// /// Session/player id /// - public ItemEventRouterResponse ProcessRagfairTrade(PmcData pmcData, ProcessRagfairTradeRequestData info, string sessionID) + public ItemEventRouterResponse ProcessRagfairTrade( + PmcData pmcData, + ProcessRagfairTradeRequestData info, + string sessionID + ) { return _tradeController.ConfirmRagfairTrading(pmcData, info, sessionID); } @@ -40,7 +48,11 @@ public class TradeCallbacks(TradeController _tradeController) /// /// Session/player id /// - public ItemEventRouterResponse SellAllFromSavage(PmcData pmcData, SellScavItemsToFenceRequestData info, string sessionID) + public ItemEventRouterResponse SellAllFromSavage( + PmcData pmcData, + SellScavItemsToFenceRequestData info, + string sessionID + ) { return _tradeController.SellScavItemsToFence(pmcData, info, sessionID); } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/TraderCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/TraderCallbacks.cs index 1324ee20..d77efaa6 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/TraderCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/TraderCallbacks.cs @@ -35,7 +35,9 @@ public class TraderCallbacks( /// public ValueTask GetTraderSettings(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_traderController.GetAllTraders(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_traderController.GetAllTraders(sessionID)) + ); } /// @@ -44,7 +46,9 @@ public class TraderCallbacks( public ValueTask GetTrader(string url, EmptyRequestData _, string sessionID) { var traderID = url.Replace("/client/trading/api/getTrader/", ""); - return new ValueTask(_httpResponseUtil.GetBody(_traderController.GetTrader(sessionID, traderID))); + return new ValueTask( + _httpResponseUtil.GetBody(_traderController.GetTrader(sessionID, traderID)) + ); } /// @@ -54,7 +58,9 @@ public class TraderCallbacks( public ValueTask GetAssort(string url, EmptyRequestData _, string sessionID) { var traderID = url.Replace("/client/trading/api/getTraderAssort/", ""); - return new ValueTask(_httpResponseUtil.GetBody(_traderController.GetAssort(sessionID, traderID))); + return new ValueTask( + _httpResponseUtil.GetBody(_traderController.GetAssort(sessionID, traderID)) + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/WeatherCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/WeatherCallbacks.cs index 68955e18..f627ef6c 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/WeatherCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/WeatherCallbacks.cs @@ -32,6 +32,8 @@ public class WeatherCallbacks( /// public ValueTask GetLocalWeather(string url, EmptyRequestData _, string sessionID) { - return new ValueTask(_httpResponseUtil.GetBody(_weatherController.GenerateLocal(sessionID))); + return new ValueTask( + _httpResponseUtil.GetBody(_weatherController.GenerateLocal(sessionID)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/WishlistCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/WishlistCallbacks.cs index e229b1c8..dec1400a 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/WishlistCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/WishlistCallbacks.cs @@ -16,7 +16,11 @@ public class WishlistCallbacks(WishlistController _wishlistController) /// /// Session/player id /// - public ItemEventRouterResponse AddToWishlist(PmcData pmcData, AddToWishlistRequest info, string sessionID) + public ItemEventRouterResponse AddToWishlist( + PmcData pmcData, + AddToWishlistRequest info, + string sessionID + ) { return _wishlistController.AddToWishList(pmcData, info, sessionID); } @@ -28,7 +32,11 @@ public class WishlistCallbacks(WishlistController _wishlistController) /// /// Session/player id /// - public ItemEventRouterResponse RemoveFromWishlist(PmcData pmcData, RemoveFromWishlistRequest info, string sessionID) + public ItemEventRouterResponse RemoveFromWishlist( + PmcData pmcData, + RemoveFromWishlistRequest info, + string sessionID + ) { return _wishlistController.RemoveFromWishList(pmcData, info, sessionID); } @@ -40,7 +48,11 @@ public class WishlistCallbacks(WishlistController _wishlistController) /// /// Session/player id /// - public ItemEventRouterResponse ChangeWishlistItemCategory(PmcData pmcData, ChangeWishlistItemCategoryRequest info, string sessionID) + public ItemEventRouterResponse ChangeWishlistItemCategory( + PmcData pmcData, + ChangeWishlistItemCategoryRequest info, + string sessionID + ) { return _wishlistController.ChangeWishListItemCategory(pmcData, info, sessionID); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/AchievementController.cs b/Libraries/SPTarkov.Server.Core/Controllers/AchievementController.cs index 48a1ef6f..7d8f0449 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/AchievementController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/AchievementController.cs @@ -23,10 +23,7 @@ public class AchievementController( /// public virtual GetAchievementsResponse GetAchievements(string sessionID) { - return new GetAchievementsResponse - { - Elements = databaseService.GetAchievements() - }; + return new GetAchievementsResponse { Elements = databaseService.GetAchievements() }; } /// @@ -37,12 +34,21 @@ public class AchievementController( public virtual CompletedAchievementsResponse GetAchievementStatics(string sessionId) { var stats = new Dictionary(); - var profiles = profileHelper.GetProfiles() - .Where(kvp => !coreConfig.Features.AchievementProfileIdBlacklist.Contains(kvp.Value.ProfileInfo.ProfileId)) + var profiles = profileHelper + .GetProfiles() + .Where(kvp => + !coreConfig.Features.AchievementProfileIdBlacklist.Contains( + kvp.Value.ProfileInfo.ProfileId + ) + ) .ToDictionary(); var achievements = databaseService.GetAchievements(); - foreach (var achievementId in achievements.Select(achievement => achievement.Id).Where(achievementId => !string.IsNullOrEmpty(achievementId))) + foreach ( + var achievementId in achievements + .Select(achievement => achievement.Id) + .Where(achievementId => !string.IsNullOrEmpty(achievementId)) + ) { var profilesHaveAchievement = 0; foreach (var (profileId, profile) in profiles) @@ -63,15 +69,13 @@ public class AchievementController( var percentage = 0; if (profiles.Count > 0) { - percentage = (int)Math.Round((double)profilesHaveAchievement / profiles.Count * 100); + percentage = (int) + Math.Round((double)profilesHaveAchievement / profiles.Count * 100); } stats.Add(achievementId, percentage); } - return new CompletedAchievementsResponse - { - Elements = stats - }; + return new CompletedAchievementsResponse { Elements = stats }; } } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs index 29952697..d87c204a 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Text.Json.Serialization; -using SPTarkov.Server.Core.Constants; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Generators; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Common; @@ -50,7 +50,9 @@ public class BotController( { if (!_botConfig.PresetBatch.TryGetValue(type, out var limit)) { - _logger.Warning(_localisationService.GetText("bot-bot_preset_count_value_missing", type)); + _logger.Warning( + _localisationService.GetText("bot-bot_preset_count_value_missing", type) + ); return 10; } @@ -78,23 +80,38 @@ public class BotController( /// OPTIONAL - applicationContext Data stored at start of raid /// OPTIONAL - should raid settings chosen pre-raid be ignored /// Difficulty object - public DifficultyCategories GetBotDifficulty(string sessionId, string type, string diffLevel, bool ignoreRaidSettings = false) + public DifficultyCategories GetBotDifficulty( + string sessionId, + string type, + string diffLevel, + bool ignoreRaidSettings = false + ) { var difficulty = diffLevel.ToLower(); - var raidConfig = _profileActivityService.GetProfileActivityRaidData(sessionId)?.RaidConfiguration; + var raidConfig = _profileActivityService + .GetProfileActivityRaidData(sessionId) + ?.RaidConfiguration; if (!(raidConfig != null || ignoreRaidSettings)) { - _logger.Error(_localisationService.GetText("bot-missing_application_context", "RAID_CONFIGURATION")); + _logger.Error( + _localisationService.GetText( + "bot-missing_application_context", + "RAID_CONFIGURATION" + ) + ); } // Check value chosen in pre-raid difficulty dropdown // If value is not 'asonline', change requested difficulty to be what was chosen in dropdown - var botDifficultyDropDownValue = raidConfig?.WavesSettings?.BotDifficulty?.ToString().ToLower() ?? "asonline"; + var botDifficultyDropDownValue = + raidConfig?.WavesSettings?.BotDifficulty?.ToString().ToLower() ?? "asonline"; if (botDifficultyDropDownValue != "asonline") { - difficulty = _botDifficultyHelper.ConvertBotDifficultyDropdownToBotDifficulty(botDifficultyDropDownValue); + difficulty = _botDifficultyHelper.ConvertBotDifficultyDropdownToBotDifficulty( + botDifficultyDropDownValue + ); } var botDb = _databaseService.GetBots(); @@ -130,7 +147,9 @@ public class BotController( result[botTypeLower] = result[Roles.Assault]; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to find bot: {botTypeLower} in db, copying '{Roles.Assault}'"); + _logger.Debug( + $"Unable to find bot: {botTypeLower} in db, copying '{Roles.Assault}'" + ); } continue; @@ -139,7 +158,9 @@ public class BotController( if (botDetails?.BotDifficulty is null) { // Bot has no difficulty values, skip - _logger.Warning($"Unable to find bot: {botTypeLower} difficulty values in db, skipping"); + _logger.Warning( + $"Unable to find bot: {botTypeLower} difficulty values in db, skipping" + ); continue; } @@ -153,7 +174,11 @@ public class BotController( } // Store all difficulty values in dict keyed by difficulty type e.g. easy/normal/impossible - result[botNameKey].Add(difficultyName, GetBotDifficulty(string.Empty, botNameKey, difficultyName, true)); + result[botNameKey] + .Add( + difficultyName, + GetBotDifficulty(string.Empty, botNameKey, difficultyName, true) + ); } } @@ -180,7 +205,11 @@ public class BotController( /// Player generating bots /// Session/Player id /// List of generated bots - protected List GenerateBotWaves(GenerateBotsRequestData request, PmcData? pmcProfile, string sessionId) + protected List GenerateBotWaves( + GenerateBotsRequestData request, + PmcData? pmcProfile, + string sessionId + ) { var generatedBotList = new List(); var raidSettings = GetMostRecentRaidSettings(sessionId); @@ -191,23 +220,36 @@ public class BotController( var stopwatch = Stopwatch.StartNew(); // Map conditions to promises for bot generation - Task.WaitAll((request.Conditions ?? []) - .Select(condition => Task.Factory.StartNew(() => - { - var botWaveGenerationDetails = GetBotGenerationDetailsForWave( - condition, - pmcProfile, - allPmcsHaveSameNameAsPlayer, - raidSettings); + Task.WaitAll( + (request.Conditions ?? []) + .Select(condition => + Task.Factory.StartNew(() => + { + var botWaveGenerationDetails = GetBotGenerationDetailsForWave( + condition, + pmcProfile, + allPmcsHaveSameNameAsPlayer, + raidSettings + ); - GenerateBotWave(condition, botWaveGenerationDetails, generatedBotList, sessionId); - })).ToArray()); + GenerateBotWave( + condition, + botWaveGenerationDetails, + generatedBotList, + sessionId + ); + }) + ) + .ToArray() + ); stopwatch.Stop(); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Took {stopwatch.ElapsedMilliseconds}ms to GenerateMultipleBotsAndCache()"); + _logger.Debug( + $"Took {stopwatch.ElapsedMilliseconds}ms to GenerateMultipleBotsAndCache()" + ); } return generatedBotList; @@ -225,9 +267,13 @@ public class BotController( GenerateCondition generateRequest, BotGenerationDetails botGenerationDetails, List botList, - string sessionId) + string sessionId + ) { - var isEventBot = generateRequest.Role?.Contains("event", StringComparison.OrdinalIgnoreCase); + var isEventBot = generateRequest.Role?.Contains( + "event", + StringComparison.OrdinalIgnoreCase + ); if (isEventBot.GetValueOrDefault(false)) { // Add eventRole data + reassign role property to be base type @@ -241,45 +287,55 @@ public class BotController( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Generating wave of: {botGenerationDetails.BotCountToGenerate} bots of type: {role} {botGenerationDetails.BotDifficulty}"); + _logger.Debug( + $"Generating wave of: {botGenerationDetails.BotCountToGenerate} bots of type: {role} {botGenerationDetails.BotDifficulty}" + ); } - Parallel.For(0, botGenerationDetails.BotCountToGenerate.Value, (i) => - { - BotBase bot = null; - - try + Parallel.For( + 0, + botGenerationDetails.BotCountToGenerate.Value, + (i) => { - bot = _botGenerator.PrepareAndGenerateBot(sessionId, _cloner.Clone(botGenerationDetails)); - } - catch (Exception e) - { - _logger.Error( - $"Failed to generate bot: {botGenerationDetails.Role} #{i + 1}: {e.Message} {e.StackTrace}"); - return; - } + BotBase bot = null; - // The client expects the Side for PMCs to be `Savage` - // We do this here so it's after we cache the bot in the match details lookup, as when you die, they will have the right side - if (bot.Info.Side is Sides.Bear or Sides.Usec) - { - bot.Info.Side = Sides.Savage; - } + try + { + bot = _botGenerator.PrepareAndGenerateBot( + sessionId, + _cloner.Clone(botGenerationDetails) + ); + } + catch (Exception e) + { + _logger.Error( + $"Failed to generate bot: {botGenerationDetails.Role} #{i + 1}: {e.Message} {e.StackTrace}" + ); + return; + } - lock (_botListLock) - { - botList.Add(bot); - } + // The client expects the Side for PMCs to be `Savage` + // We do this here so it's after we cache the bot in the match details lookup, as when you die, they will have the right side + if (bot.Info.Side is Sides.Bear or Sides.Usec) + { + bot.Info.Side = Sides.Savage; + } - // Store bot details in cache so post-raid PMC messages can use data - _matchBotDetailsCacheService.CacheBot(bot); - }); + lock (_botListLock) + { + botList.Add(bot); + } + + // Store bot details in cache so post-raid PMC messages can use data + _matchBotDetailsCacheService.CacheBot(bot); + } + ); if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Generated: {botGenerationDetails.BotCountToGenerate} {botGenerationDetails.Role}" + - $"({botGenerationDetails.EventRole ?? botGenerationDetails.Role ?? ""}) {botGenerationDetails.BotDifficulty} bots" + $"Generated: {botGenerationDetails.BotCountToGenerate} {botGenerationDetails.Role}" + + $"({botGenerationDetails.EventRole ?? botGenerationDetails.Role ?? ""}) {botGenerationDetails.BotDifficulty} bots" ); } } @@ -290,11 +346,15 @@ public class BotController( /// GetRaidConfigurationRequestData if it exists protected GetRaidConfigurationRequestData? GetMostRecentRaidSettings(string sessionId) { - var raidConfiguration = _profileActivityService.GetProfileActivityRaidData(sessionId)?.RaidConfiguration; + var raidConfiguration = _profileActivityService + .GetProfileActivityRaidData(sessionId) + ?.RaidConfiguration; if (raidConfiguration is null) { - _logger.Warning(_localisationService.GetText("bot-unable_to_load_raid_settings_from_appcontext")); + _logger.Warning( + _localisationService.GetText("bot-unable_to_load_raid_settings_from_appcontext") + ); } return raidConfiguration; @@ -307,7 +367,10 @@ public class BotController( /// MinMax values protected MinMax GetPmcLevelRangeForMap(string? location) { - return _pmcConfig.LocationSpecificPmcLevelOverride!.GetValueOrDefault(location?.ToLower() ?? "", null); + return _pmcConfig.LocationSpecificPmcLevelOverride!.GetValueOrDefault( + location?.ToLower() ?? "", + null + ); } /// @@ -322,24 +385,30 @@ public class BotController( GenerateCondition condition, PmcData? pmcProfile, bool allPmcsHaveSameNameAsPlayer, - GetRaidConfigurationRequestData? raidSettings) + GetRaidConfigurationRequestData? raidSettings + ) { var generateAsPmc = _botHelper.IsBotPmc(condition.Role); return new BotGenerationDetails { IsPmc = generateAsPmc, - Side = generateAsPmc ? _botHelper.GetPmcSideByRole(condition.Role ?? string.Empty) : "Savage", + Side = generateAsPmc + ? _botHelper.GetPmcSideByRole(condition.Role ?? string.Empty) + : "Savage", Role = condition.Role, PlayerLevel = pmcProfile?.Info?.Level ?? 1, PlayerName = pmcProfile?.Info?.Nickname, BotRelativeLevelDeltaMax = _pmcConfig.BotRelativeLevelDeltaMax, BotRelativeLevelDeltaMin = _pmcConfig.BotRelativeLevelDeltaMin, - BotCountToGenerate = Math.Max(GetBotPresetGenerationLimit(condition.Role), condition.Limit), // Choose largest between value passed in from request vs what's in bot.config + BotCountToGenerate = Math.Max( + GetBotPresetGenerationLimit(condition.Role), + condition.Limit + ), // Choose largest between value passed in from request vs what's in bot.config BotDifficulty = condition.Difficulty, LocationSpecificPmcLevelOverride = GetPmcLevelRangeForMap(raidSettings?.Location), // Min/max levels for PMCs to generate within IsPlayerScav = false, - AllPmcsHaveSameNameAsPlayer = allPmcsHaveSameNameAsPlayer + AllPmcsHaveSameNameAsPlayer = allPmcsHaveSameNameAsPlayer, }; } @@ -359,7 +428,10 @@ public class BotController( if (location == "default") { _logger.Warning( - _localisationService.GetText("bot-no_bot_cap_found_for_location", location.ToLower()) + _localisationService.GetText( + "bot-no_bot_cap_found_for_location", + location.ToLower() + ) ); } @@ -376,7 +448,7 @@ public class BotController( { PmcType = _pmcConfig.PmcType, Assault = _botConfig.AssaultBrainType, - PlayerScav = _botConfig.PlayerScavBrainType + PlayerScav = _botConfig.PlayerScavBrainType, }; } } @@ -384,23 +456,11 @@ public class BotController( public record AiBotBrainTypes { [JsonPropertyName("pmc")] - public Dictionary>> PmcType - { - get; - set; - } + public Dictionary>> PmcType { get; set; } [JsonPropertyName("assault")] - public Dictionary> Assault - { - get; - set; - } + public Dictionary> Assault { get; set; } [JsonPropertyName("playerScav")] - public Dictionary> PlayerScav - { - get; - set; - } + public Dictionary> PlayerScav { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/BuildController.cs b/Libraries/SPTarkov.Server.Core/Controllers/BuildController.cs index 2cfe31eb..23da8676 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/BuildController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/BuildController.cs @@ -42,30 +42,37 @@ public class BuildController( { EquipmentBuilds = [], WeaponBuilds = [], - MagazineBuilds = [] + MagazineBuilds = [], }; } // Ensure the secure container in the default presets match what the player has equipped - var defaultEquipmentPresetsClone = _cloner.Clone(_databaseService.GetTemplates().DefaultEquipmentPresets) + var defaultEquipmentPresetsClone = _cloner + .Clone(_databaseService.GetTemplates().DefaultEquipmentPresets) .ToList(); // Get players secure container - var playerSecureContainer = profile?.CharacterData?.PmcData?.Inventory?.Items?.FirstOrDefault(x => x.SlotId == secureContainerSlotId - ); + var playerSecureContainer = + profile?.CharacterData?.PmcData?.Inventory?.Items?.FirstOrDefault(x => + x.SlotId == secureContainerSlotId + ); - var firstDefaultItemsSecureContainer = defaultEquipmentPresetsClone? - .FirstOrDefault() - ?.Items? - .FirstOrDefault(x => x.SlotId == secureContainerSlotId); + var firstDefaultItemsSecureContainer = defaultEquipmentPresetsClone + ?.FirstOrDefault() + ?.Items?.FirstOrDefault(x => x.SlotId == secureContainerSlotId); - if (playerSecureContainer is not null && playerSecureContainer.Template != firstDefaultItemsSecureContainer?.Template) - // Default equipment presets' secure container tpl doesn't match players secure container tpl + if ( + playerSecureContainer is not null + && playerSecureContainer.Template != firstDefaultItemsSecureContainer?.Template + ) + // Default equipment presets' secure container tpl doesn't match players secure container tpl { foreach (var defaultPreset in defaultEquipmentPresetsClone) { // Find presets secure container - var secureContainer = defaultPreset.Items?.FirstOrDefault(item => item.SlotId == secureContainerSlotId); + var secureContainer = defaultPreset.Items?.FirstOrDefault(item => + item.SlotId == secureContainerSlotId + ); if (secureContainer is not null) { secureContainer.Template = playerSecureContainer.Template; @@ -102,7 +109,7 @@ public class BuildController( Id = body.Id, Name = body.Name, Root = body.Root, - Items = body.Items + Items = body.Items, }; var profile = _profileHelper.GetFullProfile(sessionId); @@ -132,8 +139,9 @@ public class BuildController( var profile = _profileHelper.GetFullProfile(sessionID); var pmcData = profile.CharacterData.PmcData; - var existingSavedEquipmentBuilds = - _saveServer.GetProfile(sessionID).UserBuildData.EquipmentBuilds; + var existingSavedEquipmentBuilds = _saveServer + .GetProfile(sessionID) + .UserBuildData.EquipmentBuilds; // Replace duplicate ID's. The first item is the base item. // Root ID and the base item ID need to match. @@ -145,10 +153,11 @@ public class BuildController( Name = request.Name, BuildType = EquipmentBuildType.Custom, Root = request.Items[0].Id, - Items = request.Items + Items = request.Items, }; - var existingBuild = existingSavedEquipmentBuilds?.FirstOrDefault(build => build.Name == request.Name || build.Id == request.Id + var existingBuild = existingSavedEquipmentBuilds?.FirstOrDefault(build => + build.Name == request.Name || build.Id == request.Id ); if (existingBuild is not null) { @@ -190,7 +199,7 @@ public class BuildController( Caliber = request.Caliber, TopCount = request.TopCount, BottomCount = request.BottomCount, - Items = request.Items + Items = request.Items, }; var profile = _profileHelper.GetFullProfile(sessionId); @@ -198,7 +207,9 @@ public class BuildController( profile.UserBuildData.MagazineBuilds ??= []; // Check if template with desired name already exists and remove it - var magazineBuildToRemove = profile.UserBuildData.MagazineBuilds.FirstOrDefault(item => item.Name == request.Name); + var magazineBuildToRemove = profile.UserBuildData.MagazineBuilds.FirstOrDefault(item => + item.Name == request.Name + ); if (magazineBuildToRemove is not null) { profile.UserBuildData.MagazineBuilds.Remove(magazineBuildToRemove); @@ -222,7 +233,9 @@ public class BuildController( var magazineBuilds = profile.UserBuildData.MagazineBuilds; // Check for id in weapon array first - var matchingWeaponBuild = weaponBuilds.FirstOrDefault(weaponBuild => weaponBuild.Id == idToRemove); + var matchingWeaponBuild = weaponBuilds.FirstOrDefault(weaponBuild => + weaponBuild.Id == idToRemove + ); if (matchingWeaponBuild is not null) { weaponBuilds.Remove(matchingWeaponBuild); @@ -231,7 +244,9 @@ public class BuildController( } // Id not found in weapons, try equipment - var matchingEquipmentBuild = equipmentBuilds.FirstOrDefault(equipmentBuild => equipmentBuild.Id == idToRemove); + var matchingEquipmentBuild = equipmentBuilds.FirstOrDefault(equipmentBuild => + equipmentBuild.Id == idToRemove + ); if (matchingEquipmentBuild is not null) { equipmentBuilds.Remove(matchingEquipmentBuild); @@ -240,7 +255,9 @@ public class BuildController( } // Id not found in weapons/equipment, try mags - var matchingMagazineBuild = magazineBuilds.FirstOrDefault(magBuild => magBuild.Id == idToRemove); + var matchingMagazineBuild = magazineBuilds.FirstOrDefault(magBuild => + magBuild.Id == idToRemove + ); if (matchingMagazineBuild is not null) { magazineBuilds.Remove(matchingMagazineBuild); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/ClientLogController.cs b/Libraries/SPTarkov.Server.Core/Controllers/ClientLogController.cs index f9fd4b5c..5f78ba6e 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/ClientLogController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/ClientLogController.cs @@ -7,9 +7,7 @@ using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; namespace SPTarkov.Server.Core.Controllers; [Injectable] -public class ClientLogController( - ISptLogger _logger -) +public class ClientLogController(ISptLogger _logger) { /// /// Handle /singleplayer/log diff --git a/Libraries/SPTarkov.Server.Core/Controllers/CustomizationController.cs b/Libraries/SPTarkov.Server.Core/Controllers/CustomizationController.cs index a2352868..543d00ac 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/CustomizationController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/CustomizationController.cs @@ -44,16 +44,18 @@ public class CustomizationController( var suits = _databaseService.GetTrader(traderId).Suits; var matchingSuits = suits?.Where(s => clothing.ContainsKey(s.SuiteId!)).ToList(); - matchingSuits = matchingSuits?.Where(s => clothing[s.SuiteId ?? string.Empty] - ?.Properties?.Side? - .Contains(pmcData?.Info?.Side ?? string.Empty) ?? - false + matchingSuits = matchingSuits + ?.Where(s => + clothing[s.SuiteId ?? string.Empty] + ?.Properties?.Side?.Contains(pmcData?.Info?.Side ?? string.Empty) ?? false ) .ToList(); if (matchingSuits == null) { - throw new Exception(_localisationService.GetText("customisation-unable_to_get_trader_suits", traderId)); + throw new Exception( + _localisationService.GetText("customisation-unable_to_get_trader_suits", traderId) + ); } return matchingSuits; @@ -70,7 +72,8 @@ public class CustomizationController( public ItemEventRouterResponse BuyCustomisation( PmcData pmcData, BuyClothingRequestData buyClothingRequest, - string sessionId) + string sessionId + ) { var output = _eventOutputHolder.GetOutput(sessionId); @@ -78,7 +81,10 @@ public class CustomizationController( if (traderOffer is null) { _logger.Error( - _localisationService.GetText("customisation-unable_to_find_suit_by_id", buyClothingRequest.Offer) + _localisationService.GetText( + "customisation-unable_to_find_suit_by_id", + buyClothingRequest.Offer + ) ); return output; } @@ -90,11 +96,7 @@ public class CustomizationController( _logger.Error( _localisationService.GetText( "customisation-item_already_purchased", - new - { - itemId = suitDetails?.Id, - itemName = suitDetails?.Name - } + new { itemId = suitDetails?.Id, itemName = suitDetails?.Name } ) ); @@ -111,7 +113,7 @@ public class CustomizationController( { Id = suitId, Source = CustomisationSource.UNLOCKED_IN_GAME, - Type = CustomisationType.SUITE + Type = CustomisationType.SUITE, }; profile.CustomisationUnlocks.Add(rewardToStore); @@ -130,7 +132,9 @@ public class CustomizationController( var fullProfile = _profileHelper.GetFullProfile(sessionId); // Check if clothing can be found by id - return fullProfile.CustomisationUnlocks.Exists(customisation => Equals(customisation.Id, suitId)); + return fullProfile.CustomisationUnlocks.Exists(customisation => + Equals(customisation.Id, suitId) + ); } /// @@ -144,7 +148,9 @@ public class CustomizationController( var foundSuit = GetAllTraderSuits(sessionId).FirstOrDefault(s => s.Id == offerId); if (foundSuit is null) { - _logger.Error(_localisationService.GetText("customisation-unable_to_find_suit_with_id", offerId)); + _logger.Error( + _localisationService.GetText("customisation-unable_to_find_suit_with_id", offerId) + ); } return foundSuit; @@ -157,9 +163,12 @@ public class CustomizationController( /// Player profile /// Clothing purchased /// Client response - protected void PayForClothingItems(string sessionId, PmcData pmcData, + protected void PayForClothingItems( + string sessionId, + PmcData pmcData, List? itemsToPayForClothingWith, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { if (itemsToPayForClothingWith is null || itemsToPayForClothingWith.Count == 0) { @@ -175,15 +184,15 @@ public class CustomizationController( new IdWithCount { Count = inventoryItemToProcess.Count.Value, - Id = inventoryItemToProcess.Id - } + Id = inventoryItemToProcess.Id, + }, ], TransactionId = Traders.RAGMAN, Action = "BuyCustomization", Type = "", ItemId = "", Count = 0, - SchemeId = 0 + SchemeId = 0, }; _paymentService.PayMoney(pmcData, options, sessionId, output); @@ -202,7 +211,10 @@ public class CustomizationController( foreach (var trader in traders) { - if (trader.Value.Base?.CustomizationSeller is not null && trader.Value.Base.CustomizationSeller.Value) + if ( + trader.Value.Base?.CustomizationSeller is not null + && trader.Value.Base.CustomizationSeller.Value + ) { result.AddRange(GetTraderSuits(trader.Key, sessionId)); } @@ -226,10 +238,11 @@ public class CustomizationController( /// /// Session/Player id /// - public List GetCustomisationStorage( - string sessionId) + public List GetCustomisationStorage(string sessionId) { - var customisationResultsClone = _cloner.Clone(_databaseService.GetTemplates().CustomisationStorage); + var customisationResultsClone = _cloner.Clone( + _databaseService.GetTemplates().CustomisationStorage + ); var profile = _profileHelper.GetFullProfile(sessionId); if (profile is null) @@ -249,7 +262,11 @@ public class CustomizationController( /// /// Players PMC profile /// - public ItemEventRouterResponse SetCustomisation(string sessionId, CustomizationSetRequest request, PmcData pmcData) + public ItemEventRouterResponse SetCustomisation( + string sessionId, + CustomizationSetRequest request, + PmcData pmcData + ) { foreach (var customisation in request.Customizations) { diff --git a/Libraries/SPTarkov.Server.Core/Controllers/DialogueController.cs b/Libraries/SPTarkov.Server.Core/Controllers/DialogueController.cs index 6f8640b0..891c4a5e 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/DialogueController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/DialogueController.cs @@ -37,13 +37,17 @@ public class DialogueController( { if (_dialogueChatBots.Any(cb => cb.GetChatBot().Id == chatBot.GetChatBot().Id)) { - _logger.Error(_localisationService.GetText("dialog-chatbot_id_already_exists", chatBot.GetChatBot().Id)); + _logger.Error( + _localisationService.GetText( + "dialog-chatbot_id_already_exists", + chatBot.GetChatBot().Id + ) + ); } _dialogueChatBots.Add(chatBot); } - /// /// Handle onUpdate spt event /// @@ -80,7 +84,7 @@ public class DialogueController( { Id = friendProfile.Id, Aid = friendProfile.Aid, - Info = friendProfile.Info + Info = friendProfile.Info, } ); } @@ -91,7 +95,7 @@ public class DialogueController( { Friends = friends, Ignore = [], - InIgnoreList = [] + InIgnoreList = [], }; } @@ -144,9 +148,7 @@ public class DialogueController( /// Dialog id /// Session Id /// DialogueInfo - public virtual DialogueInfo? GetDialogueInfo( - string? dialogueId, - string sessionId) + public virtual DialogueInfo? GetDialogueInfo(string? dialogueId, string sessionId) { var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId); var dialogue = dialogs!.GetValueOrDefault(dialogueId); @@ -164,7 +166,7 @@ public class DialogueController( New = dialogue?.New, AttachmentsNew = dialogue?.AttachmentsNew, Pinned = dialogue?.Pinned, - Users = GetDialogueUsers(dialogue, dialogue?.Type, sessionId) + Users = GetDialogueUsers(dialogue, dialogue?.Type, sessionId), }; return result; @@ -180,14 +182,19 @@ public class DialogueController( public virtual List GetDialogueUsers( Dialogue? dialog, MessageType? messageType, - string sessionId) + string sessionId + ) { var profile = _saveServer.GetProfile(sessionId); // User to user messages are special in that they need the player to exist in them, add if they don't - if (messageType == MessageType.UserMessage && - dialog?.Users is not null && - dialog.Users.All(userDialog => userDialog.Id != profile.CharacterData?.PmcData?.SessionId)) + if ( + messageType == MessageType.UserMessage + && dialog?.Users is not null + && dialog.Users.All(userDialog => + userDialog.Id != profile.CharacterData?.PmcData?.SessionId + ) + ) { dialog.Users.Add( new UserDialogInfo @@ -200,8 +207,12 @@ public class DialogueController( Nickname = profile.CharacterData?.PmcData?.Info?.Nickname, Side = profile.CharacterData?.PmcData?.Info?.Side, MemberCategory = profile.CharacterData?.PmcData?.Info?.MemberCategory, - SelectedMemberCategory = profile.CharacterData?.PmcData?.Info?.SelectedMemberCategory - } + SelectedMemberCategory = profile + .CharacterData + ?.PmcData + ?.Info + ?.SelectedMemberCategory, + }, } ); } @@ -220,7 +231,8 @@ public class DialogueController( /// GetMailDialogViewResponseData object public virtual GetMailDialogViewResponseData GenerateDialogueView( GetMailDialogViewRequestData request, - string sessionId) + string sessionId + ) { var dialogueId = request.DialogId; var fullProfile = _saveServer.GetProfile(sessionId); @@ -232,7 +244,7 @@ public class DialogueController( { Messages = [], Profiles = [], - HasMessagesWithRewards = false + HasMessagesWithRewards = false, }; } @@ -246,7 +258,7 @@ public class DialogueController( { Messages = dialogue.Messages, Profiles = GetProfilesForMail(fullProfile, dialogue.Users), - HasMessagesWithRewards = MessagesHaveUncollectedRewards(dialogue.Messages!) + HasMessagesWithRewards = MessagesHaveUncollectedRewards(dialogue.Messages!), }; } @@ -258,11 +270,16 @@ public class DialogueController( /// Dialogue protected Dialogue GetDialogByIdFromProfile( SptProfile profile, - GetMailDialogViewRequestData request) + GetMailDialogViewRequestData request + ) { - if (profile.DialogueRecords is null || profile.DialogueRecords.ContainsKey(request.DialogId!)) + if ( + profile.DialogueRecords is null + || profile.DialogueRecords.ContainsKey(request.DialogId!) + ) { - return profile.DialogueRecords?[request.DialogId!] ?? throw new NullReferenceException(); + return profile.DialogueRecords?[request.DialogId!] + ?? throw new NullReferenceException(); } profile.DialogueRecords[request.DialogId!] = new Dialogue @@ -272,7 +289,7 @@ public class DialogueController( Pinned = false, Messages = [], New = 0, - Type = request.Type + Type = request.Type, }; if (request.Type != MessageType.UserMessage) @@ -282,7 +299,9 @@ public class DialogueController( var dialogue = profile.DialogueRecords[request.DialogId!]; dialogue.Users = []; - var chatBot = _dialogueChatBots.FirstOrDefault(cb => cb.GetChatBot().Id == request.DialogId); + var chatBot = _dialogueChatBots.FirstOrDefault(cb => + cb.GetChatBot().Id == request.DialogId + ); if (chatBot is null) { @@ -301,11 +320,14 @@ public class DialogueController( /// Player profile /// The participants of the mail /// UserDialogInfo list - protected List GetProfilesForMail(SptProfile fullProfile, List? userDialogs) + protected List GetProfilesForMail( + SptProfile fullProfile, + List? userDialogs + ) { List result = []; if (userDialogs is null) - // Nothing to add + // Nothing to add { return result; } @@ -330,8 +352,8 @@ public class DialogueController( Side = pmcProfile?.Info?.Side, Level = pmcProfile?.Info?.Level, MemberCategory = pmcProfile?.Info?.MemberCategory, - SelectedMemberCategory = pmcProfile?.Info?.SelectedMemberCategory - } + SelectedMemberCategory = pmcProfile?.Info?.SelectedMemberCategory, + }, } ); @@ -344,15 +366,16 @@ public class DialogueController( /// Session id /// Dialog id /// Count of messages with attachments - protected int GetUnreadMessagesWithAttachmentsCount( - string sessionId, - string dialogueId) + protected int GetUnreadMessagesWithAttachmentsCount(string sessionId, string dialogueId) { var newAttachmentCount = 0; var activeMessages = GetActiveMessagesFromDialog(sessionId, dialogueId); foreach (var message in activeMessages) { - if (message.HasRewards.GetValueOrDefault(false) && !message.RewardCollected.GetValueOrDefault(false)) + if ( + message.HasRewards.GetValueOrDefault(false) + && !message.RewardCollected.GetValueOrDefault(false) + ) { newAttachmentCount++; } @@ -372,11 +395,13 @@ public class DialogueController( var timeNow = _timeUtil.GetTimeStamp(); var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId); - return dialogs[dialogueId].Messages?.Where(message => - { - var checkTime = message.DateTime + (message.MaxStorageTime ?? 0); - return timeNow < checkTime; - }).ToList() ?? []; + return dialogs[dialogueId] + .Messages?.Where(message => + { + var checkTime = message.DateTime + (message.MaxStorageTime ?? 0); + return timeNow < checkTime; + }) + .ToList() ?? []; } /// @@ -395,9 +420,7 @@ public class DialogueController( /// /// id of the dialog to remove /// Player id - public virtual void RemoveDialogue( - string? dialogueId, - string sessionId) + public virtual void RemoveDialogue(string? dialogueId, string sessionId) { var profile = _saveServer.GetProfile(sessionId); if (!profile.DialogueRecords.ContainsKey(dialogueId)) @@ -405,11 +428,7 @@ public class DialogueController( _logger.Error( _localisationService.GetText( "dialogue-unable_to_find_in_profile", - new - { - sessionId, - dialogueId - } + new { sessionId, dialogueId } ) ); @@ -433,11 +452,7 @@ public class DialogueController( _logger.Error( _localisationService.GetText( "dialogue-unable_to_find_in_profile", - new - { - sessionId, - dialogueId - } + new { sessionId, dialogueId } ) ); @@ -461,10 +476,7 @@ public class DialogueController( _logger.Error( _localisationService.GetText( "dialogue-unable_to_find_dialogs_in_profile", - new - { - sessionId - } + new { sessionId } ) ); @@ -491,9 +503,7 @@ public class DialogueController( var dialog = dialogs.TryGetValue(dialogueId, out var dialogInfo); if (!dialog) { - _logger.Error( - _localisationService.GetText("dialogue-unable_to_find_in_profile") - ); + _logger.Error(_localisationService.GetText("dialogue-unable_to_find_in_profile")); return null; } @@ -508,7 +518,7 @@ public class DialogueController( { Messages = messagesWithAttachments, Profiles = [], - HasMessagesWithRewards = MessagesHaveUncollectedRewards(messagesWithAttachments) + HasMessagesWithRewards = MessagesHaveUncollectedRewards(messagesWithAttachments), }; } @@ -518,18 +528,15 @@ public class DialogueController( /// Session/Player id /// /// - public virtual string SendMessage( - string sessionId, - SendMessageRequest request) + public virtual string SendMessage(string sessionId, SendMessageRequest request) { _mailSendService.SendPlayerMessageToNpc(sessionId, request.DialogId!, request.Text!); - return (_dialogueChatBots.FirstOrDefault(cb => - cb.GetChatBot().Id == request.DialogId - ) - ?.HandleMessage(sessionId, request) ?? - request.DialogId) ?? - string.Empty; + return ( + _dialogueChatBots + .FirstOrDefault(cb => cb.GetChatBot().Id == request.DialogId) + ?.HandleMessage(sessionId, request) ?? request.DialogId + ) ?? string.Empty; } /// @@ -592,7 +599,10 @@ public class DialogueController( /// Session/player id /// Sent friend request /// - public virtual FriendRequestSendResponse SendFriendRequest(string sessionID, FriendRequestData request) + public virtual FriendRequestSendResponse SendFriendRequest( + string sessionID, + FriendRequestData request + ) { // To avoid needing to jump between profiles, auto-accept all friend requests var friendProfile = _profileHelper.GetFullProfile(request.To); @@ -602,7 +612,7 @@ public class DialogueController( { Status = BackendErrorCodes.PlayerProfileNotFound, RequestId = "", // Unused in an error state - RetryAfter = 600 + RetryAfter = 600, }; } @@ -620,7 +630,9 @@ public class DialogueController( var notification = new WsFriendsListAccept { EventType = NotificationEventType.friendListRequestAccept, - Profile = _profileHelper.GetChatRoomMemberFromPmcProfile(friendProfile.CharacterData.PmcData) + Profile = _profileHelper.GetChatRoomMemberFromPmcProfile( + friendProfile.CharacterData.PmcData + ), }; _notificationSendHelper.SendMessage(sessionID, notification); }, @@ -633,7 +645,7 @@ public class DialogueController( { Status = BackendErrorCodes.None, RequestId = friendProfile.ProfileInfo.Aid.ToString(), - RetryAfter = 600 + RetryAfter = 600, }; } @@ -662,7 +674,9 @@ public class DialogueController( var profile = _saveServer.GetProfile(sessionId); if (!profile.DialogueRecords.TryGetValue(request.DialogId, out var dialogToClear)) { - _logger.Warning($"unable to clear messages from dialog: {request.DialogId} as it cannot be found in profile: {sessionId}"); + _logger.Warning( + $"unable to clear messages from dialog: {request.DialogId} as it cannot be found in profile: {sessionId}" + ); return; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs index 60fedbf8..0d82dac0 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs @@ -15,7 +15,6 @@ using SPTarkov.Server.Core.Utils.Cloners; using SPTarkov.Server.Core.Utils.Json; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Controllers; [Injectable] @@ -81,7 +80,7 @@ public class GameController( fullProfile.SptData ??= new Spt { //TODO: complete - Version = "Replace_me" + Version = "Replace_me", }; fullProfile.SptData.Migrations ??= new Dictionary(); fullProfile.FriendProfileIds ??= []; @@ -91,8 +90,14 @@ public class GameController( return; } - fullProfile.CharacterData!.PmcData!.WishList ??= new DictionaryOrList(new Dictionary(), []); - fullProfile.CharacterData.ScavData!.WishList ??= new DictionaryOrList(new Dictionary(), []); + fullProfile.CharacterData!.PmcData!.WishList ??= new DictionaryOrList( + new Dictionary(), + [] + ); + fullProfile.CharacterData.ScavData!.WishList ??= new DictionaryOrList( + new Dictionary(), + [] + ); if (fullProfile.DialogueRecords is not null) { @@ -101,7 +106,9 @@ public class GameController( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Started game with session {sessionId} {fullProfile.ProfileInfo?.Username}"); + _logger.Debug( + $"Started game with session {sessionId} {fullProfile.ProfileInfo?.Username}" + ); } var pmcProfile = fullProfile.CharacterData.PmcData; @@ -133,7 +140,12 @@ public class GameController( _hideoutHelper.UnlockHideoutWallInProfile(pmcProfile); // Handle if player has been inactive for a long time, catch up on hideout update before the user goes to his hideout - if (!_profileActivityService.ActiveWithinLastMinutes(sessionId, _hideoutConfig.UpdateProfileHideoutWhenActiveWithinMinutes)) + if ( + !_profileActivityService.ActiveWithinLastMinutes( + sessionId, + _hideoutConfig.UpdateProfileHideoutWhenActiveWithinMinutes + ) + ) { _hideoutHelper.UpdatePlayerHideout(sessionId); } @@ -167,10 +179,12 @@ public class GameController( public GameConfigResponse GetGameConfig(string sessionId) { var profile = _profileHelper.GetPmcProfile(sessionId); - var gameTime = profile?.Stats?.Eft?.OverallCounters?.Items? - .FirstOrDefault(c => c.Key!.Contains("LifeTime") && c.Key.Contains("Pmc")) - ?.Value ?? - 0D; + var gameTime = + profile + ?.Stats?.Eft?.OverallCounters?.Items?.FirstOrDefault(c => + c.Key!.Contains("LifeTime") && c.Key.Contains("Pmc") + ) + ?.Value ?? 0D; var config = new GameConfigResponse { @@ -188,18 +202,14 @@ public class GameController( Trading = _httpServerHelper.GetBackendUrl(), Messaging = _httpServerHelper.GetBackendUrl(), Main = _httpServerHelper.GetBackendUrl(), - RagFair = _httpServerHelper.GetBackendUrl() + RagFair = _httpServerHelper.GetBackendUrl(), }, UseProtobuf = false, UtcTime = _timeUtil.GetTimeStamp(), TotalInGame = gameTime, SessionMode = "pve", - PurchasedGames = new PurchasedGames - { - IsEftPurchased = true, - IsArenaPurchased = false - }, - IsGameSynced = true + PurchasedGames = new PurchasedGames { IsEftPurchased = true, IsArenaPurchased = false }, + IsGameSynced = true, }; return config; @@ -211,14 +221,12 @@ public class GameController( /// Session/Player id /// /// - public GameModeResponse GetGameMode( - string sessionId, - GameModeRequestData requestData) + public GameModeResponse GetGameMode(string sessionId, GameModeRequestData requestData) { return new GameModeResponse { GameMode = "pve", - BackendUrl = _httpServerHelper.GetBackendUrl() + BackendUrl = _httpServerHelper.GetBackendUrl(), }; } @@ -229,14 +237,7 @@ public class GameController( /// public List GetServer(string sessionId) { - return - [ - new ServerDetails - { - Ip = _httpConfig.BackendIp, - Port = _httpConfig.BackendPort - } - ]; + return [new ServerDetails { Ip = _httpConfig.BackendIp, Port = _httpConfig.BackendPort }]; } /// @@ -246,13 +247,9 @@ public class GameController( /// public CurrentGroupResponse GetCurrentGroup(string sessionId) { - return new CurrentGroupResponse - { - Squad = [] - }; + return new CurrentGroupResponse { Squad = [] }; } - /// /// Handle client/checkVersion /// @@ -263,7 +260,7 @@ public class GameController( return new CheckVersionResponse { IsValid = true, - LatestVersion = _coreConfig.CompatibleTarkovVersion + LatestVersion = _coreConfig.CompatibleTarkovVersion, }; } @@ -275,11 +272,7 @@ public class GameController( public GameKeepAliveResponse GetKeepAlive(string sessionId) { _profileActivityService.SetActivityTimestamp(sessionId); - return new GameKeepAliveResponse - { - Message = "OK", - UtcTime = _timeUtil.GetTimeStamp() - }; + return new GameKeepAliveResponse { Message = "OK", UtcTime = _timeUtil.GetTimeStamp() }; } /// @@ -311,7 +304,9 @@ public class GameController( var botReloadSkill = _profileHelper.GetSkillFromProfile(pmcProfile, SkillTypes.BotReload); if (botReloadSkill?.Progress > 0) { - _logger.Warning(_localisationService.GetText("server_start_player_active_botreload_skill")); + _logger.Warning( + _localisationService.GetText("server_start_player_active_botreload_skill") + ); } } @@ -337,23 +332,25 @@ public class GameController( var hpRegenPerHour = 456.6; // Set new values, whatever is smallest - energyRegenPerHour += pmcProfile.Bonuses! - .Where(bonus => bonus.Type == BonusType.EnergyRegeneration) + energyRegenPerHour += pmcProfile + .Bonuses!.Where(bonus => bonus.Type == BonusType.EnergyRegeneration) .Aggregate(0d, (sum, bonus) => sum + bonus.Value!.Value); - hydrationRegenPerHour += pmcProfile.Bonuses! - .Where(bonus => bonus.Type == BonusType.HydrationRegeneration) + hydrationRegenPerHour += pmcProfile + .Bonuses!.Where(bonus => bonus.Type == BonusType.HydrationRegeneration) .Aggregate(0d, (sum, bonus) => sum + bonus.Value!.Value); - hpRegenPerHour += pmcProfile.Bonuses! - .Where(bonus => bonus.Type == BonusType.HealthRegeneration) + hpRegenPerHour += pmcProfile + .Bonuses!.Where(bonus => bonus.Type == BonusType.HealthRegeneration) .Aggregate(0d, (sum, bonus) => sum + bonus.Value!.Value); // Player has energy deficit if (pmcProfile.Health?.Energy?.Current - pmcProfile.Health?.Energy?.Maximum <= _deviation) { // Set new value, whatever is smallest - pmcProfile.Health!.Energy!.Current += Math.Round(energyRegenPerHour * (diffSeconds!.Value / 3600)); + pmcProfile.Health!.Energy!.Current += Math.Round( + energyRegenPerHour * (diffSeconds!.Value / 3600) + ); if (pmcProfile.Health.Energy.Current > pmcProfile.Health.Energy.Maximum) { pmcProfile.Health.Energy.Current = pmcProfile.Health.Energy.Maximum; @@ -361,9 +358,14 @@ public class GameController( } // Player has hydration deficit - if (pmcProfile.Health?.Hydration?.Current - pmcProfile.Health?.Hydration?.Maximum <= _deviation) + if ( + pmcProfile.Health?.Hydration?.Current - pmcProfile.Health?.Hydration?.Maximum + <= _deviation + ) { - pmcProfile.Health!.Hydration!.Current += Math.Round(hydrationRegenPerHour * (diffSeconds!.Value / 3600)); + pmcProfile.Health!.Hydration!.Current += Math.Round( + hydrationRegenPerHour * (diffSeconds!.Value / 3600) + ); if (pmcProfile.Health.Hydration.Current > pmcProfile.Health.Hydration.Maximum) { pmcProfile.Health.Hydration.Current = pmcProfile.Health.Hydration.Maximum; @@ -383,10 +385,15 @@ public class GameController( /// Player /// /// - protected void DecreaseBodyPartEffectTimes(PmcData pmcProfile, double hpRegenPerHour, double diffSeconds) + protected void DecreaseBodyPartEffectTimes( + PmcData pmcProfile, + double hpRegenPerHour, + double diffSeconds + ) { - foreach (var bodyPart in pmcProfile.Health!.BodyParts! - .Select(bodyPartKvP => bodyPartKvP.Value)) + foreach ( + var bodyPart in pmcProfile.Health!.BodyParts!.Select(bodyPartKvP => bodyPartKvP.Value) + ) { // Check part hp if (bodyPart.Health!.Current < bodyPart.Health.Maximum) @@ -399,7 +406,6 @@ public class GameController( bodyPart.Health.Current = bodyPart.Health.Maximum; } - if (bodyPart.Effects is null || bodyPart.Effects.Count == 0) { continue; @@ -423,7 +429,7 @@ public class GameController( // Decrement effect time value by difference between current time and time health was last updated effectKvP.Value.Time -= diffSeconds; if (effectKvP.Value.Time < 1) - // Effect time was sub 1, set floor it can be + // Effect time was sub 1, set floor it can be { effectKvP.Value.Time = 1; } @@ -475,7 +481,9 @@ public class GameController( { if ( fullProfile.SptData.Mods.Any(m => - m.Author == mod.ModMetadata.Author && m.Version == mod.ModMetadata.Version && m.Name == mod.ModMetadata.Name + m.Author == mod.ModMetadata.Author + && m.Version == mod.ModMetadata.Version + && m.Name == mod.ModMetadata.Name ) ) { @@ -490,7 +498,7 @@ public class GameController( Version = mod.ModMetadata.Version, Name = mod.ModMetadata.Name, Url = mod.ModMetadata.Url, - DateAdded = _timeUtil.GetTimeStamp() + DateAdded = _timeUtil.GetTimeStamp(), } ); } @@ -552,7 +560,9 @@ public class GameController( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug($"Profile made with: {fullProfile.SptData?.Version}"); - _logger.Debug($"Server version: {ProgramStatics.SPT_VERSION() ?? _coreConfig.SptVersion} {ProgramStatics.COMMIT()}"); + _logger.Debug( + $"Server version: {ProgramStatics.SPT_VERSION() ?? _coreConfig.SptVersion} {ProgramStatics.COMMIT()}" + ); _logger.Debug($"Debug enabled: {ProgramStatics.DEBUG()}"); _logger.Debug($"Mods enabled: {ProgramStatics.MODS()}"); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs b/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs index 608cf88e..8c63c141 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs @@ -25,7 +25,8 @@ public class HealthController( LocalisationService _localisationService, HttpResponseUtil _httpResponseUtil, HealthHelper _healthHelper, - ICloner _cloner) + ICloner _cloner +) { /// /// When healing in menu @@ -37,15 +38,21 @@ public class HealthController( public ItemEventRouterResponse OffRaidHeal( PmcData pmcData, OffraidHealRequestData request, - string sessionID) + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); // Update medkit used (hpresource) - var healingItemToUse = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == request.Item); + var healingItemToUse = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == request.Item + ); if (healingItemToUse is null) { - var errorMessage = _localisationService.GetText("health-healing_item_not_found", request.Item); + var errorMessage = _localisationService.GetText( + "health-healing_item_not_found", + request.Item + ); _logger.Error(errorMessage); return _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -61,11 +68,10 @@ public class HealthController( else { // Get max healing from db - var maxHp = _itemHelper.GetItem(healingItemToUse.Template).Value.Properties.MaxHpResource; - healingItemToUse.Upd.MedKit = new UpdMedKit - { - HpResource = maxHp - request.Count - }; // Subtract amout used from max + var maxHp = _itemHelper + .GetItem(healingItemToUse.Template) + .Value.Properties.MaxHpResource; + healingItemToUse.Upd.MedKit = new UpdMedKit { HpResource = maxHp - request.Count }; // Subtract amout used from max // request.count appears to take into account healing effects removed, e.g. bleeds // Salewa heals limb for 20 and fixes light bleed = (20+45 = 65) } @@ -82,7 +88,9 @@ public class HealthController( var bodyPartToHeal = pmcData.Health.BodyParts.GetValueOrDefault(request.Part); if (bodyPartToHeal is null) { - _logger.Warning($"Player: {sessionID} Tried to heal a non-existent body part: {request.Part}"); + _logger.Warning( + $"Player: {sessionID} Tried to heal a non-existent body part: {request.Part}" + ); return output; } @@ -99,20 +107,25 @@ public class HealthController( { // Check enum has effectType if (!Enum.TryParse(effectKvP.Key, out var effect)) - // Enum doesnt contain this key + // Enum doesnt contain this key { continue; } // Check if healing item removes the effect on limb - if (!healItemEffectDetails.TryGetValue(effect, out var matchingEffectFromHealingItem)) - // Healing item doesn't have matching effect, it doesn't remove the effect + if ( + !healItemEffectDetails.TryGetValue( + effect, + out var matchingEffectFromHealingItem + ) + ) + // Healing item doesn't have matching effect, it doesn't remove the effect { continue; } // Adjust limb heal amount based on if it's fixing an effect (request.count is TOTAL cost of hp resource on heal item, NOT amount to heal limb) - amountToHealLimb -= (int) (matchingEffectFromHealingItem.Cost ?? 0); + amountToHealLimb -= (int)(matchingEffectFromHealingItem.Cost ?? 0); bodyPartToHeal.Effects.Remove(effectKvP.Key); } } @@ -140,14 +153,15 @@ public class HealthController( public ItemEventRouterResponse OffRaidEat( PmcData pmcData, OffraidEatRequestData request, - string sessionID) + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); var resourceLeft = 0d; var itemToConsume = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == request.Item); if (itemToConsume is null) - // Item not found, very bad + // Item not found, very bad { return _httpResponseUtil.AppendErrorToOutput( output, @@ -155,7 +169,9 @@ public class HealthController( ); } - var consumedItemMaxResource = _itemHelper.GetItem(itemToConsume.Template).Value.Properties.MaxResource; + var consumedItemMaxResource = _itemHelper + .GetItem(itemToConsume.Template) + .Value.Properties.MaxResource; if (consumedItemMaxResource > 1) { // Ensure item has a upd object @@ -165,7 +181,7 @@ public class HealthController( { itemToConsume.Upd.FoodDrink = new UpdFoodDrink { - HpPercent = consumedItemMaxResource - request.Count + HpPercent = consumedItemMaxResource - request.Count, }; } else @@ -192,14 +208,21 @@ public class HealthController( switch (key) { case HealthFactor.Hydration: - ApplyEdibleEffect(pmcData.Health.Hydration, effectProps, foodIsSingleUse, request); + ApplyEdibleEffect( + pmcData.Health.Hydration, + effectProps, + foodIsSingleUse, + request + ); break; case HealthFactor.Energy: ApplyEdibleEffect(pmcData.Health.Energy, effectProps, foodIsSingleUse, request); break; default: - _logger.Warning($"Unhandled effect after consuming: {itemToConsume.Template}, {key}"); + _logger.Warning( + $"Unhandled effect after consuming: {itemToConsume.Template}, {key}" + ); break; } } @@ -214,11 +237,15 @@ public class HealthController( /// Properties of consumed item /// Single use item /// Client request - protected void ApplyEdibleEffect(CurrentMinMax bodyValue, EffectsHealthProps consumptionDetails, bool foodIsSingleUse, - OffraidEatRequestData request) + protected void ApplyEdibleEffect( + CurrentMinMax bodyValue, + EffectsHealthProps consumptionDetails, + bool foodIsSingleUse, + OffraidEatRequestData request + ) { if (foodIsSingleUse) - // Apply whole value from passed in parameter + // Apply whole value from passed in parameter { bodyValue.Current += consumptionDetails.Value; } @@ -253,7 +280,8 @@ public class HealthController( public ItemEventRouterResponse HealthTreatment( PmcData pmcData, HealthTreatmentRequestData healthTreatmentRequest, - string sessionID) + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); var payMoneyRequest = new ProcessBuyTradeRequestData @@ -264,7 +292,7 @@ public class HealthController( Type = "", ItemId = "", Count = 0, - SchemeId = 0 + SchemeId = 0, }; _paymentService.PayMoney(pmcData, payMoneyRequest, sessionID, output); @@ -276,12 +304,12 @@ public class HealthController( foreach (var bodyPartKvP in healthTreatmentRequest.Difference.BodyParts.GetAllPropsAsDict()) { // Get body part from request + from pmc profile - var partRequest = (BodyPartEffects) bodyPartKvP.Value; + var partRequest = (BodyPartEffects)bodyPartKvP.Value; var profilePart = pmcData.Health.BodyParts[bodyPartKvP.Key]; // Bodypart healing is chosen when part request hp is above 0 if (partRequest.Health > 0) - // Heal bodypart + // Heal bodypart { profilePart.Health.Current = profilePart.Health.Maximum; } @@ -315,10 +343,7 @@ public class HealthController( /// Player profile /// Request data /// session id - public void ApplyWorkoutChanges( - PmcData? pmcData, - WorkoutData request, - string sessionId) + public void ApplyWorkoutChanges(PmcData? pmcData, WorkoutData request, string sessionId) { pmcData.Skills.Common = request.Skills.Common; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs b/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs index 51a966d6..8784ea09 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs @@ -52,7 +52,7 @@ public class HideoutController( HideoutAreas.AirFilteringUnit, HideoutAreas.WaterCollector, HideoutAreas.Generator, - HideoutAreas.BitcoinFarm + HideoutAreas.BitcoinFarm, ]; protected HideoutConfig _hideoutConfig = _configServer.GetConfig(); @@ -65,18 +65,21 @@ public class HideoutController( /// Start upgrade request /// Session/player id /// Client response - public void StartUpgrade(PmcData pmcData, HideoutUpgradeRequestData request, string sessionID, ItemEventRouterResponse output) + public void StartUpgrade( + PmcData pmcData, + HideoutUpgradeRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { - var items = request.Items.Select(reqItem => - { - var item = pmcData.Inventory.Items.FirstOrDefault(invItem => invItem.Id == reqItem.Id); - return new - { - inventoryItem = item, - requestedItem = reqItem - }; - } - ) + var items = request + .Items.Select(reqItem => + { + var item = pmcData.Inventory.Items.FirstOrDefault(invItem => + invItem.Id == reqItem.Id + ); + return new { inventoryItem = item, requestedItem = reqItem }; + }) .ToList(); // If it's not money, its construction / barter items @@ -85,7 +88,10 @@ public class HideoutController( if (item.inventoryItem is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_item_in_inventory", item.requestedItem.Id) + _localisationService.GetText( + "hideout-unable_to_find_item_in_inventory", + item.requestedItem.Id + ) ); _httpResponseUtil.AppendErrorToOutput(output); @@ -93,10 +99,10 @@ public class HideoutController( } if ( - _paymentHelper.IsMoneyTpl(item.inventoryItem.Template) && - item.inventoryItem.Upd is not null && - item.inventoryItem.Upd.StackObjectsCount is not null && - item.inventoryItem.Upd.StackObjectsCount > item.requestedItem.Count + _paymentHelper.IsMoneyTpl(item.inventoryItem.Template) + && item.inventoryItem.Upd is not null + && item.inventoryItem.Upd.StackObjectsCount is not null + && item.inventoryItem.Upd.StackObjectsCount > item.requestedItem.Count ) { item.inventoryItem.Upd.StackObjectsCount -= item.requestedItem.Count; @@ -108,10 +114,14 @@ public class HideoutController( } // Construction time management - var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == request.AreaType); + var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == request.AreaType + ); if (profileHideoutArea is null) { - _logger.Error(_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)); + _logger.Error( + _localisationService.GetText("hideout-unable_to_find_area", request.AreaType) + ); _httpResponseUtil.AppendErrorToOutput(output); return; @@ -123,14 +133,19 @@ public class HideoutController( if (hideoutDataDb is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_area_in_database", request.AreaType) + _localisationService.GetText( + "hideout-unable_to_find_area_in_database", + request.AreaType + ) ); _httpResponseUtil.AppendErrorToOutput(output); return; } - var ctime = hideoutDataDb.Stages[(profileHideoutArea.Level + 1).ToString()].ConstructionTime; + var ctime = hideoutDataDb + .Stages[(profileHideoutArea.Level + 1).ToString()] + .ConstructionTime; if (ctime > 0) { if (_profileHelper.IsDeveloperAccount(sessionID)) @@ -140,7 +155,7 @@ public class HideoutController( var timestamp = _timeUtil.GetTimeStamp(); - profileHideoutArea.CompleteTime = (int) Math.Round(timestamp + ctime.Value); + profileHideoutArea.CompleteTime = (int)Math.Round(timestamp + ctime.Value); profileHideoutArea.Constructing = true; } } @@ -153,15 +168,24 @@ public class HideoutController( /// Completed upgrade request /// Session/player id /// Client response - public void UpgradeComplete(PmcData pmcData, HideoutUpgradeCompleteRequestData request, string sessionID, ItemEventRouterResponse output) + public void UpgradeComplete( + PmcData pmcData, + HideoutUpgradeCompleteRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { var hideout = _databaseService.GetHideout(); var globals = _databaseService.GetGlobals(); - var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == request.AreaType); + var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == request.AreaType + ); if (profileHideoutArea is null) { - _logger.Error(_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)); + _logger.Error( + _localisationService.GetText("hideout-unable_to_find_area", request.AreaType) + ); _httpResponseUtil.AppendErrorToOutput(output); return; @@ -172,11 +196,16 @@ public class HideoutController( profileHideoutArea.CompleteTime = 0; profileHideoutArea.Constructing = false; - var hideoutData = hideout.Areas.FirstOrDefault(area => area.Type == profileHideoutArea.Type); + var hideoutData = hideout.Areas.FirstOrDefault(area => + area.Type == profileHideoutArea.Type + ); if (hideoutData is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_area_in_database", request.AreaType) + _localisationService.GetText( + "hideout-unable_to_find_area_in_database", + request.AreaType + ) ); _httpResponseUtil.AppendErrorToOutput(output); @@ -209,8 +238,8 @@ public class HideoutController( // Upgrading water collector / med station if ( - profileHideoutArea.Type == HideoutAreas.WaterCollector || - profileHideoutArea.Type == HideoutAreas.MedStation + profileHideoutArea.Type == HideoutAreas.WaterCollector + || profileHideoutArea.Type == HideoutAreas.MedStation ) { SetWallVisibleIfPrereqsMet(pmcData); @@ -236,11 +265,17 @@ public class HideoutController( /// Player profile protected void SetWallVisibleIfPrereqsMet(PmcData pmcData) { - var medStation = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.MedStation); - var waterCollector = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.WaterCollector); + var medStation = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.MedStation + ); + var waterCollector = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.WaterCollector + ); if (medStation?.Level >= 1 && waterCollector?.Level >= 1) { - var wall = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.EmergencyWall); + var wall = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.EmergencyWall + ); if (wall?.Level == 0) { wall.Level = 3; @@ -257,15 +292,26 @@ public class HideoutController( /// /// Area of hideout player is upgrading /// Stage player is upgrading to - protected void AddContainerImprovementToProfile(ItemEventRouterResponse output, string sessionId, PmcData pmcData, BotHideoutArea profileParentHideoutArea, - HideoutArea dbHideoutArea, Stage hideoutStage) + protected void AddContainerImprovementToProfile( + ItemEventRouterResponse output, + string sessionId, + PmcData pmcData, + BotHideoutArea profileParentHideoutArea, + HideoutArea dbHideoutArea, + Stage hideoutStage + ) { // Add key/value to `hideoutAreaStashes` dictionary - used to link hideout area to inventory stash by its id // Key is the enums value stored as a string, e.g. "27" for cultist circle - var keyForHideoutAreaStash = ((int) dbHideoutArea.Type).ToString(); + var keyForHideoutAreaStash = ((int)dbHideoutArea.Type).ToString(); if (!pmcData.Inventory.HideoutAreaStashes.ContainsKey(keyForHideoutAreaStash)) { - if (!pmcData.Inventory.HideoutAreaStashes.TryAdd(keyForHideoutAreaStash, dbHideoutArea.Id)) + if ( + !pmcData.Inventory.HideoutAreaStashes.TryAdd( + keyForHideoutAreaStash, + dbHideoutArea.Id + ) + ) { _logger.Error($"Unable to add key: {dbHideoutArea.Type} to HideoutAreaStashes"); } @@ -276,17 +322,34 @@ public class HideoutController( // Edge case, add/update `stand1/stand2/stand3` children if (dbHideoutArea.Type == HideoutAreas.EquipmentPresetsStand) - // Can have multiple 'standx' children depending on upgrade level + // Can have multiple 'standx' children depending on upgrade level { - AddMissingPresetStandItemsToProfile(sessionId, hideoutStage, pmcData, dbHideoutArea, output); + AddMissingPresetStandItemsToProfile( + sessionId, + hideoutStage, + pmcData, + dbHideoutArea, + output + ); } // Don't inform client when upgraded area is hall of fame or equipment stand, BSG doesn't inform client this specific upgrade has occurred // will break client if sent - - if (ShouldAddContainerUpgradeToClientResponse(dbHideoutArea, profileParentHideoutArea.Level.GetValueOrDefault(1))) + + if ( + ShouldAddContainerUpgradeToClientResponse( + dbHideoutArea, + profileParentHideoutArea.Level.GetValueOrDefault(1) + ) + ) { - AddContainerUpgradeToClientOutput(sessionId, keyForHideoutAreaStash, dbHideoutArea, hideoutStage, output); + AddContainerUpgradeToClientOutput( + sessionId, + keyForHideoutAreaStash, + dbHideoutArea, + hideoutStage, + output + ); } // Some hideout areas (Gun stand) have child areas linked to it @@ -300,20 +363,30 @@ public class HideoutController( } // Add key/value to `hideoutAreaStashes` dictionary - used to link hideout area to inventory stash by its id - var childAreaTypeKey = ((int) childDbArea.Type).ToString(); + var childAreaTypeKey = ((int)childDbArea.Type).ToString(); if (pmcData.Inventory.HideoutAreaStashes.GetValueOrDefault(childAreaTypeKey) is null) { pmcData.Inventory.HideoutAreaStashes[childAreaTypeKey] = childDbArea.Id; } // Set child area level to same as parent area - pmcData.Hideout.Areas.FirstOrDefault(hideoutArea => hideoutArea.Type == childDbArea.Type).Level = - pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == profileParentHideoutArea.Type).Level; + pmcData + .Hideout.Areas.FirstOrDefault(hideoutArea => hideoutArea.Type == childDbArea.Type) + .Level = pmcData + .Hideout.Areas.FirstOrDefault(area => area.Type == profileParentHideoutArea.Type) + .Level; // Add/upgrade stash item in player inventory - if (!childDbArea.Stages.TryGetValue(profileParentHideoutArea.Level.ToString(), out var childDbAreaStage)) + if ( + !childDbArea.Stages.TryGetValue( + profileParentHideoutArea.Level.ToString(), + out var childDbAreaStage + ) + ) { - _logger.Error($"Unable to find stage: {profileParentHideoutArea.Level} of area: {dbHideoutArea.Id}"); + _logger.Error( + $"Unable to find stage: {profileParentHideoutArea.Level} of area: {dbHideoutArea.Id}" + ); return; } @@ -321,8 +394,13 @@ public class HideoutController( AddUpdateInventoryItemToProfile(sessionId, pmcData, childDbArea, childDbAreaStage); // Inform client of the changes - AddContainerUpgradeToClientOutput(sessionId, childAreaTypeKey, childDbArea, childDbAreaStage, output); - + AddContainerUpgradeToClientOutput( + sessionId, + childAreaTypeKey, + childDbArea, + childDbAreaStage, + output + ); } /// @@ -348,9 +426,16 @@ public class HideoutController( /// Players PMC profile /// Hideout area from db being upgraded /// Stage area upgraded to - protected void AddUpdateInventoryItemToProfile(string sessionId, PmcData pmcData, HideoutArea dbHideoutArea, Stage hideoutStage) + protected void AddUpdateInventoryItemToProfile( + string sessionId, + PmcData pmcData, + HideoutArea dbHideoutArea, + Stage hideoutStage + ) { - var existingInventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == dbHideoutArea.Id); + var existingInventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == dbHideoutArea.Id + ); if (existingInventoryItem is not null) { // Update existing items container tpl to point to new id (tpl) @@ -363,7 +448,7 @@ public class HideoutController( var newContainerItem = new Item { Id = dbHideoutArea.Id, - Template = hideoutStage.Container + Template = hideoutStage.Container, }; pmcData.Inventory.Items.Add(newContainerItem); } @@ -376,18 +461,21 @@ public class HideoutController( /// /// /// Client response - protected void AddContainerUpgradeToClientOutput(string sessionId, string changedHideoutStashesKey, HideoutArea hideoutDbData, Stage hideoutStage, - ItemEventRouterResponse output) + protected void AddContainerUpgradeToClientOutput( + string sessionId, + string changedHideoutStashesKey, + HideoutArea hideoutDbData, + Stage hideoutStage, + ItemEventRouterResponse output + ) { // Ensure ChangedHideoutStashes isn't null - output.ProfileChanges[sessionId].ChangedHideoutStashes ??= new Dictionary(); + output.ProfileChanges[sessionId].ChangedHideoutStashes ??= + new Dictionary(); // Inform client of changes - output.ProfileChanges[sessionId].ChangedHideoutStashes[changedHideoutStashesKey] = new HideoutStashItem - { - Id = hideoutDbData.Id, - Template = hideoutStage.Container - }; + output.ProfileChanges[sessionId].ChangedHideoutStashes[changedHideoutStashesKey] = + new HideoutStashItem { Id = hideoutDbData.Id, Template = hideoutStage.Container }; } /// @@ -398,23 +486,30 @@ public class HideoutController( /// request from client to place item in area slot /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse PutItemsInAreaSlots(PmcData pmcData, HideoutPutItemInRequestData addItemToHideoutRequest, string sessionID) + public ItemEventRouterResponse PutItemsInAreaSlots( + PmcData pmcData, + HideoutPutItemInRequestData addItemToHideoutRequest, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); var itemsToAdd = addItemToHideoutRequest.Items.Select(kvp => + { + var item = pmcData.Inventory.Items.FirstOrDefault(invItem => + invItem.Id == kvp.Value.Id + ); + return new { - var item = pmcData.Inventory.Items.FirstOrDefault(invItem => invItem.Id == kvp.Value.Id); - return new - { - inventoryItem = item, - requestedItem = kvp.Value, - slot = kvp.Key - }; - } - ); + inventoryItem = item, + requestedItem = kvp.Value, + slot = kvp.Key, + }; + }); - var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == addItemToHideoutRequest.AreaType); + var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == addItemToHideoutRequest.AreaType + ); if (hideoutArea is null) { _logger.Error( @@ -433,11 +528,7 @@ public class HideoutController( _logger.Error( _localisationService.GetText( "hideout-unable_to_find_item_in_inventory", - new - { - itemId = item.requestedItem.Id, - area = hideoutArea.Type - } + new { itemId = item.requestedItem.Id, area = hideoutArea.Type } ) ); return _httpResponseUtil.AppendErrorToOutput(output); @@ -445,7 +536,8 @@ public class HideoutController( // Add item to area.slots var destinationLocationIndex = int.Parse(item.slot); - var hideoutSlotIndex = hideoutArea.Slots.FindIndex(slot => slot.LocationIndex == destinationLocationIndex + var hideoutSlotIndex = hideoutArea.Slots.FindIndex(slot => + slot.LocationIndex == destinationLocationIndex ); if (hideoutSlotIndex == -1) { @@ -461,8 +553,8 @@ public class HideoutController( { Id = item.inventoryItem.Id, Template = item.inventoryItem.Template, - Upd = item.inventoryItem.Upd - } + Upd = item.inventoryItem.Upd, + }, ]; _inventoryHelper.RemoveItem(pmcData, item.inventoryItem.Id, sessionID, output); @@ -482,29 +574,38 @@ public class HideoutController( /// Take item out of area request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse TakeItemsFromAreaSlots(PmcData pmcData, HideoutTakeItemOutRequestData request, string sessionID) + public ItemEventRouterResponse TakeItemsFromAreaSlots( + PmcData pmcData, + HideoutTakeItemOutRequestData request, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); - var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == request.AreaType); + var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == request.AreaType + ); if (hideoutArea is null) { - _logger.Error(_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)); + _logger.Error( + _localisationService.GetText("hideout-unable_to_find_area", request.AreaType) + ); return _httpResponseUtil.AppendErrorToOutput(output); } if (hideoutArea.Slots is null || hideoutArea.Slots.Count == 0) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_item_to_remove_from_area", hideoutArea.Type) + _localisationService.GetText( + "hideout-unable_to_find_item_to_remove_from_area", + hideoutArea.Type + ) ); return _httpResponseUtil.AppendErrorToOutput(output); } // Handle areas that have resources that can be placed in/taken out of slots from the area - if ( - _hideoutAreas.Contains(hideoutArea.Type ?? HideoutAreas.NotSet) - ) + if (_hideoutAreas.Contains(hideoutArea.Type ?? HideoutAreas.NotSet)) { var response = RemoveResourceFromArea(sessionID, pmcData, request, output, hideoutArea); @@ -514,7 +615,10 @@ public class HideoutController( } throw new Exception( - _localisationService.GetText("hideout-unhandled_remove_item_from_area_request", hideoutArea.Type) + _localisationService.GetText( + "hideout-unhandled_remove_item_from_area_request", + hideoutArea.Type + ) ); } @@ -527,8 +631,13 @@ public class HideoutController( /// Client response /// Area fuel is being removed from /// ItemEventRouterResponse - protected ItemEventRouterResponse RemoveResourceFromArea(string sessionID, PmcData pmcData, HideoutTakeItemOutRequestData removeResourceRequest, - ItemEventRouterResponse output, BotHideoutArea hideoutArea) + protected ItemEventRouterResponse RemoveResourceFromArea( + string sessionID, + PmcData pmcData, + HideoutTakeItemOutRequestData removeResourceRequest, + ItemEventRouterResponse output, + BotHideoutArea hideoutArea + ) { var slotIndexToRemove = removeResourceRequest?.Slots?.FirstOrDefault(); if (slotIndexToRemove is null) @@ -541,10 +650,14 @@ public class HideoutController( } // Assume only one item in slot - var itemToReturn = hideoutArea.Slots?.FirstOrDefault(slot => slot.LocationIndex == slotIndexToRemove)?.Items?.FirstOrDefault(); + var itemToReturn = hideoutArea + .Slots?.FirstOrDefault(slot => slot.LocationIndex == slotIndexToRemove) + ?.Items?.FirstOrDefault(); if (itemToReturn is null) { - _logger.Error($"Unable to remove resource from area: {removeResourceRequest.AreaType} slot as no item found, RESTART CLIENT IMMEDIATELY"); + _logger.Error( + $"Unable to remove resource from area: {removeResourceRequest.AreaType} slot as no item found, RESTART CLIENT IMMEDIATELY" + ); return output; } @@ -555,18 +668,20 @@ public class HideoutController( ItemWithModsToAdd = [itemToReturn.ConvertToItem()], FoundInRaid = itemToReturn.Upd?.SpawnedInSession, Callback = null, - UseSortingTable = false + UseSortingTable = false, }; _inventoryHelper.AddItemToStash(sessionID, request, pmcData, output); if (output.Warnings?.Count > 0) - // Adding to stash failed, drop out - don't remove item from hideout area slot + // Adding to stash failed, drop out - don't remove item from hideout area slot { return output; } // Remove items from slot, keep locationIndex object - var hideoutSlotIndex = hideoutArea.Slots.FindIndex(slot => slot.LocationIndex == slotIndexToRemove); + var hideoutSlotIndex = hideoutArea.Slots.FindIndex(slot => + slot.LocationIndex == slotIndexToRemove + ); hideoutArea.Slots[hideoutSlotIndex].Items = null; return output; @@ -580,17 +695,25 @@ public class HideoutController( /// Toggle area request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse ToggleArea(PmcData pmcData, HideoutToggleAreaRequestData request, string sessionID) + public ItemEventRouterResponse ToggleArea( + PmcData pmcData, + HideoutToggleAreaRequestData request, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); // Force a production update (occur before area is toggled as it could be generator and doing it after generator enabled would cause incorrect calculaton of production progress) _hideoutHelper.UpdatePlayerHideout(sessionID); - var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == request.AreaType); + var hideoutArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == request.AreaType + ); if (hideoutArea is null) { - _logger.Error(_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)); + _logger.Error( + _localisationService.GetText("hideout-unable_to_find_area", request.AreaType) + ); return _httpResponseUtil.AppendErrorToOutput(output); } @@ -606,7 +729,11 @@ public class HideoutController( /// /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse SingleProductionStart(PmcData pmcData, HideoutSingleProductionStartRequestData request, string sessionID) + public ItemEventRouterResponse SingleProductionStart( + PmcData pmcData, + HideoutSingleProductionStartRequestData request, + string sessionID + ) { // Start production _hideoutHelper.RegisterProduction(pmcData, request, sessionID); @@ -629,7 +756,8 @@ public class HideoutController( foreach (var itemToDelete in itemsToDelete) { var itemToCheck = pmcData.Inventory.Items.FirstOrDefault(i => i.Id == itemToDelete.Id); - var requirement = recipeRequirementsClone.FirstOrDefault(requirement => requirement.TemplateId == itemToCheck.Template + var requirement = recipeRequirementsClone.FirstOrDefault(requirement => + requirement.TemplateId == itemToCheck.Template ); // Handle tools not having a `count`, but always only requiring 1 @@ -639,12 +767,18 @@ public class HideoutController( continue; } - _inventoryHelper.RemoveItemByCount(pmcData, itemToDelete.Id, requiredCount, sessionID, output); + _inventoryHelper.RemoveItemByCount( + pmcData, + itemToDelete.Id, + requiredCount, + sessionID, + output + ); // Tools don't have a count if (requirement.Type != "Tool") { - requirement.Count -= (int) itemToDelete.Count; + requirement.Count -= (int)itemToDelete.Count; } } @@ -659,13 +793,19 @@ public class HideoutController( /// /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse ScavCaseProductionStart(PmcData pmcData, HideoutScavCaseStartRequestData request, string sessionID) + public ItemEventRouterResponse ScavCaseProductionStart( + PmcData pmcData, + HideoutScavCaseStartRequestData request, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); foreach (var requestedItem in request.Items) { - var inventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == requestedItem.Id); + var inventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == requestedItem.Id + ); if (inventoryItem is null) { _logger.Error( @@ -677,7 +817,10 @@ public class HideoutController( return _httpResponseUtil.AppendErrorToOutput(output); } - if (inventoryItem.Upd?.StackObjectsCount is not null && inventoryItem.Upd.StackObjectsCount > requestedItem.Count) + if ( + inventoryItem.Upd?.StackObjectsCount is not null + && inventoryItem.Upd.StackObjectsCount > requestedItem.Count + ) { inventoryItem.Upd.StackObjectsCount -= requestedItem.Count; } @@ -687,11 +830,16 @@ public class HideoutController( } } - var recipe = _databaseService.GetHideout().Production?.ScavRecipes?.FirstOrDefault(r => r.Id == request.RecipeId); + var recipe = _databaseService + .GetHideout() + .Production?.ScavRecipes?.FirstOrDefault(r => r.Id == request.RecipeId); if (recipe is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_scav_case_recipie_in_database", request.RecipeId) + _localisationService.GetText( + "hideout-unable_to_find_scav_case_recipie_in_database", + request.RecipeId + ) ); return _httpResponseUtil.AppendErrorToOutput(output); @@ -701,19 +849,21 @@ public class HideoutController( // - normal recipe: Production time value is stored in attribute "productionTime" with small "p" // - scav case recipe: Production time value is stored in attribute "ProductionTime" with capital "P" var adjustedCraftTime = - recipe.ProductionTime - - _hideoutHelper.GetSkillProductionTimeReduction( + recipe.ProductionTime + - _hideoutHelper.GetSkillProductionTimeReduction( pmcData, recipe.ProductionTime ?? 0, SkillTypes.Crafting, - _databaseService.GetGlobals().Configuration.SkillsSettings.Crafting.CraftTimeReductionPerLevel ?? 0 + _databaseService + .GetGlobals() + .Configuration.SkillsSettings.Crafting.CraftTimeReductionPerLevel ?? 0 ); var modifiedScavCaseTime = GetScavCaseTime(pmcData, adjustedCraftTime); pmcData.Hideout.Production[request.RecipeId] = _hideoutHelper.InitProduction( request.RecipeId, - (int) (_profileHelper.IsDeveloperAccount(sessionID) ? 40 : modifiedScavCaseTime), + (int)(_profileHelper.IsDeveloperAccount(sessionID) ? 40 : modifiedScavCaseTime), false ); pmcData.Hideout.Production[request.RecipeId].SptIsScavCase = true; @@ -749,7 +899,7 @@ public class HideoutController( pmcData.Hideout.Production[$"ScavCase{recipeId}"] = new Production { Products = rewards, - RecipeId = recipeId + RecipeId = recipeId, }; } @@ -760,7 +910,11 @@ public class HideoutController( /// Continuous production request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse ContinuousProductionStart(PmcData pmcData, HideoutContinuousProductionStartRequestData request, string sessionID) + public ItemEventRouterResponse ContinuousProductionStart( + PmcData pmcData, + HideoutContinuousProductionStartRequestData request, + string sessionID + ) { _hideoutHelper.RegisterProduction(pmcData, request, sessionID); @@ -775,7 +929,11 @@ public class HideoutController( /// Remove production from area request /// Session/Player id /// - public ItemEventRouterResponse TakeProduction(PmcData pmcData, HideoutTakeProductionRequestData request, string sessionID) + public ItemEventRouterResponse TakeProduction( + PmcData pmcData, + HideoutTakeProductionRequestData request, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); var hideoutDb = _databaseService.GetHideout(); @@ -797,7 +955,9 @@ public class HideoutController( return output; } - var scavCase = hideoutDb.Production.ScavRecipes.FirstOrDefault(r => r.Id == request.RecipeId); + var scavCase = hideoutDb.Production.ScavRecipes.FirstOrDefault(r => + r.Id == request.RecipeId + ); if (scavCase is not null) { HandleScavCase(sessionID, pmcData, request, output); @@ -823,8 +983,13 @@ public class HideoutController( /// Players PMC profile /// Remove production from area request /// Client response - protected void HandleRecipe(string sessionID, HideoutProduction recipe, PmcData pmcData, HideoutTakeProductionRequestData request, - ItemEventRouterResponse output) + protected void HandleRecipe( + string sessionID, + HideoutProduction recipe, + PmcData pmcData, + HideoutTakeProductionRequestData request, + ItemEventRouterResponse output + ) { // Validate that we have a matching production var productionDict = pmcData.Hideout.Production; @@ -893,7 +1058,7 @@ public class HideoutController( reward.FirstOrDefault().Upd.RecodableComponent = new UpdRecodableComponent { - IsEncoded = true + IsEncoded = true, }; } } @@ -912,7 +1077,7 @@ public class HideoutController( // Check if the recipe is the same as the last one - get bonus when crafting same thing multiple times var area = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == recipe.AreaType); if (area is not null && request.RecipeId != area.LastRecipe) - // 1 point per craft upon the end of production for alternating between 2 different crafting recipes in the same module + // 1 point per craft upon the end of production for alternating between 2 different crafting recipes in the same module { craftingExpAmount += _hideoutConfig.ExpCraftAmount; // Default is 10 } @@ -923,8 +1088,10 @@ public class HideoutController( if (hoursCrafting / _hideoutConfig.HoursForSkillCrafting >= 1) { // Spent enough time crafting to get a bonus xp multiplier - var multiplierCrafting = Math.Floor(hoursCrafting.Value / _hideoutConfig.HoursForSkillCrafting); - craftingExpAmount += (int) (1 * multiplierCrafting); + var multiplierCrafting = Math.Floor( + hoursCrafting.Value / _hideoutConfig.HoursForSkillCrafting + ); + craftingExpAmount += (int)(1 * multiplierCrafting); hoursCrafting -= _hideoutConfig.HoursForSkillCrafting * multiplierCrafting; } @@ -952,7 +1119,7 @@ public class HideoutController( ItemsWithModsToAdd = [toolItem], FoundInRaid = toolItem.FirstOrDefault()?.Upd?.SpawnedInSession ?? false, UseSortingTable = false, - Callback = null + Callback = null, }; _inventoryHelper.AddItemsToStash(sessionID, addToolsRequest, pmcData, output); @@ -968,7 +1135,7 @@ public class HideoutController( ItemsWithModsToAdd = itemAndChildrenToSendToPlayer, FoundInRaid = true, UseSortingTable = false, - Callback = null + Callback = null, }; _inventoryHelper.AddItemsToStash(sessionID, addItemsRequest, pmcData, output); if (output.Warnings?.Count > 0) @@ -993,10 +1160,14 @@ public class HideoutController( { _profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Crafting, craftingExpAmount); - var intellectAmountToGive = 0.5 * Math.Round((double) (craftingExpAmount / 15)); + var intellectAmountToGive = 0.5 * Math.Round((double)(craftingExpAmount / 15)); if (intellectAmountToGive > 0) { - _profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Intellect, intellectAmountToGive); + _profileHelper.AddSkillPointsToPlayer( + pmcData, + SkillTypes.Intellect, + intellectAmountToGive + ); } } @@ -1033,7 +1204,11 @@ public class HideoutController( /// /// /// Reward is a preset - protected void HandleStackableState(HideoutProduction recipe, List> itemAndChildrenToSendToPlayer, bool rewardIsPreset) + protected void HandleStackableState( + HideoutProduction recipe, + List> itemAndChildrenToSendToPlayer, + bool rewardIsPreset + ) { var rewardIsStackable = _itemHelper.IsItemTplStackable(recipe.EndProduct); if (rewardIsStackable.GetValueOrDefault(false)) @@ -1043,10 +1218,7 @@ public class HideoutController( { Id = _hashUtil.Generate(), Template = recipe.EndProduct, - Upd = new Upd - { - StackObjectsCount = recipe.Count - } + Upd = new Upd { StackObjectsCount = recipe.Count }, }; // Split item into separate items with acceptable stack sizes @@ -1062,13 +1234,7 @@ public class HideoutController( if (!rewardIsPreset) { itemAndChildrenToSendToPlayer.Add( - [ - new Item - { - Id = _hashUtil.Generate(), - Template = recipe.EndProduct - } - ] + [new Item { Id = _hashUtil.Generate(), Template = recipe.EndProduct }] ); } @@ -1077,7 +1243,9 @@ public class HideoutController( var countOfItemsToReward = recipe.Count; for (var index = 1; index < countOfItemsToReward; index++) { - var itemAndMods = _itemHelper.ReplaceIDs(_cloner.Clone(itemAndChildrenToSendToPlayer.FirstOrDefault())); + var itemAndMods = _itemHelper.ReplaceIDs( + _cloner.Clone(itemAndChildrenToSendToPlayer.FirstOrDefault()) + ); itemAndChildrenToSendToPlayer.AddRange([itemAndMods]); } } @@ -1105,18 +1273,22 @@ public class HideoutController( /// Profile to get counter from /// Recipe being crafted /// TaskConditionCounter - protected TaskConditionCounter GetHoursCraftingTaskConditionCounter(PmcData pmcData, HideoutProduction recipe) + protected TaskConditionCounter GetHoursCraftingTaskConditionCounter( + PmcData pmcData, + HideoutProduction recipe + ) { if (!pmcData.TaskConditionCounters.TryGetValue(NameTaskConditionCountersCraftingId, out _)) - // Doesn't exist, create + // Doesn't exist, create { - pmcData.TaskConditionCounters[NameTaskConditionCountersCraftingId] = new TaskConditionCounter - { - Id = recipe.Id, - Type = NameTaskConditionCountersCraftingId, - SourceId = "CounterCrafting", - Value = 0 - }; + pmcData.TaskConditionCounters[NameTaskConditionCountersCraftingId] = + new TaskConditionCounter + { + Id = recipe.Id, + Type = NameTaskConditionCountersCraftingId, + SourceId = "CounterCrafting", + Value = 0, + }; } return pmcData.TaskConditionCounters[NameTaskConditionCountersCraftingId]; @@ -1129,12 +1301,17 @@ public class HideoutController( /// Players PMC profile /// Get rewards from scavcase craft request /// Client response - protected void HandleScavCase(string sessionID, PmcData pmcData, HideoutTakeProductionRequestData request, ItemEventRouterResponse output) + protected void HandleScavCase( + string sessionID, + PmcData pmcData, + HideoutTakeProductionRequestData request, + ItemEventRouterResponse output + ) { var ongoingProductions = pmcData.Hideout.Production; string? prodId = null; foreach (var production in ongoingProductions) - // Production or ScavCase + // Production or ScavCase { if (production.Value.RecipeId == request.RecipeId) { @@ -1165,7 +1342,7 @@ public class HideoutController( ItemsWithModsToAdd = scavCaseRewards, FoundInRaid = true, Callback = null, - UseSortingTable = false + UseSortingTable = false, }; _inventoryHelper.AddItemsToStash(sessionID, addItemsRequest, pmcData, output); @@ -1192,7 +1369,12 @@ public class HideoutController( /// Players PMC profile /// QTE result object /// Client response - public void HandleQTEEventOutcome(string sessionId, PmcData pmcData, HandleQTEEventRequestData request, ItemEventRouterResponse output) + public void HandleQTEEventOutcome( + string sessionId, + PmcData pmcData, + HandleQTEEventRequestData request, + ItemEventRouterResponse output + ) { // { // "Action": "HideoutQuickTimeEvent", @@ -1211,14 +1393,22 @@ public class HideoutController( if (outcome) { // Success - pmcData.Health.Energy.Current += relevantQte.Results[QteEffectType.singleSuccessEffect].Energy; - pmcData.Health.Hydration.Current += relevantQte.Results[QteEffectType.singleSuccessEffect].Hydration; + pmcData.Health.Energy.Current += relevantQte + .Results[QteEffectType.singleSuccessEffect] + .Energy; + pmcData.Health.Hydration.Current += relevantQte + .Results[QteEffectType.singleSuccessEffect] + .Hydration; } else { // Failed - pmcData.Health.Energy.Current += relevantQte.Results[QteEffectType.singleFailEffect].Energy; - pmcData.Health.Hydration.Current += relevantQte.Results[QteEffectType.singleFailEffect].Hydration; + pmcData.Health.Energy.Current += relevantQte + .Results[QteEffectType.singleFailEffect] + .Energy; + pmcData.Health.Hydration.Current += relevantQte + .Results[QteEffectType.singleFailEffect] + .Hydration; } } @@ -1243,17 +1433,21 @@ public class HideoutController( protected void HandleMusclePain(PmcData pmcData, QteResult finishEffect) { var hasMildPain = pmcData.Health.BodyParts["Chest"].Effects?.ContainsKey("MildMusclePain"); - var hasSeverePain = pmcData.Health.BodyParts["Chest"].Effects?.ContainsKey("SevereMusclePain"); + var hasSeverePain = pmcData + .Health.BodyParts["Chest"] + .Effects?.ContainsKey("SevereMusclePain"); // Has no muscle pain at all, add mild if (!hasMildPain.GetValueOrDefault(false) && !hasSeverePain.GetValueOrDefault(false)) { // Nullguard - pmcData.Health.BodyParts["Chest"].Effects ??= new Dictionary(); - pmcData.Health.BodyParts["Chest"].Effects["MildMusclePain"] = new BodyPartEffectProperties - { - Time = finishEffect.RewardEffects.FirstOrDefault().Time // TODO - remove hard coded access, get value properly - }; + pmcData.Health.BodyParts["Chest"].Effects ??= + new Dictionary(); + pmcData.Health.BodyParts["Chest"].Effects["MildMusclePain"] = + new BodyPartEffectProperties + { + Time = finishEffect.RewardEffects.FirstOrDefault().Time, // TODO - remove hard coded access, get value properly + }; return; } @@ -1263,10 +1457,11 @@ public class HideoutController( // Already has mild pain, remove mild and add severe pmcData.Health.BodyParts["Chest"].Effects.Remove("MildMusclePain"); - pmcData.Health.BodyParts["Chest"].Effects["SevereMusclePain"] = new BodyPartEffectProperties - { - Time = finishEffect.RewardEffects.FirstOrDefault().Time - }; + pmcData.Health.BodyParts["Chest"].Effects["SevereMusclePain"] = + new BodyPartEffectProperties + { + Time = finishEffect.RewardEffects.FirstOrDefault().Time, + }; } } @@ -1276,24 +1471,26 @@ public class HideoutController( /// Session/Player id /// Players PMC profile /// shooting range score request> - public void RecordShootingRangePoints(string sessionId, PmcData pmcData, RecordShootingRangePoints request) + public void RecordShootingRangePoints( + string sessionId, + PmcData pmcData, + RecordShootingRangePoints request + ) { const string shootingRangeKey = "ShootingRangePoints"; var overallCounterItems = pmcData.Stats.Eft.OverallCounters.Items; // Find counter by key - var shootingRangeHighScore = overallCounterItems.FirstOrDefault(counter => counter.Key.Contains(shootingRangeKey)); + var shootingRangeHighScore = overallCounterItems.FirstOrDefault(counter => + counter.Key.Contains(shootingRangeKey) + ); if (shootingRangeHighScore is null) { // Counter not found, add blank one - overallCounterItems.Add( - new CounterKeyValue - { - Key = [shootingRangeKey], - Value = 0 - } + overallCounterItems.Add(new CounterKeyValue { Key = [shootingRangeKey], Value = 0 }); + shootingRangeHighScore = overallCounterItems.FirstOrDefault(counter => + counter.Key.Contains(shootingRangeKey) ); - shootingRangeHighScore = overallCounterItems.FirstOrDefault(counter => counter.Key.Contains(shootingRangeKey)); } shootingRangeHighScore.Value = request.Points; @@ -1306,21 +1503,20 @@ public class HideoutController( /// Players PMC profile /// Improve area request /// ItemEventRouterResponse - public ItemEventRouterResponse ImproveArea(string sessionId, PmcData pmcData, HideoutImproveAreaRequestData request) + public ItemEventRouterResponse ImproveArea( + string sessionId, + PmcData pmcData, + HideoutImproveAreaRequestData request + ) { var output = _eventOutputHolder.GetOutput(sessionId); // Create mapping of required item with corresponding item from player inventory var items = request.Items.Select(reqItem => - { - var item = pmcData.Inventory.Items.FirstOrDefault(invItem => invItem.Id == reqItem.Id); - return new - { - inventoryItem = item, - requestedItem = reqItem - }; - } - ); + { + var item = pmcData.Inventory.Items.FirstOrDefault(invItem => invItem.Id == reqItem.Id); + return new { inventoryItem = item, requestedItem = reqItem }; + }); // If it's not money, its construction / barter items foreach (var item in items) @@ -1328,16 +1524,19 @@ public class HideoutController( if (item.inventoryItem is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_item_in_inventory", item.requestedItem.Id) + _localisationService.GetText( + "hideout-unable_to_find_item_in_inventory", + item.requestedItem.Id + ) ); return _httpResponseUtil.AppendErrorToOutput(output); } if ( - _paymentHelper.IsMoneyTpl(item.inventoryItem.Template) && - item.inventoryItem.Upd is not null && - item.inventoryItem.Upd.StackObjectsCount is not null && - item.inventoryItem.Upd.StackObjectsCount > item.requestedItem.Count + _paymentHelper.IsMoneyTpl(item.inventoryItem.Template) + && item.inventoryItem.Upd is not null + && item.inventoryItem.Upd.StackObjectsCount is not null + && item.inventoryItem.Upd.StackObjectsCount > item.requestedItem.Count ) { item.inventoryItem.Upd.StackObjectsCount -= item.requestedItem.Count; @@ -1348,18 +1547,27 @@ public class HideoutController( } } - var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(x => x.Type == request.AreaType); + var profileHideoutArea = pmcData.Hideout.Areas.FirstOrDefault(x => + x.Type == request.AreaType + ); if (profileHideoutArea is null) { - _logger.Error(_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)); + _logger.Error( + _localisationService.GetText("hideout-unable_to_find_area", request.AreaType) + ); return _httpResponseUtil.AppendErrorToOutput(output); } - var hideoutDbData = _databaseService.GetHideout().Areas.FirstOrDefault(area => area.Type == request.AreaType); + var hideoutDbData = _databaseService + .GetHideout() + .Areas.FirstOrDefault(area => area.Type == request.AreaType); if (hideoutDbData is null) { _logger.Error( - _localisationService.GetText("hideout-unable_to_find_area_in_database", request.AreaType) + _localisationService.GetText( + "hideout-unable_to_find_area_in_database", + request.AreaType + ) ); return _httpResponseUtil.AppendErrorToOutput(output); } @@ -1370,7 +1578,8 @@ public class HideoutController( if (output.ProfileChanges[sessionId].Improvements is null) { - output.ProfileChanges[sessionId].Improvements = new Dictionary(); + output.ProfileChanges[sessionId].Improvements = + new Dictionary(); } foreach (var improvement in improvements) @@ -1378,7 +1587,7 @@ public class HideoutController( var improvementDetails = new HideoutImprovement { Completed = false, - ImproveCompleteTimestamp = (long) (timestamp + improvement.ImprovementTime) + ImproveCompleteTimestamp = (long)(timestamp + improvement.ImprovementTime), }; output.ProfileChanges[sessionId].Improvements[improvement.Id] = improvementDetails; @@ -1396,7 +1605,11 @@ public class HideoutController( /// Players PMC profile /// Cancel production request data /// ItemEventRouterResponse - public ItemEventRouterResponse CancelProduction(string sessionId, PmcData pmcData, HideoutCancelProductionRequestData request) + public ItemEventRouterResponse CancelProduction( + string sessionId, + PmcData pmcData, + HideoutCancelProductionRequestData request + ) { var output = _eventOutputHolder.GetOutput(sessionId); @@ -1417,7 +1630,11 @@ public class HideoutController( return output; } - public ItemEventRouterResponse CicleOfCultistProductionStart(string sessionId, PmcData pmcData, HideoutCircleOfCultistProductionStartRequestData request) + public ItemEventRouterResponse CicleOfCultistProductionStart( + string sessionId, + PmcData pmcData, + HideoutCircleOfCultistProductionStartRequestData request + ) { return _circleOfCultistService.StartSacrifice(sessionId, pmcData, request); } @@ -1429,7 +1646,11 @@ public class HideoutController( /// Players PMC profile /// Delete production request /// ItemEventRouterResponse - public ItemEventRouterResponse HideoutDeleteProductionCommand(string sessionId, PmcData pmcData, HideoutDeleteProductionRequestData request) + public ItemEventRouterResponse HideoutDeleteProductionCommand( + string sessionId, + PmcData pmcData, + HideoutDeleteProductionRequestData request + ) { var output = _eventOutputHolder.GetOutput(sessionId); @@ -1446,7 +1667,11 @@ public class HideoutController( /// Players PMC profile /// Apply hideout customisation request /// ItemEventRouterResponse - public ItemEventRouterResponse HideoutCustomizationApply(string sessionId, PmcData pmcData, HideoutCustomizationApplyRequestData request) + public ItemEventRouterResponse HideoutCustomizationApply( + string sessionId, + PmcData pmcData, + HideoutCustomizationApplyRequestData request + ) { var output = _eventOutputHolder.GetOutput(sessionId); @@ -1455,12 +1680,15 @@ public class HideoutController( .Customisation.Globals.FirstOrDefault(cust => cust.Id == request.OfferId); if (itemDetails is null) { - _logger.Error($"Unable to find customisation: {request.OfferId} in db, cannot apply to hideout"); + _logger.Error( + $"Unable to find customisation: {request.OfferId} in db, cannot apply to hideout" + ); return output; } - pmcData.Hideout.Customization[GetHideoutCustomisationType(itemDetails.Type)] = itemDetails.ItemId; + pmcData.Hideout.Customization[GetHideoutCustomisationType(itemDetails.Type)] = + itemDetails.ItemId; return output; } @@ -1498,8 +1726,13 @@ public class HideoutController( /// Players PMC profile /// /// Client response - protected void AddMissingPresetStandItemsToProfile(string sessionId, Stage equipmentPresetStage, PmcData pmcData, HideoutArea equipmentPresetHideoutArea, - ItemEventRouterResponse output) + protected void AddMissingPresetStandItemsToProfile( + string sessionId, + Stage equipmentPresetStage, + PmcData pmcData, + HideoutArea equipmentPresetHideoutArea, + ItemEventRouterResponse output + ) { // Each slot is a single Mannequin var slots = _itemHelper.GetItem(equipmentPresetStage.Container).Value.Properties.Slots; @@ -1519,7 +1752,7 @@ public class HideoutController( Id = standId, Template = ItemTpl.INVENTORY_DEFAULT, ParentId = equipmentPresetHideoutArea.Id, - SlotId = mannequinSlot.Name + SlotId = mannequinSlot.Name, }; pmcData.Inventory.Items.Add(mannequinToAdd); @@ -1527,11 +1760,13 @@ public class HideoutController( var mannequinPocketItemToAdd = new Item { Id = _hashUtil.Generate(), - Template = pmcData.Inventory.Items.FirstOrDefault(item => item.SlotId == "Pockets" && item.ParentId == pmcData.Inventory.Equipment + Template = pmcData + .Inventory.Items.FirstOrDefault(item => + item.SlotId == "Pockets" && item.ParentId == pmcData.Inventory.Equipment ) .Template, // Same pocket tpl as players profile (unheard get bigger, matching pockets etc) ParentId = standId, - SlotId = "Pockets" + SlotId = "Pockets", }; pmcData.Inventory.Items.Add(mannequinPocketItemToAdd); output.ProfileChanges[sessionId].Items.NewItems.Add(mannequinToAdd); @@ -1547,11 +1782,17 @@ public class HideoutController( /// Player profile /// Client request /// - public ItemEventRouterResponse HideoutCustomizationSetMannequinPose(string sessionId, PmcData pmcData, HideoutCustomizationSetMannequinPoseRequest request) + public ItemEventRouterResponse HideoutCustomizationSetMannequinPose( + string sessionId, + PmcData pmcData, + HideoutCustomizationSetMannequinPoseRequest request + ) { if (request.Poses is null) { - _logger.Warning("this really shouldnt be possible, but a request has come in with a pose change without poses"); + _logger.Warning( + "this really shouldnt be possible, but a request has come in with a pose change without poses" + ); return _eventOutputHolder.GetOutput(sessionId); } @@ -1584,12 +1825,13 @@ public class HideoutController( { foreach (var sessionID in _saveServer.GetProfiles()) { - if (sessionID.Value.CharacterData.PmcData.Hideout is not null && - _profileActivityService.ActiveWithinLastMinutes( + if ( + sessionID.Value.CharacterData.PmcData.Hideout is not null + && _profileActivityService.ActiveWithinLastMinutes( sessionID.Key, _hideoutConfig.UpdateProfileHideoutWhenActiveWithinMinutes ) - ) + ) { _hideoutHelper.UpdatePlayerHideout(sessionID.Key); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/InRaidController.cs b/Libraries/SPTarkov.Server.Core/Controllers/InRaidController.cs index 38b0db8a..209bc75e 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/InRaidController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/InRaidController.cs @@ -25,7 +25,7 @@ public class InRaidController( /// Register player request public void AddPlayer(string sessionId, RegisterPlayerRequestData info) { - // _applicationContext.AddValue(ContextVariableType.REGISTER_PLAYER_REQUEST, info); + // _applicationContext.AddValue(ContextVariableType.REGISTER_PLAYER_REQUEST, info); } /// diff --git a/Libraries/SPTarkov.Server.Core/Controllers/InsuranceController.cs b/Libraries/SPTarkov.Server.Core/Controllers/InsuranceController.cs index c6040c5b..f1483ae4 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/InsuranceController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/InsuranceController.cs @@ -91,11 +91,15 @@ public class InsuranceController( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Found {profileInsuranceDetails.Count} insurance packages in profile {sessionId}"); + _logger.Debug( + $"Found {profileInsuranceDetails.Count} insurance packages in profile {sessionId}" + ); } } - return profileInsuranceDetails.Where(insured => insuranceTime >= insured.ScheduledTime).ToList(); + return profileInsuranceDetails + .Where(insured => insuranceTime >= insured.ScheduledTime) + .ToList(); } /// @@ -159,17 +163,20 @@ public class InsuranceController( protected void RemoveInsurancePackageFromProfile(string sessionId, Insurance insPackage) { var profile = _saveServer.GetProfile(sessionId); - profile.InsuranceList = profile.InsuranceList.Where(insurance => - insurance.TraderId != insPackage.TraderId || - insurance.SystemData?.Date != insPackage.SystemData?.Date || - insurance.SystemData?.Time != insPackage.SystemData?.Time || - insurance.SystemData?.Location != insPackage.SystemData?.Location + profile.InsuranceList = profile + .InsuranceList.Where(insurance => + insurance.TraderId != insPackage.TraderId + || insurance.SystemData?.Date != insPackage.SystemData?.Date + || insurance.SystemData?.Time != insPackage.SystemData?.Time + || insurance.SystemData?.Location != insPackage.SystemData?.Location ) .ToList(); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Removed processed insurance package. Remaining packages: {profile.InsuranceList.Count}"); + _logger.Debug( + $"Removed processed insurance package. Remaining packages: {profile.InsuranceList.Count}" + ); } } @@ -186,11 +193,14 @@ public class InsuranceController( // Populate a Map object of items for quick lookup by their ID and use it to populate a Map of main-parent items // and each of their attachments. For example, a gun mapped to each of its attachments. var itemsMap = _itemHelper.GenerateItemsMap(insured.Items); - var parentAttachmentsMap = PopulateParentAttachmentsMap(rootItemParentId, insured, itemsMap); + var parentAttachmentsMap = PopulateParentAttachmentsMap( + rootItemParentId, + insured, + itemsMap + ); // Check to see if any regular items are present. - var hasRegularItems = itemsMap.Values.Any(item => !_itemHelper.IsAttachmentAttached(item) - ); + var hasRegularItems = itemsMap.Values.Any(item => !_itemHelper.IsAttachmentAttached(item)); // Process all items that are not attached, attachments; those are handled separately, by value. if (hasRegularItems) @@ -229,7 +239,11 @@ public class InsuranceController( /// The insurance object containing the items to evaluate /// A Dictionary for quick item look-up by item ID /// A dictionary containing parent item IDs to arrays of their attachment items - protected Dictionary> PopulateParentAttachmentsMap(string rootItemParentID, Insurance insured, Dictionary itemsMap) + protected Dictionary> PopulateParentAttachmentsMap( + string rootItemParentID, + Insurance insured, + Dictionary itemsMap + ) { var mainParentToAttachmentsMap = new Dictionary>(); foreach (var insuredItem in insured.Items) @@ -247,7 +261,7 @@ public class InsuranceController( { insuredItemId = insuredItem.Id, insuredItemTpl = insuredItem.Template, - parentId = insuredItem.ParentId + parentId = insuredItem.ParentId, } ) ); @@ -270,7 +284,7 @@ public class InsuranceController( new { insuredItemId = insuredItem.Id, - insuredItemTpl = insuredItem.Template + insuredItemTpl = insuredItem.Template, } ) ); @@ -290,7 +304,7 @@ public class InsuranceController( { insuredItemId = insuredItem.Id, insuredItemTpl = insuredItem.Template, - parentId = insuredItem.ParentId + parentId = insuredItem.ParentId, } ) ); @@ -322,8 +336,10 @@ public class InsuranceController( /// Dictionary containing parent item IDs to arrays of their attachment items /// Hashset containing parent item IDs to arrays of their attachment items which are not moddable in-raid /// - protected Dictionary> RemoveNonModdableAttachments(Dictionary> parentAttachmentsMap, - Dictionary itemsMap) + protected Dictionary> RemoveNonModdableAttachments( + Dictionary> parentAttachmentsMap, + Dictionary itemsMap + ) { var updatedMap = new Dictionary>(); @@ -371,7 +387,11 @@ public class InsuranceController( /// Insurance object containing the items to evaluate /// Hashset to keep track of items marked for deletion /// Dictionary containing parent item IDs to arrays of their attachment items - protected void ProcessRegularItems(Insurance insured, HashSet toDelete, Dictionary> parentAttachmentsMap) + protected void ProcessRegularItems( + Insurance insured, + HashSet toDelete, + Dictionary> parentAttachmentsMap + ) { foreach (var insuredItem in insured.Items) { @@ -419,8 +439,12 @@ public class InsuranceController( /// Dictionary for quick item look-up by item ID /// Trader ID from the Insurance object /// Tracked attachment ids to be removed - protected void ProcessAttachments(Dictionary> mainParentToAttachmentsMap, Dictionary itemsMap, string? insuredTraderId, - HashSet toDelete) + protected void ProcessAttachments( + Dictionary> mainParentToAttachmentsMap, + Dictionary itemsMap, + string? insuredTraderId, + HashSet toDelete + ) { foreach (var parentObj in mainParentToAttachmentsMap) { @@ -444,7 +468,6 @@ public class InsuranceController( } } - /// /// Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by /// their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the @@ -454,16 +477,26 @@ public class InsuranceController( /// Array of attachment items to sort, filter, and roll /// ID of the trader to that has ensured these items /// array that accumulates the IDs of the items to be deleted - protected void ProcessAttachmentByParent(List attachments, string? traderId, HashSet toDelete) + protected void ProcessAttachmentByParent( + List attachments, + string? traderId, + HashSet toDelete + ) { // Create dict of item ids + their flea/handbook price (highest is chosen) var weightedAttachmentByPrice = WeightAttachmentsByPrice(attachments); // Get how many attachments we want to pull off parent - var countOfAttachmentsToRemove = GetAttachmentCountToRemove(weightedAttachmentByPrice, traderId); + var countOfAttachmentsToRemove = GetAttachmentCountToRemove( + weightedAttachmentByPrice, + traderId + ); // Create prob array and add all attachments with rouble price as the weight - var attachmentsProbabilityArray = new ProbabilityObjectArray(_mathUtil, _cloner); + var attachmentsProbabilityArray = new ProbabilityObjectArray( + _mathUtil, + _cloner + ); foreach (var attachmentTpl in weightedAttachmentByPrice) { attachmentsProbabilityArray.Add( @@ -472,7 +505,10 @@ public class InsuranceController( } // Draw x attachments from weighted array to remove from parent, remove from pool after being picked - var attachmentIdsToRemove = attachmentsProbabilityArray.Draw((int) countOfAttachmentsToRemove, false); + var attachmentIdsToRemove = attachmentsProbabilityArray.Draw( + (int)countOfAttachmentsToRemove, + false + ); foreach (var attachmentId in attachmentIdsToRemove) { toDelete.Add(attachmentId); @@ -492,7 +528,11 @@ public class InsuranceController( /// /// /// - protected void LogAttachmentsBeingRemoved(List attachmentIdsToRemove, List attachments, Dictionary attachmentPrices) + protected void LogAttachmentsBeingRemoved( + List attachmentIdsToRemove, + List attachments, + Dictionary attachmentPrices + ) { var index = 1; foreach (var attachmentId in attachmentIdsToRemove) @@ -500,8 +540,8 @@ public class InsuranceController( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Attachment {index} Id: {attachmentId} Tpl: {attachments.FirstOrDefault(x => x.Id == attachmentId)?.Template} - " + - $"Price: {attachmentPrices[attachmentId]}" + $"Attachment {index} Id: {attachmentId} Tpl: {attachments.FirstOrDefault(x => x.Id == attachmentId)?.Template} - " + + $"Price: {attachmentPrices[attachmentId]}" ); } @@ -521,7 +561,10 @@ public class InsuranceController( // Get a dictionary of item tpls + their rouble price foreach (var attachment in attachments) { - var price = _ragfairPriceService.GetDynamicItemPrice(attachment.Template, Money.ROUBLES); + var price = _ragfairPriceService.GetDynamicItemPrice( + attachment.Template, + Money.ROUBLES + ); if (price is not null) { result[attachment.Id] = Math.Round(price ?? 0); @@ -539,7 +582,10 @@ public class InsuranceController( /// Dict of item Tpls and their rouble price /// Trader the attachment is insured against /// Attachment count to remove - protected double GetAttachmentCountToRemove(Dictionary weightedAttachmentByPrice, string? traderId) + protected double GetAttachmentCountToRemove( + Dictionary weightedAttachmentByPrice, + string? traderId + ) { const int removeCount = 0; @@ -550,7 +596,9 @@ public class InsuranceController( // Get attachments count above or equal to price set in config return weightedAttachmentByPrice - .Where(attachment => attachment.Value >= _insuranceConfig.MinAttachmentRoublePriceToBeTaken) + .Where(attachment => + attachment.Value >= _insuranceConfig.MinAttachmentRoublePriceToBeTaken + ) .Count(_ => RollForDelete(traderId) ?? false); } @@ -577,8 +625,8 @@ public class InsuranceController( // Map is labs + insurance is disabled in base.json if (IsMapLabsAndInsuranceDisabled(insurance)) - // Trader has labs-specific messages - // Wipe out returnable items + // Trader has labs-specific messages + // Wipe out returnable items { HandleLabsInsurance(traderDialogMessages, insurance); } @@ -587,9 +635,14 @@ public class InsuranceController( HandleLabyrinthInsurance(traderDialogMessages, insurance); } else if (insurance.Items?.Count == 0) - // Not labs and no items to return + // Not labs and no items to return { - if (traderDialogMessages.TryGetValue("insuranceFailed", out var insuranceFailedTemplates)) + if ( + traderDialogMessages.TryGetValue( + "insuranceFailed", + out var insuranceFailedTemplates + ) + ) { insurance.MessageTemplateId = _randomUtil.GetArrayValue(insuranceFailedTemplates); } @@ -615,8 +668,15 @@ public class InsuranceController( /// protected bool IsMapLabsAndInsuranceDisabled(Insurance insurance, string labsId = "laboratory") { - return string.Equals(insurance.SystemData?.Location, labsId, StringComparison.OrdinalIgnoreCase) && - !(_databaseService.GetLocation(labsId)?.Base?.Insurance.GetValueOrDefault(false) ?? false); + return string.Equals( + insurance.SystemData?.Location, + labsId, + StringComparison.OrdinalIgnoreCase + ) + && !( + _databaseService.GetLocation(labsId)?.Base?.Insurance.GetValueOrDefault(false) + ?? false + ); } /// @@ -625,10 +685,20 @@ public class InsuranceController( /// The insured items to process /// OPTIONAL - id of labs location /// - protected bool IsMapLabyrinthAndInsuranceDisabled(Insurance insurance, string labyrinthId = "labyrinth") + protected bool IsMapLabyrinthAndInsuranceDisabled( + Insurance insurance, + string labyrinthId = "labyrinth" + ) { - return string.Equals(insurance.SystemData?.Location, labyrinthId, StringComparison.OrdinalIgnoreCase) && - !(_databaseService.GetLocation(labyrinthId)?.Base?.Insurance.GetValueOrDefault(false) ?? false); + return string.Equals( + insurance.SystemData?.Location, + labyrinthId, + StringComparison.OrdinalIgnoreCase + ) + && !( + _databaseService.GetLocation(labyrinthId)?.Base?.Insurance.GetValueOrDefault(false) + ?? false + ); } /// @@ -636,7 +706,10 @@ public class InsuranceController( /// /// /// - protected void HandleLabsInsurance(Dictionary?>? traderDialogMessages, Insurance insurance) + protected void HandleLabsInsurance( + Dictionary?>? traderDialogMessages, + Insurance insurance + ) { // Use labs specific messages if available, otherwise use default var responseMesageIds = @@ -655,10 +728,13 @@ public class InsuranceController( /// /// /// - protected void HandleLabyrinthInsurance(Dictionary?>? traderDialogMessages, Insurance insurance) + protected void HandleLabyrinthInsurance( + Dictionary?>? traderDialogMessages, + Insurance insurance + ) { // Use labs specific messages if available, otherwise use default - var responseMessageIds = + var responseMessageIds = traderDialogMessages["insuranceFailedLabyrinth"]?.Count > 0 ? traderDialogMessages["insuranceFailedLabyrinth"] : traderDialogMessages["insuranceFailed"]; @@ -669,7 +745,6 @@ public class InsuranceController( insurance.Items = []; } - /// /// Roll for chance of item being 'lost' /// @@ -692,11 +767,15 @@ public class InsuranceController( var roll = returnChance >= traderReturnChance; // Log the roll with as much detail as possible. - var itemName = insuredItem is not null ? $"{_itemHelper.GetItemName(insuredItem.Template)}" : ""; + var itemName = insuredItem is not null + ? $"{_itemHelper.GetItemName(insuredItem.Template)}" + : ""; var status = roll ? "Delete" : "Keep"; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Rolling {itemName} with {trader} - Return {traderReturnChance}% - Roll: {returnChance} - Status: {status}"); + _logger.Debug( + $"Rolling {itemName} with {trader} - Return {traderReturnChance}% - Roll: {returnChance} - Status: {status}" + ); } return roll; @@ -709,7 +788,11 @@ public class InsuranceController( /// Insurance request /// Session/Player id /// ItemEventRouterResponse object to send to client - public ItemEventRouterResponse Insure(PmcData pmcData, InsureRequestData request, string sessionId) + public ItemEventRouterResponse Insure( + PmcData pmcData, + InsureRequestData request, + string sessionId + ) { var output = _eventOutputHolder.GetOutput(sessionId); var itemsToInsureCount = request.Items.Count; @@ -729,7 +812,7 @@ public class InsuranceController( pmcData, inventoryItemsHash[key], request.TransactionId - ) + ), } ); } @@ -742,7 +825,7 @@ public class InsuranceController( Type = "", ItemId = "", Count = 0, - SchemeId = 0 + SchemeId = 0, }; // pay for the item insurance @@ -757,20 +840,22 @@ public class InsuranceController( foreach (var key in request.Items) { pmcData.InsuredItems.Add( - new InsuredItem - { - TId = request.TransactionId, - ItemId = inventoryItemsHash[key].Id - } + new InsuredItem { TId = request.TransactionId, ItemId = inventoryItemsHash[key].Id } ); // If Item is Helmet or Body Armour -> Handle insurance of soft inserts - if (_itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(inventoryItemsHash[key].Template)) + if ( + _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(inventoryItemsHash[key].Template) + ) { InsureSoftInserts(inventoryItemsHash[key], pmcData, request); } } - _profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, itemsToInsureCount * 0.01); + _profileHelper.AddSkillPointsToPlayer( + pmcData, + SkillTypes.Charisma, + itemsToInsureCount * 0.01 + ); return output; } @@ -781,9 +866,15 @@ public class InsuranceController( /// Armor item to be insured /// Players PMC profile /// Insurance request data - public void InsureSoftInserts(Item itemWithSoftInserts, PmcData pmcData, InsureRequestData request) + public void InsureSoftInserts( + Item itemWithSoftInserts, + PmcData pmcData, + InsureRequestData request + ) { - var softInsertSlots = pmcData.Inventory.Items.Where(item => item.ParentId == itemWithSoftInserts.Id && _itemHelper.IsSoftInsertId(item.SlotId.ToLower()) + var softInsertSlots = pmcData.Inventory.Items.Where(item => + item.ParentId == itemWithSoftInserts.Id + && _itemHelper.IsSoftInsertId(item.SlotId.ToLower()) ); foreach (var softInsertSlot in softInsertSlots) @@ -794,11 +885,7 @@ public class InsuranceController( } pmcData.InsuredItems.Add( - new InsuredItem - { - TId = request.TransactionId, - ItemId = softInsertSlot.Id - } + new InsuredItem { TId = request.TransactionId, ItemId = softInsertSlot.Id } ); } } @@ -830,7 +917,9 @@ public class InsuranceController( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Item with id: {itemId} missing from player inventory, skipping"); + _logger.Debug( + $"Item with id: {itemId} missing from player inventory, skipping" + ); } continue; @@ -838,7 +927,11 @@ public class InsuranceController( items.TryAdd( inventoryItemsHash[itemId].Template, - _insuranceService.GetRoublePriceToInsureItemWithTrader(pmcData, inventoryItemsHash[itemId], trader) + _insuranceService.GetRoublePriceToInsureItemWithTrader( + pmcData, + inventoryItemsHash[itemId], + trader + ) ); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/InventoryController.cs b/Libraries/SPTarkov.Server.Core/Controllers/InventoryController.cs index dc4bbea0..c7e6d3e2 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/InventoryController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/InventoryController.cs @@ -48,8 +48,12 @@ public class InventoryController( /// Move request data /// Session/Player id /// Client response - public void MoveItem(PmcData pmcData, InventoryMoveRequestData moveRequest, string sessionId, - ItemEventRouterResponse output) + public void MoveItem( + PmcData pmcData, + InventoryMoveRequestData moveRequest, + string sessionId, + ItemEventRouterResponse output + ) { if (output.Warnings?.Count > 0) { @@ -57,18 +61,27 @@ public class InventoryController( } // Changes made to result apply to character inventory - var ownerInventoryItems = _inventoryHelper.GetOwnerInventoryItems(moveRequest, moveRequest.Item, sessionId); + var ownerInventoryItems = _inventoryHelper.GetOwnerInventoryItems( + moveRequest, + moveRequest.Item, + sessionId + ); if (ownerInventoryItems.SameInventory.GetValueOrDefault(false)) { // Don't move items from trader to profile, this can happen when editing a traders preset weapons - if (moveRequest.FromOwner?.Type == "Trader" && !ownerInventoryItems.IsMail.GetValueOrDefault(false)) + if ( + moveRequest.FromOwner?.Type == "Trader" + && !ownerInventoryItems.IsMail.GetValueOrDefault(false) + ) { AppendTraderExploitErrorResponse(output); return; } // Check for item in inventory before allowing internal transfer - var originalItemLocation = ownerInventoryItems.From?.FirstOrDefault(item => item.Id == moveRequest.Item); + var originalItemLocation = ownerInventoryItems.From?.FirstOrDefault(item => + item.Id == moveRequest.Item + ); if (originalItemLocation is null) { // Internal item move but item never existed, possible dupe glitch @@ -91,9 +104,19 @@ public class InventoryController( } // Item is moving into or out of place of fame dog tag slot - if (moveRequest.To?.Container != null && - (moveRequest.To.Container.StartsWith("dogtag", StringComparison.OrdinalIgnoreCase) || - originalLocationSlotId.StartsWith("dogtag", StringComparison.OrdinalIgnoreCase))) + if ( + moveRequest.To?.Container != null + && ( + moveRequest.To.Container.StartsWith( + "dogtag", + StringComparison.OrdinalIgnoreCase + ) + || originalLocationSlotId.StartsWith( + "dogtag", + StringComparison.OrdinalIgnoreCase + ) + ) + ) { _hideoutHelper.ApplyPlaceOfFameDogtagBonus(pmcData); } @@ -117,7 +140,7 @@ public class InventoryController( _httpResponseUtil.AppendErrorToOutput( output, _localisationService.GetText("inventory-edit_trader_item"), - (BackendErrorCodes) 228 + (BackendErrorCodes)228 ); } @@ -129,13 +152,21 @@ public class InventoryController( /// Pin/Lock request data /// Session/Player id /// Client response - public void PinOrLock(PmcData pmcData, PinOrLockItemRequest request, string sessionId, - ItemEventRouterResponse output) + public void PinOrLock( + PmcData pmcData, + PinOrLockItemRequest request, + string sessionId, + ItemEventRouterResponse output + ) { - var itemToAdjust = pmcData.Inventory!.Items!.FirstOrDefault(item => item.Id == request.Item); + var itemToAdjust = pmcData.Inventory!.Items!.FirstOrDefault(item => + item.Id == request.Item + ); if (itemToAdjust is null) { - _logger.Error($"Unable find item: {request.Item} to: {request.State} on player {sessionId}to: "); + _logger.Error( + $"Unable find item: {request.Item} to: {request.State} on player {sessionId}to: " + ); return; } @@ -165,7 +196,11 @@ public class InventoryController( /// Players PMC profile /// /// Session/Player id - public void RedeemProfileReward(PmcData pmcData, RedeemProfileRequestData request, string sessionId) + public void RedeemProfileReward( + PmcData pmcData, + RedeemProfileRequestData request, + string sessionId + ) { var fullProfile = _profileHelper.GetFullProfile(sessionId); foreach (var rewardEvent in request.Events) @@ -173,49 +208,58 @@ public class InventoryController( // Hard coded to `SYSTEM` for now // TODO: make this dynamic var dialog = fullProfile.DialogueRecords["59e7125688a45068a6249071"]; - var mail = dialog.Messages.FirstOrDefault(message => message.Id == rewardEvent.MessageId); - var mailEvent = - mail.ProfileChangeEvents.FirstOrDefault(changeEvent => changeEvent.Id == rewardEvent.EventId); - + var mail = dialog.Messages.FirstOrDefault(message => + message.Id == rewardEvent.MessageId + ); + var mailEvent = mail.ProfileChangeEvents.FirstOrDefault(changeEvent => + changeEvent.Id == rewardEvent.EventId + ); + switch (mailEvent.Type) { case "TraderSalesSum": pmcData.TradersInfo[mailEvent.Entity].SalesSum = mailEvent.Value; _traderHelper.LevelUp(mailEvent.Entity, pmcData); - _logger.Success($"Set trader {mailEvent.Entity}: Sales Sum to: {mailEvent.Value}"); + _logger.Success( + $"Set trader {mailEvent.Entity}: Sales Sum to: {mailEvent.Value}" + ); break; case "TraderStanding": pmcData.TradersInfo[mailEvent.Entity].Standing = mailEvent.Value; _traderHelper.LevelUp(mailEvent.Entity, pmcData); - _logger.Success($"Set trader {mailEvent.Entity}: Standing to: {mailEvent.Value}"); + _logger.Success( + $"Set trader {mailEvent.Entity}: Standing to: {mailEvent.Value}" + ); break; case "ProfileLevel": - pmcData.Info.Experience = (int) mailEvent.Value.Value; + pmcData.Info.Experience = (int)mailEvent.Value.Value; // Will calculate level below _traderHelper.ValidateTraderStandingsAndPlayerLevelForProfile(sessionId); _logger.Success($"Set profile xp to: {mailEvent.Value}"); break; case "SkillPoints": + { + var profileSkill = pmcData.Skills.Common.FirstOrDefault(x => + x.Id == Enum.Parse(mailEvent.Entity) + ); + if (profileSkill is null) { - var profileSkill = pmcData.Skills.Common.FirstOrDefault(x => x.Id == Enum.Parse(mailEvent.Entity)); - if (profileSkill is null) - { - _logger.Warning($"Unable to find skill with name: {mailEvent.Entity}"); - continue; - } - - profileSkill.Progress = mailEvent.Value; - _logger.Success($"Set profile skill: {mailEvent.Entity} to: {mailEvent.Value}"); - break; + _logger.Warning($"Unable to find skill with name: {mailEvent.Entity}"); + continue; } + + profileSkill.Progress = mailEvent.Value; + _logger.Success($"Set profile skill: {mailEvent.Entity} to: {mailEvent.Value}"); + break; + } case "ExamineAllItems": - { - var itemsToInspect = _itemHelper.GetItems().Where(x => x.Type != "Node"); - FlagItemsAsInspectedAndRewardXp(itemsToInspect.Select(x => x.Id), fullProfile); - _logger.Success($"Flagged {itemsToInspect.Count()} items as examined"); + { + var itemsToInspect = _itemHelper.GetItems().Where(x => x.Type != "Node"); + FlagItemsAsInspectedAndRewardXp(itemsToInspect.Select(x => x.Id), fullProfile); + _logger.Success($"Flagged {itemsToInspect.Count()} items as examined"); - break; - } + break; + } case "UnlockTrader": pmcData.TradersInfo[mailEvent.Entity].Unlocked = true; _logger.Success($"Trader {mailEvent.Entity} Unlocked"); @@ -228,19 +272,21 @@ public class InventoryController( break; case "HideoutAreaLevel": + { + var areaName = mailEvent.Entity; + var newValue = mailEvent.Value; + var hideoutAreaType = Enum.Parse(areaName ?? "NotSet"); + + var desiredArea = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == hideoutAreaType + ); + if (desiredArea is not null) { - var areaName = mailEvent.Entity; - var newValue = mailEvent.Value; - var hideoutAreaType = Enum.Parse(areaName ?? "NotSet"); - - var desiredArea = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == hideoutAreaType); - if (desiredArea is not null) - { - desiredArea.Level = (int?) newValue; - } - - break; + desiredArea.Level = (int?)newValue; } + + break; + } default: _logger.Warning($"Unhandled profile reward event: {mailEvent.Type}"); @@ -254,7 +300,10 @@ public class InventoryController( /// /// Inspected item tpls /// Profile to add xp to - protected void FlagItemsAsInspectedAndRewardXp(IEnumerable itemTpls, SptProfile fullProfile) + protected void FlagItemsAsInspectedAndRewardXp( + IEnumerable itemTpls, + SptProfile fullProfile + ) { foreach (var itemTpl in itemTpls) { @@ -262,16 +311,23 @@ public class InventoryController( if (!item.Key) { _logger.Warning( - _localisationService.GetText("inventory-unable_to_inspect_item_not_in_db", itemTpl) + _localisationService.GetText( + "inventory-unable_to_inspect_item_not_in_db", + itemTpl + ) ); return; } - fullProfile.CharacterData.PmcData.Info.Experience += item.Value.Properties.ExamineExperience; + fullProfile.CharacterData.PmcData.Info.Experience += item.Value + .Properties + .ExamineExperience; fullProfile.CharacterData.PmcData.Encyclopedia[itemTpl] = false; - fullProfile.CharacterData.ScavData.Info.Experience += item.Value.Properties.ExamineExperience; + fullProfile.CharacterData.ScavData.Info.Experience += item.Value + .Properties + .ExamineExperience; fullProfile.CharacterData.ScavData.Encyclopedia[itemTpl] = false; } @@ -291,8 +347,12 @@ public class InventoryController( /// /// Session/Player id /// Client response - public void OpenRandomLootContainer(PmcData pmcData, OpenRandomLootContainerRequestData request, string sessionId, - ItemEventRouterResponse output) + public void OpenRandomLootContainer( + PmcData pmcData, + OpenRandomLootContainerRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { // Container player opened in their inventory var openedItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == request.Item); @@ -305,7 +365,7 @@ public class InventoryController( { ItemTpl.RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_VIOLET_OPEN, ItemTpl.RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_BLUE_OPEN, - ItemTpl.RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_GREEN_OPEN + ItemTpl.RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_GREEN_OPEN, }; // Temp fix for unlocked weapon crate hideout craft if (isSealedWeaponBox || unlockedWeaponCrates.Contains(containerDetailsDb.Value.Id)) @@ -320,10 +380,14 @@ public class InventoryController( } else { - var rewardContainerDetails = _inventoryHelper.GetRandomLootContainerRewardDetails(openedItem.Template); + var rewardContainerDetails = _inventoryHelper.GetRandomLootContainerRewardDetails( + openedItem.Template + ); if (rewardContainerDetails?.RewardCount == null) { - _logger.Error($"Unable to add loot to container: {openedItem.Template}, no rewards found"); + _logger.Error( + $"Unable to add loot to container: {openedItem.Template}, no rewards found" + ); } else { @@ -344,7 +408,7 @@ public class InventoryController( ItemsWithModsToAdd = rewards, FoundInRaid = foundInRaid, Callback = null, - UseSortingTable = true + UseSortingTable = true, }; _inventoryHelper.AddItemsToStash(sessionId, addItemsRequest, pmcData, output); if (output.Warnings?.Count > 0) @@ -364,8 +428,12 @@ public class InventoryController( /// Edit marker request /// Session/Player id /// Client response - public void EditMapMarker(PmcData pmcData, InventoryEditMarkerRequestData request, string sessionId, - ItemEventRouterResponse output) + public void EditMapMarker( + PmcData pmcData, + InventoryEditMarkerRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { var mapItem = _mapMarkerService.EditMarkerOnMap(pmcData, request); @@ -380,8 +448,12 @@ public class InventoryController( /// Delete marker request /// Session/Player id /// Client response - public void DeleteMapMarker(PmcData pmcData, InventoryDeleteMarkerRequestData request, string sessionId, - ItemEventRouterResponse output) + public void DeleteMapMarker( + PmcData pmcData, + InventoryDeleteMarkerRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { var mapItem = _mapMarkerService.DeleteMarkerFromMap(pmcData, request); @@ -389,8 +461,12 @@ public class InventoryController( output.ProfileChanges[sessionId].Items.ChangedItems.Add(mapItem); } - public void CreateMapMarker(PmcData pmcData, InventoryCreateMarkerRequestData request, string sessionId, - ItemEventRouterResponse output) + public void CreateMapMarker( + PmcData pmcData, + InventoryCreateMarkerRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { var adjustedMapItem = _mapMarkerService.CreateMarkerOnMap(pmcData, request); @@ -405,16 +481,25 @@ public class InventoryController( /// Add marker request /// Session/Player id /// Client response - public void SortInventory(PmcData pmcData, InventorySortRequestData request, string sessionId, - ItemEventRouterResponse output) + public void SortInventory( + PmcData pmcData, + InventorySortRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { foreach (var change in request.ChangedItems) { - var inventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == change.Id); + var inventoryItem = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == change.Id + ); if (inventoryItem is null) { _logger.Error( - _localisationService.GetText("inventory-unable_to_sort_inventory_restart_game", change.Id) + _localisationService.GetText( + "inventory-unable_to_sort_inventory_restart_game", + change.Id + ) ); continue; @@ -440,8 +525,11 @@ public class InventoryController( /// /// Session/Player id /// - public ItemEventRouterResponse ReadEncyclopedia(PmcData pmcData, InventoryReadEncyclopediaRequestData request, - string sessionId) + public ItemEventRouterResponse ReadEncyclopedia( + PmcData pmcData, + InventoryReadEncyclopediaRequestData request, + string sessionId + ) { foreach (var id in request.Ids) { @@ -458,8 +546,12 @@ public class InventoryController( /// Examine item request /// Session/Player id /// Client response - public void ExamineItem(PmcData pmcData, InventoryExamineRequestData request, string sessionId, - ItemEventRouterResponse output) + public void ExamineItem( + PmcData pmcData, + InventoryExamineRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { string? itemId = null; if (request.FromOwner is not null) @@ -470,12 +562,17 @@ public class InventoryController( } catch { - _logger.Error(_localisationService.GetText("inventory-examine_item_does_not_exist", request.Item)); + _logger.Error( + _localisationService.GetText( + "inventory-examine_item_does_not_exist", + request.Item + ) + ); } } if (itemId is null) - // item template + // item template { if (_databaseService.GetItems().ContainsKey(request.Item)) { @@ -514,14 +611,17 @@ public class InventoryController( } if (request.FromOwner.Id == Traders.FENCE) - // Get tpl from fence assorts + // Get tpl from fence assorts { - return _fenceService.GetRawFenceAssorts().Items.FirstOrDefault(x => x.Id == request.Item)?.Template; + return _fenceService + .GetRawFenceAssorts() + .Items.FirstOrDefault(x => x.Id == request.Item) + ?.Template; } if (request.FromOwner.Type == "Trader") - // Not fence - // get tpl from trader assort + // Not fence + // get tpl from trader assort { return _databaseService .GetTrader(request.FromOwner.Id) @@ -539,18 +639,23 @@ public class InventoryController( } // Try alternate way of getting offer if first approach fails - var offer = _ragfairOfferService.GetOfferByOfferId(request.Item) ?? - _ragfairOfferService.GetOfferByOfferId(request.FromOwner.Id); + var offer = + _ragfairOfferService.GetOfferByOfferId(request.Item) + ?? _ragfairOfferService.GetOfferByOfferId(request.FromOwner.Id); // Try find examine item inside offer items array - var matchingItem = offer.Items.FirstOrDefault(offerItem => offerItem.Id == request.Item); + var matchingItem = offer.Items.FirstOrDefault(offerItem => + offerItem.Id == request.Item + ); if (matchingItem is not null) { return matchingItem.Template; } // Unable to find item in database or ragfair - _logger.Warning(_localisationService.GetText("inventory-unable_to_find_item", request.Item)); + _logger.Warning( + _localisationService.GetText("inventory-unable_to_find_item", request.Item) + ); } // get hideout item @@ -565,7 +670,9 @@ public class InventoryController( // all mail the player has var mail = _profileHelper.GetFullProfile(sessionId).DialogueRecords; // per trader/person mail - var dialogue = mail.FirstOrDefault(x => x.Value.Messages.Any(m => m.Id == request.FromOwner.Id)); + var dialogue = mail.FirstOrDefault(x => + x.Value.Messages.Any(m => m.Id == request.FromOwner.Id) + ); // check each message from that trader/person for messages that match the ID we got var message = dialogue.Value.Messages.FirstOrDefault(m => m.Id == request.FromOwner.Id); // get the Id given and get the Template ID from that @@ -590,8 +697,12 @@ public class InventoryController( /// /// Session/Player id /// Client response - public void UnBindItem(PmcData pmcData, InventoryBindRequestData request, string sessionId, - ItemEventRouterResponse output) + public void UnBindItem( + PmcData pmcData, + InventoryBindRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { // Remove kvp from requested fast panel index @@ -607,8 +718,12 @@ public class InventoryController( /// /// Session/Player id /// Client response - public void BindItem(PmcData pmcData, InventoryBindRequestData bindRequest, string sessionId, - ItemEventRouterResponse output) + public void BindItem( + PmcData pmcData, + InventoryBindRequestData bindRequest, + string sessionId, + ItemEventRouterResponse output + ) { // Remove link if (pmcData.Inventory.FastPanel.ContainsKey(bindRequest.Index)) @@ -627,7 +742,11 @@ public class InventoryController( /// /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse TagItem(PmcData pmcData, InventoryTagRequestData request, string sessionId) + public ItemEventRouterResponse TagItem( + PmcData pmcData, + InventoryTagRequestData request, + string sessionId + ) { var itemToTag = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == request.Item); if (itemToTag is null) @@ -636,20 +755,13 @@ public class InventoryController( $"Unable to tag item: {request.Item} as it cannot be found in player {sessionId} inventory" ); - return new ItemEventRouterResponse - { - Warnings = [] - }; + return new ItemEventRouterResponse { Warnings = [] }; } // Null guard itemToTag.Upd ??= new Upd(); - itemToTag.Upd.Tag = new UpdTag - { - Color = request.TagColor, - Name = request.TagName - }; + itemToTag.Upd.Tag = new UpdTag { Color = request.TagColor, Name = request.TagName }; return _eventOutputHolder.GetOutput(sessionId); } @@ -661,7 +773,11 @@ public class InventoryController( /// Toggle request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse ToggleItem(PmcData pmcData, InventoryToggleRequestData request, string sessionId) + public ItemEventRouterResponse ToggleItem( + PmcData pmcData, + InventoryToggleRequestData request, + string sessionId + ) { // May need to reassign to scav profile var playerData = pmcData; @@ -677,23 +793,22 @@ public class InventoryController( { _itemHelper.AddUpdObjectToItem( itemToToggle, - _localisationService.GetText("inventory-item_to_toggle_missing_upd", itemToToggle.Id) + _localisationService.GetText( + "inventory-item_to_toggle_missing_upd", + itemToToggle.Id + ) ); - itemToToggle.Upd.Togglable = new UpdTogglable - { - On = request.Value - }; + itemToToggle.Upd.Togglable = new UpdTogglable { On = request.Value }; return _eventOutputHolder.GetOutput(sessionId); } - _logger.Warning(_localisationService.GetText("inventory-unable_to_toggle_item_not_found", request.Item)); + _logger.Warning( + _localisationService.GetText("inventory-unable_to_toggle_item_not_found", request.Item) + ); - return new ItemEventRouterResponse - { - Warnings = [] - }; + return new ItemEventRouterResponse { Warnings = [] }; } /// @@ -703,7 +818,11 @@ public class InventoryController( /// Fold item request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse FoldItem(PmcData pmcData, InventoryFoldRequestData request, string sessionId) + public ItemEventRouterResponse FoldItem( + PmcData pmcData, + InventoryFoldRequestData request, + string sessionId + ) { // May need to reassign to scav profile var playerData = pmcData; @@ -714,27 +833,26 @@ public class InventoryController( playerData = _profileHelper.GetScavProfile(sessionId); } - var itemToFold = playerData.Inventory.Items.FirstOrDefault(item => item?.Id == request.Item); + var itemToFold = playerData.Inventory.Items.FirstOrDefault(item => + item?.Id == request.Item + ); if (itemToFold is null) { // Item not found _logger.Warning( - _localisationService.GetText("inventory-unable_to_fold_item_not_found_in_inventory", request.Item) + _localisationService.GetText( + "inventory-unable_to_fold_item_not_found_in_inventory", + request.Item + ) ); - return new ItemEventRouterResponse - { - Warnings = [] - }; + return new ItemEventRouterResponse { Warnings = [] }; } // Item may not have upd object _itemHelper.AddUpdObjectToItem(itemToFold); - itemToFold.Upd.Foldable = new UpdFoldable - { - Folded = request.Value - }; + itemToFold.Upd.Foldable = new UpdFoldable { Folded = request.Value }; return _eventOutputHolder.GetOutput(sessionId); } @@ -748,7 +866,11 @@ public class InventoryController( /// Swap item request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse SwapItem(PmcData pmcData, InventorySwapRequestData request, string sessionId) + public ItemEventRouterResponse SwapItem( + PmcData pmcData, + InventorySwapRequestData request, + string sessionId + ) { // During post-raid scav transfer, the swap may be in the scav inventory var playerData = pmcData; @@ -763,11 +885,7 @@ public class InventoryController( _logger.Error( _localisationService.GetText( "inventory-unable_to_find_item_to_swap", - new - { - item1Id = request.Item, - item2Id = request.Item2 - } + new { item1Id = request.Item, item2Id = request.Item2 } ) ); } @@ -778,11 +896,7 @@ public class InventoryController( _logger.Error( _localisationService.GetText( "inventory-unable_to_find_item_to_swap", - new - { - item1Id = request.Item2, - item2Id = request.Item - } + new { item1Id = request.Item2, item2Id = request.Item } ) ); } @@ -827,11 +941,19 @@ public class InventoryController( /// Transfer item request /// Session/Player id /// Client response - public void TransferItem(PmcData pmcData, InventoryTransferRequestData request, string sessionId, - ItemEventRouterResponse output) + public void TransferItem( + PmcData pmcData, + InventoryTransferRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { // TODO - check GetOwnerInventoryItems() call still works - var inventoryItems = _inventoryHelper.GetOwnerInventoryItems(request, request.Item, sessionId); + var inventoryItems = _inventoryHelper.GetOwnerInventoryItems( + request, + request.Item, + sessionId + ); var sourceItem = inventoryItems.From.FirstOrDefault(item => item.Id == request.Item); var destinationItem = inventoryItems.To.FirstOrDefault(item => item.Id == request.With); @@ -855,27 +977,21 @@ public class InventoryController( return; } - sourceItem.Upd ??= new Upd - { - StackObjectsCount = 1 - }; + sourceItem.Upd ??= new Upd { StackObjectsCount = 1 }; var sourceStackCount = sourceItem.Upd.StackObjectsCount; if (sourceStackCount > request.Count) - // Source items stack count greater than new desired count + // Source items stack count greater than new desired count { sourceItem.Upd.StackObjectsCount = sourceStackCount - request.Count; } else - // Moving a full stack onto a smaller stack + // Moving a full stack onto a smaller stack { sourceItem.Upd.StackObjectsCount = sourceStackCount - 1; } - destinationItem.Upd ??= new Upd - { - StackObjectsCount = 1 - }; + destinationItem.Upd ??= new Upd { StackObjectsCount = 1 }; var destinationStackCount = destinationItem.Upd.StackObjectsCount; destinationItem.Upd.StackObjectsCount = destinationStackCount + request.Count; @@ -889,17 +1005,26 @@ public class InventoryController( /// Merge stacks request /// Session/Player id /// Client response - public void MergeItem(PmcData pmcData, InventoryMergeRequestData request, string sessionID, - ItemEventRouterResponse output) + public void MergeItem( + PmcData pmcData, + InventoryMergeRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { // Changes made to result apply to character inventory - var inventoryItems = _inventoryHelper.GetOwnerInventoryItems(request, request.Item, sessionID); + var inventoryItems = _inventoryHelper.GetOwnerInventoryItems( + request, + request.Item, + sessionID + ); // Get source item (can be from player or trader or mail) var sourceItem = inventoryItems.From.FirstOrDefault(x => x.Id == request.Item); if (sourceItem is null) { - var errorMessage = $"Unable to merge stacks as source item: {request.With} cannot be found"; + var errorMessage = + $"Unable to merge stacks as source item: {request.With} cannot be found"; _logger.Error(errorMessage); _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -911,7 +1036,8 @@ public class InventoryController( var destinationItem = inventoryItems.To.FirstOrDefault(x => x.Id == request.With); if (destinationItem is null) { - var errorMessage = $"Unable to merge stacks as destination item: {request.With} cannot be found"; + var errorMessage = + $"Unable to merge stacks as destination item: {request.With} cannot be found"; _logger.Error(errorMessage); _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -920,48 +1046,38 @@ public class InventoryController( } if (destinationItem.Upd?.StackObjectsCount is null) - // No stackcount on destination, add one + // No stackcount on destination, add one { - destinationItem.Upd = new Upd - { - StackObjectsCount = 1 - }; + destinationItem.Upd = new Upd { StackObjectsCount = 1 }; } if (sourceItem.Upd is null) { - sourceItem.Upd = new Upd - { - StackObjectsCount = 1 - }; + sourceItem.Upd = new Upd { StackObjectsCount = 1 }; } else if (sourceItem.Upd.StackObjectsCount is null) - // Items pulled out of raid can have no stack count if the stack should be 1 + // Items pulled out of raid can have no stack count if the stack should be 1 { sourceItem.Upd.StackObjectsCount = 1; } // Remove FiR status from destination stack when source stack has no FiR but destination does - if (!sourceItem.Upd.SpawnedInSession.GetValueOrDefault(false) && - destinationItem.Upd.SpawnedInSession.GetValueOrDefault(false)) + if ( + !sourceItem.Upd.SpawnedInSession.GetValueOrDefault(false) + && destinationItem.Upd.SpawnedInSession.GetValueOrDefault(false) + ) { destinationItem.Upd.SpawnedInSession = false; } - destinationItem.Upd.StackObjectsCount += - sourceItem.Upd.StackObjectsCount; // Add source stackcount to destination - output.ProfileChanges[sessionID] - .Items.DeletedItems.Add( - new Item - { - Id = sourceItem.Id - } - ); // Inform client source item being deleted + destinationItem.Upd.StackObjectsCount += sourceItem.Upd.StackObjectsCount; // Add source stackcount to destination + output.ProfileChanges[sessionID].Items.DeletedItems.Add(new Item { Id = sourceItem.Id }); // Inform client source item being deleted var indexOfItemToRemove = inventoryItems.From.FindIndex(x => x.Id == sourceItem.Id); if (indexOfItemToRemove == -1) { - var errorMessage = $"Unable to find item: {sourceItem.Id} to remove from sender inventory"; + var errorMessage = + $"Unable to find item: {sourceItem.Id} to remove from sender inventory"; _logger.Error(errorMessage); _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -979,11 +1095,19 @@ public class InventoryController( /// Split stack request /// Session/Player id /// Client response - public void SplitItem(PmcData pmcData, InventorySplitRequestData request, string sessionID, - ItemEventRouterResponse output) + public void SplitItem( + PmcData pmcData, + InventorySplitRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { // Changes made to result apply to character inventory - var inventoryItems = _inventoryHelper.GetOwnerInventoryItems(request, request.NewItem, sessionID); + var inventoryItems = _inventoryHelper.GetOwnerInventoryItems( + request, + request.NewItem, + sessionID + ); // Handle cartridge edge-case if (request.Container.Location is null && request.Container.ContainerName == "cartridges") @@ -996,7 +1120,8 @@ public class InventoryController( var itemToSplit = inventoryItems.From.FirstOrDefault(x => x.Id == request.SplitItem); if (itemToSplit is null) { - var errorMessage = $"Unable to split stack as source item: {request.SplitItem} cannot be found"; + var errorMessage = + $"Unable to split stack as source item: {request.SplitItem} cannot be found"; _logger.Error(errorMessage); _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -1012,13 +1137,14 @@ public class InventoryController( itemToSplit.Upd.StackObjectsCount -= request.Count; // Inform client of change - output.ProfileChanges[sessionID] + output + .ProfileChanges[sessionID] .Items.NewItems.Add( new Item { Id = request.NewItem, Template = itemToSplit.Template, - Upd = updatedUpd + Upd = updatedUpd, } ); @@ -1031,7 +1157,7 @@ public class InventoryController( ParentId = request.Container.Id, SlotId = request.Container.ContainerName, Location = request.Container.Location, - Upd = updatedUpd + Upd = updatedUpd, } ); } @@ -1044,8 +1170,12 @@ public class InventoryController( /// Discard item request /// Session/Player id /// Client response - public void DiscardItem(PmcData pmcData, InventoryRemoveRequestData request, string sessionId, - ItemEventRouterResponse output) + public void DiscardItem( + PmcData pmcData, + InventoryRemoveRequestData request, + string sessionId, + ItemEventRouterResponse output + ) { if (request.FromOwner?.Type == "Mail") { @@ -1054,9 +1184,10 @@ public class InventoryController( return; } - var profileToRemoveItemFrom = request.FromOwner is null || request.FromOwner?.Id == pmcData.Id - ? pmcData - : _profileHelper.GetFullProfile(sessionId).CharacterData.ScavData; + var profileToRemoveItemFrom = + request.FromOwner is null || request.FromOwner?.Id == pmcData.Id + ? pmcData + : _profileHelper.GetFullProfile(sessionId).CharacterData.ScavData; _inventoryHelper.RemoveItem(profileToRemoveItemFrom, request.Item, sessionId, output); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/LauncherController.cs b/Libraries/SPTarkov.Server.Core/Controllers/LauncherController.cs index 62a4a59d..9cf545df 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/LauncherController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/LauncherController.cs @@ -37,8 +37,11 @@ public class LauncherController( public ConnectResponse Connect() { // Get all possible profile types + filter out any that are blacklisted - var profileTemplates = _databaseService.GetProfileTemplates() - .Where(profile => !_coreConfig.Features.CreateNewProfileTypesBlacklist.Contains(profile.Key)) + var profileTemplates = _databaseService + .GetProfileTemplates() + .Where(profile => + !_coreConfig.Features.CreateNewProfileTypesBlacklist.Contains(profile.Key) + ) .ToDictionary(); return new ConnectResponse @@ -46,7 +49,7 @@ public class LauncherController( BackendUrl = _httpServerHelper.GetBackendUrl(), Name = _coreConfig.ServerName, Editions = profileTemplates.Select(x => x.Key).ToList(), - ProfileDescriptions = GetProfileDescriptions(profileTemplates) + ProfileDescriptions = GetProfileDescriptions(profileTemplates), }; } @@ -55,7 +58,9 @@ public class LauncherController( /// /// Profiles to get descriptions of /// Dictionary of profile types with related descriptive text - protected Dictionary GetProfileDescriptions(Dictionary profileTemplates) + protected Dictionary GetProfileDescriptions( + Dictionary profileTemplates + ) { var result = new Dictionary(); foreach (var (profileKey, profile) in profileTemplates) @@ -72,7 +77,11 @@ public class LauncherController( /// public Info? Find(string? sessionId) { - return sessionId is not null && _saveServer.GetProfiles().TryGetValue(sessionId, out var profile) ? profile.ProfileInfo : null; + return + sessionId is not null + && _saveServer.GetProfiles().TryGetValue(sessionId, out var profile) + ? profile.ProfileInfo + : null; } /// @@ -126,7 +135,7 @@ public class LauncherController( Username = info.Username, Password = info.Password, IsWiped = true, - Edition = info.Edition + Edition = info.Edition, }; _saveServer.CreateProfile(newProfileDetails); @@ -229,7 +238,10 @@ public class LauncherController( /// Dictionary of mod name and mod details public Dictionary GetLoadedServerMods() { - return _loadedMods.ToDictionary(sptMod => sptMod.ModMetadata?.Name ?? "UNKNOWN MOD", sptMod => sptMod.ModMetadata); + return _loadedMods.ToDictionary( + sptMod => sptMod.ModMetadata?.Name ?? "UNKNOWN MOD", + sptMod => sptMod.ModMetadata + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Controllers/LauncherV2Controller.cs b/Libraries/SPTarkov.Server.Core/Controllers/LauncherV2Controller.cs index 74e007cb..2e4353da 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/LauncherV2Controller.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/LauncherV2Controller.cs @@ -48,7 +48,10 @@ public class LauncherV2Controller( foreach (var profileKvP in dbProfiles) { - result.TryAdd(profileKvP.Key, _localisationService.GetText(profileKvP.Value.DescriptionLocaleKey)); + result.TryAdd( + profileKvP.Key, + _localisationService.GetText(profileKvP.Value.DescriptionLocaleKey) + ); } return result; @@ -174,7 +177,7 @@ public class LauncherV2Controller( Username = info.Username, Password = info.Password, IsWiped = true, - Edition = info.Edition + Edition = info.Edition, }; _saveServer.CreateProfile(newProfileDetails); @@ -204,7 +207,10 @@ public class LauncherV2Controller( { foreach (var profile in _saveServer.GetProfiles()) { - if (info.Username == profile.Value.ProfileInfo!.Username && info.Password == profile.Value.ProfileInfo.Password) + if ( + info.Username == profile.Value.ProfileInfo!.Username + && info.Password == profile.Value.ProfileInfo.Password + ) { return profile.Key; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/LocationController.cs b/Libraries/SPTarkov.Server.Core/Controllers/LocationController.cs index 382a9a9d..141ad860 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/LocationController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/LocationController.cs @@ -7,7 +7,6 @@ using SPTarkov.Server.Core.Services; using SPTarkov.Server.Core.Utils.Cloners; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Controllers; [Injectable] @@ -54,7 +53,7 @@ public class LocationController( return new LocationsGenerateAllResponse { Locations = locationResult, - Paths = locationsFromDb.Base!.Paths + Paths = locationsFromDb.Base!.Paths, }; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/MatchController.cs b/Libraries/SPTarkov.Server.Core/Controllers/MatchController.cs index f5c078c7..e649e0d6 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/MatchController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/MatchController.cs @@ -70,9 +70,9 @@ public class MatchController( RaidMode = "Online", Mode = "deathmatch", ShortId = null, - AdditionalInfo = null - } - ] + AdditionalInfo = null, + }, + ], }; return output; @@ -85,11 +85,7 @@ public class MatchController( /// MatchGroupStatusResponse public MatchGroupStatusResponse GetGroupStatus(MatchGroupStatusRequest request) { - return new MatchGroupStatusResponse - { - Players = [], - MaxPveCountExceeded = false - }; + return new MatchGroupStatusResponse { Players = [], MaxPveCountExceeded = false }; } /// @@ -138,7 +134,10 @@ public class MatchController( /// Session/Player id /// Start raid request /// StartLocalRaidResponseData - public StartLocalRaidResponseData StartLocalRaid(string sessionId, StartLocalRaidRequestData request) + public StartLocalRaidResponseData StartLocalRaid( + string sessionId, + StartLocalRaidRequestData request + ) { return _locationLifecycleService.StartLocalRaid(sessionId, request); } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/NoteController.cs b/Libraries/SPTarkov.Server.Core/Controllers/NoteController.cs index 5d0ab989..d87b1860 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/NoteController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/NoteController.cs @@ -7,9 +7,7 @@ using SPTarkov.Server.Core.Routers; namespace SPTarkov.Server.Core.Controllers; [Injectable] -public class NoteController( - EventOutputHolder _eventOutputHolder -) +public class NoteController(EventOutputHolder _eventOutputHolder) { /// /// @@ -20,13 +18,10 @@ public class NoteController( public ItemEventRouterResponse AddNote( PmcData pmcData, NoteActionRequest request, - string sessionId) + string sessionId + ) { - var newNote = new Note - { - Time = request.Note.Time, - Text = request.Note.Text - }; + var newNote = new Note { Time = request.Note.Time, Text = request.Note.Text }; pmcData.Notes.DataNotes.Add(newNote); return _eventOutputHolder.GetOutput(sessionId); @@ -41,7 +36,8 @@ public class NoteController( public ItemEventRouterResponse EditNote( PmcData pmcData, NoteActionRequest request, - string sessionId) + string sessionId + ) { var noteToEdit = pmcData.Notes.DataNotes[request.Index!.Value]; noteToEdit.Time = request.Note.Time; @@ -59,7 +55,8 @@ public class NoteController( public ItemEventRouterResponse DeleteNote( PmcData pmcData, NoteActionRequest request, - string sessionId) + string sessionId + ) { pmcData.Notes?.DataNotes?.RemoveAt(request.Index!.Value); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/NotifierController.cs b/Libraries/SPTarkov.Server.Core/Controllers/NotifierController.cs index cc58b632..f7def4e9 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/NotifierController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/NotifierController.cs @@ -63,7 +63,7 @@ public class NotifierController( ChannelId = sessionId, Url = "", NotifierServer = GetServer(sessionId), - WebSocket = _notifierHelper.GetWebSocketServer(sessionId) + WebSocket = _notifierHelper.GetWebSocketServer(sessionId), }; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/PresetController.cs b/Libraries/SPTarkov.Server.Core/Controllers/PresetController.cs index 9c3d17b3..eea39734 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/PresetController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/PresetController.cs @@ -33,10 +33,7 @@ public class PresetController( // Get root items tpl var tpl = preset.Items.FirstOrDefault()?.Template; - result.TryAdd(tpl, new PresetCacheDetails - { - PresetIds = [] - }); + result.TryAdd(tpl, new PresetCacheDetails { PresetIds = [] }); result.TryGetValue(tpl, out var details); details.PresetIds.Add(presetId); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/PrestigeController.cs b/Libraries/SPTarkov.Server.Core/Controllers/PrestigeController.cs index 57b06ae0..1a531aa6 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/PrestigeController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/PrestigeController.cs @@ -23,8 +23,7 @@ public class PrestigeController( /// /// Session/Player id /// Prestige - public Prestige GetPrestige( - string sessionId) + public Prestige GetPrestige(string sessionId) { return _databaseService.GetTemplates().Prestige; } @@ -59,9 +58,7 @@ public class PrestigeController( /// /// /// - public async Task ObtainPrestige( - string sessionId, - ObtainPrestigeRequestList request) + public async Task ObtainPrestige(string sessionId, ObtainPrestigeRequestList request) { var profile = _profileHelper.GetFullProfile(sessionId); if (profile is not null) @@ -69,7 +66,7 @@ public class PrestigeController( var pendingPrestige = new PendingPrestige { PrestigeLevel = profile.CharacterData.PmcData.Info.PrestigeLevel + 1, - Items = request + Items = request, }; profile.SptData.PendingPrestige = pendingPrestige; diff --git a/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs b/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs index e11277a3..e5cfa1aa 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs @@ -57,7 +57,9 @@ public class ProfileController( var profile = _saveServer.GetProfile(sessionId); if (profile?.CharacterData == null) { - throw new Exception($"Unable to find character data for id: {sessionId}. Profile may be corrupt"); + throw new Exception( + $"Unable to find character data for id: {sessionId}. Profile may be corrupt" + ); } var pmc = profile.CharacterData.PmcData; @@ -81,7 +83,7 @@ public class ProfileController( MaxLevel = maxLvl, Edition = profile.ProfileInfo?.Edition ?? "", ProfileId = profile.ProfileInfo?.ProfileId ?? "", - SptData = _profileHelper.GetDefaultSptDataObject() + SptData = _profileHelper.GetDefaultSptDataObject(), }; } @@ -93,12 +95,13 @@ public class ProfileController( Side = pmc.Info.Side, CurrentLevel = pmc.Info.Level, CurrentExperience = pmc.Info.Experience ?? 0, - PreviousExperience = currentLevel == 0 ? 0 : _profileHelper.GetExperience(currentLevel.Value), + PreviousExperience = + currentLevel == 0 ? 0 : _profileHelper.GetExperience(currentLevel.Value), NextLevel = xpToNextLevel, MaxLevel = maxLvl, Edition = profile.ProfileInfo?.Edition ?? "", ProfileId = profile.ProfileInfo?.ProfileId ?? "", - SptData = profile.SptData + SptData = profile.SptData, }; } @@ -118,7 +121,10 @@ public class ProfileController( /// Create profile request /// Player id /// Player id - public virtual async ValueTask CreateProfile(ProfileCreateRequestData request, string sessionId) + public virtual async ValueTask CreateProfile( + ProfileCreateRequestData request, + string sessionId + ) { return await _createProfileService.CreateProfile(sessionId, request); } @@ -140,7 +146,10 @@ public class ProfileController( /// Validate nickname request /// Session/Player id /// - public virtual NicknameValidationResult ValidateNickname(ValidateNicknameRequestData request, string sessionId) + public virtual NicknameValidationResult ValidateNickname( + ValidateNicknameRequestData request, + string sessionId + ) { if (request.Nickname?.Length < 3) { @@ -162,13 +171,13 @@ public class ProfileController( /// Change nickname request /// Player id /// - public virtual NicknameValidationResult ChangeNickname(ProfileChangeNicknameRequestData request, string sessionId) + public virtual NicknameValidationResult ChangeNickname( + ProfileChangeNicknameRequestData request, + string sessionId + ) { var output = ValidateNickname( - new ValidateNicknameRequestData - { - Nickname = request.Nickname - }, + new ValidateNicknameRequestData { Nickname = request.Nickname }, sessionId ); @@ -200,7 +209,10 @@ public class ProfileController( /// Search profiles request /// Player id /// Found profiles - public virtual List SearchProfiles(SearchProfilesRequestData request, string sessionID) + public virtual List SearchProfiles( + SearchProfilesRequestData request, + string sessionID + ) { var result = new List(); @@ -241,7 +253,7 @@ public class ProfileController( Status = "Free", Sid = "", Ip = "", - Port = 0 + Port = 0, }, new ProfileStatusData { @@ -250,9 +262,9 @@ public class ProfileController( Status = "Free", Sid = "", Ip = "", - Port = 0 - } - ] + Port = 0, + }, + ], }; return response; @@ -264,13 +276,21 @@ public class ProfileController( /// Session/Player id /// Get other profile request /// GetOtherProfileResponse - public virtual GetOtherProfileResponse GetOtherProfile(string sessionId, GetOtherProfileRequest request) + public virtual GetOtherProfileResponse GetOtherProfile( + string sessionId, + GetOtherProfileRequest request + ) { // Find the profile by the account ID, fall back to the current player if we can't find the account var profileToView = _profileHelper.GetFullProfileByAccountId(request.AccountId); - if (profileToView?.CharacterData?.PmcData is null || profileToView.CharacterData.ScavData is null) + if ( + profileToView?.CharacterData?.PmcData is null + || profileToView.CharacterData.ScavData is null + ) { - _logger.Warning($"Unable to get profile: {request.AccountId} to show, falling back to own profile"); + _logger.Warning( + $"Unable to get profile: {request.AccountId} to show, falling back to own profile" + ); profileToView = _profileHelper.GetFullProfile(sessionId); } @@ -283,12 +303,17 @@ public class ProfileController( hideoutKeys.Add(profileToViewPmc.Inventory.HideoutCustomizationStashId); // Find hideout items e.g. posters - var hideoutRootItems = profileToViewPmc.Inventory.Items.Where(x => hideoutKeys.Contains(x.Id)); + var hideoutRootItems = profileToViewPmc.Inventory.Items.Where(x => + hideoutKeys.Contains(x.Id) + ); var itemsToReturn = new List(); foreach (var rootItems in hideoutRootItems) { // Check each root items for children and add - var itemWithChildren = _itemHelper.FindAndReturnChildrenAsItems(profileToViewPmc.Inventory.Items, rootItems.Id); + var itemWithChildren = _itemHelper.FindAndReturnChildrenAsItems( + profileToViewPmc.Inventory.Items, + rootItems.Id + ); itemsToReturn.AddRange(itemWithChildren); } @@ -301,10 +326,12 @@ public class ProfileController( Nickname = profileToViewPmc.Info.Nickname, Side = profileToViewPmc.Info.Side, Experience = profileToViewPmc.Info.Experience, - MemberCategory = (int)(profileToViewPmc.Info.MemberCategory ?? MemberCategory.Default), + MemberCategory = (int)( + profileToViewPmc.Info.MemberCategory ?? MemberCategory.Default + ), BannedState = profileToViewPmc.Info.BannedState, BannedUntil = profileToViewPmc.Info.BannedUntil, - RegistrationDate = profileToViewPmc.Info.RegistrationDate + RegistrationDate = profileToViewPmc.Info.RegistrationDate, }, Customization = new OtherProfileCustomization { @@ -312,13 +339,13 @@ public class ProfileController( Body = profileToViewPmc.Customization.Body, Feet = profileToViewPmc.Customization.Feet, Hands = profileToViewPmc.Customization.Hands, - Dogtag = profileToViewPmc.Customization.DogTag + Dogtag = profileToViewPmc.Customization.DogTag, }, Skills = profileToViewPmc.Skills, Equipment = new OtherProfileEquipment { Id = profileToViewPmc.Inventory.Equipment, - Items = profileToViewPmc.Inventory.Items + Items = profileToViewPmc.Inventory.Items, }, Achievements = profileToViewPmc.Achievements, FavoriteItems = _profileHelper.GetOtherProfileFavorites(profileToViewPmc), @@ -327,21 +354,21 @@ public class ProfileController( Eft = new OtherProfileSubStats { TotalInGameTime = profileToViewPmc.Stats.Eft.TotalInGameTime, - OverAllCounters = profileToViewPmc.Stats.Eft.OverallCounters - } + OverAllCounters = profileToViewPmc.Stats.Eft.OverallCounters, + }, }, ScavStats = new OtherProfileStats { Eft = new OtherProfileSubStats { TotalInGameTime = profileToViewScav.Stats.Eft.TotalInGameTime, - OverAllCounters = profileToViewScav.Stats.Eft.OverallCounters - } + OverAllCounters = profileToViewScav.Stats.Eft.OverallCounters, + }, }, Hideout = profileToViewPmc.Hideout, CustomizationStash = profileToViewPmc.Inventory.HideoutCustomizationStashId, HideoutAreaStashes = profileToViewPmc.Inventory.HideoutAreaStashes, - Items = itemsToReturn + Items = itemsToReturn, }; return profile; diff --git a/Libraries/SPTarkov.Server.Core/Controllers/QuestController.cs b/Libraries/SPTarkov.Server.Core/Controllers/QuestController.cs index 1c271e4a..a202f48f 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/QuestController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/QuestController.cs @@ -14,7 +14,6 @@ using SPTarkov.Server.Core.Utils; using SPTarkov.Server.Core.Utils.Cloners; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Controllers; [Injectable] @@ -63,13 +62,19 @@ public class QuestController( /// Quest accepted /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse AcceptQuest(PmcData pmcData, AcceptQuestRequestData acceptedQuest, string sessionID) + public ItemEventRouterResponse AcceptQuest( + PmcData pmcData, + AcceptQuestRequestData acceptedQuest, + string sessionID + ) { var acceptQuestResponse = _eventOutputHolder.GetOutput(sessionID); // Does quest exist in profile // Restarting a failed quest can mean quest exists in profile - var existingQuestStatus = pmcData.Quests.FirstOrDefault(x => x.QId == acceptedQuest.QuestId); + var existingQuestStatus = pmcData.Quests.FirstOrDefault(x => + x.QId == acceptedQuest.QuestId + ); if (existingQuestStatus is not null) { // Update existing @@ -81,7 +86,11 @@ public class QuestController( else { // Add new quest to server profile - var newQuest = _questHelper.GetQuestReadyForProfile(pmcData, QuestStatusEnum.Started, acceptedQuest); + var newQuest = _questHelper.GetQuestReadyForProfile( + pmcData, + QuestStatusEnum.Started, + acceptedQuest + ); pmcData.Quests.Add(newQuest); } @@ -94,10 +103,10 @@ public class QuestController( AddTaskConditionCountersToProfile( questFromDb.Conditions.AvailableForFinish, pmcData, - acceptedQuest.QuestId); + acceptedQuest.QuestId + ); } - // Get messageId of text to send to player as text message in game var messageId = _questHelper.GetMessageIdForQuestStart( questFromDb.StartedMessageText, @@ -120,7 +129,9 @@ public class QuestController( MessageType.QuestStart, messageId, startedQuestRewardItems.ToList(), - _timeUtil.GetHoursAsSeconds((int) _questHelper.GetMailItemRedeemTimeHoursForProfile(pmcData)) + _timeUtil.GetHoursAsSeconds( + (int)_questHelper.GetMailItemRedeemTimeHoursForProfile(pmcData) + ) ); // Having accepted new quest, look for newly unlocked quests and inform client of them @@ -142,7 +153,11 @@ public class QuestController( /// Conditions to iterate over and possibly add to profile /// Players PMC profile /// Quest where conditions originated - protected void AddTaskConditionCountersToProfile(List questConditions, PmcData pmcData, string questId) + protected void AddTaskConditionCountersToProfile( + List questConditions, + PmcData pmcData, + string questId + ) { foreach (var condition in questConditions) { @@ -161,7 +176,7 @@ public class QuestController( Id = condition.Id, SourceId = questId, Type = condition.ConditionType, - Value = 0 + Value = 0, }; break; } @@ -178,7 +193,11 @@ public class QuestController( /// Complete quest request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse CompleteQuest(PmcData pmcData, CompleteQuestRequestData request, string sessionId) + public ItemEventRouterResponse CompleteQuest( + PmcData pmcData, + CompleteQuestRequestData request, + string sessionId + ) { return _questHelper.CompleteQuest(pmcData, request, sessionId); } @@ -191,7 +210,11 @@ public class QuestController( /// Handover request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse HandoverQuest(PmcData pmcData, HandoverQuestRequestData request, string sessionID) + public ItemEventRouterResponse HandoverQuest( + PmcData pmcData, + HandoverQuestRequestData request, + string sessionID + ) { var quest = _questHelper.GetQuestFromDb(request.QuestId, pmcData); List handoverQuestTypes = ["HandoverItem", "WeaponAssembly"]; @@ -202,7 +225,11 @@ public class QuestController( // Decrement number of items handed in QuestCondition? handoverRequirements = null; - foreach (var condition in quest.Conditions.AvailableForFinish.Where(condition => condition.Id == request.ConditionId)) + foreach ( + var condition in quest.Conditions.AvailableForFinish.Where(condition => + condition.Id == request.ConditionId + ) + ) { // Not a handover quest type, skip if (!handoverQuestTypes.Contains(condition.ConditionType)) @@ -216,7 +243,7 @@ public class QuestController( if (pmcData.TaskConditionCounters.TryGetValue("ConditionId", out var counter)) { - handedInCount -= (int) (counter.Value ?? 0); + handedInCount -= (int)(counter.Value ?? 0); if (handedInCount <= 0) { @@ -228,7 +255,7 @@ public class QuestController( questId = request.QuestId, conditionId = request.ConditionId, profileCounter = counter.Value, - value = handedInCount + value = handedInCount, } ) ); @@ -242,15 +269,26 @@ public class QuestController( if (isItemHandoverQuest && handedInCount == 0) { - return ShowRepeatableQuestInvalidConditionError(request.QuestId, request.ConditionId, output); + return ShowRepeatableQuestInvalidConditionError( + request.QuestId, + request.ConditionId, + output + ); } var totalItemCountToRemove = 0d; foreach (var itemHandover in request.Items) { - var matchingItemInProfile = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == itemHandover.Id); - if (!(matchingItemInProfile is not null && handoverRequirements.Target.List.Contains(matchingItemInProfile.Template))) - // Item handed in by player doesn't match what was requested + var matchingItemInProfile = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == itemHandover.Id + ); + if ( + !( + matchingItemInProfile is not null + && handoverRequirements.Target.List.Contains(matchingItemInProfile.Template) + ) + ) + // Item handed in by player doesn't match what was requested { return ShowQuestItemHandoverMatchError( request, @@ -261,7 +299,10 @@ public class QuestController( } // Remove the right quantity of given items - var itemCountToRemove = Math.Min(itemHandover.Count ?? 0, handedInCount - totalItemCountToRemove); + var itemCountToRemove = Math.Min( + itemHandover.Count ?? 0, + handedInCount - totalItemCountToRemove + ); totalItemCountToRemove += itemCountToRemove; if (itemHandover.Count - itemCountToRemove > 0) { @@ -269,7 +310,7 @@ public class QuestController( _questHelper.ChangeItemStack( pmcData, itemHandover.Id, - (int) (itemHandover.Count - itemCountToRemove), + (int)(itemHandover.Count - itemCountToRemove), sessionID, output ); @@ -283,17 +324,16 @@ public class QuestController( else { // Remove item with children - var toRemove = _itemHelper.FindAndReturnChildrenByItems(pmcData.Inventory.Items, itemHandover.Id); + var toRemove = _itemHelper.FindAndReturnChildrenByItems( + pmcData.Inventory.Items, + itemHandover.Id + ); var index = pmcData.Inventory.Items.Count; // Important: don't tell the client to remove the attachments, it will handle it - output.ProfileChanges[sessionID] - .Items.DeletedItems.Add( - new Item - { - Id = itemHandover.Id - } - ); + output + .ProfileChanges[sessionID] + .Items.DeletedItems.Add(new Item { Id = itemHandover.Id }); // Important: loop backward when removing items from the array we're looping on while (index-- > 0) @@ -315,7 +355,7 @@ public class QuestController( childItems.RemoveAt(0); // Remove the parent // Sort by the current `location` and update - childItems.Sort((a, b) => (int) a.Location > (int) b.Location ? 1 : -1); + childItems.Sort((a, b) => (int)a.Location > (int)b.Location ? 1 : -1); for (var i = 0; i < childItems.Count; i++) { @@ -344,15 +384,15 @@ public class QuestController( /// Relevant condition id that failed /// Client response /// ItemEventRouterResponse - protected ItemEventRouterResponse ShowRepeatableQuestInvalidConditionError(string questId, string conditionId, ItemEventRouterResponse output) + protected ItemEventRouterResponse ShowRepeatableQuestInvalidConditionError( + string questId, + string conditionId, + ItemEventRouterResponse output + ) { var errorMessage = _localisationService.GetText( "repeatable-quest_handover_failed_condition_invalid", - new - { - questId, - conditionId - } + new { questId, conditionId } ); _logger.Error(errorMessage); @@ -367,8 +407,12 @@ public class QuestController( /// Quest handover requirements /// Response to send to user /// ItemEventRouterResponse - protected ItemEventRouterResponse ShowQuestItemHandoverMatchError(HandoverQuestRequestData handoverQuestRequest, Item? itemHandedOver, - QuestCondition? handoverRequirements, ItemEventRouterResponse output) + protected ItemEventRouterResponse ShowQuestItemHandoverMatchError( + HandoverQuestRequestData handoverQuestRequest, + Item? itemHandedOver, + QuestCondition? handoverRequirements, + ItemEventRouterResponse output + ) { var errorMessage = _localisationService.GetText( "quest-handover_wrong_item", @@ -376,7 +420,7 @@ public class QuestController( { questId = handoverQuestRequest.QuestId, handedInTpl = itemHandedOver?.Template ?? "UNKNOWN", - requiredTpl = handoverRequirements.Target.List.FirstOrDefault() + requiredTpl = handoverRequirements.Target.List.FirstOrDefault(), } ); _logger.Error(errorMessage); @@ -392,7 +436,12 @@ public class QuestController( /// Backend counter id to update /// Quest id counter is associated with /// Value to increment the backend counter with - protected void UpdateProfileTaskConditionCounterValue(PmcData pmcData, string conditionId, string questId, double counterValue) + protected void UpdateProfileTaskConditionCounterValue( + PmcData pmcData, + string conditionId, + string questId, + double counterValue + ) { if (pmcData.TaskConditionCounters.GetValueOrDefault(conditionId) != null) { @@ -401,13 +450,16 @@ public class QuestController( return; } - pmcData.TaskConditionCounters.Add(conditionId, new TaskConditionCounter - { - Id = conditionId, - SourceId = questId, - Type = "HandoverItem", - Value = counterValue - }); + pmcData.TaskConditionCounters.Add( + conditionId, + new TaskConditionCounter + { + Id = conditionId, + SourceId = questId, + Type = "HandoverItem", + Value = counterValue, + } + ); } /// @@ -418,7 +470,12 @@ public class QuestController( /// Session/Player id /// /// ItemEventRouterResponse - public ItemEventRouterResponse FailQuest(PmcData pmcData, FailQuestRequestData request, string sessionID, ItemEventRouterResponse output) + public ItemEventRouterResponse FailQuest( + PmcData pmcData, + FailQuestRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { _questHelper.FailQuest(pmcData, request, sessionID, output); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs index 8bfed10d..bb77e008 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs @@ -114,8 +114,9 @@ public class RagfairController // Check profile is capable of creating offers var pmcProfile = profile.CharacterData.PmcData; if ( - pmcProfile.RagfairInfo is not null && - pmcProfile.Info.Level >= _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel + pmcProfile.RagfairInfo is not null + && pmcProfile.Info.Level + >= _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel ) { _ragfairOfferHelper.ProcessOffersOnProfile(sessionId); @@ -139,19 +140,28 @@ public class RagfairController { Offers = [], OffersCount = searchRequest.Limit, - SelectedCategory = searchRequest.HandbookId + SelectedCategory = searchRequest.HandbookId, }; // Get all offers ready for sorting/filtering below - result.Offers = GetOffersForSearchType(searchRequest, itemsToAdd, traderAssorts, profile.CharacterData.PmcData); + result.Offers = GetOffersForSearchType( + searchRequest, + itemsToAdd, + traderAssorts, + profile.CharacterData.PmcData + ); // Client requested a category refresh if (searchRequest.UpdateOfferCount.GetValueOrDefault(false)) { - result.Categories = GetSpecificCategories(profile.CharacterData.PmcData, searchRequest, result.Offers); + result.Categories = GetSpecificCategories( + profile.CharacterData.PmcData, + searchRequest, + result.Offers + ); } - // Adjust index value of offers found to start at 0 + // Adjust index value of offers found to start at 0 AddIndexValueToOffers(result.Offers); // Sort offers @@ -171,7 +181,11 @@ public class RagfairController } // Update trader offers' values, Lock quest-linked offers + adjust offer buy limits - foreach (var traderOffer in result.Offers.Where(offer => _ragfairOfferHelper.OfferIsFromTrader(offer))) + foreach ( + var traderOffer in result.Offers.Where(offer => + _ragfairOfferHelper.OfferIsFromTrader(offer) + ) + ) { // For the items, check the barter schemes. The method getDisplayableAssorts sets a flag sptQuestLocked // to true if the quest is not completed yet @@ -239,11 +253,7 @@ public class RagfairController _logger.Warning( _localisationService.GetText( "ragfair-unable_to_adjust_stack_count_assort_not_found", - new - { - offerId = offer.Items.First().Id, - traderId = offer.User.Id - } + new { offerId = offer.Items.First().Id, traderId = offer.User.Id } ) ); @@ -288,7 +298,7 @@ public class RagfairController // Get specific assort purchase data and set current purchase buy value traderPurchases.TryGetValue(assortId, out var assortTraderPurchaseData); - offer.BuyRestrictionCurrent = (int?) assortTraderPurchaseData?.PurchaseCount ?? 0; + offer.BuyRestrictionCurrent = (int?)assortTraderPurchaseData?.PurchaseCount ?? 0; offer.BuyRestrictionMax = offerRootItem.Upd.BuyRestrictionMax; } @@ -313,12 +323,16 @@ public class RagfairController /// Client search request data /// Ragfair offers to get categories for /// Record with templates + counts - protected Dictionary GetSpecificCategories(PmcData pmcProfile, SearchRequestData searchRequest, - List offers) + protected Dictionary GetSpecificCategories( + PmcData pmcProfile, + SearchRequestData searchRequest, + List offers + ) { // Linked/required search categories var playerHasFleaUnlocked = - pmcProfile.Info.Level >= _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel; + pmcProfile.Info.Level + >= _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel; List offerPool = []; if (IsLinkedSearch(searchRequest) || IsRequiredSearch(searchRequest)) { @@ -340,7 +354,11 @@ public class RagfairController return new Dictionary(); } - return _ragfairServer.GetAllActiveCategories(playerHasFleaUnlocked, searchRequest, offerPool); + return _ragfairServer.GetAllActiveCategories( + playerHasFleaUnlocked, + searchRequest, + offerPool + ); } /// @@ -371,14 +389,22 @@ public class RagfairController /// Trader assorts /// /// Array of offers - protected List GetOffersForSearchType(SearchRequestData searchRequest, List itemsToAdd, + protected List GetOffersForSearchType( + SearchRequestData searchRequest, + List itemsToAdd, Dictionary traderAssorts, - PmcData pmcProfile) + PmcData pmcProfile + ) { // Searching for items in preset menu if (searchRequest.BuildCount > 0) { - return _ragfairOfferHelper.GetOffersForBuild(searchRequest, itemsToAdd, traderAssorts, pmcProfile); + return _ragfairOfferHelper.GetOffersForBuild( + searchRequest, + itemsToAdd, + traderAssorts, + pmcProfile + ); } if (searchRequest.NeededSearchId?.Length > 0) @@ -387,7 +413,12 @@ public class RagfairController } // Searching for general items - return _ragfairOfferHelper.GetValidOffers(searchRequest, itemsToAdd, traderAssorts, pmcProfile); + return _ragfairOfferHelper.GetValidOffers( + searchRequest, + itemsToAdd, + traderAssorts, + pmcProfile + ); } /// @@ -396,8 +427,10 @@ public class RagfairController /// Client request object /// OPTIONAL - Should trader offers be ignored in the calculation /// min/avg/max values for an item based on flea offers available - public GetItemPriceResult GetItemMinAvgMaxFleaPriceValues(GetMarketPriceRequestData getPriceRequest, - bool ignoreTraderOffers = true) + public GetItemPriceResult GetItemMinAvgMaxFleaPriceValues( + GetMarketPriceRequestData getPriceRequest, + bool ignoreTraderOffers = true + ) { // Get all items of tpl var offers = _ragfairOfferService.GetOffersOfType(getPriceRequest.TemplateId); @@ -415,7 +448,7 @@ public class RagfairController { Avg = Math.Round(average), Min = minMax.Min, - Max = minMax.Max + Max = minMax.Max, }; } @@ -431,11 +464,15 @@ public class RagfairController { Avg = tplPrice, Min = tplPrice, - Max = tplPrice + Max = tplPrice, }; } - protected double GetAveragePriceFromOffers(List offers, MinMax minMax, bool ignoreTraderOffers) + protected double GetAveragePriceFromOffers( + List offers, + MinMax minMax, + bool ignoreTraderOffers + ) { var sum = 0d; var totalOfferCount = 0; @@ -488,14 +525,21 @@ public class RagfairController /// Flea list creation offer /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse AddPlayerOffer(PmcData pmcData, AddOfferRequestData offerRequest, string sessionID) + public ItemEventRouterResponse AddPlayerOffer( + PmcData pmcData, + AddOfferRequestData offerRequest, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); var fullProfile = _profileHelper.GetFullProfile(sessionID); if (!IsValidPlayerOfferRequest(offerRequest)) { - return _httpResponseUtil.AppendErrorToOutput(output, "Unable to add offer, check server for error"); + return _httpResponseUtil.AppendErrorToOutput( + output, + "Unable to add offer, check server for error" + ); } var typeOfOffer = GetOfferType(offerRequest); @@ -540,7 +584,9 @@ public class RagfairController if (offerRequest.Requirements is null) { - _logger.Error(_localisationService.GetText("ragfair-unable_to_place_offer_with_no_requirements")); + _logger.Error( + _localisationService.GetText("ragfair-unable_to_place_offer_with_no_requirements") + ); return false; } @@ -588,8 +634,12 @@ public class RagfairController /// Full profile of player /// output Response to send to client /// ItemEventRouterResponse - protected ItemEventRouterResponse CreateMultiOffer(string sessionID, AddOfferRequestData offerRequest, - SptProfile fullProfile, ItemEventRouterResponse output) + protected ItemEventRouterResponse CreateMultiOffer( + string sessionID, + AddOfferRequestData offerRequest, + SptProfile fullProfile, + ItemEventRouterResponse output + ) { var pmcData = fullProfile.CharacterData.PmcData; // var itemsToListCount = offerRequest.Items.Count; // Wasn't used to commented out for now // Does not count stack size, only items @@ -625,17 +675,18 @@ public class RagfairController var rootOfferItem = offer.Items.First(x => x.Id == firstOfferItemId); // Average offer price for single item (or whole weapon) - var averages = - GetItemMinAvgMaxFleaPriceValues( - new GetMarketPriceRequestData - { - TemplateId = offer.Items[0].Template - } - ); + var averages = GetItemMinAvgMaxFleaPriceValues( + new GetMarketPriceRequestData { TemplateId = offer.Items[0].Template } + ); // Check for and apply item price modifer if it exists in config var averageOfferPrice = averages.Avg; - if (_ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue(rootOfferItem.Template, out var itemPriceModifer)) + if ( + _ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue( + rootOfferItem.Template, + out var itemPriceModifer + ) + ) { averageOfferPrice *= itemPriceModifer; } @@ -657,7 +708,7 @@ public class RagfairController ); // Create array of sell times for items listed - offer.SellResults = _ragfairSellHelper.RollForSale(sellChancePercent, (int) stackCountTotal); + offer.SellResults = _ragfairSellHelper.RollForSale(sellChancePercent, (int)stackCountTotal); // Subtract flea market fee from stash if (_ragfairConfig.Sell.Fees) @@ -667,7 +718,7 @@ public class RagfairController rootOfferItem, pmcData, playerListedPriceInRub, - (int) stackCountTotal, + (int)stackCountTotal, offerRequest, output ); @@ -700,8 +751,12 @@ public class RagfairController /// Full profile of player /// Response to send to client /// ItemEventRouterResponse - protected ItemEventRouterResponse CreatePackOffer(string sessionID, AddOfferRequestData offerRequest, - SptProfile fullProfile, ItemEventRouterResponse output) + protected ItemEventRouterResponse CreatePackOffer( + string sessionID, + AddOfferRequestData offerRequest, + SptProfile fullProfile, + ItemEventRouterResponse output + ) { var pmcData = fullProfile.CharacterData.PmcData; // var itemsToListCount = offerRequest.Items.Count; // TODO: Wasn't used so commented out for now // Does not count stack size, only items @@ -730,22 +785,29 @@ public class RagfairController firstListingRootItem.Upd.StackObjectsCount = stackCountTotal; // Create flea object - var offer = CreatePlayerOffer(sessionID, offerRequest.Requirements, firstListingAndChildren, true); + var offer = CreatePlayerOffer( + sessionID, + offerRequest.Requirements, + firstListingAndChildren, + true + ); // This is the item that will be listed on flea, has merged stackObjectCount var newRootOfferItem = offer.Items[0]; // TODO: add logic like single/multi offers to find root item // Single price for an item var averages = GetItemMinAvgMaxFleaPriceValues( - new GetMarketPriceRequestData - { - TemplateId = firstListingRootItem.Template - } + new GetMarketPriceRequestData { TemplateId = firstListingRootItem.Template } ); var singleItemPrice = averages.Avg; // Check for and apply item price modifer if it exists in config - if (_ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue(newRootOfferItem.Template, out var itemPriceModifer)) + if ( + _ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue( + newRootOfferItem.Template, + out var itemPriceModifer + ) + ) { singleItemPrice *= itemPriceModifer; } @@ -767,7 +829,11 @@ public class RagfairController ); // Create array of sell times for items listed + sell all at once as it's a pack - offer.SellResults = _ragfairSellHelper.RollForSale(sellChancePercent, (int) stackCountTotal, true); + offer.SellResults = _ragfairSellHelper.RollForSale( + sellChancePercent, + (int)stackCountTotal, + true + ); // Subtract flea market fee from stash if (_ragfairConfig.Sell.Fees) @@ -777,7 +843,7 @@ public class RagfairController newRootOfferItem, pmcData, playerListedPriceInRub, - (int) stackCountTotal, + (int)stackCountTotal, offerRequest, output ); @@ -809,22 +875,30 @@ public class RagfairController /// Full profile of player /// Response to send to client /// ItemEventRouterResponse - protected ItemEventRouterResponse CreateSingleOffer(string sessionID, AddOfferRequestData offerRequest, + protected ItemEventRouterResponse CreateSingleOffer( + string sessionID, + AddOfferRequestData offerRequest, SptProfile fullProfile, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { var pmcData = fullProfile.CharacterData.PmcData; // var itemsToListCount = offerRequest.Items.Count; // Wasn't used so commented out for now // Does not count stack size, only items // Find items to be listed on flea from player inventory var inventoryItemsToSell = GetItemsToListOnFleaFromInventory(pmcData, offerRequest.Items); - if (inventoryItemsToSell.Items is null || !string.IsNullOrEmpty(inventoryItemsToSell.ErrorMessage)) + if ( + inventoryItemsToSell.Items is null + || !string.IsNullOrEmpty(inventoryItemsToSell.ErrorMessage) + ) { _httpResponseUtil.AppendErrorToOutput(output, inventoryItemsToSell.ErrorMessage); } // Total count of items summed using their stack counts - var stackCountTotal = _ragfairOfferHelper.GetTotalStackCountSize(inventoryItemsToSell.Items); + var stackCountTotal = _ragfairOfferHelper.GetTotalStackCountSize( + inventoryItemsToSell.Items + ); // Checks are done, create offer var playerListedPriceInRub = CalculateRequirementsPriceInRub(offerRequest.Requirements); @@ -841,17 +915,18 @@ public class RagfairController var qualityMultiplier = _itemHelper.GetItemQualityModifierForItems(offer.Items, true); // Average offer price for single item (or whole weapon) - var averages = - GetItemMinAvgMaxFleaPriceValues( - new GetMarketPriceRequestData - { - TemplateId = offerRootItem.Template - } - ); + var averages = GetItemMinAvgMaxFleaPriceValues( + new GetMarketPriceRequestData { TemplateId = offerRootItem.Template } + ); var averageOfferPriceSingleItem = averages.Avg; // Check for and apply item price modifer if it exists in config - if (_ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue(offerRootItem.Template, out var itemPriceModifer)) + if ( + _ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue( + offerRootItem.Template, + out var itemPriceModifer + ) + ) { averageOfferPriceSingleItem *= itemPriceModifer; } @@ -865,7 +940,7 @@ public class RagfairController playerListedPriceInRub, qualityMultiplier ); - offer.SellResults = _ragfairSellHelper.RollForSale(sellChancePercent, (int) stackCountTotal); + offer.SellResults = _ragfairSellHelper.RollForSale(sellChancePercent, (int)stackCountTotal); // Subtract flea market fee from stash if (_ragfairConfig.Sell.Fees) @@ -875,7 +950,7 @@ public class RagfairController offerRootItem, pmcData, playerListedPriceInRub, - (int) stackCountTotal, + (int)stackCountTotal, offerRequest, output ); @@ -916,10 +991,13 @@ public class RagfairController double requirementsPriceInRub, int itemStackCount, AddOfferRequestData offerRequest, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { // Get tax from cache hydrated earlier by client, if that's missing fall back to server calculation (inaccurate) - var storedClientTaxValue = _ragfairTaxService.GetStoredClientOfferTaxValueById(offerRequest.Items[0]); + var storedClientTaxValue = _ragfairTaxService.GetStoredClientOfferTaxValueById( + offerRequest.Items[0] + ); var tax = storedClientTaxValue is not null ? storedClientTaxValue.Fee : _ragfairTaxService.CalculateTax( @@ -932,7 +1010,9 @@ public class RagfairController if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Offer tax to charge: {tax}, pulled from client: {storedClientTaxValue.Count is not null}"); + _logger.Debug( + $"Offer tax to charge: {tax}, pulled from client: {storedClientTaxValue.Count is not null}" + ); } // cleanup of cache now we've used the tax value from it @@ -960,32 +1040,34 @@ public class RagfairController /// Item(s) to list on flea (with children) /// Is this a pack offer /// RagfairOffer - protected RagfairOffer CreatePlayerOffer(string sessionId, List requirements, List items, - bool sellInOnePiece) + protected RagfairOffer CreatePlayerOffer( + string sessionId, + List requirements, + List items, + bool sellInOnePiece + ) { const int loyalLevel = 1; var formattedItems = items.Select(item => - { - var isChild = items.Any(subItem => subItem.Id == item.ParentId); + { + var isChild = items.Any(subItem => subItem.Id == item.ParentId); - return new Item - { - Id = item.Id, - Template = item.Template, - ParentId = isChild ? item.ParentId : "hideout", - SlotId = isChild ? item.SlotId : "hideout", - Upd = item.Upd - }; - } - ); + return new Item + { + Id = item.Id, + Template = item.Template, + ParentId = isChild ? item.ParentId : "hideout", + SlotId = isChild ? item.SlotId : "hideout", + Upd = item.Upd, + }; + }); var formattedRequirements = requirements.Select(item => new BarterScheme - { - Template = item.Template, - Count = item.Count, - OnlyFunctional = item.OnlyFunctional - } - ); + { + Template = item.Template, + Count = item.Count, + OnlyFunctional = item.OnlyFunctional, + }); return _ragfairOfferGenerator.CreateAndAddFleaOffer( sessionId, @@ -993,7 +1075,7 @@ public class RagfairController formattedItems.ToList(), formattedRequirements.ToList(), loyalLevel, - (int?) items.FirstOrDefault()?.Upd?.StackObjectsCount ?? 1, + (int?)items.FirstOrDefault()?.Upd?.StackObjectsCount ?? 1, sellInOnePiece ); } @@ -1006,17 +1088,21 @@ public class RagfairController protected double CalculateRequirementsPriceInRub(List requirements) { return requirements.Sum(requirement => + { + if ( + string.IsNullOrEmpty(requirement.Template) + || !requirement.Count.HasValue + || requirement.Count == 0 + ) { - if (string.IsNullOrEmpty(requirement.Template) || !requirement.Count.HasValue || requirement.Count == 0) - { - return 0; - } - - return _paymentHelper.IsMoneyTpl(requirement.Template) - ? _handbookHelper.InRUB(requirement.Count.Value, requirement.Template) - : _itemHelper.GetDynamicItemPrice(requirement.Template).Value * requirement.Count.Value; + return 0; } - ); + + return _paymentHelper.IsMoneyTpl(requirement.Template) + ? _handbookHelper.InRUB(requirement.Count.Value, requirement.Template) + : _itemHelper.GetDynamicItemPrice(requirement.Template).Value + * requirement.Count.Value; + }); } /// @@ -1025,8 +1111,10 @@ public class RagfairController /// Players PMC profile /// Request /// GetItemsToListOnFleaFromInventoryResult - protected GetItemsToListOnFleaFromInventoryResult GetItemsToListOnFleaFromInventory(PmcData pmcData, - List itemIdsFromFleaOfferRequest) + protected GetItemsToListOnFleaFromInventoryResult GetItemsToListOnFleaFromInventory( + PmcData pmcData, + List itemIdsFromFleaOfferRequest + ) { List> itemsToReturn = []; var errorMessage = string.Empty; @@ -1039,40 +1127,38 @@ public class RagfairController { errorMessage = _localisationService.GetText( "ragfair-unable_to_find_item_in_inventory", - new - { - id = itemId - } + new { id = itemId } ); _logger.Error(errorMessage); return new GetItemsToListOnFleaFromInventoryResult { Items = itemsToReturn, - ErrorMessage = errorMessage + ErrorMessage = errorMessage, }; } _itemHelper.FixItemStackCount(rootItem); - itemsToReturn.Add(_itemHelper.FindAndReturnChildrenAsItems(pmcData.Inventory.Items, itemId)); + itemsToReturn.Add( + _itemHelper.FindAndReturnChildrenAsItems(pmcData.Inventory.Items, itemId) + ); } if (itemsToReturn?.Count == 0) { - errorMessage = _localisationService.GetText("ragfair-unable_to_find_requested_items_in_inventory"); + errorMessage = _localisationService.GetText( + "ragfair-unable_to_find_requested_items_in_inventory" + ); _logger.Error(errorMessage); - return new GetItemsToListOnFleaFromInventoryResult - { - ErrorMessage = errorMessage - }; + return new GetItemsToListOnFleaFromInventoryResult { ErrorMessage = errorMessage }; } return new GetItemsToListOnFleaFromInventoryResult { Items = itemsToReturn, - ErrorMessage = errorMessage + ErrorMessage = errorMessage, }; } @@ -1094,11 +1180,7 @@ public class RagfairController _logger.Warning( _localisationService.GetText( "ragfair-unable_to_remove_offer_not_found_in_profile", - new - { - profileId = sessionId, - offerId - } + new { profileId = sessionId, offerId } ) ); @@ -1109,13 +1191,7 @@ public class RagfairController if (playerOffer is null) { _logger.Error( - _localisationService.GetText( - "ragfair-offer_not_found_in_profile", - new - { - offerId - } - ) + _localisationService.GetText("ragfair-offer_not_found_in_profile", new { offerId }) ); return _httpResponseUtil.AppendErrorToOutput( @@ -1130,10 +1206,12 @@ public class RagfairController { // `expireSeconds` Default is 71 seconds var newEndTime = _ragfairConfig.Sell.ExpireSeconds + _timeUtil.GetTimeStamp(); - playerOffer.EndTime = (long?) Math.Round((double) newEndTime); + playerOffer.EndTime = (long?)Math.Round((double)newEndTime); } - _logger.Debug($"Flagged player offer: {offerId} for expiry in: {TimeSpan.FromTicks(playerOffer.EndTime.Value).ToString()}"); + _logger.Debug( + $"Flagged player offer: {offerId} for expiry in: {TimeSpan.FromTicks(playerOffer.EndTime.Value).ToString()}" + ); return output; } @@ -1144,7 +1222,10 @@ public class RagfairController /// Extend time request /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse ExtendOffer(ExtendOfferRequestData extendRequest, string sessionId) + public ItemEventRouterResponse ExtendOffer( + ExtendOfferRequestData extendRequest, + string sessionId + ) { var output = _eventOutputHolder.GetOutput(sessionId); @@ -1158,10 +1239,7 @@ public class RagfairController _logger.Warning( _localisationService.GetText( "ragfair-offer_not_found_in_profile", - new - { - offerId = extendRequest.OfferId - } + new { offerId = extendRequest.OfferId } ) ); return _httpResponseUtil.AppendErrorToOutput( @@ -1179,7 +1257,8 @@ public class RagfairController var sellInOncePiece = playerOffer.SellInOnePiece.GetValueOrDefault(false); if (!sellInOncePiece) { - count = (int) playerOffer.Items.Sum(offerItem => offerItem.Upd?.StackObjectsCount ?? 0); + count = (int) + playerOffer.Items.Sum(offerItem => offerItem.Upd?.StackObjectsCount ?? 0); } var tax = _ragfairTaxService.CalculateTax( @@ -1202,7 +1281,7 @@ public class RagfairController } // Add extra time to offer - playerOffers[playerOfferIndex].EndTime += (long?) Math.Round((decimal) secondsToAdd); + playerOffers[playerOfferIndex].EndTime += (long?)Math.Round((decimal)secondsToAdd); return output; } @@ -1213,7 +1292,10 @@ public class RagfairController /// What currency: RUB, EURO, USD /// Amount of currency /// ProcessBuyTradeRequestData - protected ProcessBuyTradeRequestData CreateBuyTradeRequestObject(CurrencyType currency, double value) + protected ProcessBuyTradeRequestData CreateBuyTradeRequestObject( + CurrencyType currency, + double value + ) { return new ProcessBuyTradeRequestData { @@ -1224,13 +1306,13 @@ public class RagfairController new IdWithCount { Id = _paymentHelper.GetCurrency(currency), - Count = Math.Round(value) - } + Count = Math.Round(value), + }, ], Type = "", ItemId = "", Count = 0, - SchemeId = 0 + SchemeId = 0, }; } @@ -1258,16 +1340,8 @@ public class RagfairController public record GetItemsToListOnFleaFromInventoryResult { - public List>? Items - { - get; - set; - } + public List>? Items { get; set; } - public string? ErrorMessage - { - get; - set; - } + public string? ErrorMessage { get; set; } } } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RepairController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RepairController.cs index ed20bdbf..9f676d88 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RepairController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RepairController.cs @@ -8,10 +8,7 @@ using SPTarkov.Server.Core.Services; namespace SPTarkov.Server.Core.Controllers; [Injectable] -public class RepairController( - EventOutputHolder _eventOutputHolder, - RepairService _repairService -) +public class RepairController(EventOutputHolder _eventOutputHolder, RepairService _repairService) { /// /// Handle TraderRepair event @@ -24,14 +21,20 @@ public class RepairController( public ItemEventRouterResponse TraderRepair( string sessionID, TraderRepairActionDataRequest body, - PmcData pmcData) + PmcData pmcData + ) { var output = _eventOutputHolder.GetOutput(sessionID); // find the item to repair foreach (var repairItem in body.RepairItems) { - var repairDetails = _repairService.RepairItemByTrader(sessionID, pmcData, repairItem, body.TId); + var repairDetails = _repairService.RepairItemByTrader( + sessionID, + pmcData, + repairItem, + body.TId + ); _repairService.PayForRepair( sessionID, @@ -68,7 +71,8 @@ public class RepairController( public ItemEventRouterResponse RepairWithKit( string sessionId, RepairActionDataRequest body, - PmcData pmcData) + PmcData pmcData + ) { var output = _eventOutputHolder.GetOutput(sessionId); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs index af15db36..a10d483a 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs @@ -53,7 +53,11 @@ public class RepeatableQuestController( /// Repeatable quest accepted /// Session/Player id /// ItemEventRouterResponse - public ItemEventRouterResponse AcceptRepeatableQuest(PmcData pmcData, AcceptQuestRequestData acceptedQuest, string sessionID) + public ItemEventRouterResponse AcceptRepeatableQuest( + PmcData pmcData, + AcceptQuestRequestData acceptedQuest, + string sessionID + ) { // Create and store quest status object inside player profile var newRepeatableQuest = _questHelper.GetQuestReadyForProfile( @@ -74,11 +78,16 @@ public class RepeatableQuestController( ) ); - throw new Exception(_localisationService.GetText("repeatable-unable_to_accept_quest_see_log")); + throw new Exception( + _localisationService.GetText("repeatable-unable_to_accept_quest_see_log") + ); } // Some scav quests need to be added to scav profile for them to show up in-raid - if (repeatableQuestProfile.Side == "Scav" && _questTypes.Contains(repeatableQuestProfile.Type.ToString())) + if ( + repeatableQuestProfile.Side == "Scav" + && _questTypes.Contains(repeatableQuestProfile.Type.ToString()) + ) { var fullProfile = _profileHelper.GetFullProfile(sessionID); @@ -98,8 +107,11 @@ public class RepeatableQuestController( /// Change quest request /// Session/Player id /// - public ItemEventRouterResponse ChangeRepeatableQuest(PmcData pmcData, RepeatableQuestChangeRequest changeRequest, - string sessionID) + public ItemEventRouterResponse ChangeRepeatableQuest( + PmcData pmcData, + RepeatableQuestChangeRequest changeRequest, + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); @@ -112,7 +124,9 @@ public class RepeatableQuestController( if (repeatables.RepeatableType is null || repeatables.Quest is null) { // Unable to find quest being replaced - var message = _localisationService.GetText("quest-unable_to_find_repeatable_to_replace"); + var message = _localisationService.GetText( + "quest-unable_to_find_repeatable_to_replace" + ); _logger.Error(message); return _httpResponseUtil.AppendErrorToOutput(output, message); @@ -125,8 +139,8 @@ public class RepeatableQuestController( var replacedQuestTraderId = questToReplace.TraderId; // Update active quests to exclude the quest we're replacing - repeatablesOfTypeInProfile.ActiveQuests = repeatablesOfTypeInProfile.ActiveQuests.Where(quest => quest.Id != changeRequest.QuestId - ) + repeatablesOfTypeInProfile.ActiveQuests = repeatablesOfTypeInProfile + .ActiveQuests.Where(quest => quest.Id != changeRequest.QuestId) .ToList(); // Save for later cost calculations @@ -138,7 +152,8 @@ public class RepeatableQuestController( repeatablesOfTypeInProfile.ChangeRequirement.Remove(changeRequest.QuestId); // Get config for this repeatable subtype (daily/weekly/scav) - var repeatableConfig = _questConfig.RepeatableQuests.FirstOrDefault(config => config.Name == repeatablesOfTypeInProfile.Name + var repeatableConfig = _questConfig.RepeatableQuests.FirstOrDefault(config => + config.Name == repeatablesOfTypeInProfile.Name ); // If the configuration dictates to replace with the same quest type, adjust the available quest types @@ -148,7 +163,10 @@ public class RepeatableQuestController( } // Generate meta-data for what type/level range of quests can be generated for player - var allowedQuestTypes = GenerateQuestPool(repeatableConfig, pmcData.Info.Level.GetValueOrDefault(1)); + var allowedQuestTypes = GenerateQuestPool( + repeatableConfig, + pmcData.Info.Level.GetValueOrDefault(1) + ); var newRepeatableQuest = AttemptToGenerateRepeatableQuest( sessionID, pmcData, @@ -186,7 +204,7 @@ public class RepeatableQuestController( repeatablesOfTypeInProfile.ChangeRequirement[newRepeatableQuest.Id] = new ChangeRequirement { ChangeCost = newRepeatableQuest.ChangeCost, - ChangeStandingCost = _randomUtil.GetArrayValue(repeatableConfig.StandingChangeCost) + ChangeStandingCost = _randomUtil.GetArrayValue(repeatableConfig.StandingChangeCost), }; // Check if we should charge player for replacing quest @@ -201,12 +219,22 @@ public class RepeatableQuestController( var traderOfReplacedQuest = pmcData.TradersInfo[replacedQuestTraderId]; traderOfReplacedQuest.Standing -= previousChangeRequirement.ChangeStandingCost; - var charismaBonus = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.Charisma)?.Progress ?? 0; + var charismaBonus = + _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.Charisma)?.Progress ?? 0; foreach (var cost in previousChangeRequirement.ChangeCost) { // Not free, Charge player + apply charisma bonus to cost of replacement - cost.Count = (int) Math.Truncate(cost.Count.Value * (1 - Math.Truncate(charismaBonus / 100) * 0.001)); - _paymentService.AddPaymentToOutput(pmcData, cost.TemplateId, cost.Count.Value, sessionID, output); + cost.Count = (int) + Math.Truncate( + cost.Count.Value * (1 - Math.Truncate(charismaBonus / 100) * 0.001) + ); + _paymentService.AddPaymentToOutput( + pmcData, + cost.TemplateId, + cost.Count.Value, + sessionID, + output + ); if (output.Warnings.Count > 0) { return output; @@ -265,8 +293,11 @@ public class RepeatableQuestController( /// Can be daily / weekly / scav repeatable /// Subtype of repeatable quest: daily / weekly / scav /// Is the repeatable being replaced for free - protected bool UseFreeRefreshIfAvailable(SptProfile? fullProfile, PmcDataRepeatableQuest repeatableSubType, - string repeatableTypeName) + protected bool UseFreeRefreshIfAvailable( + SptProfile? fullProfile, + PmcDataRepeatableQuest repeatableSubType, + string repeatableTypeName + ) { // No free refreshes, exit early if (repeatableSubType.FreeChangesAvailable <= 0) @@ -305,12 +336,14 @@ public class RepeatableQuestController( /// /// repeatables that have the replaced and new quest /// Id of the replaced quest - protected void CleanUpRepeatableChangeRequirements(PmcDataRepeatableQuest repeatablesOfTypeInProfile, - string replacedQuestId) + protected void CleanUpRepeatableChangeRequirements( + PmcDataRepeatableQuest repeatablesOfTypeInProfile, + string replacedQuestId + ) { if (repeatablesOfTypeInProfile.ActiveQuests.Count == 1) - // Only one repeatable quest being replaced (e.g. scav_daily), remove everything ready for new quest requirement to be added - // Will assist in cleanup of existing profiles data + // Only one repeatable quest being replaced (e.g. scav_daily), remove everything ready for new quest requirement to be added + // Will assist in cleanup of existing profiles data { repeatablesOfTypeInProfile.ChangeRequirement.Clear(); @@ -329,8 +362,12 @@ public class RepeatableQuestController( /// What type/level range of quests can be generated for player /// Config for the quest type to generate /// - protected RepeatableQuest? AttemptToGenerateRepeatableQuest(string sessionId, PmcData pmcData, - QuestTypePool questTypePool, RepeatableQuestConfig repeatableConfig) + protected RepeatableQuest? AttemptToGenerateRepeatableQuest( + string sessionId, + PmcData pmcData, + QuestTypePool questTypePool, + RepeatableQuestConfig repeatableConfig + ) { const int maxAttempts = 10; RepeatableQuest? newRepeatableQuest = null; @@ -346,7 +383,7 @@ public class RepeatableQuestController( ); if (newRepeatableQuest is not null) - // Successfully generated a quest, exit loop + // Successfully generated a quest, exit loop { break; } @@ -356,7 +393,12 @@ public class RepeatableQuestController( if (attempts > maxAttempts) { - _logger.Error(_localisationService.GetText("quest-repeatable_generation_failed_please_report", attempts)); + _logger.Error( + _localisationService.GetText( + "quest-repeatable_generation_failed_please_report", + attempts + ) + ); } return newRepeatableQuest; @@ -370,7 +412,10 @@ public class RepeatableQuestController( protected void RemoveQuestFromProfile(SptProfile fullProfile, string questToReplaceId) { // Find quest we're replacing in pmc profile quests array and remove it - _questHelper.FindAndRemoveQuestFromArrayIfExists(questToReplaceId, fullProfile.CharacterData.PmcData.Quests); + _questHelper.FindAndRemoveQuestFromArrayIfExists( + questToReplaceId, + fullProfile.CharacterData.PmcData.Quests + ); // Look for and remove quest we're replacing in scav profile too if (fullProfile.CharacterData.ScavData is not null) @@ -393,10 +438,11 @@ public class RepeatableQuestController( foreach (var repeatablesInProfile in pmcData.RepeatableQuests) { // Check for existing quest in (daily/weekly/scav arrays) - var questToReplace = - repeatablesInProfile.ActiveQuests?.FirstOrDefault(repeatable => repeatable.Id == questId); + var questToReplace = repeatablesInProfile.ActiveQuests?.FirstOrDefault(repeatable => + repeatable.Id == questId + ); if (questToReplace is null) - // Not found, skip to next repeatable subtype + // Not found, skip to next repeatable subtype { continue; } @@ -404,7 +450,7 @@ public class RepeatableQuestController( return new GetRepeatableByIdResult { Quest = questToReplace, - RepeatableType = repeatablesInProfile + RepeatableType = repeatablesInProfile, }; } @@ -443,12 +489,15 @@ public class RepeatableQuestController( foreach (var repeatableConfig in _questConfig.RepeatableQuests) { // Get daily/weekly data from profile, add empty object if missing - var generatedRepeatables = GetRepeatableQuestSubTypeFromProfile(repeatableConfig, pmcData); + var generatedRepeatables = GetRepeatableQuestSubTypeFromProfile( + repeatableConfig, + pmcData + ); var repeatableTypeLower = repeatableConfig.Name.ToLower(); var canAccessRepeatables = CanProfileAccessRepeatableQuests(repeatableConfig, pmcData); if (!canAccessRepeatables) - // Don't send any repeatables, even existing ones + // Don't send any repeatables, even existing ones { continue; } @@ -483,7 +532,10 @@ public class RepeatableQuestController( ProcessExpiredQuests(generatedRepeatables, pmcData); // Create dynamic quest pool to avoid generating duplicates - var questTypePool = GenerateQuestPool(repeatableConfig, pmcData.Info.Level.GetValueOrDefault(1)); + var questTypePool = GenerateQuestPool( + repeatableConfig, + pmcData.Info.Level.GetValueOrDefault(1) + ); // Add repeatable quests of this loops sub-type (daily/weekly) for (var i = 0; i < GetQuestCount(repeatableConfig, fullProfile); i++) @@ -535,7 +587,9 @@ public class RepeatableQuestController( new ChangeRequirement { ChangeCost = quest.ChangeCost, - ChangeStandingCost = _randomUtil.GetArrayValue(repeatableConfig.StandingChangeCost) // Randomise standing loss to replace + ChangeStandingCost = _randomUtil.GetArrayValue( + repeatableConfig.StandingChangeCost + ), // Randomise standing loss to replace } ); } @@ -553,7 +607,7 @@ public class RepeatableQuestController( InactiveQuests = generatedRepeatables.InactiveQuests, ChangeRequirement = generatedRepeatables.ChangeRequirement, FreeChanges = generatedRepeatables.FreeChanges, - FreeChangesAvailable = generatedRepeatables.FreeChangesAvailable + FreeChangesAvailable = generatedRepeatables.FreeChangesAvailable, } ); } @@ -567,11 +621,14 @@ public class RepeatableQuestController( /// daily/weekly config /// Players PMC profile /// PmcDataRepeatableQuest - protected PmcDataRepeatableQuest GetRepeatableQuestSubTypeFromProfile(RepeatableQuestConfig repeatableConfig, - PmcData pmcData) + protected PmcDataRepeatableQuest GetRepeatableQuestSubTypeFromProfile( + RepeatableQuestConfig repeatableConfig, + PmcData pmcData + ) { // Get from profile, add if missing - var repeatableQuestDetails = pmcData.RepeatableQuests.FirstOrDefault(repeatable => repeatable.Name == repeatableConfig.Name + var repeatableQuestDetails = pmcData.RepeatableQuests.FirstOrDefault(repeatable => + repeatable.Name == repeatableConfig.Name ); var hasAccess = _profileHelper.HasAccessToRepeatableFreeRefreshSystem(pmcData); @@ -586,7 +643,7 @@ public class RepeatableQuestController( InactiveQuests = [], EndTime = 0, FreeChanges = hasAccess ? repeatableConfig.FreeChanges : 0, - FreeChangesAvailable = hasAccess ? repeatableConfig.FreeChangesAvailable : 0 + FreeChangesAvailable = hasAccess ? repeatableConfig.FreeChangesAvailable : 0, }; // Add base object that holds repeatable data to profile @@ -610,10 +667,16 @@ public class RepeatableQuestController( /// Repeatable quest config /// Players PMC profile /// True if profile has access to repeatables - protected bool CanProfileAccessRepeatableQuests(RepeatableQuestConfig repeatableConfig, PmcData pmcData) + protected bool CanProfileAccessRepeatableQuests( + RepeatableQuestConfig repeatableConfig, + PmcData pmcData + ) { // PMC and daily quests not unlocked yet - if (repeatableConfig.Side == "Pmc" && !PlayerHasDailyPmcQuestsUnlocked(pmcData, repeatableConfig)) + if ( + repeatableConfig.Side == "Pmc" + && !PlayerHasDailyPmcQuestsUnlocked(pmcData, repeatableConfig) + ) { return false; } @@ -638,7 +701,10 @@ public class RepeatableQuestController( /// Players PMC profile /// Config of daily type to check /// True if unlocked - protected static bool PlayerHasDailyPmcQuestsUnlocked(PmcData pmcData, RepeatableQuestConfig repeatableConfig) + protected static bool PlayerHasDailyPmcQuestsUnlocked( + PmcData pmcData, + RepeatableQuestConfig repeatableConfig + ) { return pmcData.Info.Level >= repeatableConfig.MinPlayerLevel; } @@ -650,9 +716,11 @@ public class RepeatableQuestController( /// True if unlocked protected bool PlayerHasDailyScavQuestsUnlocked(PmcData pmcData) { - return pmcData?.Hideout?.Areas?.FirstOrDefault(hideoutArea => hideoutArea.Type == HideoutAreas.IntelligenceCenter) - ?.Level >= - 1; + return pmcData + ?.Hideout?.Areas?.FirstOrDefault(hideoutArea => + hideoutArea.Type == HideoutAreas.IntelligenceCenter + ) + ?.Level >= 1; } /// @@ -660,12 +728,17 @@ public class RepeatableQuestController( /// /// Repeatables to process (daily/weekly) /// Players PMC profile - protected void ProcessExpiredQuests(PmcDataRepeatableQuest generatedRepeatables, PmcData pmcData) + protected void ProcessExpiredQuests( + PmcDataRepeatableQuest generatedRepeatables, + PmcData pmcData + ) { var questsToKeep = new List(); foreach (var activeQuest in generatedRepeatables.ActiveQuests) { - var questStatusInProfile = pmcData.Quests.FirstOrDefault(quest => quest.QId == activeQuest.Id); + var questStatusInProfile = pmcData.Quests.FirstOrDefault(quest => + quest.QId == activeQuest.Id + ); if (questStatusInProfile is null) { continue; @@ -723,8 +796,15 @@ public class RepeatableQuestController( // Add "any" to pickup quest pool questPool.Pool.Pickup.Locations[ELocationName.any] = ["any"]; - var eliminationConfig = _repeatableQuestHelper.GetEliminationConfigByPmcLevel(pmcLevel, repeatableConfig); - var targetsConfig = new ProbabilityObjectArray(_mathUtil, _cloner, eliminationConfig.Targets); + var eliminationConfig = _repeatableQuestHelper.GetEliminationConfigByPmcLevel( + pmcLevel, + repeatableConfig + ); + var targetsConfig = new ProbabilityObjectArray( + _mathUtil, + _cloner, + eliminationConfig.Targets + ); // Populate Elimination quest targets and their locations foreach (var target in targetsConfig) @@ -734,10 +814,7 @@ public class RepeatableQuestController( { questPool.Pool.Elimination.Targets.Add( target.Key, - new TargetLocation - { - Locations = ["any"] - } + new TargetLocation { Locations = ["any"] } ); continue; @@ -747,16 +824,16 @@ public class RepeatableQuestController( var possibleLocations = repeatableConfig.Locations.Keys; var allowedLocations = target.Key == "Savage" - ? possibleLocations.Where(location => location != ELocationName.laboratory - ) // Exclude labs for Savage targets. + ? possibleLocations.Where(location => location != ELocationName.laboratory) // Exclude labs for Savage targets. : possibleLocations; questPool.Pool.Elimination.Targets.Add( target.Key, new TargetLocation { - Locations = allowedLocations.Select(x => x.ToString()).ToList() - }); + Locations = allowedLocations.Select(x => x.ToString()).ToList(), + } + ); } return questPool; @@ -776,17 +853,17 @@ public class RepeatableQuestController( { Exploration = new ExplorationPool { - Locations = new Dictionary>() + Locations = new Dictionary>(), }, Elimination = new EliminationPool { - Targets = new Dictionary() + Targets = new Dictionary(), }, Pickup = new ExplorationPool { - Locations = new Dictionary>() - } - } + Locations = new Dictionary>(), + }, + }, }; } @@ -805,23 +882,25 @@ public class RepeatableQuestController( } // Add elite bonus to daily quests - if (string.Equals(repeatableConfig.Name, "daily", StringComparison.OrdinalIgnoreCase) && - _profileHelper.HasEliteSkillLevel(SkillTypes.Charisma, fullProfile.CharacterData.PmcData)) - // Elite charisma skill gives extra daily quest(s) + if ( + string.Equals(repeatableConfig.Name, "daily", StringComparison.OrdinalIgnoreCase) + && _profileHelper.HasEliteSkillLevel( + SkillTypes.Charisma, + fullProfile.CharacterData.PmcData + ) + ) + // Elite charisma skill gives extra daily quest(s) { questCount += _databaseService .GetGlobals() - .Configuration - .SkillsSettings - .Charisma - .BonusSettings - .EliteBonusSettings - .RepeatableQuestExtraCount - .GetValueOrDefault(0); + .Configuration.SkillsSettings.Charisma.BonusSettings.EliteBonusSettings.RepeatableQuestExtraCount.GetValueOrDefault( + 0 + ); } // Add any extra repeatable quests the profile has unlocked - questCount += (int) fullProfile.SptData.ExtraRepeatableQuests.GetValueOrDefault(repeatableConfig.Id, 0); + questCount += (int) + fullProfile.SptData.ExtraRepeatableQuests.GetValueOrDefault(repeatableConfig.Id, 0); return questCount; } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/TradeController.cs b/Libraries/SPTarkov.Server.Core/Controllers/TradeController.cs index e478b891..6d305816 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/TradeController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/TradeController.cs @@ -50,7 +50,8 @@ public class TradeController( public ItemEventRouterResponse ConfirmTrading( PmcData pmcData, ProcessBaseTradeRequestData request, - string sessionID) + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); @@ -58,7 +59,7 @@ public class TradeController( if (request.Type == "buy_from_trader") { var foundInRaid = _traderConfig.PurchasesAreFoundInRaid; - var buyData = (ProcessBuyTradeRequestData) request; + var buyData = (ProcessBuyTradeRequestData)request; _tradeHelper.BuyItem(pmcData, buyData, sessionID, foundInRaid, output); return output; @@ -67,7 +68,7 @@ public class TradeController( // Selling if (request.Type == "sell_to_trader") { - var sellData = (ProcessSellTradeRequestData) request; + var sellData = (ProcessSellTradeRequestData)request; _tradeHelper.SellItem(pmcData, pmcData, sellData, sessionID, output); return output; @@ -76,7 +77,11 @@ public class TradeController( var errorMessage = $"Unhandled trade event: {request.Type}"; _logger.Error(errorMessage); - return _httpResponseUtil.AppendErrorToOutput(output, errorMessage, BackendErrorCodes.RagfairUnavailable); + return _httpResponseUtil.AppendErrorToOutput( + output, + errorMessage, + BackendErrorCodes.RagfairUnavailable + ); } /// @@ -89,7 +94,8 @@ public class TradeController( public ItemEventRouterResponse ConfirmRagfairTrading( PmcData pmcData, ProcessRagfairTradeRequestData request, - string sessionID) + string sessionID + ) { var output = _eventOutputHolder.GetOutput(sessionID); @@ -111,7 +117,11 @@ public class TradeController( "ragfair-unable_to_purchase_0_count_item", _itemHelper.GetItem(fleaOffer.Items[0].Template).Value.Name ); - return _httpResponseUtil.AppendErrorToOutput(output, errorMessage, BackendErrorCodes.OfferOutOfStock); + return _httpResponseUtil.AppendErrorToOutput( + output, + errorMessage, + BackendErrorCodes.OfferOutOfStock + ); } if (_ragfairOfferHelper.OfferIsFromTrader(fleaOffer)) @@ -146,18 +156,24 @@ public class TradeController( PmcData pmcData, RagfairOffer fleaOffer, OfferRequest requestOffer, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { // Skip buying items when player doesn't have needed loyalty if (PlayerLacksTraderLoyaltyLevelToBuyOffer(fleaOffer, pmcData)) { - var errorMessage = $"Unable to buy item: {fleaOffer.Items[0].Template} from trader: {fleaOffer.User.Id} as loyalty level too low, skipping"; + var errorMessage = + $"Unable to buy item: {fleaOffer.Items[0].Template} from trader: {fleaOffer.User.Id} as loyalty level too low, skipping"; if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug(errorMessage); } - _httpResponseUtil.AppendErrorToOutput(output, errorMessage, BackendErrorCodes.RagfairUnavailable); + _httpResponseUtil.AppendErrorToOutput( + output, + errorMessage, + BackendErrorCodes.RagfairUnavailable + ); return; } @@ -171,9 +187,15 @@ public class TradeController( ItemId = fleaOffer.Root, Count = requestOffer.Count, SchemeId = 0, - SchemeItems = requestOffer.Items + SchemeItems = requestOffer.Items, }; - _tradeHelper.BuyItem(pmcData, buyData, sessionId, _traderConfig.PurchasesAreFoundInRaid, output); + _tradeHelper.BuyItem( + pmcData, + buyData, + sessionId, + _traderConfig.PurchasesAreFoundInRaid, + output + ); // Remove/lower offer quantity of item purchased from trader flea offer _ragfairServer.ReduceOfferQuantity(fleaOffer.Id, requestOffer.Count ?? 0); @@ -192,7 +214,8 @@ public class TradeController( PmcData pmcData, RagfairOffer fleaOffer, OfferRequest requestOffer, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { var buyData = new ProcessBuyTradeRequestData { @@ -202,11 +225,17 @@ public class TradeController( ItemId = fleaOffer.Id, // Store ragfair offerId in buyRequestData.item_id Count = requestOffer.Count, SchemeId = 0, - SchemeItems = requestOffer.Items + SchemeItems = requestOffer.Items, }; // buyItem() must occur prior to removing the offer stack, otherwise item inside offer doesn't exist for confirmTrading() to use - _tradeHelper.BuyItem(pmcData, buyData, sessionId, _ragfairConfig.Dynamic.PurchasesAreFoundInRaid, output); + _tradeHelper.BuyItem( + pmcData, + buyData, + sessionId, + _ragfairConfig.Dynamic.PurchasesAreFoundInRaid, + output + ); if (output.Warnings?.Count > 0) { return; @@ -234,9 +263,7 @@ public class TradeController( /// id of the offer /// Owner id /// true if offer was made by a player - protected bool IsPlayerOffer( - string offerId, - string? offerOwnerId) + protected bool IsPlayerOffer(string offerId, string? offerOwnerId) { // No ownerId, not player offer if (offerOwnerId is null) @@ -246,7 +273,7 @@ public class TradeController( var offerCreatorProfile = _profileHelper.GetPmcProfile(offerOwnerId); if (offerCreatorProfile is null || offerCreatorProfile.RagfairInfo.Offers?.Count == 0) - // No profile or no offers + // No profile or no offers { return false; } @@ -261,9 +288,7 @@ public class TradeController( /// Flea offer being bought /// Player profile /// True if player can buy offer - protected bool PlayerLacksTraderLoyaltyLevelToBuyOffer( - RagfairOffer fleaOffer, - PmcData pmcData) + protected bool PlayerLacksTraderLoyaltyLevelToBuyOffer(RagfairOffer fleaOffer, PmcData pmcData) { return fleaOffer.LoyaltyLevel > pmcData.TradersInfo[fleaOffer.User.Id].LoyaltyLevel; } @@ -278,11 +303,12 @@ public class TradeController( public ItemEventRouterResponse SellScavItemsToFence( PmcData pmcData, SellScavItemsToFenceRequestData request, - string sessionId) + string sessionId + ) { var output = _eventOutputHolder.GetOutput(sessionId); - MailMoneyToPlayer(sessionId, (int) request.TotalValue, Traders.FENCE); + MailMoneyToPlayer(sessionId, (int)request.TotalValue, Traders.FENCE); return output; } @@ -293,10 +319,7 @@ public class TradeController( /// Session id /// amount of roubles to send /// Trader to sell items to - protected void MailMoneyToPlayer( - string sessionId, - int roublesToSend, - string trader) + protected void MailMoneyToPlayer(string sessionId, int roublesToSend, string trader) { if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -308,10 +331,7 @@ public class TradeController( { Id = _hashUtil.Generate(), Template = Money.ROUBLES, - Upd = new Upd - { - StackObjectsCount = roublesToSend - } + Upd = new Upd { StackObjectsCount = roublesToSend }, }; // Ensure money is properly split to follow its max stack size limit @@ -322,7 +342,11 @@ public class TradeController( sessionId, trader, MessageType.MessageWithItems, - _randomUtil.GetArrayValue(_databaseService.GetTrader(trader).Dialogue.TryGetValue("soldItems", out var items) ? items : new List()), + _randomUtil.GetArrayValue( + _databaseService.GetTrader(trader).Dialogue.TryGetValue("soldItems", out var items) + ? items + : new List() + ), curencyReward.SelectMany(x => x).ToList(), _timeUtil.GetHoursAsSeconds(72) ); @@ -340,7 +364,8 @@ public class TradeController( string parentItemId, List items, Dictionary handbookPrices, - TraderBase traderDetails) + TraderBase traderDetails + ) { var itemWithChildren = _itemHelper.FindAndReturnChildrenAsItems(items, parentItemId); @@ -348,14 +373,25 @@ public class TradeController( foreach (var itemToSell in itemWithChildren) { var itemDetails = _itemHelper.GetItem(itemToSell.Template); - if (!(itemDetails.Key && _itemHelper.IsOfBaseclasses(itemDetails.Value.Id, traderDetails.ItemsBuy.Category))) - // Skip if tpl isn't item OR item doesn't fulfil match traders buy categories + if ( + !( + itemDetails.Key + && _itemHelper.IsOfBaseclasses( + itemDetails.Value.Id, + traderDetails.ItemsBuy.Category + ) + ) + ) + // Skip if tpl isn't item OR item doesn't fulfil match traders buy categories { continue; } // Get price of item multiplied by how many are in stack - totalPrice += (int) ((handbookPrices[itemToSell.Template] ?? 0) * (itemToSell.Upd?.StackObjectsCount ?? 1)); + totalPrice += (int)( + (handbookPrices[itemToSell.Template] ?? 0) + * (itemToSell.Upd?.StackObjectsCount ?? 1) + ); } return totalPrice; diff --git a/Libraries/SPTarkov.Server.Core/Controllers/TraderController.cs b/Libraries/SPTarkov.Server.Core/Controllers/TraderController.cs index b82461fa..b7b0e01c 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/TraderController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/TraderController.cs @@ -67,8 +67,9 @@ public class TraderController( _traderPurchasePersisterService.RemoveStalePurchasesFromProfiles(traderId); // Set to next hour on clock or current time + 60 minutes - trader.Base.NextResupply = - traderResetStartsWithServer ? (int) _traderHelper.GetNextUpdateTimestamp(trader.Base.Id) : (int) nextHourTimestamp; + trader.Base.NextResupply = traderResetStartsWithServer + ? (int)_traderHelper.GetNextUpdateTimestamp(trader.Base.Id) + : (int)nextHourTimestamp; } } @@ -85,10 +86,7 @@ public class TraderController( var barterSchemeItem = kvp.Value?.FirstOrDefault()?.FirstOrDefault(); if (barterSchemeItem != null && _paymentHelper.IsMoneyTpl(barterSchemeItem.Template)) { - barterSchemeItem.Count += Math.Round( - barterSchemeItem?.Count * multiplier ?? 0D, - 2 - ); + barterSchemeItem.Count += Math.Round(barterSchemeItem?.Count * multiplier ?? 0D, 2); } } } @@ -108,14 +106,14 @@ public class TraderController( case Traders.LIGHTHOUSEKEEPER: continue; case Traders.FENCE: + { + if (_fenceService.NeedsPartialRefresh()) { - if (_fenceService.NeedsPartialRefresh()) - { - _fenceService.GenerateFenceAssorts(); - } - - continue; + _fenceService.GenerateFenceAssorts(); } + + continue; + } } // Trader needs to be refreshed @@ -203,8 +201,8 @@ public class TraderController( { { "5449016a4bdc2d6f028b456f", handbookPrices[Money.ROUBLES] }, { "569668774bdc2da2298b4568", handbookPrices[Money.EUROS] }, - { "5696686a4bdc2da3298b456a", handbookPrices[Money.DOLLARS] } - } + { "5696686a4bdc2da3298b456a", handbookPrices[Money.DOLLARS] }, + }, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Controllers/WeatherController.cs b/Libraries/SPTarkov.Server.Core/Controllers/WeatherController.cs index e8c5e912..922358d5 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/WeatherController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/WeatherController.cs @@ -23,7 +23,6 @@ public class WeatherController( { protected WeatherConfig _weatherConfig = _configServer.GetConfig(); - /// /// Handle client/weather /// @@ -36,7 +35,7 @@ public class WeatherController( Time = "", Date = "", Weather = null, - Season = Season.AUTUMN + Season = Season.AUTUMN, }; _weatherGenerator.CalculateGameTime(result); @@ -55,7 +54,7 @@ public class WeatherController( var result = new GetLocalWeatherResponseData { Season = _seasonalEventService.GetActiveWeatherSeason(), - Weather = [] + Weather = [], }; result.Weather.AddRange(_raidWeatherService.GetUpcomingWeather()); diff --git a/Libraries/SPTarkov.Server.Core/Controllers/WishlistController.cs b/Libraries/SPTarkov.Server.Core/Controllers/WishlistController.cs index 67a5e256..8e7a662a 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/WishlistController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/WishlistController.cs @@ -7,9 +7,7 @@ using SPTarkov.Server.Core.Routers; namespace SPTarkov.Server.Core.Controllers; [Injectable] -public class WishlistController( - EventOutputHolder _eventOutputHolder -) +public class WishlistController(EventOutputHolder _eventOutputHolder) { /// /// Handle AddToWishList @@ -21,7 +19,8 @@ public class WishlistController( public ItemEventRouterResponse AddToWishList( PmcData pmcData, AddToWishlistRequest request, - string sessionId) + string sessionId + ) { foreach (var item in request.Items) { @@ -41,7 +40,8 @@ public class WishlistController( public ItemEventRouterResponse RemoveFromWishList( PmcData pmcData, RemoveFromWishlistRequest request, - string sessionId) + string sessionId + ) { foreach (var itemId in request.Items) { @@ -61,7 +61,8 @@ public class WishlistController( public ItemEventRouterResponse ChangeWishListItemCategory( PmcData pmcData, ChangeWishlistItemCategoryRequest request, - string sessionId) + string sessionId + ) { pmcData.WishList.Dictionary[request.Item] = request.Category.Value; diff --git a/Libraries/SPTarkov.Server.Core/DI/Router.cs b/Libraries/SPTarkov.Server.Core/DI/Router.cs index f1418f63..c3bccc2b 100644 --- a/Libraries/SPTarkov.Server.Core/DI/Router.cs +++ b/Libraries/SPTarkov.Server.Core/DI/Router.cs @@ -32,14 +32,10 @@ public abstract class Router { if (partialMatch) { - return GetInternalHandledRoutes() - .Where(r => r.dynamic) - .Any(r => url.Contains(r.route)); + return GetInternalHandledRoutes().Where(r => r.dynamic).Any(r => url.Contains(r.route)); } - return GetInternalHandledRoutes() - .Where(r => !r.dynamic) - .Any(r => r.route == url); + return GetInternalHandledRoutes().Where(r => !r.dynamic).Any(r => r.route == url); } } @@ -54,14 +50,19 @@ public abstract class StaticRouter : Router _jsonUtil = jsonUtil; } - public async ValueTask HandleStatic(string url, string? body, string sessionID, string output) + public async ValueTask HandleStatic( + string url, + string? body, + string sessionID, + string output + ) { var action = _actions.Single(route => route.url == url); var type = action.bodyType; IRequestData? info = null; if (type != null && !string.IsNullOrEmpty(body)) { - info = (IRequestData?) _jsonUtil.Deserialize(body, type); + info = (IRequestData?)_jsonUtil.Deserialize(body, type); } return await action.action(url, info, sessionID, output); @@ -84,14 +85,19 @@ public abstract class DynamicRouter : Router _jsonUtil = jsonUtil; } - public async ValueTask HandleDynamic(string url, string? body, string sessionID, string output) + public async ValueTask HandleDynamic( + string url, + string? body, + string sessionID, + string output + ) { var action = actions.First(r => url.Contains(r.url)); var type = action.bodyType; IRequestData? info = null; if (type != null && !string.IsNullOrEmpty(body)) { - info = (IRequestData?) _jsonUtil.Deserialize(body, type); + info = (IRequestData?)_jsonUtil.Deserialize(body, type); } return await action.action(url, info, sessionID, output); @@ -107,11 +113,13 @@ public abstract class DynamicRouter : Router // So instead I added the definition public abstract class ItemEventRouterDefinition : Router { - public abstract ValueTask HandleItemEvent(string url, + public abstract ValueTask HandleItemEvent( + string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output); + ItemEventRouterResponse output + ); } public abstract class SaveLoadRouter : Router diff --git a/Libraries/SPTarkov.Server.Core/DI/ServiceLocator.cs b/Libraries/SPTarkov.Server.Core/DI/ServiceLocator.cs index e30392c4..114b3b5f 100644 --- a/Libraries/SPTarkov.Server.Core/DI/ServiceLocator.cs +++ b/Libraries/SPTarkov.Server.Core/DI/ServiceLocator.cs @@ -1,18 +1,14 @@ namespace SPTarkov.Server.Core.DI { /// - /// A service locator designed specifically for Harmony patches and other + /// A service locator designed specifically for Harmony patches and other /// parts of the application that do not have direct access to the Dependency Injection (DI) system. /// /// This should not be used at all when having direct access to DI. /// public static class ServiceLocator { - public static IServiceProvider ServiceProvider - { - get; - private set; - } + public static IServiceProvider ServiceProvider { get; private set; } internal static void SetServiceProvider(IServiceProvider provider) { diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs index 22a4675d..cc9fa15d 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs @@ -41,7 +41,11 @@ public class BotEquipmentModGenerator( ICloner _cloner ) { - protected static readonly FrozenSet _modSightIds = ["mod_sight_front", "mod_sight_rear"]; + protected static readonly FrozenSet _modSightIds = + [ + "mod_sight_front", + "mod_sight_rear", + ]; // Slots that hold scopes protected static readonly FrozenSet _scopeIds = @@ -52,14 +56,25 @@ public class BotEquipmentModGenerator( "mod_scope_000", "mod_scope_001", "mod_scope_002", - "mod_scope_003" + "mod_scope_003", ]; // Slots that hold muzzles - protected static readonly FrozenSet _muzzleIds = ["mod_muzzle", "mod_muzzle_000", "mod_muzzle_001"]; + protected static readonly FrozenSet _muzzleIds = + [ + "mod_muzzle", + "mod_muzzle_000", + "mod_muzzle_001", + ]; // Slots a weapon can store its stock in - protected static readonly FrozenSet _stockSlots = ["mod_stock", "mod_stock_000", "mod_stock_001", "mod_stock_akms"]; + protected static readonly FrozenSet _stockSlots = + [ + "mod_stock", + "mod_stock_000", + "mod_stock_001", + "mod_stock_akms", + ]; // Slots that hold cartridges protected static readonly FrozenSet _cartridgeHolderSlots = @@ -68,7 +83,7 @@ public class BotEquipmentModGenerator( "patron_in_weapon", "patron_in_weapon_000", "patron_in_weapon_001", - "cartridges" + "cartridges", ]; protected BotConfig _botConfig = _configServer.GetConfig(); @@ -83,15 +98,23 @@ public class BotEquipmentModGenerator( /// The relevant blacklist from bot.json equipment dictionary /// should this mod be forced to spawn /// Item + compatible mods as an array - public List GenerateModsForEquipment(List equipment, string parentId, TemplateItem parentTemplate, GenerateEquipmentProperties settings, - EquipmentFilterDetails specificBlacklist, bool shouldForceSpawn = false) + public List GenerateModsForEquipment( + List equipment, + string parentId, + TemplateItem parentTemplate, + GenerateEquipmentProperties settings, + EquipmentFilterDetails specificBlacklist, + bool shouldForceSpawn = false + ) { var forceSpawn = shouldForceSpawn; // Get mod pool for the desired item if (!settings.ModPool.TryGetValue(parentTemplate.Id, out var compatibleModsPool)) { - _logger.Warning($"bot: {settings.BotData.Role} lacks a mod slot pool for item: {parentTemplate.Id} {parentTemplate.Name}"); + _logger.Warning( + $"bot: {settings.BotData.Role} lacks a mod slot pool for item: {parentTemplate.Id} {parentTemplate.Name}" + ); } // Iterate over mod pool and choose mods to add to item @@ -109,7 +132,7 @@ public class BotEquipmentModGenerator( modSlot = modSlotName, parentId = parentTemplate.Id, parentName = parentTemplate.Name, - botRole = settings.BotData.Role + botRole = settings.BotData.Role, } ) ); @@ -140,17 +163,21 @@ public class BotEquipmentModGenerator( var modPoolToChooseFrom = modPool; // Filter the pool of items in blacklist - var filteredModPool = FilterModsByBlacklist(modPoolToChooseFrom, specificBlacklist, modSlotName); + var filteredModPool = FilterModsByBlacklist( + modPoolToChooseFrom, + specificBlacklist, + modSlotName + ); if (filteredModPool.Count > 0) - // use filtered pool as it has items in it + // use filtered pool as it has items in it { modPoolToChooseFrom = filteredModPool; } // Slot can hold armor plates + we are filtering possible items by bot level, handle if ( - settings.BotEquipmentConfig.FilterPlatesByLevel.GetValueOrDefault(false) && - _itemHelper.IsRemovablePlateSlot(modSlotName.ToLower()) + settings.BotEquipmentConfig.FilterPlatesByLevel.GetValueOrDefault(false) + && _itemHelper.IsRemovablePlateSlot(modSlotName.ToLower()) ) { var plateSlotFilteringOutcome = FilterPlateModsForSlotByLevel( @@ -161,7 +188,8 @@ public class BotEquipmentModGenerator( ); switch (plateSlotFilteringOutcome.Result) { - case Result.UNKNOWN_FAILURE or Result.NO_DEFAULT_FILTER: + case Result.UNKNOWN_FAILURE + or Result.NO_DEFAULT_FILTER: if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( @@ -188,8 +216,12 @@ public class BotEquipmentModGenerator( while (exhaustableModPool.HasValues()) { modTpl = exhaustableModPool.GetRandomValue(); - if (modTpl is not null && - !_botGeneratorHelper.IsItemIncompatibleWithCurrentItems(equipment, modTpl, modSlotName).Incompatible.GetValueOrDefault(false)) + if ( + modTpl is not null + && !_botGeneratorHelper + .IsItemIncompatibleWithCurrentItems(equipment, modTpl, modSlotName) + .Incompatible.GetValueOrDefault(false) + ) { found = true; break; @@ -199,7 +231,12 @@ public class BotEquipmentModGenerator( // Compatible item not found but slot REQUIRES item, get random item from db if (!found && itemSlotTemplate.Required.GetValueOrDefault(false)) { - modTpl = GetRandomModTplFromItemDb(modTpl, itemSlotTemplate, modSlotName, equipment); + modTpl = GetRandomModTplFromItemDb( + modTpl, + itemSlotTemplate, + modSlotName, + equipment + ); found = modTpl is not null; } @@ -227,12 +264,19 @@ public class BotEquipmentModGenerator( // Generate new id to ensure all items are unique on bot var modId = _hashUtil.Generate(); equipment.Add( - CreateModItem(modId, modTpl, parentId, modSlotName, modTemplate.Value, settings.BotData.Role) + CreateModItem( + modId, + modTpl, + parentId, + modSlotName, + modTemplate.Value, + settings.BotData.Role + ) ); // Does item being added exist in mod pool - has its own mod pool if (settings.ModPool.ContainsKey(modTpl)) - // Call self again with mod being added as item to add child mods to + // Call self again with mod being added as item to add child mods to { GenerateModsForEquipment( equipment, @@ -256,13 +300,17 @@ public class BotEquipmentModGenerator( /// Plates tpls to choose from /// The armor items db template /// Array of plate tpls to choose from - public FilterPlateModsForSlotByLevelResult FilterPlateModsForSlotByLevel(GenerateEquipmentProperties settings, string modSlot, - HashSet existingPlateTplPool, TemplateItem armorItem) + public FilterPlateModsForSlotByLevelResult FilterPlateModsForSlotByLevel( + GenerateEquipmentProperties settings, + string modSlot, + HashSet existingPlateTplPool, + TemplateItem armorItem + ) { var result = new FilterPlateModsForSlotByLevelResult { Result = Result.UNKNOWN_FAILURE, - PlateModTemplates = null + PlateModTemplates = null, }; // Not pmc or not a plate slot, return original mod pool array @@ -275,9 +323,10 @@ public class BotEquipmentModGenerator( } // Get the front/back/side weights based on bots level - var plateSlotWeights = settings.BotEquipmentConfig?.ArmorPlateWeighting.FirstOrDefault(armorWeight => - settings.BotData.Level >= armorWeight.LevelRange.Min && - settings.BotData.Level <= armorWeight.LevelRange.Max + var plateSlotWeights = settings.BotEquipmentConfig?.ArmorPlateWeighting.FirstOrDefault( + armorWeight => + settings.BotData.Level >= armorWeight.LevelRange.Min + && settings.BotData.Level <= armorWeight.LevelRange.Max ); if (plateSlotWeights is null) @@ -303,10 +352,15 @@ public class BotEquipmentModGenerator( var chosenArmorPlateLevelString = _weightedRandomHelper.GetWeightedValue(plateWeights); // Convert the array of ids into database items - var platesFromDb = existingPlateTplPool.Select(plateTpl => _itemHelper.GetItem(plateTpl).Value); + var platesFromDb = existingPlateTplPool.Select(plateTpl => + _itemHelper.GetItem(plateTpl).Value + ); // Filter plates to the chosen level based on its armorClass property - var platesOfDesiredLevel = platesFromDb.Where(item => item.Properties.ArmorClass.Value == double.Parse(chosenArmorPlateLevelString, CultureInfo.InvariantCulture)); + var platesOfDesiredLevel = platesFromDb.Where(item => + item.Properties.ArmorClass.Value + == double.Parse(chosenArmorPlateLevelString, CultureInfo.InvariantCulture) + ); if (platesOfDesiredLevel.Any()) { // Plates found @@ -337,7 +391,9 @@ public class BotEquipmentModGenerator( findCompatiblePlateAttempts++; - platesOfDesiredLevel = platesFromDb.Where(item => item.Properties.ArmorClass == chosenArmorPlateLevelDouble); + platesOfDesiredLevel = platesFromDb.Where(item => + item.Properties.ArmorClass == chosenArmorPlateLevelDouble + ); // Valid plates found, exit if (platesOfDesiredLevel.Any()) { @@ -398,7 +454,8 @@ public class BotEquipmentModGenerator( /// MinMax of armorClass from plate pool protected static MinMax GetMinMaxArmorPlateClass(List platePool) { - platePool.Sort((x, y) => + platePool.Sort( + (x, y) => { if (x.Properties.ArmorClass < y.Properties.ArmorClass) { @@ -417,7 +474,7 @@ public class BotEquipmentModGenerator( return new MinMax { Min = platePool[0].Properties.ArmorClass.Value, - Max = platePool[platePool.Count - 1].Properties.ArmorClass.Value + Max = platePool[platePool.Count - 1].Properties.ArmorClass.Value, }; } @@ -429,7 +486,9 @@ public class BotEquipmentModGenerator( /// Tpl of plate protected string? GetDefaultPlateTpl(TemplateItem armorItem, string modSlot) { - var relatedItemDbModSlot = armorItem.Properties.Slots?.FirstOrDefault(slot => string.Equals(slot.Name, modSlot, StringComparison.OrdinalIgnoreCase)); + var relatedItemDbModSlot = armorItem.Properties.Slots?.FirstOrDefault(slot => + string.Equals(slot.Name, modSlot, StringComparison.OrdinalIgnoreCase) + ); return relatedItemDbModSlot?.Props?.Filters.FirstOrDefault()?.Plate; } @@ -445,7 +504,8 @@ public class BotEquipmentModGenerator( var defaultPreset = _presetHelper.GetDefaultPreset(armorItemTpl); return defaultPreset?.Items?.FirstOrDefault(item => - string.Equals(item.SlotId, modSlot, StringComparison.OrdinalIgnoreCase)); + string.Equals(item.SlotId, modSlot, StringComparison.OrdinalIgnoreCase) + ); } /// @@ -465,7 +525,7 @@ public class BotEquipmentModGenerator( { weaponName = request.ParentTemplate.Name, weaponId = request.ParentTemplate.Id, - botRole = request.BotData.Role + botRole = request.BotData.Role, } ) ); @@ -486,10 +546,16 @@ public class BotEquipmentModGenerator( var botWeaponSightWhitelist = _botEquipmentFilterService.GetBotWeaponSightWhitelist( request.BotData.EquipmentRole ); - var randomisationSettings = _botHelper.GetBotRandomizationDetails(request.BotData.Level ?? 0, botEquipConfig); + var randomisationSettings = _botHelper.GetBotRandomizationDetails( + request.BotData.Level ?? 0, + botEquipConfig + ); // Iterate over mod pool and choose mods to attach - var sortedModKeys = SortModKeys(compatibleModsPool.Keys.ToHashSet(), request.ParentTemplate.Id); + var sortedModKeys = SortModKeys( + compatibleModsPool.Keys.ToHashSet(), + request.ParentTemplate.Id + ); foreach (var modSlot in sortedModKeys) { // Check weapon has slot for mod to fit in @@ -504,7 +570,7 @@ public class BotEquipmentModGenerator( modSlot, weaponId = request.ParentTemplate.Id, weaponName = request.ParentTemplate.Name, - botRole = request.BotData.Role + botRole = request.BotData.Role, } ) ); @@ -513,7 +579,10 @@ public class BotEquipmentModGenerator( } // If the parent is a UBGL, the patron_in_weapon will be generated later - so skip it for now - if (modSlot == "patron_in_weapon" && _itemHelper.IsOfBaseclass(request.ParentTemplate.Id, BaseClasses.UBGL)) + if ( + modSlot == "patron_in_weapon" + && _itemHelper.IsOfBaseclass(request.ParentTemplate.Id, BaseClasses.UBGL) + ) { continue; } @@ -530,7 +599,8 @@ public class BotEquipmentModGenerator( continue; } - var isRandomisableSlot = randomisationSettings?.RandomisedWeaponModSlots?.Contains(modSlot) ?? false; + var isRandomisableSlot = + randomisationSettings?.RandomisedWeaponModSlots?.Contains(modSlot) ?? false; ModToSpawnRequest modToSpawnRequest = new() { ModSlot = modSlot, @@ -545,7 +615,7 @@ public class BotEquipmentModGenerator( ModSpawnResult = modSpawnResult, WeaponStats = request.WeaponStats, ConflictingItemTpls = request.ConflictingItemTpls, - BotData = request.BotData + BotData = request.BotData, }; var modToAdd = ChooseModToPutIntoSlot(modToSpawnRequest); @@ -555,7 +625,15 @@ public class BotEquipmentModGenerator( continue; } - if (!IsModValidForSlot(modToAdd, modsParentSlot, modSlot, request.ParentTemplate, request.BotData.Role)) + if ( + !IsModValidForSlot( + modToAdd, + modsParentSlot, + modSlot, + request.ParentTemplate, + request.BotData.Role + ) + ) { continue; } @@ -579,12 +657,19 @@ public class BotEquipmentModGenerator( if (ModSlotCanHoldScope(modSlot, modToAddTemplate.Value.Parent)) { // mod_mount was picked to be added to weapon, force scope chance to ensure its filled - List scopeSlots = ["mod_scope", "mod_scope_000", "mod_scope_001", "mod_scope_002", "mod_scope_003"]; + List scopeSlots = + [ + "mod_scope", + "mod_scope_000", + "mod_scope_001", + "mod_scope_002", + "mod_scope_003", + ]; AdjustSlotSpawnChances(request.ModSpawnChances, scopeSlots, 100); // Hydrate pool of mods that fit into mount as its a randomisable slot if (isRandomisableSlot) - // Add scope mods to modPool dictionary to ensure the mount has a scope in the pool to pick + // Add scope mods to modPool dictionary to ensure the mount has a scope in the pool to pick { AddCompatibleModsForProvidedMod( "mod_scope", @@ -613,11 +698,11 @@ public class BotEquipmentModGenerator( // Handguard mod can take a sub handguard mod + weapon has no UBGL (takes same slot) // Force spawn chance to be 100% to ensure it gets added if ( - modSlot == "mod_handguard" && - modToAddTemplate.Value.Properties.Slots.Any(slot => slot.Name == "mod_handguard") && - !request.Weapon.Any(item => item.SlotId == "mod_launcher") - ) - // Needed for handguards with lower + modSlot == "mod_handguard" + && modToAddTemplate.Value.Properties.Slots.Any(slot => slot.Name == "mod_handguard") + && !request.Weapon.Any(item => item.SlotId == "mod_launcher") + ) + // Needed for handguards with lower { request.ModSpawnChances["mod_handguard"] = 100; } @@ -627,7 +712,13 @@ public class BotEquipmentModGenerator( if (ShouldForceSubStockSlots(modSlot, botEquipConfig, modToAddTemplate.Value)) { // Stock mod can take additional stocks, could be a locking device, force 100% chance - List subStockSlots = ["mod_stock", "mod_stock_000", "mod_stock_001", "mod_stock_akms"]; + List subStockSlots = + [ + "mod_stock", + "mod_stock_000", + "mod_stock_001", + "mod_stock_akms", + ]; AdjustSlotSpawnChances(request.ModSpawnChances, subStockSlots, 100); } @@ -643,7 +734,10 @@ public class BotEquipmentModGenerator( request.WeaponStats.HasRearIronSight = true; } } - else if (!(request.WeaponStats.HasOptic ?? false) && _itemHelper.IsOfBaseclass(modToAddTemplate.Value.Id, BaseClasses.SIGHTS)) + else if ( + !(request.WeaponStats.HasOptic ?? false) + && _itemHelper.IsOfBaseclass(modToAddTemplate.Value.Id, BaseClasses.SIGHTS) + ) { request.WeaponStats.HasOptic = true; } @@ -682,9 +776,15 @@ public class BotEquipmentModGenerator( // Sometimes randomised slots are missing sub-mods, if so, get values from mod pool service // Check for a randomisable slot + without data in modPool + item being added as additional slots - if (isRandomisableSlot && !containsModInPool && modToAddTemplate.Value.Properties.Slots.Any()) + if ( + isRandomisableSlot + && !containsModInPool + && modToAddTemplate.Value.Properties.Slots.Any() + ) { - var modFromService = _botEquipmentModPoolService.GetModsForWeaponSlot(modToAddTemplate.Value.Id); + var modFromService = _botEquipmentModPoolService.GetModsForWeaponSlot( + modToAddTemplate.Value.Id + ); if (modFromService?.Count > 0) { request.ModPool[modToAddTemplate.Value.Id] = modFromService.ToDictionary(); @@ -696,7 +796,9 @@ public class BotEquipmentModGenerator( if (!containsModInPool && !isRandomisableSlot) { // Check for required mods the item we've added needs to be classified as 'valid' - var modFromService = _botEquipmentModPoolService.GetRequiredModsForWeaponSlot(modToAddTemplate.Value.Id); + var modFromService = _botEquipmentModPoolService.GetRequiredModsForWeaponSlot( + modToAddTemplate.Value.Id + ); if (modFromService?.Count > 0) { request.ModPool[modToAddTemplate.Value.Id] = modFromService; @@ -718,11 +820,11 @@ public class BotEquipmentModGenerator( { Role = request.BotData.Role, Level = request.BotData.Level, - EquipmentRole = request.BotData.EquipmentRole + EquipmentRole = request.BotData.EquipmentRole, }, ModLimits = request.ModLimits, WeaponStats = request.WeaponStats, - ConflictingItemTpls = request.ConflictingItemTpls + ConflictingItemTpls = request.ConflictingItemTpls, }; // Call self recursively to add mods to this mod GenerateModsForWeapon(sessionId, recursiveRequestData); @@ -741,8 +843,8 @@ public class BotEquipmentModGenerator( protected bool ItemLacksSlotsCartridgesAndChambers(TemplateItem item) { return item.Properties.Slots?.Count == 0 - && item.Properties.Cartridges?.Count == 0 - && item.Properties.Chambers?.Count == 0; + && item.Properties.Cartridges?.Count == 0 + && item.Properties.Chambers?.Count == 0; } /// @@ -752,12 +854,17 @@ public class BotEquipmentModGenerator( /// Bots equipment config/chance values /// Mod being added to bots weapon /// True if it should - public bool ShouldForceSubStockSlots(string modSlot, EquipmentFilters botEquipConfig, TemplateItem modToAddTemplate) + public bool ShouldForceSubStockSlots( + string modSlot, + EquipmentFilters botEquipConfig, + TemplateItem modToAddTemplate + ) { // Can the stock hold child items var hasSubSlots = modToAddTemplate.Properties.Slots?.Count > 0; - return (_stockSlots.Contains(modSlot) && hasSubSlots) || botEquipConfig.ForceStock.GetValueOrDefault(false); + return (_stockSlots.Contains(modSlot) && hasSubSlots) + || botEquipConfig.ForceStock.GetValueOrDefault(false); } /// @@ -770,7 +877,7 @@ public class BotEquipmentModGenerator( { // Gas block /w front sight is special case, deem it a 'front sight' too if (modSlot == "mod_gas_block" && tpl == "5ae30e795acfc408fb139a0b") - // M4A1 front sight with gas block + // M4A1 front sight with gas block { return true; } @@ -795,7 +902,11 @@ public class BotEquipmentModGenerator( /// Chance dictionary to update /// /// - public void AdjustSlotSpawnChances(Dictionary? modSpawnChances, List? modSlotsToAdjust, double newChancePercent) + public void AdjustSlotSpawnChances( + Dictionary? modSpawnChances, + List? modSlotsToAdjust, + double newChancePercent + ) { if (modSpawnChances is null) { @@ -834,7 +945,10 @@ public class BotEquipmentModGenerator( /// Array of mod slot strings to sort /// The Tpl of the item with mod keys being sorted /// Sorted array - public HashSet SortModKeys(HashSet unsortedSlotKeys, string itemTplWithKeysToSort) + public HashSet SortModKeys( + HashSet unsortedSlotKeys, + string itemTplWithKeysToSort + ) { // No need to sort with only 1 item in array if (unsortedSlotKeys.Count <= 1) @@ -953,11 +1067,17 @@ public class BotEquipmentModGenerator( case "patron_in_weapon": case "patron_in_weapon_000": case "patron_in_weapon_001": - return parentTemplate?.Properties?.Chambers?.FirstOrDefault(chamber => chamber.Name.Contains(modSlotLower, StringComparison.OrdinalIgnoreCase)); + return parentTemplate?.Properties?.Chambers?.FirstOrDefault(chamber => + chamber.Name.Contains(modSlotLower, StringComparison.OrdinalIgnoreCase) + ); case "cartridges": - return parentTemplate?.Properties?.Cartridges?.FirstOrDefault(c => string.Equals(c.Name, modSlotLower, StringComparison.OrdinalIgnoreCase)); + return parentTemplate?.Properties?.Cartridges?.FirstOrDefault(c => + string.Equals(c.Name, modSlotLower, StringComparison.OrdinalIgnoreCase) + ); default: - return parentTemplate?.Properties?.Slots?.FirstOrDefault(s => string.Equals(s.Name, modSlotLower, StringComparison.OrdinalIgnoreCase)); + return parentTemplate?.Properties?.Slots?.FirstOrDefault(s => + string.Equals(s.Name, modSlotLower, StringComparison.OrdinalIgnoreCase) + ); } } @@ -969,18 +1089,31 @@ public class BotEquipmentModGenerator( /// Chances for various mod spawns /// Various config settings for generating this type of bot /// ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped - public ModSpawn ShouldModBeSpawned(Slot itemSlot, string modSlotName, Dictionary modSpawnChances, EquipmentFilters botEquipConfig) + public ModSpawn ShouldModBeSpawned( + Slot itemSlot, + string modSlotName, + Dictionary modSpawnChances, + EquipmentFilters botEquipConfig + ) { var slotRequired = itemSlot.Required; if (GetAmmoContainers().Contains(modSlotName)) - // Always force mags/cartridges in weapon to spawn + // Always force mags/cartridges in weapon to spawn { return ModSpawn.SPAWN; } - var spawnMod = _probabilityHelper.RollChance(modSpawnChances.GetValueOrDefault(modSlotName.ToLower())); - if (!spawnMod && (slotRequired.GetValueOrDefault(false) || (botEquipConfig.WeaponSlotIdsToMakeRequired?.Contains(modSlotName) ?? false))) - // Edge case: Mod is required but spawn chance roll failed, choose default mod spawn for slot + var spawnMod = _probabilityHelper.RollChance( + modSpawnChances.GetValueOrDefault(modSlotName.ToLower()) + ); + if ( + !spawnMod + && ( + slotRequired.GetValueOrDefault(false) + || (botEquipConfig.WeaponSlotIdsToMakeRequired?.Contains(modSlotName) ?? false) + ) + ) + // Edge case: Mod is required but spawn chance roll failed, choose default mod spawn for slot { return ModSpawn.DEFAULT_MOD; } @@ -996,7 +1129,9 @@ public class BotEquipmentModGenerator( public KeyValuePair? ChooseModToPutIntoSlot(ModToSpawnRequest request) { // Slot mod will fill - var parentSlot = request.ParentTemplate.Properties.Slots?.FirstOrDefault(i => i.Name == request.ModSlot); + var parentSlot = request.ParentTemplate.Properties.Slots?.FirstOrDefault(i => + i.Name == request.ModSlot + ); var weaponTemplate = _itemHelper.GetItem(request.Weapon[0].Template).Value; // It's ammo, use predefined ammo parameter @@ -1012,7 +1147,9 @@ public class BotEquipmentModGenerator( // Nothing in mod pool + item not required if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Mod pool for optional slot: {request.ModSlot} on item: {request.ParentTemplate.Name} was empty, skipping mod"); + _logger.Debug( + $"Mod pool for optional slot: {request.ModSlot} on item: {request.ParentTemplate.Name} was empty, skipping mod" + ); } return null; @@ -1020,11 +1157,15 @@ public class BotEquipmentModGenerator( // Filter out non-whitelisted scopes, use the full mod pool if filtered pool would have no elements if (request.ModSlot.Contains("mod_scope") && request.BotWeaponSightWhitelist is not null) - // scope pool has more than one scope + // scope pool has more than one scope { if (modPool.Count > 1) { - modPool = FilterSightsByWeaponType(request.Weapon[0], modPool, request.BotWeaponSightWhitelist); + modPool = FilterSightsByWeaponType( + request.Weapon[0], + modPool, + request.BotWeaponSightWhitelist + ); } } @@ -1044,7 +1185,8 @@ public class BotEquipmentModGenerator( else if ((request.WeaponStats?.HasRearIronSight ?? false) && modPool.Count > 1) { // Attempt to limit modpool to high profile gas blocks when weapon has rear iron sight + no front iron sight - var onlyHighProfileGasBlocks = modPool.Where(tpl => !_botConfig.LowProfileGasBlockTpls.Contains(tpl) + var onlyHighProfileGasBlocks = modPool.Where(tpl => + !_botConfig.LowProfileGasBlockTpls.Contains(tpl) ); if (onlyHighProfileGasBlocks.Any()) { @@ -1055,9 +1197,9 @@ public class BotEquipmentModGenerator( // Check if weapon has min magazine size limit if ( - request?.ModSlot == "mod_magazine" && - (request?.IsRandomisableSlot ?? false) && - request.RandomisationSettings.MinimumMagazineSize is not null + request?.ModSlot == "mod_magazine" + && (request?.IsRandomisableSlot ?? false) + && request.RandomisationSettings.MinimumMagazineSize is not null ) { modPool = GetFilteredMagazinePoolByCapacity(request, modPool).ToHashSet(); @@ -1072,30 +1214,51 @@ public class BotEquipmentModGenerator( request.Weapon, request.ModSlot ); - if (chosenModResult.SlotBlocked.GetValueOrDefault(false) && !parentSlot.Required.GetValueOrDefault(false)) - // Don't bother trying to fit mod, slot is completely blocked + if ( + chosenModResult.SlotBlocked.GetValueOrDefault(false) + && !parentSlot.Required.GetValueOrDefault(false) + ) + // Don't bother trying to fit mod, slot is completely blocked { return null; } // Log if mod chosen was incompatible - if (chosenModResult.Incompatible.GetValueOrDefault(false) && !parentSlot.Required.GetValueOrDefault(false)) + if ( + chosenModResult.Incompatible.GetValueOrDefault(false) + && !parentSlot.Required.GetValueOrDefault(false) + ) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to find compatible mod of type: {parentSlot.Name}, in slot: {request.ModSlot} reason: {chosenModResult.Reason}"); + _logger.Debug( + $"Unable to find compatible mod of type: {parentSlot.Name}, in slot: {request.ModSlot} reason: {chosenModResult.Reason}" + ); } } // Get random mod to attach from items db for required slots if none found above - if (!(chosenModResult.Found ?? false) && parentSlot != null && (parentSlot.Required ?? false)) + if ( + !(chosenModResult.Found ?? false) + && parentSlot != null + && (parentSlot.Required ?? false) + ) { - chosenModResult.ChosenTemplate = GetRandomModTplFromItemDb("", parentSlot, request.ModSlot, request.Weapon); + chosenModResult.ChosenTemplate = GetRandomModTplFromItemDb( + "", + parentSlot, + request.ModSlot, + request.Weapon + ); chosenModResult.Found = true; } // Compatible item not found + not required - if (!chosenModResult.Found.GetValueOrDefault(false) && parentSlot is not null && !parentSlot.Required.GetValueOrDefault(false)) + if ( + !chosenModResult.Found.GetValueOrDefault(false) + && parentSlot is not null + && !parentSlot.Required.GetValueOrDefault(false) + ) { return null; } @@ -1121,20 +1284,29 @@ public class BotEquipmentModGenerator( /// Request data /// Pool of magazine tpls to filter /// Filtered pool of magazine tpls - public IEnumerable GetFilteredMagazinePoolByCapacity(ModToSpawnRequest modSpawnRequest, HashSet modPool) + public IEnumerable GetFilteredMagazinePoolByCapacity( + ModToSpawnRequest modSpawnRequest, + HashSet modPool + ) { var weaponTpl = modSpawnRequest.Weapon.FirstOrDefault().Template; - modSpawnRequest.RandomisationSettings.MinimumMagazineSize.TryGetValue(weaponTpl, out var minMagSizeFromSettings); - var desiredMagazineTpls = modPool.Where(magTpl => - { - var magazineDb = _itemHelper.GetItem(magTpl).Value; - return magazineDb.Properties is not null && magazineDb.Properties.Cartridges.FirstOrDefault().MaxCount >= minMagSizeFromSettings; - } + modSpawnRequest.RandomisationSettings.MinimumMagazineSize.TryGetValue( + weaponTpl, + out var minMagSizeFromSettings ); + var desiredMagazineTpls = modPool.Where(magTpl => + { + var magazineDb = _itemHelper.GetItem(magTpl).Value; + return magazineDb.Properties is not null + && magazineDb.Properties.Cartridges.FirstOrDefault().MaxCount + >= minMagSizeFromSettings; + }); if (!desiredMagazineTpls.Any()) { - _logger.Warning($"Magazine size filter for: {weaponTpl} was too strict, ignoring filter"); + _logger.Warning( + $"Magazine size filter for: {weaponTpl} was too strict, ignoring filter" + ); return modPool; } @@ -1153,8 +1325,14 @@ public class BotEquipmentModGenerator( /// Array of weapon items chosen item will be added to /// Name of slot picked mod will be placed into /// Chosen weapon details - public ChooseRandomCompatibleModResult GetCompatibleWeaponModTplForSlotFromPool(ModToSpawnRequest request, HashSet modPool, Slot parentSlot, - ModSpawn? choiceTypeEnum, List weapon, string modSlotName) + public ChooseRandomCompatibleModResult GetCompatibleWeaponModTplForSlotFromPool( + ModToSpawnRequest request, + HashSet modPool, + Slot parentSlot, + ModSpawn? choiceTypeEnum, + List weapon, + string modSlotName + ) { // Filter out incompatible mods from pool var preFilteredModPool = GetFilteredModPool(modPool, request.ConflictingItemTpls); @@ -1164,19 +1342,22 @@ public class BotEquipmentModGenerator( { Incompatible = true, Found = false, - Reason = $"Unable to add mod to {choiceTypeEnum.ToString()} slot: {modSlotName}. All: {modPool.Count} had conflicts" + Reason = + $"Unable to add mod to {choiceTypeEnum.ToString()} slot: {modSlotName}. All: {modPool.Count} had conflicts", }; } // Filter modpool to only items that appear in parents allowed list - preFilteredModPool = preFilteredModPool.Where(tpl => parentSlot.Props.Filters[0].Filter.Contains(tpl)).ToHashSet(); + preFilteredModPool = preFilteredModPool + .Where(tpl => parentSlot.Props.Filters[0].Filter.Contains(tpl)) + .ToHashSet(); if (preFilteredModPool.Count == 0) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = "No mods found in parents allowed list" + Reason = "No mods found in parents allowed list", }; } @@ -1189,7 +1370,11 @@ public class BotEquipmentModGenerator( /// How should the slot choice be handled - forced/normal etc /// Weapon mods at current time /// IChooseRandomCompatibleModResult - public ChooseRandomCompatibleModResult GetCompatibleModFromPool(HashSet modPool, ModSpawn? modSpawnType, List weapon) + public ChooseRandomCompatibleModResult GetCompatibleModFromPool( + HashSet modPool, + ModSpawn? modSpawnType, + List weapon + ) { // Create exhaustable pool to pick mod item from var exhaustableModPool = CreateExhaustableArray(modPool); @@ -1199,7 +1384,7 @@ public class BotEquipmentModGenerator( { Incompatible = true, Found = false, - Reason = "unknown" + Reason = "unknown", }; // Limit how many attempts to find a compatible mod can occur before giving up @@ -1211,13 +1396,13 @@ public class BotEquipmentModGenerator( chosenTpl = exhaustableModPool.GetRandomValue(); var pickedItemDetails = _itemHelper.GetItem(chosenTpl); if (!pickedItemDetails.Key) - // Not valid item, try again + // Not valid item, try again { continue; } if (pickedItemDetails.Value.Properties is null) - // no props data, try again + // no props data, try again { continue; } @@ -1234,7 +1419,8 @@ public class BotEquipmentModGenerator( // Check if existing weapon mods are incompatible with chosen item var existingItemBlockingChoice = weapon.FirstOrDefault(item => - pickedItemDetails.Value.Properties.ConflictingItems?.Contains(item.Template) ?? false + pickedItemDetails.Value.Properties.ConflictingItems?.Contains(item.Template) + ?? false ); if (existingItemBlockingChoice is not null) { @@ -1250,7 +1436,6 @@ public class BotEquipmentModGenerator( } blockedAttemptCount++; - // Not compatible - Try again ; continue; @@ -1259,7 +1444,8 @@ public class BotEquipmentModGenerator( // Edge case- Some mod combos will never work, make sure this isnt the case if (WeaponModComboIsIncompatible(weapon, chosenTpl)) { - chosenModResult.Reason = $"Chosen weapon mod: {chosenTpl} can never be compatible with existing weapon mods"; + chosenModResult.Reason = + $"Chosen weapon mod: {chosenTpl} can never be compatible with existing weapon mods"; break; } @@ -1299,7 +1485,10 @@ public class BotEquipmentModGenerator( /// /// Mods root parent (weapon/equipment) /// Array of mod tpls - public HashSet? GetModPoolForSlot(ModToSpawnRequest request, TemplateItem weaponTemplate) + public HashSet? GetModPoolForSlot( + ModToSpawnRequest request, + TemplateItem weaponTemplate + ) { // Mod is flagged as being default only, try and find it in globals if (request.ModSpawnResult == ModSpawn.DEFAULT_MOD) @@ -1309,7 +1498,11 @@ public class BotEquipmentModGenerator( if (request.IsRandomisableSlot.GetValueOrDefault(false)) { - return GetDynamicModPool(request.ParentTemplate.Id, request.ModSlot, request.BotEquipBlacklist); + return GetDynamicModPool( + request.ParentTemplate.Id, + request.ModSlot, + request.BotEquipBlacklist + ); } // Required mod is not default or randomisable, use existing pool @@ -1327,7 +1520,10 @@ public class BotEquipmentModGenerator( /// /// /// Hashset of mods keyed by slot - public HashSet GetModPoolForDefaultSlot(ModToSpawnRequest request, TemplateItem weaponTemplate) + public HashSet GetModPoolForDefaultSlot( + ModToSpawnRequest request, + TemplateItem weaponTemplate + ) { var matchingModFromPreset = GetMatchingModFromPreset(request, weaponTemplate); if (matchingModFromPreset is null) @@ -1336,7 +1532,9 @@ public class BotEquipmentModGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"{request.BotData.Role} No default: {request.ModSlot} mod found for: {weaponTemplate.Name}, using existing pool"); + _logger.Debug( + $"{request.BotData.Role} No default: {request.ModSlot} mod found for: {weaponTemplate.Name}, using existing pool" + ); } } @@ -1349,22 +1547,28 @@ public class BotEquipmentModGenerator( // You'd have a mod being picked without any sub-mods in its chain, possibly resulting in missing required mods not being added // Mod is in existing mod pool if (request.ItemModPool[request.ModSlot].Contains(matchingModFromPreset.Template)) - // Found mod on preset + it already exists in mod pool + // Found mod on preset + it already exists in mod pool { return [matchingModFromPreset.Template]; } // Get an array of items that are allowed in slot from parent item // Check the filter of the slot to ensure a chosen mod fits - var parentSlotCompatibleItems = request.ParentTemplate.Properties.Slots?.FirstOrDefault(slot => - string.Equals(slot.Name.ToLower(), request.ModSlot.ToLower(), StringComparison.Ordinal) + var parentSlotCompatibleItems = request + .ParentTemplate.Properties.Slots?.FirstOrDefault(slot => + string.Equals( + slot.Name.ToLower(), + request.ModSlot.ToLower(), + StringComparison.Ordinal + ) ) ?.Props.Filters?[0].Filter; // Mod isn't in existing pool, only add if it has no children and exists inside parent filter if ( - (parentSlotCompatibleItems?.Contains(matchingModFromPreset.Template) ?? false) && - _itemHelper.GetItem(matchingModFromPreset.Template).Value.Properties.Slots?.Count == 0 + (parentSlotCompatibleItems?.Contains(matchingModFromPreset.Template) ?? false) + && _itemHelper.GetItem(matchingModFromPreset.Template).Value.Properties.Slots?.Count + == 0 ) { // Chosen mod has no conflicts + no children + is in parent compat list @@ -1393,7 +1597,9 @@ public class BotEquipmentModGenerator( } // Last ditch, use full pool of items minus conflicts - var newListOfModsForSlot = parentSlotCompatibleItems.Where(tpl => !request.ConflictingItemTpls.Contains(tpl)); + var newListOfModsForSlot = parentSlotCompatibleItems.Where(tpl => + !request.ConflictingItemTpls.Contains(tpl) + ); if (newListOfModsForSlot.Any()) { return newListOfModsForSlot.ToHashSet(); @@ -1418,7 +1624,8 @@ public class BotEquipmentModGenerator( { var matchingPreset = GetMatchingPreset(weaponTemplate, request.ParentTemplate.Id); return matchingPreset?.Items?.FirstOrDefault(item => - string.Equals(item?.SlotId, request.ModSlot, StringComparison.OrdinalIgnoreCase)); + string.Equals(item?.SlotId, request.ModSlot, StringComparison.OrdinalIgnoreCase) + ); } /// @@ -1455,7 +1662,10 @@ public class BotEquipmentModGenerator( public bool WeaponModComboIsIncompatible(List weapon, string modTpl) { // STM-9 + AR-15 Lone Star Ion Lite handguard - if (weapon[0].Template == "60339954d62c9b14ed777c06" && modTpl == "5d4405f0a4b9361e6a4e6bd9") + if ( + weapon[0].Template == "60339954d62c9b14ed777c06" + && modTpl == "5d4405f0a4b9361e6a4e6bd9" + ) { return true; } @@ -1473,7 +1683,14 @@ public class BotEquipmentModGenerator( /// Used to add additional properties in the upd object /// The bots role mod is being created for /// Item object - public Item CreateModItem(string modId, string modTpl, string parentId, string modSlot, TemplateItem modTemplate, string botRole) + public Item CreateModItem( + string modId, + string modTpl, + string parentId, + string modSlot, + TemplateItem modTemplate, + string botRole + ) { return new Item { @@ -1481,7 +1698,7 @@ public class BotEquipmentModGenerator( Template = modTpl, ParentId = parentId, SlotId = modSlot, - Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(modTemplate, botRole) + Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(modTemplate, botRole), }; } @@ -1503,7 +1720,12 @@ public class BotEquipmentModGenerator( /// Slot to get mod to fill /// Items to ensure picked mod is compatible with /// Item tpl - public string? GetRandomModTplFromItemDb(string fallbackModTpl, Slot parentSlot, string modSlot, List items) + public string? GetRandomModTplFromItemDb( + string fallbackModTpl, + Slot parentSlot, + string modSlot, + List items + ) { // Find compatible mods and make an array of them var allowedItems = parentSlot.Props.Filters[0].Filter; @@ -1514,7 +1736,11 @@ public class BotEquipmentModGenerator( while (exhaustableModPool.HasValues()) { tmpModTpl = exhaustableModPool.GetRandomValue(); - if (!_botGeneratorHelper.IsItemIncompatibleWithCurrentItems(items, tmpModTpl, modSlot).Incompatible.GetValueOrDefault(false)) + if ( + !_botGeneratorHelper + .IsItemIncompatibleWithCurrentItems(items, tmpModTpl, modSlot) + .Incompatible.GetValueOrDefault(false) + ) { return tmpModTpl; } @@ -1533,8 +1759,13 @@ public class BotEquipmentModGenerator( /// Db template of the mods being added /// Bots wildspawntype (assault/pmcBot/exUsec etc) /// True if valid for slot - public bool IsModValidForSlot(KeyValuePair? modToAdd, Slot slotAddedToTemplate, string modSlot, TemplateItem parentTemplate, - string botRole) + public bool IsModValidForSlot( + KeyValuePair? modToAdd, + Slot slotAddedToTemplate, + string modSlot, + TemplateItem parentTemplate, + string botRole + ) { var modBeingAddedDbTemplate = modToAdd.Value; @@ -1544,11 +1775,7 @@ public class BotEquipmentModGenerator( _logger.Error( _localisationService.GetText( "bot-no_item_template_found_when_adding_mod", - new - { - modId = modBeingAddedDbTemplate.Value?.Id ?? "UNKNOWN", - modSlot - } + new { modId = modBeingAddedDbTemplate.Value?.Id ?? "UNKNOWN", modSlot } ) ); if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -1573,7 +1800,7 @@ public class BotEquipmentModGenerator( itemName = modBeingAddedDbTemplate.Value?.Name ?? "UNKNOWN", iodSlot = modSlot, parentItemName = parentTemplate.Name, - botRole + botRole, } ) ); @@ -1593,11 +1820,16 @@ public class BotEquipmentModGenerator( /// db object for modItem we get compatible mods from /// Pool of mods we are adding to /// A blacklist of items that cannot be picked - public void AddCompatibleModsForProvidedMod(string desiredSlotName, TemplateItem modTemplate, + public void AddCompatibleModsForProvidedMod( + string desiredSlotName, + TemplateItem modTemplate, IDictionary>> modPool, - EquipmentFilterDetails botEquipBlacklist) + EquipmentFilterDetails botEquipBlacklist + ) { - var desiredSlotObject = modTemplate.Properties?.Slots?.FirstOrDefault(slot => slot.Name.Contains(desiredSlotName)); + var desiredSlotObject = modTemplate.Properties?.Slots?.FirstOrDefault(slot => + slot.Name.Contains(desiredSlotName) + ); var supportedSubMods = desiredSlotObject?.Props?.Filters?.FirstOrDefault()?.Filter; if (supportedSubMods is null) @@ -1606,19 +1838,18 @@ public class BotEquipmentModGenerator( } // Filter mods - var filteredMods = FilterModsByBlacklist(supportedSubMods.ToHashSet(), botEquipBlacklist, desiredSlotName); + var filteredMods = FilterModsByBlacklist( + supportedSubMods.ToHashSet(), + botEquipBlacklist, + desiredSlotName + ); if (!filteredMods.Any()) { _logger.Warning( - _localisationService - .GetText( - "bot-unable_to_filter_mods_all_blacklisted", - new - { - slotName = desiredSlotObject.Name, - itemName = modTemplate.Name - } - ) + _localisationService.GetText( + "bot-unable_to_filter_mods_all_blacklisted", + new { slotName = desiredSlotObject.Name, itemName = modTemplate.Name } + ) ); } @@ -1634,7 +1865,11 @@ public class BotEquipmentModGenerator( /// Slot item should fit in /// Equipment that should not be picked /// Array of compatible items for that slot - public HashSet GetDynamicModPool(string parentItemId, string modSlot, EquipmentFilterDetails botEquipBlacklist) + public HashSet GetDynamicModPool( + string parentItemId, + string modSlot, + EquipmentFilterDetails botEquipBlacklist + ) { var modsFromDynamicPool = _cloner.Clone( _botEquipmentModPoolService.GetCompatibleModsForWeaponSlot(parentItemId, modSlot) @@ -1643,7 +1878,12 @@ public class BotEquipmentModGenerator( var filteredMods = FilterModsByBlacklist(modsFromDynamicPool, botEquipBlacklist, modSlot); if (!filteredMods.Any()) { - _logger.Warning(_localisationService.GetText("bot-unable_to_filter_mod_slot_all_blacklisted", modSlot)); + _logger.Warning( + _localisationService.GetText( + "bot-unable_to_filter_mod_slot_all_blacklisted", + modSlot + ) + ); return modsFromDynamicPool; } @@ -1658,7 +1898,11 @@ public class BotEquipmentModGenerator( /// Equipment blacklist /// Slot mods belong to /// Filtered array of mod tpls - public HashSet FilterModsByBlacklist(HashSet allowedMods, EquipmentFilterDetails? botEquipBlacklist, string modSlot) + public HashSet FilterModsByBlacklist( + HashSet allowedMods, + EquipmentFilterDetails? botEquipBlacklist, + string modSlot + ) { // No blacklist, nothing to filter out if (botEquipBlacklist is null) @@ -1670,7 +1914,9 @@ public class BotEquipmentModGenerator( // Get item blacklist and mod equipment blacklist as one array botEquipBlacklist.Equipment.TryGetValue(modSlot, out var equipmentBlacklistValues); - var blacklist = _itemFilterService.GetBlacklistedItems().Concat(equipmentBlacklistValues ?? []); + var blacklist = _itemFilterService + .GetBlacklistedItems() + .Concat(equipmentBlacklistValues ?? []); result = allowedMods.Where(tpl => !blacklist.Contains(tpl)).ToHashSet(); return result; @@ -1686,28 +1932,32 @@ public class BotEquipmentModGenerator( /// ModPool which should include available cartridges /// The CylinderMagazine's UID /// The CylinderMagazine's template - public void FillCamora(List items, Dictionary>> modPool, string cylinderMagParentId, - TemplateItem cylinderMagTemplate) + public void FillCamora( + List items, + Dictionary>> modPool, + string cylinderMagParentId, + TemplateItem cylinderMagTemplate + ) { if (!modPool.TryGetValue(cylinderMagTemplate.Id, out var itemModPool)) { _logger.Warning( _localisationService.GetText( "bot-unable_to_fill_camora_slot_mod_pool_empty", - new - { - weaponId = cylinderMagTemplate.Id, - weaponName = cylinderMagTemplate.Name - } + new { weaponId = cylinderMagTemplate.Id, weaponName = cylinderMagTemplate.Name } ) ); - var camoraSlots = cylinderMagTemplate.Properties.Slots.Where(slot => slot.Name.StartsWith("camora")); + var camoraSlots = cylinderMagTemplate.Properties.Slots.Where(slot => + slot.Name.StartsWith("camora") + ); // Attempt to generate camora slots for item modPool[cylinderMagTemplate.Id] = new Dictionary>(); foreach (var camora in camoraSlots) { - modPool[cylinderMagTemplate.Id][camora.Name] = camora.Props.Filters?[0].Filter.ToHashSet(); + modPool[cylinderMagTemplate.Id][camora.Name] = camora.Props.Filters?[ + 0 + ].Filter.ToHashSet(); } itemModPool = modPool[cylinderMagTemplate.Id]; @@ -1727,7 +1977,9 @@ public class BotEquipmentModGenerator( } else { - _logger.Error(_localisationService.GetText("bot-missing_cartridge_slot", cylinderMagTemplate.Id)); + _logger.Error( + _localisationService.GetText("bot-missing_cartridge_slot", cylinderMagTemplate.Id) + ); return; } @@ -1737,7 +1989,11 @@ public class BotEquipmentModGenerator( while (exhaustableModPool.HasValues()) { modTpl = exhaustableModPool.GetRandomValue(); - if (!_botGeneratorHelper.IsItemIncompatibleWithCurrentItems(items, modTpl, modSlot).Incompatible.GetValueOrDefault(false)) + if ( + !_botGeneratorHelper + .IsItemIncompatibleWithCurrentItems(items, modTpl, modSlot) + .Incompatible.GetValueOrDefault(false) + ) { found = true; break; @@ -1746,7 +2002,9 @@ public class BotEquipmentModGenerator( if (!found) { - _logger.Error(_localisationService.GetText("bot-no_compatible_camora_ammo_found", modSlot)); + _logger.Error( + _localisationService.GetText("bot-no_compatible_camora_ammo_found", modSlot) + ); return; } @@ -1761,7 +2019,7 @@ public class BotEquipmentModGenerator( Id = modId, Template = modTpl, ParentId = cylinderMagParentId, - SlotId = modSlotId + SlotId = modSlotId, } ); } @@ -1774,10 +2032,7 @@ public class BotEquipmentModGenerator( /// String array of shells for multiple camora sources public HashSet MergeCamoraPools(Dictionary> camorasWithShells) { - return camorasWithShells - .SelectMany(shellKvP => shellKvP.Value) - .Distinct() - .ToHashSet(); + return camorasWithShells.SelectMany(shellKvP => shellKvP.Value).Distinct().ToHashSet(); } /// @@ -1789,12 +2044,21 @@ public class BotEquipmentModGenerator( /// Full scope pool /// Whitelist of scope types by weapon base type /// Array of scope tpls that have been filtered to just ones allowed for that weapon type - public HashSet FilterSightsByWeaponType(Item weapon, HashSet scopes, Dictionary> botWeaponSightWhitelist) + public HashSet FilterSightsByWeaponType( + Item weapon, + HashSet scopes, + Dictionary> botWeaponSightWhitelist + ) { var weaponDetails = _itemHelper.GetItem(weapon.Template); // Return original scopes array if whitelist not found - if (!botWeaponSightWhitelist.TryGetValue(weaponDetails.Value.Parent, out var whitelistedSightTypes)) + if ( + !botWeaponSightWhitelist.TryGetValue( + weaponDetails.Value.Parent, + out var whitelistedSightTypes + ) + ) { if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -1821,7 +2085,10 @@ public class BotEquipmentModGenerator( // Edge case, what if item is a mount for a scope and not directly a scope? // Check item is mount + has child items var itemDetails = _itemHelper.GetItem(item).Value; - if (_itemHelper.IsOfBaseclass(item, BaseClasses.MOUNT) && itemDetails.Properties.Slots.Any()) + if ( + _itemHelper.IsOfBaseclass(item, BaseClasses.MOUNT) + && itemDetails.Properties.Slots.Any() + ) { // Check to see if mount has a scope slot (only include primary slot, ignore the rest like the backup sight slots) // Should only find 1 as there's currently no items with a mod_scope AND a mod_scope_000 @@ -1831,15 +2098,16 @@ public class BotEquipmentModGenerator( ); // Mods scope slot found must allow ALL whitelisted scope types OR be a mount - if (scopeSlot?.All(slot => + if ( + scopeSlot?.All(slot => slot.Props.Filters[0] .Filter.All(tpl => - _itemHelper.IsOfBaseclasses(tpl, whitelistedSightTypes) || - _itemHelper.IsOfBaseclass(tpl, BaseClasses.MOUNT) + _itemHelper.IsOfBaseclasses(tpl, whitelistedSightTypes) + || _itemHelper.IsOfBaseclass(tpl, BaseClasses.MOUNT) ) - ) ?? - false) - // Add mod to allowed list + ) ?? false + ) + // Add mod to allowed list { filteredScopesAndMods.Add(item); } @@ -1851,7 +2119,9 @@ public class BotEquipmentModGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Scope whitelist too restrictive for: {weapon.Template} {weaponDetails.Value.Name}, skipping filter"); + _logger.Debug( + $"Scope whitelist too restrictive for: {weapon.Template} {weaponDetails.Value.Name}, skipping filter" + ); } return scopes; diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs index 7fc5b5ab..7c4ac327 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs @@ -1,5 +1,5 @@ -using SPTarkov.Server.Core.Constants; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Common; using SPTarkov.Server.Core.Models.Eft.Common; @@ -16,7 +16,6 @@ using BodyPart = SPTarkov.Server.Core.Models.Eft.Common.Tables.BodyPart; using BodyParts = SPTarkov.Server.Core.Constants.BodyParts; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Generators; [Injectable] @@ -50,7 +49,13 @@ public class BotGenerator( /// base bot template to use (e.g. assault/pmcbot) /// profile of player generating pscav /// BotBase - public PmcData GeneratePlayerScav(string sessionId, string role, string difficulty, BotType botTemplate, PmcData profile) + public PmcData GeneratePlayerScav( + string sessionId, + string role, + string difficulty, + BotType botTemplate, + PmcData profile + ) { var bot = GetCloneOfBotBase(); bot.Info.Settings.BotDifficulty = difficulty; @@ -66,7 +71,7 @@ public class BotGenerator( BotRelativeLevelDeltaMin = 0, BotCountToGenerate = 1, BotDifficulty = difficulty, - IsPlayerScav = true + IsPlayerScav = true, }; bot = GenerateBot(sessionId, bot, botTemplate, botGenDetails); @@ -105,7 +110,7 @@ public class BotGenerator( WishList = bot.WishList, MoneyTransferLimitData = bot.MoneyTransferLimitData, IsPmc = bot.IsPmc, - Prestige = new Dictionary() + Prestige = new Dictionary(), }; } @@ -115,7 +120,10 @@ public class BotGenerator( /// Session id /// details on how to generate bots /// constructed bot - public BotBase PrepareAndGenerateBot(string sessionId, BotGenerationDetails? botGenerationDetails) + public BotBase PrepareAndGenerateBot( + string sessionId, + BotGenerationDetails? botGenerationDetails + ) { var preparedBotBase = GetPreparedBotBase( botGenerationDetails.EventRole ?? botGenerationDetails.Role, // Use eventRole if provided @@ -124,13 +132,16 @@ public class BotGenerator( ); // Get raw json data for bot (Cloned) - var botRole = botGenerationDetails.IsPmc ?? false - ? preparedBotBase.Info.Side // Use side to get usec.json or bear.json when bot will be PMC - : botGenerationDetails.Role; + var botRole = + botGenerationDetails.IsPmc ?? false + ? preparedBotBase.Info.Side // Use side to get usec.json or bear.json when bot will be PMC + : botGenerationDetails.Role; var botJsonTemplateClone = _cloner.Clone(_botHelper.GetBotTemplate(botRole)); if (botJsonTemplateClone is null) { - _logger.Error($"Unable to retrieve: {botRole} bot template, cannot generate bot of this type"); + _logger.Error( + $"Unable to retrieve: {botRole} bot template, cannot generate bot of this type" + ); } return GenerateBot(sessionId, preparedBotBase, botJsonTemplateClone, botGenerationDetails); @@ -174,7 +185,8 @@ public class BotGenerator( string sessionId, BotBase bot, BotType botJsonTemplate, - BotGenerationDetails botGenerationDetails) + BotGenerationDetails botGenerationDetails + ) { var botRoleLowercase = botGenerationDetails.Role.ToLower(); var botLevel = _botLevelGenerator.GenerateBotLevel( @@ -207,14 +219,17 @@ public class BotGenerator( : string.Empty; // Only run when generating a 'fake' playerscav, not actual player scav - if (!botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) && ShouldSimulatePlayerScav(botRoleLowercase)) + if ( + !botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) + && ShouldSimulatePlayerScav(botRoleLowercase) + ) { _botNameService.AddRandomPmcNameToBotMainProfileNicknameProperty(bot); SetRandomisedGameVersionAndCategory(bot.Info); } if (!_seasonalEventService.ChristmasEventEnabled()) - // Process all bots EXCEPT gifter, he needs christmas items + // Process all bots EXCEPT gifter, he needs christmas items { if (botGenerationDetails.Role != "gifter") { @@ -228,7 +243,12 @@ public class BotGenerator( RemoveBlacklistedLootFromBotTemplate(botJsonTemplate.BotInventory); // Remove hideout data if bot is not a PMC or pscav - match what live sends - if (!(botGenerationDetails.IsPmc.GetValueOrDefault(false) || botGenerationDetails.IsPlayerScav.GetValueOrDefault(false))) + if ( + !( + botGenerationDetails.IsPmc.GetValueOrDefault(false) + || botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) + ) + ) { bot.Hideout = null; } @@ -250,9 +270,15 @@ public class BotGenerator( botGenerationDetails.BotDifficulty, botGenerationDetails.Role ); - bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator ?? false; - bot.Info.Voice = _weightedRandomHelper.GetWeightedValue(botJsonTemplate.BotAppearance.Voice); - bot.Health = GenerateHealth(botJsonTemplate.BotHealth, botGenerationDetails.IsPlayerScav.GetValueOrDefault(false)); + bot.Info.Settings.UseSimpleAnimator = + botJsonTemplate.BotExperience.UseSimpleAnimator ?? false; + bot.Info.Voice = _weightedRandomHelper.GetWeightedValue( + botJsonTemplate.BotAppearance.Voice + ); + bot.Health = GenerateHealth( + botJsonTemplate.BotHealth, + botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) + ); bot.Skills = GenerateSkills(botJsonTemplate.BotSkills); bot.Info.PrestigeLevel = 0; @@ -308,7 +334,8 @@ public class BotGenerator( /// True if name should be simulated pscav public bool ShouldSimulatePlayerScav(string botRole) { - return botRole == Roles.Assault && _randomUtil.GetChance100(_botConfig.ChanceAssaultScavHasPlayerScavName); + return botRole == Roles.Assault + && _randomUtil.GetChance100(_botConfig.ChanceAssaultScavHasPlayerScavName); } /// @@ -318,13 +345,19 @@ public class BotGenerator( /// the killed bots difficulty /// Role of bot (optional, used for error logging) /// Experience for kill - public int GetExperienceRewardForKillByDifficulty(Dictionary> experiences, string botDifficulty, string role) + public int GetExperienceRewardForKillByDifficulty( + Dictionary> experiences, + string botDifficulty, + string role + ) { if (!experiences.TryGetValue(botDifficulty.ToLower(), out var result)) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to find experience: {botDifficulty} for {role} bot, falling back to `normal`"); + _logger.Debug( + $"Unable to find experience: {botDifficulty} for {role} bot, falling back to `normal`" + ); } return _randomUtil.GetInt(experiences["normal"].Min, experiences["normal"].Max); @@ -332,7 +365,6 @@ public class BotGenerator( // Some bots have -1/-1, shortcut result - if (result.Max == -1) { return -1; @@ -348,11 +380,17 @@ public class BotGenerator( /// Difficulty of bot to look up /// Role of bot (optional, used for error logging) /// Standing change value - public double GetStandingChangeForKillByDifficulty(Dictionary standingsForKill, string botDifficulty, string role) + public double GetStandingChangeForKillByDifficulty( + Dictionary standingsForKill, + string botDifficulty, + string role + ) { if (!standingsForKill.TryGetValue(botDifficulty.ToLower(), out var result)) { - _logger.Warning($"Unable to find standing for kill value for: {role} {botDifficulty}, falling back to `normal`"); + _logger.Warning( + $"Unable to find standing for kill value for: {role} {botDifficulty}, falling back to `normal`" + ); return standingsForKill["normal"]; } @@ -367,11 +405,17 @@ public class BotGenerator( /// Difficulty of bot to look up /// Role of bot (optional, used for error logging) /// Standing change value - public double GetAggressorBonusByDifficulty(Dictionary aggressorBonuses, string botDifficulty, string role) + public double GetAggressorBonusByDifficulty( + Dictionary aggressorBonuses, + string botDifficulty, + string role + ) { if (!aggressorBonuses.TryGetValue(botDifficulty.ToLower(), out var result)) { - _logger.Warning($"Unable to find aggressor bonus for kill value for: {role} {botDifficulty}, falling back to `normal`"); + _logger.Warning( + $"Unable to find aggressor bonus for kill value for: {role} {botDifficulty}, falling back to `normal`" + ); return aggressorBonuses["normal"]; } @@ -384,7 +428,10 @@ public class BotGenerator( /// /// Bot data to adjust /// Generation details of bot - public void FilterBlacklistedGear(BotType botJsonTemplate, BotGenerationDetails botGenerationDetails) + public void FilterBlacklistedGear( + BotType botJsonTemplate, + BotGenerationDetails botGenerationDetails + ) { var blacklist = _botEquipmentFilterService.GetBotEquipmentBlacklist( _botGeneratorHelper.GetBotEquipmentRole(botGenerationDetails.Role), @@ -392,7 +439,7 @@ public class BotGenerator( ); if (blacklist?.Gear is null) - // Nothing to filter by + // Nothing to filter by { return; } @@ -402,7 +449,7 @@ public class BotGenerator( var equipmentDict = botJsonTemplate.BotInventory.Equipment[equipmentSlot]; foreach (var blacklistedTpl in blacklistedTpls) - // Set weighting to 0, will never be picked + // Set weighting to 0, will never be picked { equipmentDict[blacklistedTpl] = 0; } @@ -433,9 +480,10 @@ public class BotGenerator( // Remove blacklisted loot from loot containers foreach (var lootContainerKey in lootContainersToFilter) { - var propInfo = props - .FirstOrDefault(x => string.Equals(x.Name, lootContainerKey, StringComparison.CurrentCultureIgnoreCase)); - var prop = (Dictionary?) propInfo.GetValue(botInventory.Items); + var propInfo = props.FirstOrDefault(x => + string.Equals(x.Name, lootContainerKey, StringComparison.CurrentCultureIgnoreCase) + ); + var prop = (Dictionary?)propInfo.GetValue(botInventory.Items); // No container, skip if (prop is null) @@ -444,9 +492,10 @@ public class BotGenerator( } var newProp = prop.Where(tpl => - { - return !_itemFilterService.IsLootableItemBlacklisted(tpl.Key); - }).ToDictionary(); + { + return !_itemFilterService.IsLootableItemBlacklisted(tpl.Key); + }) + .ToDictionary(); propInfo.SetValue(botInventory.Items, newProp); } } @@ -457,7 +506,11 @@ public class BotGenerator( /// Bot to adjust /// Appearance settings to choose from /// Generation details - public void SetBotAppearance(BotBase bot, Appearance appearance, BotGenerationDetails botGenerationDetails) + public void SetBotAppearance( + BotBase bot, + Appearance appearance, + BotGenerationDetails botGenerationDetails + ) { // Choose random values by weight bot.Customization.Head = _weightedRandomHelper.GetWeightedValue(appearance.Head); @@ -468,10 +521,13 @@ public class BotGenerator( var chosenBodyTemplate = _databaseService.GetCustomization()[bot.Customization.Body]; // Some bodies have matching hands, look up body to see if this is the case - var chosenBody = bodyGlobalDictDb.FirstOrDefault(c => c.Key == chosenBodyTemplate?.Name.Trim()); - bot.Customization.Hands = chosenBody.Value?.IsNotRandom ?? false - ? chosenBody.Value.Hands // Has fixed hands for chosen body, update to match - : _weightedRandomHelper.GetWeightedValue(appearance.Hands); // Hands can be random, choose any from weighted dict + var chosenBody = bodyGlobalDictDb.FirstOrDefault(c => + c.Key == chosenBodyTemplate?.Name.Trim() + ); + bot.Customization.Hands = + chosenBody.Value?.IsNotRandom ?? false + ? chosenBody.Value.Hands // Has fixed hands for chosen body, update to match + : _weightedRandomHelper.GetWeightedValue(appearance.Hands); // Hands can be random, choose any from weighted dict } /// @@ -491,93 +547,121 @@ public class BotGenerator( Hydration = new CurrentMinMax { Current = _randomUtil.GetDouble(healthObj.Hydration.Min, healthObj.Hydration.Max), - Maximum = healthObj.Hydration.Max + Maximum = healthObj.Hydration.Max, }, Energy = new CurrentMinMax { Current = _randomUtil.GetDouble(healthObj.Energy.Min, healthObj.Energy.Max), - Maximum = healthObj.Energy.Max + Maximum = healthObj.Energy.Max, }, Temperature = new CurrentMinMax { - Current = _randomUtil.GetDouble(healthObj.Temperature.Min, healthObj.Temperature.Max), - Maximum = healthObj.Temperature.Max + Current = _randomUtil.GetDouble( + healthObj.Temperature.Min, + healthObj.Temperature.Max + ), + Maximum = healthObj.Temperature.Max, }, BodyParts = new Dictionary { { - BodyParts.Head, new BodyPartHealth + BodyParts.Head, + new BodyPartHealth { Health = new CurrentMinMax { Current = _randomUtil.GetDouble(bodyParts.Head.Min, bodyParts.Head.Max), - Maximum = Math.Round(bodyParts.Head.Max) - } + Maximum = Math.Round(bodyParts.Head.Max), + }, } }, { - BodyParts.Chest, new BodyPartHealth + BodyParts.Chest, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.Chest.Min, bodyParts.Chest.Max), - Maximum = Math.Round(bodyParts.Chest.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.Chest.Min, + bodyParts.Chest.Max + ), + Maximum = Math.Round(bodyParts.Chest.Max), + }, } }, { - BodyParts.Stomach, new BodyPartHealth + BodyParts.Stomach, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.Stomach.Min, bodyParts.Stomach.Max), - Maximum = Math.Round(bodyParts.Stomach.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.Stomach.Min, + bodyParts.Stomach.Max + ), + Maximum = Math.Round(bodyParts.Stomach.Max), + }, } }, { - BodyParts.LeftArm, new BodyPartHealth + BodyParts.LeftArm, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.LeftArm.Min, bodyParts.LeftArm.Max), - Maximum = Math.Round(bodyParts.LeftArm.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.LeftArm.Min, + bodyParts.LeftArm.Max + ), + Maximum = Math.Round(bodyParts.LeftArm.Max), + }, } }, { - BodyParts.RightArm, new BodyPartHealth + BodyParts.RightArm, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.RightArm.Min, bodyParts.RightArm.Max), - Maximum = Math.Round(bodyParts.RightArm.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.RightArm.Min, + bodyParts.RightArm.Max + ), + Maximum = Math.Round(bodyParts.RightArm.Max), + }, } }, { - BodyParts.LeftLeg, new BodyPartHealth + BodyParts.LeftLeg, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.LeftLeg.Min, bodyParts.LeftLeg.Max), - Maximum = Math.Round(bodyParts.LeftLeg.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.LeftLeg.Min, + bodyParts.LeftLeg.Max + ), + Maximum = Math.Round(bodyParts.LeftLeg.Max), + }, } }, { - BodyParts.RightLeg, new BodyPartHealth + BodyParts.RightLeg, + new BodyPartHealth { Health = new CurrentMinMax { - Current = _randomUtil.GetDouble(bodyParts.RightLeg.Min, bodyParts.RightLeg.Max), - Maximum = Math.Round(bodyParts.RightLeg.Max) - } + Current = _randomUtil.GetDouble( + bodyParts.RightLeg.Min, + bodyParts.RightLeg.Max + ), + Maximum = Math.Round(bodyParts.RightLeg.Max), + }, } - } + }, }, UpdateTime = 0, // 0 for player-scav too - Immortal = false + Immortal = false, }; return health; @@ -602,9 +686,13 @@ public class BotGenerator( { double? hpTotal = 0; - foreach (var prop in props.Where(property => !property.Name.Equals("extensiondata", StringComparison.OrdinalIgnoreCase))) + foreach ( + var prop in props.Where(property => + !property.Name.Equals("extensiondata", StringComparison.OrdinalIgnoreCase) + ) + ) { - var value = (MinMax) prop.GetValue(bodyPart); + var value = (MinMax)prop.GetValue(bodyPart); hpTotal += value.Max; } @@ -630,7 +718,7 @@ public class BotGenerator( { Common = GetCommonSkillsWithRandomisedProgressValue(botSkills.Common), Mastering = GetMasteringSkillsWithRandomisedProgressValue(botSkills.Mastering), - Points = 0 + Points = 0, }; return skillsToReturn; @@ -641,7 +729,9 @@ public class BotGenerator( /// /// Skills to randomise /// Skills with randomised progress values as a collection - public List GetCommonSkillsWithRandomisedProgressValue(Dictionary>? skills) + public List GetCommonSkillsWithRandomisedProgressValue( + Dictionary>? skills + ) { if (skills is null) { @@ -650,23 +740,22 @@ public class BotGenerator( return skills .Select(kvp => + { + // Get skill from dict, skip if not found + var skill = kvp.Value; + if (skill == null) { - // Get skill from dict, skip if not found - var skill = kvp.Value; - if (skill == null) - { - return null; - } - - return new CommonSkill - { - Id = Enum.Parse(kvp.Key), - Progress = _randomUtil.GetDouble(skill.Min, skill.Max), - PointsEarnedDuringSession = 0, - LastAccess = 0 - }; + return null; } - ) + + return new CommonSkill + { + Id = Enum.Parse(kvp.Key), + Progress = _randomUtil.GetDouble(skill.Min, skill.Max), + PointsEarnedDuringSession = 0, + LastAccess = 0, + }; + }) .Where(baseSkill => baseSkill != null) .ToList(); } @@ -676,7 +765,9 @@ public class BotGenerator( /// /// Skills to randomise /// Skills with randomised progress values as a collection - public List GetMasteringSkillsWithRandomisedProgressValue(Dictionary>? skills) + public List GetMasteringSkillsWithRandomisedProgressValue( + Dictionary>? skills + ) { if (skills is null) { @@ -685,22 +776,21 @@ public class BotGenerator( return skills .Select(kvp => + { + // Get skill from dict, skip if not found + var skill = kvp.Value; + if (skill == null) { - // Get skill from dict, skip if not found - var skill = kvp.Value; - if (skill == null) - { - return null; - } - - // All skills have id and progress props - return new MasterySkill - { - Id = kvp.Key, - Progress = _randomUtil.GetDouble(skill.Min, skill.Max) - }; + return null; } - ) + + // All skills have id and progress props + return new MasterySkill + { + Id = kvp.Key, + Progress = _randomUtil.GetDouble(skill.Min, skill.Max), + }; + }) .Where(baseSkill => baseSkill != null) .ToList(); } @@ -716,7 +806,9 @@ public class BotGenerator( var botId = _hashUtil.Generate(); bot.Id = botId; - bot.Aid = botGenerationDetails.IsPmc.GetValueOrDefault(false) ? _hashUtil.GenerateAccountId() : 0; + bot.Aid = botGenerationDetails.IsPmc.GetValueOrDefault(false) + ? _hashUtil.GenerateAccountId() + : 0; } /// @@ -788,7 +880,9 @@ public class BotGenerator( break; default: // Everyone else gets a weighted randomised category - botInfo.MemberCategory = _weightedRandomHelper.GetWeightedValue(_pmcConfig.AccountTypeWeight); + botInfo.MemberCategory = _weightedRandomHelper.GetWeightedValue( + _pmcConfig.AccountTypeWeight + ); break; } @@ -811,10 +905,7 @@ public class BotGenerator( Template = GetDogtagTplByGameVersionAndSide(bot.Info.Side, bot.Info.GameVersion), ParentId = bot.Inventory.Equipment, SlotId = Slots.Dogtag, - Upd = new Upd - { - SpawnedInSession = true - } + Upd = new Upd { SpawnedInSession = true }, }; bot.Inventory.Items.Add(inventoryItem); diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs index 295397cd..e7e8e841 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs @@ -47,12 +47,16 @@ public class BotInventoryGenerator( EquipmentSlots.TacticalVest, EquipmentSlots.FaceCover, EquipmentSlots.Headwear, - EquipmentSlots.Earpiece + EquipmentSlots.Earpiece, ]; private readonly BotConfig _botConfig = _configServer.GetConfig(); - private readonly HashSet _slotsToCheck = [EquipmentSlots.Pockets.ToString(), EquipmentSlots.SecuredContainer.ToString()]; + private readonly HashSet _slotsToCheck = + [ + EquipmentSlots.Pockets.ToString(), + EquipmentSlots.SecuredContainer.ToString(), + ]; /// /// Add equipment/weapons/loot to bot @@ -64,7 +68,14 @@ public class BotInventoryGenerator( /// Level of bot being generated /// Game version for bot, only really applies for PMCs /// PmcInventory object with equipment/weapons/loot - public BotBaseInventory GenerateInventory(string sessionId, BotType botJsonTemplate, string botRole, bool isPmc, int botLevel, string chosenGameVersion) + public BotBaseInventory GenerateInventory( + string sessionId, + BotType botJsonTemplate, + string botRole, + bool isPmc, + int botLevel, + string chosenGameVersion + ) { var templateInventory = botJsonTemplate.BotInventory; var wornItemChances = botJsonTemplate.BotChances; @@ -74,7 +85,9 @@ public class BotInventoryGenerator( var botInventory = GenerateInventoryBase(); // Get generated raid details bot will be spawned in - var raidConfig = _profileActivityService.GetProfileActivityRaidData(sessionId)?.RaidConfiguration; + var raidConfig = _profileActivityService + .GetProfileActivityRaidData(sessionId) + ?.RaidConfiguration; GenerateAndAddEquipmentToBot( sessionId, @@ -101,7 +114,14 @@ public class BotInventoryGenerator( ); // Pick loot and add to bots containers (rig/backpack/pockets/secure) - _botLootGenerator.GenerateLoot(sessionId, botJsonTemplate, isPmc, botRole, botInventory, botLevel); + _botLootGenerator.GenerateLoot( + sessionId, + botJsonTemplate, + isPmc, + botRole, + botInventory, + botLevel + ); return botInventory; } @@ -123,36 +143,16 @@ public class BotInventoryGenerator( { Items = [ - new Item - { - Id = equipmentId, - Template = ItemTpl.INVENTORY_DEFAULT - }, - new Item - { - Id = stashId, - Template = ItemTpl.STASH_STANDARD_STASH_10X30 - }, - new Item - { - Id = questRaidItemsId, - Template = ItemTpl.STASH_QUESTRAID - }, - new Item - { - Id = questStashItemsId, - Template = ItemTpl.STASH_QUESTOFFLINE - }, - new Item - { - Id = sortingTableId, - Template = ItemTpl.SORTINGTABLE_SORTING_TABLE - }, + new Item { Id = equipmentId, Template = ItemTpl.INVENTORY_DEFAULT }, + new Item { Id = stashId, Template = ItemTpl.STASH_STANDARD_STASH_10X30 }, + new Item { Id = questRaidItemsId, Template = ItemTpl.STASH_QUESTRAID }, + new Item { Id = questStashItemsId, Template = ItemTpl.STASH_QUESTOFFLINE }, + new Item { Id = sortingTableId, Template = ItemTpl.SORTINGTABLE_SORTING_TABLE }, new Item { Id = hideoutCustomizationStashId, - Template = ItemTpl.HIDEOUTAREACONTAINER_CUSTOMIZATION - } + Template = ItemTpl.HIDEOUTAREACONTAINER_CUSTOMIZATION, + }, ], Equipment = equipmentId, Stash = stashId, @@ -162,7 +162,7 @@ public class BotInventoryGenerator( HideoutAreaStashes = new Dictionary(), FastPanel = new Dictionary(), FavoriteItems = [], - HideoutCustomizationStashId = hideoutCustomizationStashId + HideoutCustomizationStashId = hideoutCustomizationStashId, }; } @@ -177,24 +177,42 @@ public class BotInventoryGenerator( /// Level of bot /// Game version for bot, only really applies for PMCs /// RadiConfig - public void GenerateAndAddEquipmentToBot(string sessionId, BotTypeInventory templateInventory, Chances wornItemChances, string botRole, - BotBaseInventory botInventory, int botLevel, string chosenGameVersion, bool isPmc, GetRaidConfigurationRequestData? raidConfig) + public void GenerateAndAddEquipmentToBot( + string sessionId, + BotTypeInventory templateInventory, + Chances wornItemChances, + string botRole, + BotBaseInventory botInventory, + int botLevel, + string chosenGameVersion, + bool isPmc, + GetRaidConfigurationRequestData? raidConfig + ) { - _botConfig.Equipment.TryGetValue(_botGeneratorHelper.GetBotEquipmentRole(botRole), out var botEquipConfig); + _botConfig.Equipment.TryGetValue( + _botGeneratorHelper.GetBotEquipmentRole(botRole), + out var botEquipConfig + ); var randomistionDetails = _botHelper.GetBotRandomizationDetails(botLevel, botEquipConfig); // Apply nighttime changes if its nighttime + there's changes to make if ( - randomistionDetails?.NighttimeChanges is not null && - raidConfig is not null && - _weatherHelper.IsNightTime(raidConfig.TimeVariant, raidConfig.Location) + randomistionDetails?.NighttimeChanges is not null + && raidConfig is not null + && _weatherHelper.IsNightTime(raidConfig.TimeVariant, raidConfig.Location) ) { - foreach (var equipmentSlotKvP in randomistionDetails.NighttimeChanges.EquipmentModsModifiers) - // Never let mod chance go outside 0 - 100 + foreach ( + var equipmentSlotKvP in randomistionDetails.NighttimeChanges.EquipmentModsModifiers + ) + // Never let mod chance go outside 0 - 100 { randomistionDetails.EquipmentMods[equipmentSlotKvP.Key] = Math.Min( - Math.Max(randomistionDetails.EquipmentMods[equipmentSlotKvP.Key] + equipmentSlotKvP.Value, 0), + Math.Max( + randomistionDetails.EquipmentMods[equipmentSlotKvP.Key] + + equipmentSlotKvP.Value, + 0 + ), 100 ); } @@ -204,7 +222,6 @@ public class BotInventoryGenerator( var pmcProfile = _profileHelper.GetPmcProfile(sessionId); var botEquipmentRole = _botGeneratorHelper.GetBotEquipmentRole(botRole); - // Iterate over all equipment slots of bot, do it in specifc order to reduce conflicts // e.g. ArmorVest should be generated after TactivalVest // or FACE_COVER before HEADWEAR @@ -228,12 +245,12 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); } @@ -244,20 +261,24 @@ public class BotInventoryGenerator( { RootEquipmentSlot = EquipmentSlots.Pockets, // Unheard profiles have unique sized pockets - RootEquipmentPool = GetPocketPoolByGameEdition(chosenGameVersion, templateInventory, isPmc), + RootEquipmentPool = GetPocketPoolByGameEdition( + chosenGameVersion, + templateInventory, + isPmc + ), ModPool = templateInventory.Mods, SpawnChances = wornItemChances, BotData = new BotData { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, GenerateModsBlacklist = [ItemTpl.POCKETS_1X4_TUE, ItemTpl.POCKETS_LARGE], - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); @@ -272,12 +293,12 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); @@ -292,12 +313,12 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); @@ -312,12 +333,12 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); @@ -332,25 +353,25 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); // Bot has no armor vest and flagged to be forced to wear armored rig in this event if (botEquipConfig.ForceOnlyArmoredRigWhenNoArmor.GetValueOrDefault(false) && !hasArmorVest) - // Filter rigs down to only those with armor + // Filter rigs down to only those with armor { FilterRigsToThoseWithProtection(templateInventory.Equipment, botRole); } // Optimisation - Remove armored rigs from pool if (hasArmorVest) - // Filter rigs down to only those with armor + // Filter rigs down to only those with armor { FilterRigsToThoseWithoutProtection(templateInventory.Equipment, botRole); } @@ -372,12 +393,12 @@ public class BotInventoryGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, Inventory = botInventory, BotEquipmentConfig = botEquipConfig, RandomisationDetails = randomistionDetails, - GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1 + GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1, } ); } @@ -389,13 +410,14 @@ public class BotInventoryGenerator( /// /// is bot a PMC /// - protected Dictionary GetPocketPoolByGameEdition(string chosenGameVersion, BotTypeInventory templateInventory, bool isPmc) + protected Dictionary GetPocketPoolByGameEdition( + string chosenGameVersion, + BotTypeInventory templateInventory, + bool isPmc + ) { return chosenGameVersion == GameEditions.UNHEARD && isPmc - ? new Dictionary - { - [ItemTpl.POCKETS_1X4_TUE] = 1 - } + ? new Dictionary { [ItemTpl.POCKETS_1X4_TUE] = 1 } : templateInventory.Equipment.GetValueOrDefault(EquipmentSlots.Pockets); } @@ -404,7 +426,10 @@ public class BotInventoryGenerator( /// /// Equipment to filter TacticalVest of /// Role of bot vests are being filtered for - public void FilterRigsToThoseWithProtection(Dictionary> templateEquipment, string botRole) + public void FilterRigsToThoseWithProtection( + Dictionary> templateEquipment, + string botRole + ) { var tacVestsWithArmor = templateEquipment[EquipmentSlots.TacticalVest] .Where(kvp => _itemHelper.ItemHasSlots(kvp.Key)) @@ -414,7 +439,9 @@ public class BotInventoryGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to filter to only armored rigs as bot: {botRole} has none in pool"); + _logger.Debug( + $"Unable to filter to only armored rigs as bot: {botRole} has none in pool" + ); } return; @@ -429,8 +456,11 @@ public class BotInventoryGenerator( /// Equipment to filter TacticalVest by /// Role of bot vests are being filtered for /// Should the function return all rigs when 0 unarmored are found - public void FilterRigsToThoseWithoutProtection(Dictionary> templateEquipment, string botRole, - bool allowEmptyResult = true) + public void FilterRigsToThoseWithoutProtection( + Dictionary> templateEquipment, + string botRole, + bool allowEmptyResult = true + ) { var tacVestsWithoutArmor = templateEquipment[EquipmentSlots.TacticalVest] .Where(kvp => !_itemHelper.ItemHasSlots(kvp.Key)) @@ -440,7 +470,9 @@ public class BotInventoryGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to filter to only unarmored rigs as bot: {botRole} has none in pool"); + _logger.Debug( + $"Unable to filter to only unarmored rigs as bot: {botRole} has none in pool" + ); } return; @@ -458,7 +490,9 @@ public class BotInventoryGenerator( { double? spawnChance = _slotsToCheck.Contains(settings.RootEquipmentSlot.ToString()) ? 100 - : settings.SpawnChances.EquipmentChances.GetValueOrDefault(settings.RootEquipmentSlot.ToString()); + : settings.SpawnChances.EquipmentChances.GetValueOrDefault( + settings.RootEquipmentSlot.ToString() + ); if (!spawnChance.HasValue) { @@ -489,12 +523,16 @@ public class BotInventoryGenerator( return false; } - var chosenItemTpl = _weightedRandomHelper.GetWeightedValue(settings.RootEquipmentPool); + var chosenItemTpl = _weightedRandomHelper.GetWeightedValue( + settings.RootEquipmentPool + ); var dbResult = _itemHelper.GetItem(chosenItemTpl); if (!dbResult.Key) { - _logger.Error(_localisationService.GetText("bot-missing_item_template", chosenItemTpl)); + _logger.Error( + _localisationService.GetText("bot-missing_item_template", chosenItemTpl) + ); if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug($"EquipmentSlot-> {settings.RootEquipmentSlot}"); @@ -544,7 +582,10 @@ public class BotInventoryGenerator( Template = pickedItemDb.Id, ParentId = settings.Inventory.Equipment, SlotId = settings.RootEquipmentSlot.ToString(), - Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(pickedItemDb, settings.BotData.Role) + Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem( + pickedItemDb, + settings.BotData.Role + ), }; var botEquipBlacklist = _botEquipmentFilterService.GetBotEquipmentBlacklist( @@ -553,10 +594,14 @@ public class BotInventoryGenerator( ); // Edge case: Filter the armor items mod pool if bot exists in config dict + config has armor slot - if (_botConfig.Equipment.ContainsKey(settings.BotData.EquipmentRole) && - settings.RandomisationDetails?.RandomisedArmorSlots != null && - settings.RandomisationDetails.RandomisedArmorSlots.Contains(settings.RootEquipmentSlot.ToString())) - // Filter out mods from relevant blacklist + if ( + _botConfig.Equipment.ContainsKey(settings.BotData.EquipmentRole) + && settings.RandomisationDetails?.RandomisedArmorSlots != null + && settings.RandomisationDetails.RandomisedArmorSlots.Contains( + settings.RootEquipmentSlot.ToString() + ) + ) + // Filter out mods from relevant blacklist { settings.ModPool[pickedItemDb.Id] = GetFilteredDynamicModsForItem( pickedItemDb.Id, @@ -564,7 +609,9 @@ public class BotInventoryGenerator( ); } - var itemIsOnGenerateModBlacklist = settings.GenerateModsBlacklist != null && settings.GenerateModsBlacklist.Contains(pickedItemDb.Id); + var itemIsOnGenerateModBlacklist = + settings.GenerateModsBlacklist != null + && settings.GenerateModsBlacklist.Contains(pickedItemDb.Id); // Does item have slots for sub-mods to be inserted into if (pickedItemDb.Properties?.Slots?.Count > 0 && !itemIsOnGenerateModBlacklist) { @@ -595,7 +642,10 @@ public class BotInventoryGenerator( /// Item mod pool is being retrieved and filtered /// Blacklist to filter mod pool with /// Filtered pool of mods - public Dictionary> GetFilteredDynamicModsForItem(string itemTpl, Dictionary> equipmentBlacklist) + public Dictionary> GetFilteredDynamicModsForItem( + string itemTpl, + Dictionary> equipmentBlacklist + ) { var modPool = _botEquipmentModPoolService.GetModsForGearSlot(itemTpl); foreach (var modSlot in modPool) @@ -605,14 +655,16 @@ public class BotInventoryGenerator( { blacklistedMods = []; } - ; // Get mods not on blacklist - var filteredMods = modPool[modSlot.Key].Where(slotName => !blacklistedMods.Contains(slotName)); + var filteredMods = modPool[modSlot.Key] + .Where(slotName => !blacklistedMods.Contains(slotName)); if (!filteredMods.Any()) { - _logger.Warning($"Filtering {modSlot.Key} pool resulting in 0 items, skipping filter"); + _logger.Warning( + $"Filtering {modSlot.Key} pool resulting in 0 items, skipping filter" + ); continue; } @@ -633,14 +685,24 @@ public class BotInventoryGenerator( /// Is the bot being generated as a pmc /// Limits for items the bot can have /// level of bot having weapon generated - public void GenerateAndAddWeaponsToBot(BotTypeInventory templateInventory, Chances equipmentChances, string sessionId, BotBaseInventory botInventory, - string botRole, bool isPmc, Generation itemGenerationLimitsMinMax, int botLevel) + public void GenerateAndAddWeaponsToBot( + BotTypeInventory templateInventory, + Chances equipmentChances, + string sessionId, + BotBaseInventory botInventory, + string botRole, + bool isPmc, + Generation itemGenerationLimitsMinMax, + int botLevel + ) { var weaponSlotsToFill = GetDesiredWeaponsForBot(equipmentChances); foreach (var desiredWeapons in weaponSlotsToFill) - // Add weapon to bot if true and bot json has something to put into the slot + // Add weapon to bot if true and bot json has something to put into the slot { - if (desiredWeapons.ShouldSpawn && templateInventory.Equipment[desiredWeapons.Slot].Any()) + if ( + desiredWeapons.ShouldSpawn && templateInventory.Equipment[desiredWeapons.Slot].Any() + ) { AddWeaponAndMagazinesToInventory( sessionId, @@ -664,24 +726,32 @@ public class BotInventoryGenerator( /// What slots bot should have weapons generated for public List GetDesiredWeaponsForBot(Chances equipmentChances) { - var shouldSpawnPrimary = _randomUtil.GetChance100(equipmentChances.EquipmentChances["FirstPrimaryWeapon"]); + var shouldSpawnPrimary = _randomUtil.GetChance100( + equipmentChances.EquipmentChances["FirstPrimaryWeapon"] + ); return [ new DesiredWeapons { Slot = EquipmentSlots.FirstPrimaryWeapon, - ShouldSpawn = shouldSpawnPrimary + ShouldSpawn = shouldSpawnPrimary, }, new DesiredWeapons { Slot = EquipmentSlots.SecondPrimaryWeapon, - ShouldSpawn = shouldSpawnPrimary && _randomUtil.GetChance100(equipmentChances.EquipmentChances["SecondPrimaryWeapon"]) + ShouldSpawn = + shouldSpawnPrimary + && _randomUtil.GetChance100( + equipmentChances.EquipmentChances["SecondPrimaryWeapon"] + ), }, new DesiredWeapons { Slot = EquipmentSlots.Holster, - ShouldSpawn = !shouldSpawnPrimary || _randomUtil.GetChance100(equipmentChances.EquipmentChances["Holster"]) // No primary = force pistol - } + ShouldSpawn = + !shouldSpawnPrimary + || _randomUtil.GetChance100(equipmentChances.EquipmentChances["Holster"]), // No primary = force pistol + }, ]; } @@ -697,9 +767,17 @@ public class BotInventoryGenerator( /// Is the bot being generated as a pmc /// /// - public void AddWeaponAndMagazinesToInventory(string sessionId, DesiredWeapons weaponSlot, BotTypeInventory templateInventory, BotBaseInventory botInventory, - Chances equipmentChances, string botRole, - bool isPmc, Generation itemGenerationWeights, int botLevel) + public void AddWeaponAndMagazinesToInventory( + string sessionId, + DesiredWeapons weaponSlot, + BotTypeInventory templateInventory, + BotBaseInventory botInventory, + Chances equipmentChances, + string botRole, + bool isPmc, + Generation itemGenerationWeights, + int botLevel + ) { var generatedWeapon = _botWeaponGenerator.GenerateRandomWeapon( sessionId, @@ -725,15 +803,7 @@ public class BotInventoryGenerator( public class DesiredWeapons { - public EquipmentSlots Slot - { - get; - set; - } + public EquipmentSlots Slot { get; set; } - public bool ShouldSpawn - { - get; - set; - } + public bool ShouldSpawn { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotLevelGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotLevelGenerator.cs index c101f47e..f811efdd 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotLevelGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotLevelGenerator.cs @@ -24,25 +24,28 @@ public class BotLevelGenerator( /// Details to help generate a bot /// Bot the level is being generated for /// IRandomisedBotLevelResult object - public RandomisedBotLevelResult GenerateBotLevel(MinMax levelDetails, BotGenerationDetails botGenerationDetails, BotBase bot) + public RandomisedBotLevelResult GenerateBotLevel( + MinMax levelDetails, + BotGenerationDetails botGenerationDetails, + BotBase bot + ) { if (!botGenerationDetails.IsPmc.GetValueOrDefault(false)) { - return new RandomisedBotLevelResult - { - Exp = 0, - Level = 1 - }; + return new RandomisedBotLevelResult { Exp = 0, Level = 1 }; } var expTable = _databaseService.GetGlobals().Configuration.Exp.Level.ExperienceTable; - var botLevelRange = GetRelativePmcBotLevelRange(botGenerationDetails, levelDetails, expTable.Length); + var botLevelRange = GetRelativePmcBotLevelRange( + botGenerationDetails, + levelDetails, + expTable.Length + ); // Get random level based on the exp table. var exp = 0; var level = int.Parse( - ChooseBotLevel(botLevelRange.Min, botLevelRange.Max, 1, 1.15) - .ToString() + ChooseBotLevel(botLevelRange.Min, botLevelRange.Max, 1, 1.15).ToString() ); // TODO - nasty double to string to int conversion for (var i = 0; i < level; i++) { @@ -55,11 +58,7 @@ public class BotLevelGenerator( exp += _randomUtil.GetInt(0, expTable[level].Experience.Value - 1); } - return new RandomisedBotLevelResult - { - Level = level, - Exp = exp - }; + return new RandomisedBotLevelResult { Level = level, Exp = exp }; } public double ChooseBotLevel(double min, double max, int shift, double number) @@ -74,7 +73,11 @@ public class BotLevelGenerator( /// /// Max level allowed /// A MinMax of the lowest and highest level to generate the bots - public MinMax GetRelativePmcBotLevelRange(BotGenerationDetails botGenerationDetails, MinMax levelDetails, int maxAvailableLevel) + public MinMax GetRelativePmcBotLevelRange( + BotGenerationDetails botGenerationDetails, + MinMax levelDetails, + int maxAvailableLevel + ) { var levelOverride = botGenerationDetails.LocationSpecificPmcLevelOverride; @@ -93,12 +96,14 @@ public class BotLevelGenerator( // Get min level relative to player if value exists var minLevel = botGenerationDetails.PlayerLevel.HasValue - ? botGenerationDetails.PlayerLevel.Value - botGenerationDetails.BotRelativeLevelDeltaMin.Value + ? botGenerationDetails.PlayerLevel.Value + - botGenerationDetails.BotRelativeLevelDeltaMin.Value : 1 - botGenerationDetails.BotRelativeLevelDeltaMin.Value; // Get max level relative to player if value exists var maxLevel = botGenerationDetails.PlayerLevel.HasValue - ? botGenerationDetails.PlayerLevel.Value + botGenerationDetails.BotRelativeLevelDeltaMax.Value + ? botGenerationDetails.PlayerLevel.Value + + botGenerationDetails.BotRelativeLevelDeltaMax.Value : 1 + botGenerationDetails.BotRelativeLevelDeltaMin.Value; // Bound the level to the min/max possible diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs index f30401fb..19886ed4 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs @@ -54,7 +54,7 @@ public class BotLootGenerator( return new ItemSpawnLimitSettings { CurrentLimits = limitsForBotDict, - GlobalLimits = GetItemSpawnLimitsForBotType(botRole) + GlobalLimits = GetItemSpawnLimitsForBotType(botRole), }; } @@ -67,33 +67,46 @@ public class BotLootGenerator( /// Role of bot, e.g. asssult /// Inventory to add loot to /// Level of bot - public void GenerateLoot(string sessionId, BotType botJsonTemplate, bool isPmc, string botRole, BotBaseInventory botInventory, int botLevel) + public void GenerateLoot( + string sessionId, + BotType botJsonTemplate, + bool isPmc, + string botRole, + BotBaseInventory botInventory, + int botLevel + ) { // Limits on item types to be added as loot var itemCounts = botJsonTemplate.BotGeneration?.Items; if ( - itemCounts?.BackpackLoot.Weights is null || - itemCounts.PocketLoot.Weights is null || - itemCounts.VestLoot.Weights is null || - itemCounts.SpecialItems.Weights is null || - itemCounts.Healing.Weights is null || - itemCounts.Drugs.Weights is null || - itemCounts.Food.Weights is null || - itemCounts.Drink.Weights is null || - itemCounts.Currency.Weights is null || - itemCounts.Stims.Weights is null || - itemCounts.Grenades.Weights is null + itemCounts?.BackpackLoot.Weights is null + || itemCounts.PocketLoot.Weights is null + || itemCounts.VestLoot.Weights is null + || itemCounts.SpecialItems.Weights is null + || itemCounts.Healing.Weights is null + || itemCounts.Drugs.Weights is null + || itemCounts.Food.Weights is null + || itemCounts.Drink.Weights is null + || itemCounts.Currency.Weights is null + || itemCounts.Stims.Weights is null + || itemCounts.Grenades.Weights is null ) { - _logger.Warning(_localisationService.GetText("bot-unable_to_generate_bot_loot", botRole)); + _logger.Warning( + _localisationService.GetText("bot-unable_to_generate_bot_loot", botRole) + ); return; } - var backpackLootCount = _weightedRandomHelper.GetWeightedValue(itemCounts.BackpackLoot.Weights); + var backpackLootCount = _weightedRandomHelper.GetWeightedValue( + itemCounts.BackpackLoot.Weights + ); var pocketLootCount = _weightedRandomHelper.GetWeightedValue(itemCounts.PocketLoot.Weights); var vestLootCount = _weightedRandomHelper.GetWeightedValue(itemCounts.VestLoot.Weights); - var specialLootItemCount = _weightedRandomHelper.GetWeightedValue(itemCounts.SpecialItems.Weights); + var specialLootItemCount = _weightedRandomHelper.GetWeightedValue( + itemCounts.SpecialItems.Weights + ); var healingItemCount = _weightedRandomHelper.GetWeightedValue(itemCounts.Healing.Weights); var drugItemCount = _weightedRandomHelper.GetWeightedValue(itemCounts.Drugs.Weights); var foodItemCount = _weightedRandomHelper.GetWeightedValue(itemCounts.Food.Weights); @@ -127,7 +140,12 @@ public class BotLootGenerator( // Special items AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.Special, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.Special, + botJsonTemplate + ), containersBotHasAvailable, specialLootItemCount, botInventory, @@ -138,7 +156,12 @@ public class BotLootGenerator( // Healing items / Meds AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.HealingItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.HealingItems, + botJsonTemplate + ), containersBotHasAvailable, healingItemCount, botInventory, @@ -151,7 +174,12 @@ public class BotLootGenerator( // Drugs AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.DrugItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.DrugItems, + botJsonTemplate + ), containersBotHasAvailable, drugItemCount, botInventory, @@ -164,7 +192,12 @@ public class BotLootGenerator( // Food AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.FoodItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.FoodItems, + botJsonTemplate + ), containersBotHasAvailable, foodItemCount, botInventory, @@ -177,7 +210,12 @@ public class BotLootGenerator( // Drink AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.DrinkItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.DrinkItems, + botJsonTemplate + ), containersBotHasAvailable, drinkItemCount, botInventory, @@ -190,7 +228,12 @@ public class BotLootGenerator( // Currency AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.CurrencyItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.CurrencyItems, + botJsonTemplate + ), containersBotHasAvailable, currencyItemCount, botInventory, @@ -203,7 +246,12 @@ public class BotLootGenerator( // Stims AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.StimItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.StimItems, + botJsonTemplate + ), containersBotHasAvailable, stimItemCount, botInventory, @@ -216,7 +264,12 @@ public class BotLootGenerator( // Grenades AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.GrenadeItems, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.GrenadeItems, + botJsonTemplate + ), [EquipmentSlots.Pockets, EquipmentSlots.TacticalVest], // Can't use containersBotHasEquipped as we don't want grenades added to backpack grenadeCount, botInventory, @@ -270,7 +323,7 @@ public class BotLootGenerator( // TacticalVest - generate loot if they have one if (containersBotHasAvailable.Contains(EquipmentSlots.TacticalVest)) - // Vest + // Vest { AddLootFromPool( _botLootCacheService.GetLootFromCache( @@ -316,7 +369,12 @@ public class BotLootGenerator( if (!isPmc || (isPmc && _pmcConfig.AddSecureContainerLootFromBotConfig)) { AddLootFromPool( - _botLootCacheService.GetLootFromCache(botRole, isPmc, LootCacheType.Secure, botJsonTemplate), + _botLootCacheService.GetLootFromCache( + botRole, + isPmc, + LootCacheType.Secure, + botJsonTemplate + ), [EquipmentSlots.SecuredContainer], 50, botInventory, @@ -337,7 +395,8 @@ public class BotLootGenerator( return null; } - var matchingValue = _pmcConfig?.LootItemLimitsRub?.FirstOrDefault(minMaxValue => botLevel >= minMaxValue.Min && botLevel <= minMaxValue.Max + var matchingValue = _pmcConfig?.LootItemLimitsRub?.FirstOrDefault(minMaxValue => + botLevel >= minMaxValue.Min && botLevel <= minMaxValue.Max ); return matchingValue; @@ -357,7 +416,8 @@ public class BotLootGenerator( return 0; } - var matchingValue = _pmcConfig.MaxBackpackLootTotalRub.FirstOrDefault(minMaxValue => botLevel >= minMaxValue.Min && botLevel <= minMaxValue.Max + var matchingValue = _pmcConfig.MaxBackpackLootTotalRub.FirstOrDefault(minMaxValue => + botLevel >= minMaxValue.Min && botLevel <= minMaxValue.Max ); return matchingValue?.Value; } @@ -367,11 +427,17 @@ public class BotLootGenerator( /// /// Bot to check /// Array of available slots - protected HashSet GetAvailableContainersBotCanStoreItemsIn(BotBaseInventory botInventory) + protected HashSet GetAvailableContainersBotCanStoreItemsIn( + BotBaseInventory botInventory + ) { HashSet result = [EquipmentSlots.Pockets]; - if ((botInventory.Items ?? []).Any(item => item.SlotId == nameof(EquipmentSlots.TacticalVest))) + if ( + (botInventory.Items ?? []).Any(item => + item.SlotId == nameof(EquipmentSlots.TacticalVest) + ) + ) { result.Add(EquipmentSlots.TacticalVest); } @@ -393,10 +459,7 @@ public class BotLootGenerator( { // surv12 AddLootFromPool( - new Dictionary - { - { "5d02797c86f774203f38e30a", 1 } - }, + new Dictionary { { "5d02797c86f774203f38e30a", 1 } }, [EquipmentSlots.SecuredContainer], 1, botInventory, @@ -408,10 +471,7 @@ public class BotLootGenerator( // AFAK AddLootFromPool( - new Dictionary - { - { "60098ad7c2240c0fe85c570a", 1 } - }, + new Dictionary { { "60098ad7c2240c0fe85c570a", 1 } }, [EquipmentSlots.SecuredContainer], 10, botInventory, @@ -434,8 +494,7 @@ public class BotLootGenerator( /// /// Total value of loot allowed in roubles /// Is bot being generated for a pmc - protected void AddLootFromPool - ( + protected void AddLootFromPool( Dictionary pool, HashSet equipmentSlots, double totalItemCount, @@ -471,12 +530,17 @@ public class BotLootGenerator( if (!key) { - _logger.Warning($"Unable to process item tpl: {weightedItemTpl} for slots: {equipmentSlots} on bot: {botRole}"); + _logger.Warning( + $"Unable to process item tpl: {weightedItemTpl} for slots: {equipmentSlots} on bot: {botRole}" + ); continue; } - if (itemSpawnLimits is not null && ItemHasReachedSpawnLimit(itemToAddTemplate, botRole, itemSpawnLimits)) + if ( + itemSpawnLimits is not null + && ItemHasReachedSpawnLimit(itemToAddTemplate, botRole, itemSpawnLimits) + ) { // Remove item from pool to prevent it being picked again pool.Remove(weightedItemTpl); @@ -492,14 +556,19 @@ public class BotLootGenerator( { Id = newRootItemId, Template = itemToAddTemplate?.Id ?? string.Empty, - Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(itemToAddTemplate, botRole) - } + Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem( + itemToAddTemplate, + botRole + ), + }, ]; // Is Simple-Wallet / WZ wallet if (_botConfig.WalletLoot.WalletTplPool.Contains(weightedItemTpl)) { - var addCurrencyToWallet = _randomUtil.GetChance100(_botConfig.WalletLoot.ChancePercent); + var addCurrencyToWallet = _randomUtil.GetChance100( + _botConfig.WalletLoot.ChancePercent + ); if (addCurrencyToWallet) { // Create the currency items we want to add to wallet @@ -552,7 +621,9 @@ public class BotLootGenerator( // Bot has no container to put item in, exit if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to add: {totalItemCount} items to bot as it lacks a container to include them"); + _logger.Debug( + $"Unable to add: {totalItemCount} items to bot as it lacks a container to include them" + ); } break; @@ -564,9 +635,9 @@ public class BotLootGenerator( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Failed placing item: {itemToAddTemplate.Id} - {itemToAddTemplate.Name}: {i} of: {totalItemCount} items into: {botRole} " + - $"containers: {string.Join(",", equipmentSlots)}. Tried: {fitItemIntoContainerAttempts} " + - $"times, reason: {itemAddedResult}, skipping" + $"Failed placing item: {itemToAddTemplate.Id} - {itemToAddTemplate.Name}: {i} of: {totalItemCount} items into: {botRole} " + + $"containers: {string.Join(",", equipmentSlots)}. Tried: {fitItemIntoContainerAttempts} " + + $"times, reason: {itemAddedResult}, skipping" ); } @@ -609,19 +680,20 @@ public class BotLootGenerator( for (var index = 0; index < itemCount; index++) { // Choose the size of the currency stack - default is 5k, 10k, 15k, 20k, 25k - var chosenStackCount = _weightedRandomHelper.GetWeightedValue(_botConfig.WalletLoot.StackSizeWeight); + var chosenStackCount = _weightedRandomHelper.GetWeightedValue( + _botConfig.WalletLoot.StackSizeWeight + ); List items = [ new() { Id = _hashUtil.Generate(), - Template = _weightedRandomHelper.GetWeightedValue(_botConfig.WalletLoot.CurrencyWeight), + Template = _weightedRandomHelper.GetWeightedValue( + _botConfig.WalletLoot.CurrencyWeight + ), ParentId = walletId, - Upd = new Upd - { - StackObjectsCount = int.Parse(chosenStackCount) - } - } + Upd = new Upd { StackObjectsCount = int.Parse(chosenStackCount) }, + }, ]; result.Add(items); } @@ -636,7 +708,12 @@ public class BotLootGenerator( /// Item to add children to /// Is the item being generated for a pmc (affects money/ammo stack sizes) /// role bot has that owns item - public void AddRequiredChildItemsToParent(TemplateItem? itemToAddTemplate, List itemToAddChildrenTo, bool isPmc, string botRole) + public void AddRequiredChildItemsToParent( + TemplateItem? itemToAddTemplate, + List itemToAddChildrenTo, + bool isPmc, + string botRole + ) { // Fill ammo box if (_itemHelper.IsOfBaseclass(itemToAddTemplate.Id, BaseClasses.AMMO_BOX)) @@ -672,7 +749,8 @@ public class BotLootGenerator( /// are we generating for a pmc /// /// - public void AddLooseWeaponsToInventorySlot(string sessionId, + public void AddLooseWeaponsToInventorySlot( + string sessionId, BotBaseInventory botInventory, EquipmentSlots equipmentSlot, BotTypeInventory? templateInventory, @@ -680,14 +758,15 @@ public class BotLootGenerator( string botRole, bool isPmc, int botLevel, - HashSet? containersIdFull) + HashSet? containersIdFull + ) { var chosenWeaponType = _randomUtil.GetArrayValue( [ EquipmentSlots.FirstPrimaryWeapon.ToString(), EquipmentSlots.FirstPrimaryWeapon.ToString(), EquipmentSlots.FirstPrimaryWeapon.ToString(), - EquipmentSlots.Holster.ToString() + EquipmentSlots.Holster.ToString(), ] ); var randomisedWeaponCount = _randomUtil.GetInt( @@ -716,7 +795,9 @@ public class BotLootGenerator( var weaponRootItem = generatedWeapon.Weapon?.FirstOrDefault(); if (weaponRootItem is null) { - _logger.Error($"Generated loose weapon: {chosenWeaponType} for: {botRole} level: {botLevel} was null, skipping"); + _logger.Error( + $"Generated loose weapon: {chosenWeaponType} for: {botRole} level: {botLevel} was null, skipping" + ); continue; } @@ -733,7 +814,9 @@ public class BotLootGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Failed to add additional weapon: {weaponRootItem.Id} to bot backpack, reason: {result.ToString()}"); + _logger.Debug( + $"Failed to add additional weapon: {weaponRootItem.Id} to bot backpack, reason: {result.ToString()}" + ); } } } @@ -746,11 +829,15 @@ public class BotLootGenerator( /// Bot type /// /// true if item has reached spawn limit - protected bool ItemHasReachedSpawnLimit(TemplateItem? itemTemplate, string botRole, ItemSpawnLimitSettings? itemSpawnLimits) + protected bool ItemHasReachedSpawnLimit( + TemplateItem? itemTemplate, + string botRole, + ItemSpawnLimitSettings? itemSpawnLimits + ) { // PMCs and scavs have different sections of bot config for spawn limits if (itemSpawnLimits is not null && itemSpawnLimits.GlobalLimits?.Count == 0) - // No items found in spawn limit, drop out + // No items found in spawn limit, drop out { return false; } @@ -763,24 +850,24 @@ public class BotLootGenerator( var idToCheckFor = GetMatchingIdFromSpawnLimits(itemTemplate, itemSpawnLimits.GlobalLimits); if (idToCheckFor is null) - // ParentId or tplid not found in spawnLimits, not a spawn limited item, skip + // ParentId or tplid not found in spawnLimits, not a spawn limited item, skip { return false; } - // Use tryAdd to see if it exists, and automatically add 1 if (!itemSpawnLimits.CurrentLimits.TryAdd(idToCheckFor, 1)) - // if it does exist, come in here and increment - // Increment item count with this bot type + // if it does exist, come in here and increment + // Increment item count with this bot type { itemSpawnLimits.CurrentLimits[idToCheckFor]++; } - // Check if over limit var currentLimitCount = itemSpawnLimits.CurrentLimits[idToCheckFor]; - if (itemSpawnLimits.CurrentLimits[idToCheckFor] > itemSpawnLimits.GlobalLimits[idToCheckFor]) + if ( + itemSpawnLimits.CurrentLimits[idToCheckFor] > itemSpawnLimits.GlobalLimits[idToCheckFor] + ) { // Prevent edge-case of small loot pools + code trying to add limited item over and over infinitely if (currentLimitCount > currentLimitCount * 10) @@ -794,7 +881,7 @@ public class BotLootGenerator( { botRole, itemName = itemTemplate.Name, - attempts = currentLimitCount + attempts = currentLimitCount, } ) ); @@ -827,7 +914,9 @@ public class BotLootGenerator( _itemHelper.AddUpdObjectToItem(moneyItem); - moneyItem.Upd.StackObjectsCount = int.Parse(_weightedRandomHelper.GetWeightedValue(currencyWeight)); + moneyItem.Upd.StackObjectsCount = int.Parse( + _weightedRandomHelper.GetWeightedValue(currencyWeight) + ); } /// @@ -862,7 +951,12 @@ public class BotLootGenerator( return _botConfig.ItemSpawnLimits[botRole.ToLower()]; } - _logger.Warning(_localisationService.GetText("bot-unable_to_find_spawn_limits_fallback_to_defaults", botRole)); + _logger.Warning( + _localisationService.GetText( + "bot-unable_to_find_spawn_limits_fallback_to_defaults", + botRole + ) + ); return new Dictionary(); } @@ -873,7 +967,10 @@ public class BotLootGenerator( /// item we want to look for in spawn limits /// Limits to check for item /// id as string, otherwise undefined - public string? GetMatchingIdFromSpawnLimits(TemplateItem itemTemplate, Dictionary spawnLimits) + public string? GetMatchingIdFromSpawnLimits( + TemplateItem itemTemplate, + Dictionary spawnLimits + ) { if (spawnLimits.ContainsKey(itemTemplate.Id)) { diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotWeaponGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotWeaponGenerator.cs index d7abaf12..a87b2406 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotWeaponGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotWeaponGenerator.cs @@ -36,7 +36,9 @@ public class BotWeaponGenerator( { protected const string _modMagazineSlotId = "mod_magazine"; protected BotConfig _botConfig = _configServer.GetConfig(); - protected IEnumerable _inventoryMagGenComponents = MagGenSetUp(inventoryMagGenComponents); + protected IEnumerable _inventoryMagGenComponents = MagGenSetUp( + inventoryMagGenComponents + ); protected PmcConfig _pmcConfig = _configServer.GetConfig(); protected RepairConfig _repairConfig = _configServer.GetConfig(); @@ -59,8 +61,16 @@ public class BotWeaponGenerator( /// Is weapon generated for a pmc /// /// GenerateWeaponResult object - public GenerateWeaponResult GenerateRandomWeapon(string sessionId, string equipmentSlot, BotTypeInventory botTemplateInventory, string weaponParentId, - Dictionary modChances, string botRole, bool isPmc, int botLevel) + public GenerateWeaponResult GenerateRandomWeapon( + string sessionId, + string equipmentSlot, + BotTypeInventory botTemplateInventory, + string weaponParentId, + Dictionary modChances, + string botRole, + bool isPmc, + int botLevel + ) { var weaponTpl = PickWeightedWeaponTemplateFromPool(equipmentSlot, botTemplateInventory); return GenerateWeaponByTpl( @@ -82,7 +92,10 @@ public class BotWeaponGenerator( /// Primary/secondary/holster /// e.g. assault.json /// Weapon template - public string PickWeightedWeaponTemplateFromPool(string equipmentSlot, BotTypeInventory botTemplateInventory) + public string PickWeightedWeaponTemplateFromPool( + string equipmentSlot, + BotTypeInventory botTemplateInventory + ) { if (!Enum.TryParse(equipmentSlot, out EquipmentSlots key)) { @@ -106,8 +119,17 @@ public class BotWeaponGenerator( /// Is weapon being generated for a PMC. /// The level of the bot. /// GenerateWeaponResult object. - public GenerateWeaponResult? GenerateWeaponByTpl(string sessionId, string weaponTpl, string slotName, BotTypeInventory botTemplateInventory, - string weaponParentId, Dictionary modChances, string botRole, bool isPmc, int botLevel) + public GenerateWeaponResult? GenerateWeaponByTpl( + string sessionId, + string weaponTpl, + string slotName, + BotTypeInventory botTemplateInventory, + string weaponParentId, + Dictionary modChances, + string botRole, + bool isPmc, + int botLevel + ) { var modPool = botTemplateInventory.Mods; var weaponItemTemplate = _itemHelper.GetItem(weaponTpl).Value; @@ -140,7 +162,7 @@ public class BotWeaponGenerator( // Chance to add randomised weapon enhancement if (isPmc && _randomUtil.GetChance100(_pmcConfig.WeaponHasEnhancementChancePercent)) - // Add buff to weapon root + // Add buff to weapon root { _repairService.AddBuff(_repairConfig.RepairKit.Weapon, weaponWithModsArray[0]); } @@ -166,11 +188,11 @@ public class BotWeaponGenerator( { Role = botRole, Level = botLevel, - EquipmentRole = botEquipmentRole + EquipmentRole = botEquipmentRole, }, ModLimits = modLimits, WeaponStats = new WeaponStats(), - ConflictingItemTpls = new HashSet() + ConflictingItemTpls = new HashSet(), }; weaponWithModsArray = _botEquipmentModGenerator.GenerateModsForWeapon( sessionId, @@ -180,7 +202,7 @@ public class BotWeaponGenerator( // Use weapon preset from globals.json if weapon isn't valid if (!IsWeaponValid(weaponWithModsArray, botRole)) - // Weapon is bad, fall back to weapons preset + // Weapon is bad, fall back to weapons preset { weaponWithModsArray = GetPresetWeaponMods( weaponTpl, @@ -191,7 +213,9 @@ public class BotWeaponGenerator( ); } - var tempList = _cloner.Clone(weaponWithModsArray.Where(item => item.SlotId == _modMagazineSlotId)); + var tempList = _cloner.Clone( + weaponWithModsArray.Where(item => item.SlotId == _modMagazineSlotId) + ); // Fill existing magazines to full and sync ammo type foreach (var magazine in tempList) { @@ -199,11 +223,18 @@ public class BotWeaponGenerator( } // Add cartridge(s) to gun chamber(s) - if (weaponItemTemplate.Properties?.Chambers?.Count > 0 && - weaponItemTemplate.Properties.Chambers.FirstOrDefault().Props.Filters.FirstOrDefault().Filter.Contains(ammoTpl)) + if ( + weaponItemTemplate.Properties?.Chambers?.Count > 0 + && weaponItemTemplate + .Properties.Chambers.FirstOrDefault() + .Props.Filters.FirstOrDefault() + .Filter.Contains(ammoTpl) + ) { // Guns have variety of possible Chamber ids, patron_in_weapon/patron_in_weapon_000/patron_in_weapon_001 - var chamberSlotNames = weaponItemTemplate.Properties.Chambers.Select(chamberSlot => chamberSlot.Name); + var chamberSlotNames = weaponItemTemplate.Properties.Chambers.Select(chamberSlot => + chamberSlot.Name + ); AddCartridgeToChamber(weaponWithModsArray, ammoTpl, chamberSlotNames.ToList()); } @@ -228,7 +259,7 @@ public class BotWeaponGenerator( ChosenAmmoTemplate = ammoTpl, ChosenUbglAmmoTemplate = ubglAmmoTpl, WeaponMods = modPool, - WeaponTemplate = weaponItemTemplate + WeaponTemplate = weaponItemTemplate, }; } @@ -239,7 +270,11 @@ public class BotWeaponGenerator( /// Weapon and mods /// Cartridge to add to weapon /// Name of slots to create or add ammo to - protected void AddCartridgeToChamber(List weaponWithModsList, string ammoTemplate, List chamberSlotIds) + protected void AddCartridgeToChamber( + List weaponWithModsList, + string ammoTemplate, + List chamberSlotIds + ) { foreach (var slotId in chamberSlotIds) { @@ -254,10 +289,7 @@ public class BotWeaponGenerator( Template = ammoTemplate, ParentId = weaponWithModsList[0].Id, SlotId = slotId, - Upd = new Upd - { - StackObjectsCount = 1 - } + Upd = new Upd { StackObjectsCount = 1 }, } ); } @@ -265,10 +297,7 @@ public class BotWeaponGenerator( { // Already exists, update values existingItemWithSlot.Template = ammoTemplate; - existingItemWithSlot.Upd = new Upd - { - StackObjectsCount = 1 - }; + existingItemWithSlot.Upd = new Upd { StackObjectsCount = 1 }; } } } @@ -283,8 +312,13 @@ public class BotWeaponGenerator( /// Database template for weapon /// For durability values /// Base weapon item in a list - protected List ConstructWeaponBaseList(string weaponTemplate, string weaponParentId, string equipmentSlot, TemplateItem weaponItemTemplate, - string botRole) + protected List ConstructWeaponBaseList( + string weaponTemplate, + string weaponParentId, + string equipmentSlot, + TemplateItem weaponItemTemplate, + string botRole + ) { return [ @@ -294,8 +328,11 @@ public class BotWeaponGenerator( Template = weaponTemplate, ParentId = weaponParentId, SlotId = equipmentSlot, - Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(weaponItemTemplate, botRole) - } + Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem( + weaponItemTemplate, + botRole + ), + }, ]; } @@ -308,10 +345,21 @@ public class BotWeaponGenerator( /// Item template /// Bot role /// List of weapon mods - protected List GetPresetWeaponMods(string weaponTemplate, string equipmentSlot, string weaponParentId, TemplateItem itemTemplate, string botRole) + protected List GetPresetWeaponMods( + string weaponTemplate, + string equipmentSlot, + string weaponParentId, + TemplateItem itemTemplate, + string botRole + ) { // Invalid weapon generated, fallback to preset - _logger.Warning(_localisationService.GetText("bot-weapon_generated_incorrect_using_default", $"{weaponTemplate} - {itemTemplate.Name}")); + _logger.Warning( + _localisationService.GetText( + "bot-weapon_generated_incorrect_using_default", + $"{weaponTemplate} - {itemTemplate.Name}" + ) + ); List weaponMods = []; // TODO: Preset weapons trigger a lot of warnings regarding missing ammo in magazines & such @@ -331,13 +379,18 @@ public class BotWeaponGenerator( var parentItem = preset.Items[0]; parentItem.ParentId = weaponParentId; parentItem.SlotId = equipmentSlot; - parentItem.Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(itemTemplate, botRole); + parentItem.Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem( + itemTemplate, + botRole + ); preset.Items[0] = parentItem; weaponMods.AddRange(preset.Items); } else { - _logger.Error(_localisationService.GetText("bot-missing_weapon_preset", weaponTemplate)); + _logger.Error( + _localisationService.GetText("bot-missing_weapon_preset", weaponTemplate) + ); } return weaponMods; @@ -360,10 +413,16 @@ public class BotWeaponGenerator( } // Iterate over required slots in db item, check mod exists for that slot - foreach (var modSlotTemplate in modTemplate.Properties.Slots?.Where(slot => slot.Required.GetValueOrDefault(false)) ?? []) + foreach ( + var modSlotTemplate in modTemplate.Properties.Slots?.Where(slot => + slot.Required.GetValueOrDefault(false) + ) ?? [] + ) { var slotName = modSlotTemplate.Name; - var hasWeaponSlotItem = weaponItemList.Any(weaponItem => weaponItem.ParentId == mod.Id && weaponItem.SlotId == slotName); + var hasWeaponSlotItem = weaponItemList.Any(weaponItem => + weaponItem.ParentId == mod.Id && weaponItem.SlotId == slotName + ); if (!hasWeaponSlotItem) { _logger.Warning( @@ -374,7 +433,7 @@ public class BotWeaponGenerator( modSlot = modSlotTemplate.Name, modName = modTemplate.Name, slotId = mod.SlotId, - botRole + botRole, } ) ); @@ -395,16 +454,27 @@ public class BotWeaponGenerator( /// Magazine weights for count to add to inventory /// Inventory to add magazines to /// The bot type we're generating extra mags for - public void AddExtraMagazinesToInventory(GenerateWeaponResult generatedWeaponResult, GenerationData magWeights, BotBaseInventory inventory, string botRole) + public void AddExtraMagazinesToInventory( + GenerateWeaponResult generatedWeaponResult, + GenerationData magWeights, + BotBaseInventory inventory, + string botRole + ) { var weaponAndMods = generatedWeaponResult.Weapon; var weaponTemplate = generatedWeaponResult.WeaponTemplate; - var magazineTpl = GetMagazineTemplateFromWeaponTemplate(weaponAndMods, weaponTemplate, botRole); + var magazineTpl = GetMagazineTemplateFromWeaponTemplate( + weaponAndMods, + weaponTemplate, + botRole + ); var magTemplate = _itemHelper.GetItem(magazineTpl).Value; if (magTemplate is null) { - _logger.Error(_localisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl)); + _logger.Error( + _localisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl) + ); return; } @@ -414,7 +484,10 @@ public class BotWeaponGenerator( if (!ammoTemplate.Key) { _logger.Error( - _localisationService.GetText("bot-unable_to_find_ammo_item", generatedWeaponResult.ChosenAmmoTemplate) + _localisationService.GetText( + "bot-unable_to_find_ammo_item", + generatedWeaponResult.ChosenAmmoTemplate + ) ); return; @@ -434,7 +507,8 @@ public class BotWeaponGenerator( inventory ); - _inventoryMagGenComponents.FirstOrDefault(v => v.CanHandleInventoryMagGen(inventoryMagGenModel)) + _inventoryMagGenComponents + .FirstOrDefault(v => v.CanHandleInventoryMagGen(inventoryMagGenModel)) .Process(inventoryMagGenModel); // Add x stacks of bullets to SecuredContainer (bots use a magic mag packing skill to reload instantly) @@ -452,7 +526,11 @@ public class BotWeaponGenerator( /// Weapon list with mods /// Result of weapon generation /// Bot inventory to add grenades to - protected void AddUbglGrenadesToBotInventory(List weaponMods, GenerateWeaponResult generatedWeaponResult, BotBaseInventory inventory) + protected void AddUbglGrenadesToBotInventory( + List weaponMods, + GenerateWeaponResult generatedWeaponResult, + BotBaseInventory inventory + ) { // Find ubgl mod item + get details of it from db var ubglMod = weaponMods.FirstOrDefault(x => x.SlotId == "mod_launcher"); @@ -461,16 +539,14 @@ public class BotWeaponGenerator( // Define min/max of how many grenades bot will have GenerationData ubglMinMax = new() { - Weights = new Dictionary - { - { 1, 1 }, - { 2, 1 } - }, - Whitelist = new Dictionary() + Weights = new Dictionary { { 1, 1 }, { 2, 1 } }, + Whitelist = new Dictionary(), }; // get ammo template from db - var ubglAmmoDbTemplate = _itemHelper.GetItem(generatedWeaponResult.ChosenUbglAmmoTemplate).Value; + var ubglAmmoDbTemplate = _itemHelper + .GetItem(generatedWeaponResult.ChosenUbglAmmoTemplate) + .Value; // Add greandes to bot inventory var ubglAmmoGenModel = new InventoryMagGen( @@ -495,16 +571,18 @@ public class BotWeaponGenerator( /// Ammo type to add. /// Size of the ammo stack to add. /// Player inventory. - protected void AddAmmoToSecureContainer(int stackCount, string ammoTpl, int stackSize, BotBaseInventory inventory) + protected void AddAmmoToSecureContainer( + int stackCount, + string ammoTpl, + int stackSize, + BotBaseInventory inventory + ) { for (var i = 0; i < stackCount; i++) { var id = _hashUtil.Generate(); _botGeneratorHelper.AddItemWithChildrenToEquipmentSlot( - new HashSet - { - EquipmentSlots.SecuredContainer - }, + new HashSet { EquipmentSlots.SecuredContainer }, id, ammoTpl, new List @@ -513,11 +591,8 @@ public class BotWeaponGenerator( { Id = id, Template = ammoTpl, - Upd = new Upd - { - StackObjectsCount = stackSize - } - } + Upd = new Upd { StackObjectsCount = stackSize }, + }, }, inventory ); @@ -531,7 +606,11 @@ public class BotWeaponGenerator( /// Weapon to get magazine template for. /// The bot type we are getting the magazine for. /// Magazine template string. - protected string GetMagazineTemplateFromWeaponTemplate(List weaponMods, TemplateItem weaponTemplate, string botRole) + protected string GetMagazineTemplateFromWeaponTemplate( + List weaponMods, + TemplateItem weaponTemplate, + string botRole + ) { var magazine = weaponMods.FirstOrDefault(m => m.SlotId == _modMagazineSlotId); if (magazine is null) @@ -545,21 +624,19 @@ public class BotWeaponGenerator( // log error if no magazine AND not a chamber loaded weapon (e.g. shotgun revolver) if (!weaponTemplate.Properties.IsChamberLoad ?? false) - // Shouldn't happen + // Shouldn't happen { _logger.Warning( _localisationService.GetText( "bot-weapon_missing_magazine_or_chamber", - new - { - weaponId = weaponTemplate.Id, - botRole - } + new { weaponId = weaponTemplate.Id, botRole } ) ); } - var defaultMagTplId = _botWeaponGeneratorHelper.GetWeaponsDefaultMagazineTpl(weaponTemplate); + var defaultMagTplId = _botWeaponGeneratorHelper.GetWeaponsDefaultMagazineTpl( + weaponTemplate + ); if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( @@ -579,10 +656,16 @@ public class BotWeaponGenerator( /// Dictionary of all cartridges keyed by type e.g. Caliber556x45NATO /// Weapon details from database we want to pick ammo for /// Ammo template that works with the desired gun - protected string? GetWeightedCompatibleAmmo(Dictionary> cartridgePool, TemplateItem weaponTemplate) + protected string? GetWeightedCompatibleAmmo( + Dictionary> cartridgePool, + TemplateItem weaponTemplate + ) { var desiredCaliber = GetWeaponCaliber(weaponTemplate); - if (!cartridgePool.TryGetValue(desiredCaliber, out var cartridgePoolForWeapon) || cartridgePoolForWeapon?.Count == 0) + if ( + !cartridgePool.TryGetValue(desiredCaliber, out var cartridgePoolForWeapon) + || cartridgePoolForWeapon?.Count == 0 + ) { if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -593,7 +676,7 @@ public class BotWeaponGenerator( { weaponId = weaponTemplate.Id, weaponName = weaponTemplate.Name, - defaultAmmo = weaponTemplate.Properties.DefAmmo + defaultAmmo = weaponTemplate.Properties.DefAmmo, } ) ); @@ -605,9 +688,11 @@ public class BotWeaponGenerator( } // Get cartridges the weapons first chamber allow - var compatibleCartridgesInTemplate = GetCompatibleCartridgesFromWeaponTemplate(weaponTemplate); + var compatibleCartridgesInTemplate = GetCompatibleCartridgesFromWeaponTemplate( + weaponTemplate + ); if (compatibleCartridgesInTemplate.Count == 0) - // No chamber data found in weapon, send default + // No chamber data found in weapon, send default { return weaponTemplate.Properties.DefAmmo; } @@ -626,7 +711,9 @@ public class BotWeaponGenerator( if (!compatibleCartridges.Any()) { // Get cartridges from the weapons first magazine in filters - var compatibleCartridgesInMagazine = GetCompatibleCartridgesFromMagazineTemplate(weaponTemplate); + var compatibleCartridgesInMagazine = GetCompatibleCartridgesFromMagazineTemplate( + weaponTemplate + ); if (compatibleCartridgesInMagazine.Count == 0) { // No compatible cartridges found in magazine, use default @@ -634,7 +721,9 @@ public class BotWeaponGenerator( } // Get the caliber data from the first compatible round in the magazine - var magazineCaliberData = _itemHelper.GetItem(compatibleCartridgesInMagazine.FirstOrDefault()).Value.Properties.Caliber; + var magazineCaliberData = _itemHelper + .GetItem(compatibleCartridgesInMagazine.FirstOrDefault()) + .Value.Properties.Caliber; cartridgePoolForWeapon = cartridgePool[magazineCaliberData]; foreach (var cartridgeKvP in cartridgePoolForWeapon) @@ -664,7 +753,9 @@ public class BotWeaponGenerator( { ArgumentNullException.ThrowIfNull(weaponTemplate); - var cartridges = weaponTemplate.Properties?.Chambers?.FirstOrDefault()?.Props?.Filters?[0].Filter; + var cartridges = weaponTemplate + .Properties?.Chambers?.FirstOrDefault() + ?.Props?.Filters?[0].Filter; if (cartridges is not null) { return cartridges; @@ -680,26 +771,39 @@ public class BotWeaponGenerator( /// Weapon db template to get magazine cartridges for /// Hashset of cartridge tpls /// Thrown when weaponTemplate is null. - protected HashSet GetCompatibleCartridgesFromMagazineTemplate(TemplateItem weaponTemplate) + protected HashSet GetCompatibleCartridgesFromMagazineTemplate( + TemplateItem weaponTemplate + ) { ArgumentNullException.ThrowIfNull(weaponTemplate); // Get the first magazine's template from the weapon - var magazineSlot = weaponTemplate.Properties.Slots?.FirstOrDefault(slot => slot.Name == "mod_magazine"); + var magazineSlot = weaponTemplate.Properties.Slots?.FirstOrDefault(slot => + slot.Name == "mod_magazine" + ); if (magazineSlot is null) { return []; } - var magazineTemplate = _itemHelper.GetItem(magazineSlot.Props?.Filters.FirstOrDefault()?.Filter?.FirstOrDefault()); + var magazineTemplate = _itemHelper.GetItem( + magazineSlot.Props?.Filters.FirstOrDefault()?.Filter?.FirstOrDefault() + ); if (!magazineTemplate.Key) { return []; } // Try to get cartridges from slots array first, if none found, try Cartridges array - var cartridges = magazineTemplate.Value.Properties.Slots.FirstOrDefault()?.Props?.Filters.FirstOrDefault()?.Filter - ?? magazineTemplate.Value.Properties.Cartridges.FirstOrDefault()?.Props?.Filters.FirstOrDefault()?.Filter; + var cartridges = + magazineTemplate + .Value.Properties.Slots.FirstOrDefault() + ?.Props?.Filters.FirstOrDefault() + ?.Filter + ?? magazineTemplate + .Value.Properties.Cartridges.FirstOrDefault() + ?.Props?.Filters.FirstOrDefault() + ?.Filter; return cartridges ?? []; } @@ -717,7 +821,7 @@ public class BotWeaponGenerator( } if (!string.IsNullOrEmpty(weaponTemplate.Properties.AmmoCaliber)) - // 9x18pmm has a typo, should be Caliber9x18PM + // 9x18pmm has a typo, should be Caliber9x18PM { return weaponTemplate.Properties.AmmoCaliber == "Caliber9x18PMM" ? "Caliber9x18PM" @@ -729,9 +833,7 @@ public class BotWeaponGenerator( var ammoInChamber = _itemHelper.GetItem( weaponTemplate.Properties.Chambers[0].Props.Filters[0].Filter.FirstOrDefault() ); - return !ammoInChamber.Key - ? null - : ammoInChamber.Value.Properties.Caliber; + return !ammoInChamber.Key ? null : ammoInChamber.Value.Properties.Caliber; } return null; @@ -743,12 +845,18 @@ public class BotWeaponGenerator( /// Weapon with children /// Magazine item /// Cartridge to insert into magazine - protected void FillExistingMagazines(List weaponMods, Item magazine, string cartridgeTemplate) + protected void FillExistingMagazines( + List weaponMods, + Item magazine, + string cartridgeTemplate + ) { var magazineTemplate = _itemHelper.GetItem(magazine.Template).Value; if (magazineTemplate is null) { - _logger.Error(_localisationService.GetText("bot-unable_to_find_magazine_item", magazine.Template)); + _logger.Error( + _localisationService.GetText("bot-unable_to_find_magazine_item", magazine.Template) + ); return; } @@ -765,7 +873,12 @@ public class BotWeaponGenerator( } else { - AddOrUpdateMagazinesChildWithAmmo(weaponMods, magazine, cartridgeTemplate, magazineTemplate); + AddOrUpdateMagazinesChildWithAmmo( + weaponMods, + magazine, + cartridgeTemplate, + magazineTemplate + ); } } @@ -784,10 +897,7 @@ public class BotWeaponGenerator( Template = ubglAmmoTpl, ParentId = ubglMod.Id, SlotId = "patron_in_weapon", - Upd = new Upd - { - StackObjectsCount = 1 - } + Upd = new Upd { StackObjectsCount = 1 }, } ); } @@ -799,9 +909,15 @@ public class BotWeaponGenerator( /// Magazine item details we're adding cartridges to /// Cartridge to put into the magazine /// Magazines db template - protected void AddOrUpdateMagazinesChildWithAmmo(List weaponWithMods, Item magazine, string chosenAmmoTpl, TemplateItem magazineTemplate) + protected void AddOrUpdateMagazinesChildWithAmmo( + List weaponWithMods, + Item magazine, + string chosenAmmoTpl, + TemplateItem magazineTemplate + ) { - var magazineCartridgeChildItem = weaponWithMods.FirstOrDefault(m => m.ParentId == magazine.Id && m.SlotId == "cartridges" + var magazineCartridgeChildItem = weaponWithMods.FirstOrDefault(m => + m.ParentId == magazine.Id && m.SlotId == "cartridges" ); if (magazineCartridgeChildItem is not null) { @@ -813,13 +929,20 @@ public class BotWeaponGenerator( List magazineWithCartridges = [magazine]; // Add cartridges as children to above mag array - _itemHelper.FillMagazineWithCartridge(magazineWithCartridges, magazineTemplate, chosenAmmoTpl, 1); + _itemHelper.FillMagazineWithCartridge( + magazineWithCartridges, + magazineTemplate, + chosenAmmoTpl, + 1 + ); // Replace existing magazine with above array of mag + cartridge stacks var magazineIndex = weaponWithMods.FindIndex(i => i.Id == magazine.Id); // magazineWithCartridges if (magazineIndex == -1) { - _logger.Error($"Unable to add cartridges: {chosenAmmoTpl} to magazine: {magazine.Id} as none found"); + _logger.Error( + $"Unable to add cartridges: {chosenAmmoTpl} to magazine: {magazine.Id} as none found" + ); return; } @@ -842,7 +965,9 @@ public class BotWeaponGenerator( // This might not be necessary since we already filled the camoras with a random whitelisted and compatible ammo type, // but I'm not sure whether this is also used elsewhere var camoras = weaponMods - .Where(x => x.ParentId == magazineId && x.SlotId.StartsWith("camora", StringComparison.Ordinal)) + .Where(x => + x.ParentId == magazineId && x.SlotId.StartsWith("camora", StringComparison.Ordinal) + ) .ToList(); if (camoras.Count == 0) @@ -859,10 +984,7 @@ public class BotWeaponGenerator( } else { - camora.Upd = new Upd - { - StackObjectsCount = 1 - }; + camora.Upd = new Upd { StackObjectsCount = 1 }; } } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/FenceBaseAssortGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/FenceBaseAssortGenerator.cs index 46988f81..6c727213 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/FenceBaseAssortGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/FenceBaseAssortGenerator.cs @@ -60,24 +60,29 @@ public class FenceBaseAssortGenerator( // Item base type blacklisted if (traderConfig.Fence.Blacklist.Count > 0) { - if (traderConfig.Fence.Blacklist.Contains(rootItemDb.Id) || - itemHelper.IsOfBaseclasses(rootItemDb.Id, traderConfig.Fence.Blacklist) - ) + if ( + traderConfig.Fence.Blacklist.Contains(rootItemDb.Id) + || itemHelper.IsOfBaseclasses(rootItemDb.Id, traderConfig.Fence.Blacklist) + ) { continue; } } // Only allow rigs with no slots (carrier rigs) - if (itemHelper.IsOfBaseclass(rootItemDb.Id, BaseClasses.VEST) && - (rootItemDb.Properties?.Slots?.Count ?? 0) > 0 - ) + if ( + itemHelper.IsOfBaseclass(rootItemDb.Id, BaseClasses.VEST) + && (rootItemDb.Properties?.Slots?.Count ?? 0) > 0 + ) { continue; } // Skip seasonal event items when not in seasonal event - if (traderConfig.Fence.BlacklistSeasonalItems && blockedSeasonalItems.Contains(rootItemDb.Id)) + if ( + traderConfig.Fence.BlacklistSeasonalItems + && blockedSeasonalItems.Contains(rootItemDb.Id) + ) { continue; } @@ -91,11 +96,8 @@ public class FenceBaseAssortGenerator( Template = rootItemDb.Id, ParentId = "hideout", SlotId = "hideout", - Upd = new Upd - { - StackObjectsCount = 9999999 - } - } + Upd = new Upd { StackObjectsCount = 9999999 }, + }, }; // Ensure ammo is not above penetration limit value @@ -108,7 +110,7 @@ public class FenceBaseAssortGenerator( } if (itemHelper.IsOfBaseclass(rootItemDb.Id, BaseClasses.AMMO_BOX)) - // Only add cartridges to box if box has no children + // Only add cartridges to box if box has no children { if (itemWithChildrenToAdd.Count == 1) { @@ -127,12 +129,17 @@ public class FenceBaseAssortGenerator( // Create barter scheme (price) var barterSchemeToAdd = new BarterScheme { - Count = Math.Round((double) fenceService.GetItemPrice(rootItemDb.Id, itemWithChildrenToAdd)), - Template = Money.ROUBLES + Count = Math.Round( + (double)fenceService.GetItemPrice(rootItemDb.Id, itemWithChildrenToAdd) + ), + Template = Money.ROUBLES, }; // Add barter data to base - baseFenceAssort.BarterScheme[itemWithChildrenToAdd[0].Id] = [[barterSchemeToAdd]]; + baseFenceAssort.BarterScheme[itemWithChildrenToAdd[0].Id] = + [ + [barterSchemeToAdd], + ]; // Add item to base baseFenceAssort.Items.AddRange(itemWithChildrenToAdd); @@ -146,7 +153,11 @@ public class FenceBaseAssortGenerator( foreach (var defaultPreset in defaultPresets) { // Skip presets we've already added - if (baseFenceAssort.Items.Any(item => item.Upd != null && item.Upd.SptPresetId == defaultPreset.Id)) + if ( + baseFenceAssort.Items.Any(item => + item.Upd != null && item.Upd.SptPresetId == defaultPreset.Id + ) + ) { continue; } @@ -167,8 +178,7 @@ public class FenceBaseAssortGenerator( mod.Upd = new Upd { StackObjectsCount = 1, - SptPresetId = - defaultPreset.Id // Store preset id here so we can check it later to prevent preset dupes + SptPresetId = defaultPreset.Id, // Store preset id here so we can check it later to prevent preset dupes }; // Updated root item, exit loop @@ -191,9 +201,9 @@ public class FenceBaseAssortGenerator( new BarterScheme { Template = Money.ROUBLES, - Count = Math.Round(price * itemQualityModifier) - } - } + Count = Math.Round(price * itemQualityModifier), + }, + }, }; baseFenceAssort.LoyalLevelItems[itemAndChildren[0].Id] = 1; @@ -210,7 +220,12 @@ public class FenceBaseAssortGenerator( var ammoPenetrationPower = GetAmmoPenetrationPower(rootItemDb); if (ammoPenetrationPower == null) { - logger.Warning(localisationService.GetText("fence-unable_to_get_ammo_penetration_value", rootItemDb.Id)); + logger.Warning( + localisationService.GetText( + "fence-unable_to_get_ammo_penetration_value", + rootItemDb.Id + ) + ); return false; } @@ -227,13 +242,18 @@ public class FenceBaseAssortGenerator( if (itemHelper.IsOfBaseclass(rootItemDb.Id, BaseClasses.AMMO_BOX)) { // Get the cartridge tpl found inside ammo box - var cartridgeTplInBox = rootItemDb.Properties.StackSlots[0].Props.Filters[0].Filter.FirstOrDefault(); + var cartridgeTplInBox = rootItemDb + .Properties.StackSlots[0] + .Props.Filters[0] + .Filter.FirstOrDefault(); // Look up cartridge tpl in db var ammoItemDb = itemHelper.GetItem(cartridgeTplInBox); if (!ammoItemDb.Key) { - logger.Warning(localisationService.GetText("fence-ammo_not_found_in_db", cartridgeTplInBox)); + logger.Warning( + localisationService.GetText("fence-ammo_not_found_in_db", cartridgeTplInBox) + ); return null; } @@ -265,17 +285,20 @@ public class FenceBaseAssortGenerator( } // Check for and add required soft inserts to armors - var requiredSlots = itemDbDetails.Properties.Slots.Where(slot => slot.Required ?? false).ToList(); + var requiredSlots = itemDbDetails + .Properties.Slots.Where(slot => slot.Required ?? false) + .ToList(); var hasRequiredSlots = requiredSlots.Count > 0; if (hasRequiredSlots) { foreach (var requiredSlot in requiredSlots) { - var modItemDbDetails = itemHelper.GetItem(requiredSlot.Props.Filters[0].Plate).Value; - var plateTpl = - requiredSlot.Props.Filters[0].Plate; // `Plate` property appears to be the 'default' item for slot + var modItemDbDetails = itemHelper + .GetItem(requiredSlot.Props.Filters[0].Plate) + .Value; + var plateTpl = requiredSlot.Props.Filters[0].Plate; // `Plate` property appears to be the 'default' item for slot if (string.IsNullOrEmpty(plateTpl)) - // Some bsg plate properties are empty, skip mod + // Some bsg plate properties are empty, skip mod { continue; } @@ -291,9 +314,9 @@ public class FenceBaseAssortGenerator( Repairable = new UpdRepairable { Durability = modItemDbDetails.Properties.MaxDurability, - MaxDurability = modItemDbDetails.Properties.MaxDurability - } - } + MaxDurability = modItemDbDetails.Properties.MaxDurability, + }, + }, }; armor.Add(mod); @@ -301,7 +324,8 @@ public class FenceBaseAssortGenerator( } // Check for and add plate items - var plateSlots = itemDbDetails.Properties.Slots.Where(slot => itemHelper.IsRemovablePlateSlot(slot.Name)) + var plateSlots = itemDbDetails + .Properties.Slots.Where(slot => itemHelper.IsRemovablePlateSlot(slot.Name)) .ToList(); if (plateSlots.Count > 0) { @@ -309,7 +333,7 @@ public class FenceBaseAssortGenerator( { var plateTpl = plateSlot.Props.Filters[0].Plate; if (string.IsNullOrEmpty(plateTpl)) - // Bsg data lacks a default plate, skip adding mod + // Bsg data lacks a default plate, skip adding mod { continue; } @@ -327,9 +351,9 @@ public class FenceBaseAssortGenerator( Repairable = new UpdRepairable { Durability = modItemDbDetails.Properties.MaxDurability, - MaxDurability = modItemDbDetails.Properties.MaxDurability - } - } + MaxDurability = modItemDbDetails.Properties.MaxDurability, + }, + }, } ); } diff --git a/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs index 7a61e598..6db404b0 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs @@ -33,14 +33,17 @@ public class LocationLootGenerator( ) { protected readonly LocationConfig _locationConfig = _configServer.GetConfig(); - protected readonly SeasonalEventConfig _seasonalEventConfig = _configServer.GetConfig(); + protected readonly SeasonalEventConfig _seasonalEventConfig = + _configServer.GetConfig(); /// Create a list of container objects with randomised loot /// Map base to generate containers for /// Static ammo distribution /// List of container objects - public List GenerateStaticContainers(LocationBase locationBase, - Dictionary> staticAmmoDist) + public List GenerateStaticContainers( + LocationBase locationBase, + Dictionary> staticAmmoDist + ) { var staticLootItemCount = 0; var result = new List(); @@ -52,18 +55,26 @@ public class LocationLootGenerator( if (staticWeaponsOnMapClone is null) { _logger.Error( - _localisationService.GetText("location-unable_to_find_static_weapon_for_map", locationBase.Name) + _localisationService.GetText( + "location-unable_to_find_static_weapon_for_map", + locationBase.Name + ) ); } // Add mounted weapons to output loot result.AddRange(staticWeaponsOnMapClone); - var allStaticContainersOnMapClone = _cloner.Clone(mapData.StaticContainers.Value.StaticContainers); + var allStaticContainersOnMapClone = _cloner.Clone( + mapData.StaticContainers.Value.StaticContainers + ); if (allStaticContainersOnMapClone is null) { _logger.Error( - _localisationService.GetText("location-unable_to_find_static_container_for_map", locationBase.Name) + _localisationService.GetText( + "location-unable_to_find_static_container_for_map", + locationBase.Name + ) ); } @@ -82,12 +93,16 @@ public class LocationLootGenerator( // Remove christmas items from loot data if (!_seasonalEventService.ChristmasEventEnabled()) { - allStaticContainersOnMapClone = allStaticContainersOnMapClone.Where(item => !_seasonalEventConfig.ChristmasContainerIds.Contains(item.Template.Id) + allStaticContainersOnMapClone = allStaticContainersOnMapClone + .Where(item => + !_seasonalEventConfig.ChristmasContainerIds.Contains(item.Template.Id) ) .ToList(); } - var staticRandomisableContainersOnMap = GetRandomisableContainersOnMap(allStaticContainersOnMapClone); + var staticRandomisableContainersOnMap = GetRandomisableContainersOnMap( + allStaticContainersOnMapClone + ); // Keep track of static loot count var staticContainerCount = 0; @@ -98,13 +113,17 @@ public class LocationLootGenerator( staticContainerCount += guaranteedContainers.Count; // Add loot to guaranteed containers and add to result - foreach (var containerWithLoot in guaranteedContainers.Select(container => AddLootToContainer( - container, - staticForcedOnMapClone, - staticLootDist.Value, - staticAmmoDist, - locationId - ))) + foreach ( + var containerWithLoot in guaranteedContainers.Select(container => + AddLootToContainer( + container, + staticForcedOnMapClone, + staticLootDist.Value, + staticAmmoDist, + locationId + ) + ) + ) { result.Add(containerWithLoot.Template); @@ -117,8 +136,10 @@ public class LocationLootGenerator( } // Randomisation is turned off globally or just turned off for this map - if (!_locationConfig.ContainerRandomisationSettings.Enabled || !_locationConfig.ContainerRandomisationSettings.Maps.ContainsKey(locationId) - ) + if ( + !_locationConfig.ContainerRandomisationSettings.Enabled + || !_locationConfig.ContainerRandomisationSettings.Maps.ContainsKey(locationId) + ) { if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -149,15 +170,18 @@ public class LocationLootGenerator( // Group containers by their groupId if (mapData.Statics is null) { - _logger.Warning(_localisationService.GetText("location-unable_to_generate_static_loot", locationId)); + _logger.Warning( + _localisationService.GetText("location-unable_to_generate_static_loot", locationId) + ); return result; } - - // For each of the container groups, choose from the pool of containers, hydrate container with loot and add to result array - var mapping = GetGroupIdToContainerMappings(mapData.Statics, staticRandomisableContainersOnMap); + var mapping = GetGroupIdToContainerMappings( + mapData.Statics, + staticRandomisableContainersOnMap + ); foreach (var (key, data) in mapping) { // Count chosen was 0, skip @@ -170,7 +194,9 @@ public class LocationLootGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Group: {key} has no containers with < 100 % spawn chance to choose from, skipping"); + _logger.Debug( + $"Group: {key} has no containers with < 100 % spawn chance to choose from, skipping" + ); } continue; @@ -186,7 +212,9 @@ public class LocationLootGenerator( { if (_randomUtil.GetChance100(containerIdsCopy[containerId.Key] * 100)) { - data.ContainerIdsWithProbability[containerId.Key] = containerIdsCopy[containerId.Key]; + data.ContainerIdsWithProbability[containerId.Key] = containerIdsCopy[ + containerId.Key + ]; } } @@ -205,7 +233,8 @@ public class LocationLootGenerator( foreach (var chosenContainerId in chosenContainerIds) { // Look up container object from full list of containers on map - var containerObject = staticRandomisableContainersOnMap.FirstOrDefault(staticContainer => staticContainer.Template.Id == chosenContainerId + var containerObject = staticRandomisableContainersOnMap.FirstOrDefault( + staticContainer => staticContainer.Template.Id == chosenContainerId ); if (containerObject is null) { @@ -236,7 +265,10 @@ public class LocationLootGenerator( _logger.Success($"A total of: {staticLootItemCount} static items spawned"); _logger.Success( - _localisationService.GetText("location-containers_generated_success", staticContainerCount) + _localisationService.GetText( + "location-containers_generated_success", + staticContainerCount + ) ); return result; @@ -247,12 +279,15 @@ public class LocationLootGenerator( /// /// /// StaticContainerData array - protected List GetRandomisableContainersOnMap(List staticContainers) + protected List GetRandomisableContainersOnMap( + List staticContainers + ) { - return staticContainers.Where(staticContainer => - staticContainer.Probability != 1 && - !staticContainer.Template.IsAlwaysSpawn.GetValueOrDefault(false) && - !_locationConfig.ContainerRandomisationSettings.ContainerTypesToNotRandomise.Contains( + return staticContainers + .Where(staticContainer => + staticContainer.Probability != 1 + && !staticContainer.Template.IsAlwaysSpawn.GetValueOrDefault(false) + && !_locationConfig.ContainerRandomisationSettings.ContainerTypesToNotRandomise.Contains( staticContainer.Template.Items.FirstOrDefault().Template ) ) @@ -264,12 +299,15 @@ public class LocationLootGenerator( /// /// /// IStaticContainerData array - protected List GetGuaranteedContainers(List staticContainersOnMap) + protected List GetGuaranteedContainers( + List staticContainersOnMap + ) { - return staticContainersOnMap.Where(staticContainer => - staticContainer.Probability == 1 || - staticContainer.Template.IsAlwaysSpawn.GetValueOrDefault(false) || - _locationConfig.ContainerRandomisationSettings.ContainerTypesToNotRandomise.Contains( + return staticContainersOnMap + .Where(staticContainer => + staticContainer.Probability == 1 + || staticContainer.Template.IsAlwaysSpawn.GetValueOrDefault(false) + || _locationConfig.ContainerRandomisationSettings.ContainerTypesToNotRandomise.Contains( staticContainer.Template.Items.FirstOrDefault().Template ) ) @@ -283,7 +321,10 @@ public class LocationLootGenerator( /// Name of the group the containers are being collected for /// Containers and probability values for a groupId /// List of chosen container Ids - protected List GetContainersByProbability(string groupId, ContainerGroupCount containerData) + protected List GetContainersByProbability( + string groupId, + ContainerGroupCount containerData + ) { var chosenContainerIds = new List(); @@ -301,15 +342,14 @@ public class LocationLootGenerator( } // Create probability array with all possible container ids in this group and their relative probability of spawning - var containerDistribution = - new ProbabilityObjectArray(_mathUtil, _cloner); + var containerDistribution = new ProbabilityObjectArray(_mathUtil, _cloner); foreach (var x in containerIds) { var value = containerData.ContainerIdsWithProbability[x]; containerDistribution.Add(new ProbabilityObject(x, value, value)); } - chosenContainerIds.AddRange(containerDistribution.Draw((int) containerData.ChosenCount)); + chosenContainerIds.AddRange(containerDistribution.Draw((int)containerData.ChosenCount)); return chosenContainerIds; } @@ -322,7 +362,8 @@ public class LocationLootGenerator( /// dictionary keyed by groupId protected Dictionary GetGroupIdToContainerMappings( StaticContainer staticContainerGroupData, - List staticContainersOnMap) + List staticContainersOnMap + ) { // Create dictionary of all group ids and choose a count of containers the map will spawn of that group var mapping = new Dictionary(); @@ -332,31 +373,45 @@ public class LocationLootGenerator( { ContainerIdsWithProbability = new Dictionary(), ChosenCount = _randomUtil.GetInt( - (int) Math.Round( - groupKvP.Value.MinContainers.Value * - _locationConfig.ContainerRandomisationSettings.ContainerGroupMinSizeMultiplier - ), - (int) Math.Round( - groupKvP.Value.MaxContainers.Value * - _locationConfig.ContainerRandomisationSettings.ContainerGroupMaxSizeMultiplier - ) - ) + (int) + Math.Round( + groupKvP.Value.MinContainers.Value + * _locationConfig + .ContainerRandomisationSettings + .ContainerGroupMinSizeMultiplier + ), + (int) + Math.Round( + groupKvP.Value.MaxContainers.Value + * _locationConfig + .ContainerRandomisationSettings + .ContainerGroupMaxSizeMultiplier + ) + ), }; } // Add an empty group for containers without a group id but still have a < 100% chance to spawn // Likely bad BSG data, will be fixed...eventually, example of the groupIds: `NEED_TO_BE_FIXED1`,`NEED_TO_BE_FIXED_SE02`, `NEED_TO_BE_FIXED_NW_01` - mapping.Add(string.Empty, new ContainerGroupCount - { - ContainerIdsWithProbability = new Dictionary(), - ChosenCount = -1 - }); + mapping.Add( + string.Empty, + new ContainerGroupCount + { + ContainerIdsWithProbability = new Dictionary(), + ChosenCount = -1, + } + ); // Iterate over all containers and add to group keyed by groupId // Containers without a group go into a group with empty key "" foreach (var container in staticContainersOnMap) { - if (!staticContainerGroupData.Containers.TryGetValue(container.Template.Id, out var groupData)) + if ( + !staticContainerGroupData.Containers.TryGetValue( + container.Template.Id, + out var groupData + ) + ) { _logger.Error( _localisationService.GetText( @@ -385,10 +440,14 @@ public class LocationLootGenerator( new ContainerGroupCount { ChosenCount = 0d, - ContainerIdsWithProbability = new Dictionary() + ContainerIdsWithProbability = new Dictionary(), } ); - mapping[groupData.GroupId].ContainerIdsWithProbability.TryAdd(container.Template.Id, container.Probability.Value); + mapping[groupData.GroupId] + .ContainerIdsWithProbability.TryAdd( + container.Template.Id, + container.Probability.Value + ); } return mapping; @@ -404,7 +463,8 @@ public class LocationLootGenerator( /// staticAmmo.json /// Name of the map to generate static loot for /// StaticContainerData - protected StaticContainerData AddLootToContainer(StaticContainerData staticContainer, + protected StaticContainerData AddLootToContainer( + StaticContainerData staticContainer, List? staticForced, Dictionary staticLootDist, Dictionary> staticAmmoDist, @@ -422,7 +482,11 @@ public class LocationLootGenerator( var containerMap = _itemHelper.GetContainerMapping(containerTpl); // Choose count of items to add to container - var itemCountToAdd = GetWeightedCountOfContainerItems(containerTpl, staticLootDist, locationName); + var itemCountToAdd = GetWeightedCountOfContainerItems( + containerTpl, + staticLootDist, + locationName + ); if (itemCountToAdd == 0) { return containerClone; @@ -468,11 +532,15 @@ public class LocationLootGenerator( : chosenItemWithChildren.Items; // look for open slot to put chosen item into - var result = _containerHelper.FindSlotForItem(containerMap, chosenItemWithChildren.Width, chosenItemWithChildren.Height); + var result = _containerHelper.FindSlotForItem( + containerMap, + chosenItemWithChildren.Width, + chosenItemWithChildren.Height + ); if (!result.Success.GetValueOrDefault(false)) { if (failedToFitAttemptCount > _locationConfig.FitLootIntoContainerAttempts) - // x attempts to fit an item, container is probably full, stop trying to add more + // x attempts to fit an item, container is probably full, stop trying to add more { break; } @@ -499,7 +567,9 @@ public class LocationLootGenerator( { X = result.X, Y = result.Y, - R = result.Rotation.GetValueOrDefault(false) ? ItemRotation.Vertical : ItemRotation.Horizontal + R = result.Rotation.GetValueOrDefault(false) + ? ItemRotation.Vertical + : ItemRotation.Horizontal, }; // Add loot to container before returning @@ -516,23 +586,21 @@ public class LocationLootGenerator( /// staticLoot.json /// Map name (to get per-map multiplier for from config) /// item count - protected int GetWeightedCountOfContainerItems(string containerTypeId, - Dictionary staticLootDist, string locationName) + protected int GetWeightedCountOfContainerItems( + string containerTypeId, + Dictionary staticLootDist, + string locationName + ) { // Create probability array to calculate the total count of lootable items inside container - var itemCountArray = - new ProbabilityObjectArray(_mathUtil, _cloner); + var itemCountArray = new ProbabilityObjectArray(_mathUtil, _cloner); var countDistribution = staticLootDist[containerTypeId]?.ItemCountDistribution; if (countDistribution is null) { _logger.Warning( _localisationService.GetText( "location-unable_to_find_count_distribution_for_container", - new - { - containerId = containerTypeId, - locationName - } + new { containerId = containerTypeId, locationName } ) ); @@ -551,7 +619,8 @@ public class LocationLootGenerator( ); } - return (int) Math.Round(GetStaticLootMultiplierForLocation(locationName) * itemCountArray.Draw()[0]); + return (int) + Math.Round(GetStaticLootMultiplierForLocation(locationName) * itemCountArray.Draw()[0]); } /// @@ -563,18 +632,23 @@ public class LocationLootGenerator( /// ProbabilityObjectArray of item tpls + probability protected ProbabilityObjectArray GetPossibleLootItemsForContainer( string containerTypeId, - Dictionary staticLootDist) + Dictionary staticLootDist + ) { var seasonalEventActive = _seasonalEventService.SeasonalEventEnabled(); var seasonalItemTplBlacklist = _seasonalEventService.GetInactiveSeasonalEventItems(); - var itemDistribution = - new ProbabilityObjectArray(_mathUtil, _cloner); + var itemDistribution = new ProbabilityObjectArray(_mathUtil, _cloner); var itemContainerDistribution = staticLootDist[containerTypeId]?.ItemDistribution; if (itemContainerDistribution is null) { - _logger.Warning(_localisationService.GetText("location-missing_item_distribution_data", containerTypeId)); + _logger.Warning( + _localisationService.GetText( + "location-missing_item_distribution_data", + containerTypeId + ) + ); return itemDistribution; } @@ -586,14 +660,16 @@ public class LocationLootGenerator( // Skip seasonal event items if they're not enabled continue; } - + if (_itemFilterService.IsLootableItemBlacklisted(icd.Tpl)) { // Ensure no blacklisted lootable items are in pool continue; } - itemDistribution.Add(new ProbabilityObject(icd.Tpl, icd.RelativeProbability.Value, null)); + itemDistribution.Add( + new ProbabilityObject(icd.Tpl, icd.RelativeProbability.Value, null) + ); } return itemDistribution; @@ -620,9 +696,11 @@ public class LocationLootGenerator( /// /// Location to generate loot for /// Array of spawn points with loot in them - public List GenerateDynamicLoot(LooseLoot dynamicLootDist, + public List GenerateDynamicLoot( + LooseLoot dynamicLootDist, Dictionary> staticAmmoDist, - string locationName) + string locationName + ) { List loot = []; List dynamicForcedSpawnPoints = []; @@ -630,11 +708,13 @@ public class LocationLootGenerator( // Remove christmas items from loot data if (!_seasonalEventService.ChristmasEventEnabled()) { - dynamicLootDist.Spawnpoints = dynamicLootDist.Spawnpoints.Where(point => + dynamicLootDist.Spawnpoints = dynamicLootDist + .Spawnpoints.Where(point => !point.Template.Id.StartsWith("christmas", StringComparison.OrdinalIgnoreCase) ) .ToList(); - dynamicLootDist.SpawnpointsForced = dynamicLootDist.SpawnpointsForced.Where(point => + dynamicLootDist.SpawnpointsForced = dynamicLootDist + .SpawnpointsForced.Where(point => !point.Template.Id.StartsWith("christmas", StringComparison.OrdinalIgnoreCase) ) .ToList(); @@ -642,7 +722,9 @@ public class LocationLootGenerator( // Build the list of forced loot from both `spawnpointsForced` and any point marked `IsAlwaysSpawn` dynamicForcedSpawnPoints.AddRange(dynamicLootDist.SpawnpointsForced); - dynamicForcedSpawnPoints.AddRange(dynamicLootDist.Spawnpoints.Where(point => point.Template.IsAlwaysSpawn ?? false)); + dynamicForcedSpawnPoints.AddRange( + dynamicLootDist.Spawnpoints.Where(point => point.Template.IsAlwaysSpawn ?? false) + ); // Add forced loot AddForcedLoot(loot, dynamicForcedSpawnPoints, locationName, staticAmmoDist); @@ -651,16 +733,19 @@ public class LocationLootGenerator( // Draw from random distribution var desiredSpawnPointCount = Math.Round( - GetLooseLootMultiplierForLocation(locationName) * _randomUtil.GetNormallyDistributedRandomNumber( - (double) dynamicLootDist.SpawnpointCount.Mean, - (double) dynamicLootDist.SpawnpointCount.Std - ) + GetLooseLootMultiplierForLocation(locationName) + * _randomUtil.GetNormallyDistributedRandomNumber( + (double)dynamicLootDist.SpawnpointCount.Mean, + (double)dynamicLootDist.SpawnpointCount.Std + ) ); // Positions not in forced but have 100% chance to spawn List guaranteedLoosePoints = []; - var blacklistedSpawnPoints = _locationConfig.LooseLootBlacklist.GetValueOrDefault(locationName); + var blacklistedSpawnPoints = _locationConfig.LooseLootBlacklist.GetValueOrDefault( + locationName + ); var spawnPointArray = new ProbabilityObjectArray(_mathUtil, _cloner); foreach (var spawnPoint in allDynamicSpawnPoints) @@ -689,7 +774,13 @@ public class LocationLootGenerator( continue; } - spawnPointArray.Add(new ProbabilityObject(spawnPoint.Template.Id, spawnPoint.Probability ?? 0, spawnPoint)); + spawnPointArray.Add( + new ProbabilityObject( + spawnPoint.Template.Id, + spawnPoint.Probability ?? 0, + spawnPoint + ) + ); } // Select a number of spawn points to add loot to @@ -700,16 +791,19 @@ public class LocationLootGenerator( var randomSpawnPointCount = desiredSpawnPointCount - chosenSpawnPoints.Count; // Only draw random spawn points if needed if (randomSpawnPointCount > 0 && spawnPointArray.Count > 0) - // Add randomly chosen spawn points + // Add randomly chosen spawn points { - foreach (var si in spawnPointArray.Draw((int) randomSpawnPointCount, false)) + foreach (var si in spawnPointArray.Draw((int)randomSpawnPointCount, false)) { chosenSpawnPoints.Add(spawnPointArray.Data(si)); } } // Filter out duplicate locationIds // prob can be done better - chosenSpawnPoints = chosenSpawnPoints.GroupBy(spawnPoint => spawnPoint.LocationId).Select(group => group.First()).ToList(); + chosenSpawnPoints = chosenSpawnPoints + .GroupBy(spawnPoint => spawnPoint.LocationId) + .Select(group => group.First()) + .ToList(); // Do we have enough items in pool to fulfill requirement var tooManySpawnPointsRequested = desiredSpawnPointCount - chosenSpawnPoints.Count > 0; @@ -724,7 +818,7 @@ public class LocationLootGenerator( { requested = desiredSpawnPointCount + guaranteedLoosePoints.Count, found = chosenSpawnPoints.Count, - mapName = locationName + mapName = locationName, } ) ); @@ -740,22 +834,27 @@ public class LocationLootGenerator( if (spawnPoint.Template is null) { _logger.Warning( - _localisationService.GetText("location-missing_dynamic_template", spawnPoint.LocationId) + _localisationService.GetText( + "location-missing_dynamic_template", + spawnPoint.LocationId + ) ); continue; } // Ensure no blacklisted lootable items are in pool - spawnPoint.Template.Items = spawnPoint.Template.Items.Where(item => !_itemFilterService.IsLootableItemBlacklisted(item.Template) + spawnPoint.Template.Items = spawnPoint + .Template.Items.Where(item => + !_itemFilterService.IsLootableItemBlacklisted(item.Template) ) .ToList(); // Ensure no seasonal items are in pool if not in-season if (!seasonalEventActive) { - spawnPoint.Template.Items = spawnPoint.Template.Items.Where(item => !seasonalItemTplBlacklist.Contains(item.Template) - ) + spawnPoint.Template.Items = spawnPoint + .Template.Items.Where(item => !seasonalItemTplBlacklist.Contains(item.Template)) .ToList(); } @@ -765,7 +864,10 @@ public class LocationLootGenerator( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - _localisationService.GetText("location-spawnpoint_missing_items", spawnPoint.Template.Id) + _localisationService.GetText( + "location-spawnpoint_missing_items", + spawnPoint.Template.Id + ) ); } @@ -784,13 +886,22 @@ public class LocationLootGenerator( continue; } - itemArray.Add(new ProbabilityObject(itemDist.ComposedKey.Key, itemDist.RelativeProbability ?? 0, null)); + itemArray.Add( + new ProbabilityObject( + itemDist.ComposedKey.Key, + itemDist.RelativeProbability ?? 0, + null + ) + ); } if (itemArray.Count == 0) { _logger.Warning( - _localisationService.GetText("location-loot_pool_is_empty_skipping", spawnPoint.Template.Id) + _localisationService.GetText( + "location-loot_pool_is_empty_skipping", + spawnPoint.Template.Id + ) ); continue; @@ -822,44 +933,65 @@ public class LocationLootGenerator( /// List to add forced loot spawn locations to /// Forced loot locations that must be added /// Name of map currently having force loot created for - protected void AddForcedLoot(List lootLocationTemplates, - List forcedSpawnPoints, string locationName, - Dictionary> staticAmmoDist) + protected void AddForcedLoot( + List lootLocationTemplates, + List forcedSpawnPoints, + string locationName, + Dictionary> staticAmmoDist + ) { - var lootToForceSingleAmountOnMap = _locationConfig.ForcedLootSingleSpawnById.GetValueOrDefault(locationName); + var lootToForceSingleAmountOnMap = + _locationConfig.ForcedLootSingleSpawnById.GetValueOrDefault(locationName); if (lootToForceSingleAmountOnMap is not null) - // Process loot items defined as requiring only 1 spawn position as they appear in multiple positions on the map + // Process loot items defined as requiring only 1 spawn position as they appear in multiple positions on the map { foreach (var itemTpl in lootToForceSingleAmountOnMap) { // Get all spawn positions for item tpl in forced loot array - var items = forcedSpawnPoints.Where(forcedSpawnPoint => forcedSpawnPoint.Template.Items.FirstOrDefault().Template == itemTpl); + var items = forcedSpawnPoints.Where(forcedSpawnPoint => + forcedSpawnPoint.Template.Items.FirstOrDefault().Template == itemTpl + ); if (!items.Any()) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to adjust loot item {itemTpl} as it does not exist inside {locationName} forced loot."); + _logger.Debug( + $"Unable to adjust loot item {itemTpl} as it does not exist inside {locationName} forced loot." + ); } continue; } // Create probability array of all spawn positions for this spawn id - var spawnPointArray = new ProbabilityObjectArray(_mathUtil, _cloner); + var spawnPointArray = new ProbabilityObjectArray( + _mathUtil, + _cloner + ); foreach (var si in items) - // use locationId as template.Id is the same across all items + // use locationId as template.Id is the same across all items { - spawnPointArray.Add(new ProbabilityObject(si.LocationId, si.Probability ?? 0, si)); + spawnPointArray.Add( + new ProbabilityObject( + si.LocationId, + si.Probability ?? 0, + si + ) + ); } // Choose 1 out of all found spawn positions for spawn id and add to loot array foreach (var spawnPointLocationId in spawnPointArray.Draw(1, false)) { - var itemToAdd = items.FirstOrDefault(item => item.LocationId == spawnPointLocationId); + var itemToAdd = items.FirstOrDefault(item => + item.LocationId == spawnPointLocationId + ); var lootItem = itemToAdd?.Template; if (lootItem is null) { - _logger.Warning($"Item with spawn point id {spawnPointLocationId} could not be found, skipping"); + _logger.Warning( + $"Item with spawn point id {spawnPointLocationId} could not be found, skipping" + ); continue; } @@ -909,7 +1041,8 @@ public class LocationLootGenerator( forcedLootLocation.Template.Items = createItemResult.Items; // Push forced location into array as long as it doesnt exist already - var existingLocation = lootLocationTemplates.Any(spawnPoint => spawnPoint.Id == locationTemplateToAdd.Id + var existingLocation = lootLocationTemplates.Any(spawnPoint => + spawnPoint.Id == locationTemplateToAdd.Id ); if (!existingLocation) { @@ -934,13 +1067,19 @@ public class LocationLootGenerator( /// Location loot Template /// Ammo distributions /// ContainerItem object - protected ContainerItem CreateDynamicLootItem(string? chosenComposedKey, List items, Dictionary> staticAmmoDist) + protected ContainerItem CreateDynamicLootItem( + string? chosenComposedKey, + List items, + Dictionary> staticAmmoDist + ) { var chosenItem = items.FirstOrDefault(item => item.Id == chosenComposedKey); var chosenTpl = chosenItem?.Template; if (chosenTpl is null) { - throw new Exception($"Item for tpl {chosenComposedKey} was not found in the spawn point"); + throw new Exception( + $"Item for tpl {chosenComposedKey} was not found in the spawn point" + ); } var itemTemplate = _itemHelper.GetItem(chosenTpl).Value; @@ -958,48 +1097,34 @@ public class LocationLootGenerator( var stackCount = itemTemplate.Properties.StackMaxSize == 1 ? 1 - : _randomUtil.GetInt(itemTemplate.Properties.StackMinRandom.Value, itemTemplate.Properties.StackMaxRandom.Value); + : _randomUtil.GetInt( + itemTemplate.Properties.StackMinRandom.Value, + itemTemplate.Properties.StackMaxRandom.Value + ); itemWithMods.Add( new Item { Id = _hashUtil.Generate(), Template = chosenTpl, - Upd = new Upd - { - StackObjectsCount = stackCount - } + Upd = new Upd { StackObjectsCount = stackCount }, } ); } else if (_itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.AMMO_BOX)) { // Fill with cartridges - List ammoBoxItem = - [ - new() - { - Id = _hashUtil.Generate(), - Template = chosenTpl - } - ]; + List ammoBoxItem = [new() { Id = _hashUtil.Generate(), Template = chosenTpl }]; _itemHelper.AddCartridgesToAmmoBox(ammoBoxItem, itemTemplate); itemWithMods.AddRange(ammoBoxItem); } else if (_itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.MAGAZINE)) { // Create array with just magazine - List magazineItem = - [ - new() - { - Id = _hashUtil.Generate(), - Template = chosenTpl - } - ]; + List magazineItem = [new() { Id = _hashUtil.Generate(), Template = chosenTpl }]; if (_randomUtil.GetChance100(_locationConfig.StaticMagazineLootHasAmmoChancePercent)) - // Add randomised amount of cartridges + // Add randomised amount of cartridges { _itemHelper.FillMagazineWithRandomCartridge( magazineItem, @@ -1022,7 +1147,7 @@ public class LocationLootGenerator( itemWithChildren = _itemHelper.ReplaceIDs(_cloner.Clone(itemWithChildren)); if (_locationConfig.TplsToStripChildItemsFrom.Contains(chosenItem.Template)) - // Strip children from parent before adding + // Strip children from parent before adding { itemWithChildren = [itemWithChildren.FirstOrDefault()]; } @@ -1037,16 +1162,16 @@ public class LocationLootGenerator( { Items = itemWithMods, Width = size.Width, - Height = size.Height + Height = size.Height, }; } - // TODO: rewrite, BIG yikes protected ContainerItem? CreateStaticLootItem( string chosenTpl, Dictionary> staticAmmoDist, - string? parentId = null) + string? parentId = null + ) { var itemTemplate = _itemHelper.GetItem(chosenTpl).Value; if (itemTemplate.Properties is null) @@ -1058,14 +1183,7 @@ public class LocationLootGenerator( var width = itemTemplate.Properties.Width; var height = itemTemplate.Properties.Height; - List items = - [ - new() - { - Id = _hashUtil.Generate(), - Template = chosenTpl - } - ]; + List items = [new() { Id = _hashUtil.Generate(), Template = chosenTpl }]; var rootItem = items.FirstOrDefault(); // Use passed in parentId as override for new item @@ -1075,19 +1193,20 @@ public class LocationLootGenerator( } if ( - _itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.MONEY) || - _itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.AMMO) + _itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.MONEY) + || _itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.AMMO) ) { // Edge case - some ammos e.g. flares or M406 grenades shouldn't be stacked - var stackCount = itemTemplate.Properties.StackMaxSize == 1 - ? 1 - : _randomUtil.GetInt(itemTemplate.Properties.StackMinRandom.Value, itemTemplate.Properties.StackMaxRandom.Value); + var stackCount = + itemTemplate.Properties.StackMaxSize == 1 + ? 1 + : _randomUtil.GetInt( + itemTemplate.Properties.StackMinRandom.Value, + itemTemplate.Properties.StackMaxRandom.Value + ); - rootItem.Upd = new Upd - { - StackObjectsCount = stackCount - }; + rootItem.Upd = new Upd { StackObjectsCount = stackCount }; } // No spawn point, use default template else if (_itemHelper.IsOfBaseclass(chosenTpl, BaseClasses.WEAPON)) @@ -1120,11 +1239,16 @@ public class LocationLootGenerator( { Items = items, Width = width, - Height = height + Height = height, }; } - protected List GetArmorItems(string chosenTpl, Item? rootItem, List items, TemplateItem armorDbTemplate) + protected List GetArmorItems( + string chosenTpl, + Item? rootItem, + List items, + TemplateItem armorDbTemplate + ) { var defaultPreset = _presetHelper.GetDefaultPreset(chosenTpl); if (defaultPreset is not null) @@ -1163,9 +1287,10 @@ public class LocationLootGenerator( /// Root Item protected Item? CreateWeaponRootAndChildren( string chosenTpl, - Dictionary> cartridgePool, + Dictionary> cartridgePool, string? parentId, - ref List items) + ref List items + ) { List children = []; @@ -1175,7 +1300,10 @@ public class LocationLootGenerator( { try { - children = _itemHelper.ReparentItemAndChildren(defaultPreset.Items.FirstOrDefault(), defaultPreset.Items); + children = _itemHelper.ReparentItemAndChildren( + defaultPreset.Items.FirstOrDefault(), + defaultPreset.Items + ); } catch (Exception e) { @@ -1190,7 +1318,7 @@ public class LocationLootGenerator( tpl = chosenTpl, defaultId = defaultPreset.Id, defaultName = defaultPreset.Name, - parentId + parentId, } ) ); @@ -1214,11 +1342,7 @@ public class LocationLootGenerator( _logger.Error( _localisationService.GetText( "location-missing_root_item", - new - { - tpl = chosenTpl, - parentId - } + new { tpl = chosenTpl, parentId } ) ); @@ -1237,11 +1361,7 @@ public class LocationLootGenerator( _logger.Error( _localisationService.GetText( "location-unable_to_reparent_item", - new - { - tpl = chosenTpl, - parentId - } + new { tpl = chosenTpl, parentId } ) ); _logger.Error(e.StackTrace); @@ -1285,7 +1405,8 @@ public class LocationLootGenerator( Dictionary> staticAmmoDist, Item? rootItem, TemplateItem itemTemplate, - List items) + List items + ) { List magazineWithCartridges = [rootItem]; _itemHelper.FillMagazineWithRandomCartridge( @@ -1305,40 +1426,20 @@ public class LocationLootGenerator( public record ContainerGroupCount { [JsonPropertyName("containerIdsWithProbability")] - public Dictionary? ContainerIdsWithProbability - { - get; - set; - } + public Dictionary? ContainerIdsWithProbability { get; set; } [JsonPropertyName("chosenCount")] - public double? ChosenCount - { - get; - set; - } + public double? ChosenCount { get; set; } } public class ContainerItem { [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("width")] - public int? Width - { - get; - set; - } + public int? Width { get; set; } [JsonPropertyName("height")] - public int? Height - { - get; - set; - } + public int? Height { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs index 1a1a4f01..7abe1c08 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs @@ -58,18 +58,16 @@ public class LootGenerator( { // Choose one at random + add to results array var chosenSealedContainer = _randomUtil.GetArrayValue(sealedWeaponContainerPool); - result.Add([ - new Item - { - Id = _hashUtil.Generate(), - Template = chosenSealedContainer.Id, - Upd = new Upd + result.Add( + [ + new Item { - StackObjectsCount = 1, - SpawnedInSession = true - } - } - ]); + Id = _hashUtil.Generate(), + Template = chosenSealedContainer.Id, + Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, + }, + ] + ); } } @@ -85,11 +83,21 @@ public class LootGenerator( // Pool has items we could add as loot, proceed if (rewardPoolResults.ItemPool.Count > 0) { - var randomisedItemCount = _randomUtil.GetInt(options.ItemCount.Min, options.ItemCount.Max); + var randomisedItemCount = _randomUtil.GetInt( + options.ItemCount.Min, + options.ItemCount.Max + ); for (var index = 0; index < randomisedItemCount; index++) { - if (!FindAndAddRandomItemToLoot(rewardPoolResults.ItemPool, itemTypeCounts, options, result)) - // Failed to add, reduce index so we get another attempt + if ( + !FindAndAddRandomItemToLoot( + rewardPoolResults.ItemPool, + itemTypeCounts, + options, + result + ) + ) + // Failed to add, reduce index so we get another attempt { index--; } @@ -105,9 +113,8 @@ public class LootGenerator( ); if (randomisedWeaponPresetCount > 0) { - var weaponDefaultPresets = globalDefaultPresets.Where(preset => - _itemHelper.IsOfBaseclass(preset.Encyclopedia, BaseClasses.WEAPON) - ) + var weaponDefaultPresets = globalDefaultPresets + .Where(preset => _itemHelper.IsOfBaseclass(preset.Encyclopedia, BaseClasses.WEAPON)) .ToList(); if (weaponDefaultPresets.Any()) @@ -115,14 +122,14 @@ public class LootGenerator( for (var index = 0; index < randomisedWeaponPresetCount; index++) { if ( - !FindAndAddRandomPresetToLoot( - weaponDefaultPresets, - itemTypeCounts, - rewardPoolResults.Blacklist, - result - ) + !FindAndAddRandomPresetToLoot( + weaponDefaultPresets, + itemTypeCounts, + rewardPoolResults.Blacklist, + result ) - // Failed to add, reduce index so we get another attempt + ) + // Failed to add, reduce index so we get another attempt { index--; } @@ -140,9 +147,8 @@ public class LootGenerator( var armorDefaultPresets = globalDefaultPresets.Where(preset => _itemHelper.ArmorItemCanHoldMods(preset.Encyclopedia) ); - var levelFilteredArmorPresets = armorDefaultPresets.Where(armor => - IsArmorOfDesiredProtectionLevel(armor, options) - ) + var levelFilteredArmorPresets = armorDefaultPresets + .Where(armor => IsArmorOfDesiredProtectionLevel(armor, options)) .ToList(); // Add some armors to rewards @@ -151,14 +157,14 @@ public class LootGenerator( for (var index = 0; index < randomisedArmorPresetCount; index++) { if ( - !FindAndAddRandomPresetToLoot( - levelFilteredArmorPresets, - itemTypeCounts, - rewardPoolResults.Blacklist, - result - ) + !FindAndAddRandomPresetToLoot( + levelFilteredArmorPresets, + itemTypeCounts, + rewardPoolResults.Blacklist, + result ) - // Failed to add, reduce index so we get another attempt + ) + // Failed to add, reduce index so we get another attempt { index--; } @@ -195,7 +201,9 @@ public class LootGenerator( for (var i = 0; i < randomisedItemCount; i++) { // Clone preset and alter Ids to be unique - var presetWithUniqueIds = _itemHelper.ReplaceIDs(_cloner.Clone(preset.Items)); + var presetWithUniqueIds = _itemHelper.ReplaceIDs( + _cloner.Clone(preset.Items) + ); // Add to results result.Add(presetWithUniqueIds); @@ -203,7 +211,6 @@ public class LootGenerator( } continue; - } // Non-preset item to be added @@ -211,11 +218,7 @@ public class LootGenerator( { Id = _hashUtil.Generate(), Template = itemTpl, - Upd = new Upd - { - StackObjectsCount = randomisedItemCount, - SpawnedInSession = true - } + Upd = new Upd { StackObjectsCount = randomisedItemCount, SpawnedInSession = true }, }; var splitResults = _itemHelper.SplitStack(newLootItem); foreach (var splitItem in splitResults) @@ -242,11 +245,12 @@ public class LootGenerator( List itemTypeWhitelist, bool useRewardItemBlacklist, bool allowBossItems, - bool blockSeasonalItemsOutOfSeason) + bool blockSeasonalItemsOutOfSeason + ) { var itemsDb = _databaseService.GetItems().Values; var itemBlacklist = new HashSet(); - itemBlacklist.UnionWith([.._itemFilterService.GetBlacklistedItems(), ..itemTplBlacklist]); + itemBlacklist.UnionWith([.. _itemFilterService.GetBlacklistedItems(), .. itemTplBlacklist]); if (useRewardItemBlacklist) { @@ -256,10 +260,12 @@ public class LootGenerator( var itemTypeBlacklist = _itemFilterService.GetItemRewardBaseTypeBlacklist(); var itemsMatchingTypeBlacklist = itemsDb .Where(templateItem => !string.IsNullOrEmpty(templateItem.Parent)) // Ignore items without parents - .Where(templateItem => _itemHelper.IsOfBaseclasses(templateItem.Parent, itemTypeBlacklist)) + .Where(templateItem => + _itemHelper.IsOfBaseclasses(templateItem.Parent, itemTypeBlacklist) + ) .Select(templateItem => templateItem.Id); - itemBlacklist.UnionWith([..rewardItemBlacklist, ..itemsMatchingTypeBlacklist]); + itemBlacklist.UnionWith([.. rewardItemBlacklist, .. itemsMatchingTypeBlacklist]); } if (!allowBossItems) @@ -272,19 +278,16 @@ public class LootGenerator( itemBlacklist.UnionWith(_seasonalEventService.GetInactiveSeasonalEventItems()); } - var items = itemsDb.Where(item => - !itemBlacklist.Contains(item.Id) && - string.Equals(item.Type, "item", StringComparison.OrdinalIgnoreCase) && - !item.Properties.QuestItem.GetValueOrDefault(false) && - itemTypeWhitelist.Contains(item.Parent) + var items = itemsDb + .Where(item => + !itemBlacklist.Contains(item.Id) + && string.Equals(item.Type, "item", StringComparison.OrdinalIgnoreCase) + && !item.Properties.QuestItem.GetValueOrDefault(false) + && itemTypeWhitelist.Contains(item.Parent) ) .ToList(); - return new ItemRewardPoolResults - { - ItemPool = items, - Blacklist = itemBlacklist - }; + return new ItemRewardPoolResults { ItemPool = items, Blacklist = itemBlacklist }; } /// @@ -326,7 +329,7 @@ public class LootGenerator( itemTypeCounts[itemTypeId.Key] = new ItemLimit { Current = 0, - Max = limits[itemTypeId.Key] + Max = limits[itemTypeId.Key], }; } @@ -341,13 +344,19 @@ public class LootGenerator( /// item filters /// array to add found item to /// true if item was valid and added to pool - protected bool FindAndAddRandomItemToLoot(List items, Dictionary itemTypeCounts, + protected bool FindAndAddRandomItemToLoot( + List items, + Dictionary itemTypeCounts, LootRequest options, - List> result) + List> result + ) { var randomItem = _randomUtil.GetArrayValue(items); - var itemLimitCount = itemTypeCounts.TryGetValue(randomItem.Parent, out var randomItemLimitCount); + var itemLimitCount = itemTypeCounts.TryGetValue( + randomItem.Parent, + out var randomItemLimitCount + ); if (!itemLimitCount && randomItemLimitCount?.Current > randomItemLimitCount?.Max) { return false; @@ -363,11 +372,7 @@ public class LootGenerator( { Id = _hashUtil.Generate(), Template = randomItem.Id, - Upd = new Upd - { - StackObjectsCount = 1, - SpawnedInSession = true - } + Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, }; // Special case - handle items that need a stackcount > 1 @@ -380,7 +385,7 @@ public class LootGenerator( result.Add([newLootItem]); if (randomItemLimitCount is not null) - // Increment item count as it's in limit array + // Increment item count as it's in limit array { randomItemLimitCount.Current++; } @@ -417,10 +422,12 @@ public class LootGenerator( /// Items to skip /// List to add chosen preset to /// true if preset was valid and added to pool - protected bool FindAndAddRandomPresetToLoot(List presetPool, + protected bool FindAndAddRandomPresetToLoot( + List presetPool, Dictionary itemTypeCounts, HashSet itemBlacklist, - List> result) + List> result + ) { if (presetPool.Count == 0) { @@ -437,7 +444,12 @@ public class LootGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Warning(_localisationService.GetText("loot-chosen_preset_missing_encyclopedia_value", chosenPreset?.Id)); + _logger.Warning( + _localisationService.GetText( + "loot-chosen_preset_missing_encyclopedia_value", + chosenPreset?.Id + ) + ); } return false; @@ -449,7 +461,9 @@ public class LootGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"$Unable to find preset with tpl: {chosenPreset.Encyclopedia}, skipping"); + _logger.Debug( + $"$Unable to find preset with tpl: {chosenPreset.Encyclopedia}, skipping" + ); } return false; @@ -464,13 +478,21 @@ public class LootGenerator( // Some custom mod items lack a parent property if (itemDbDetails.Value?.Parent is null) { - _logger.Error(_localisationService.GetText("loot-item_missing_parentid", itemDbDetails.Value?.Name)); + _logger.Error( + _localisationService.GetText( + "loot-item_missing_parentid", + itemDbDetails.Value?.Name + ) + ); return false; } // Check chosen preset hasn't exceeded spawn limit - var hasItemLimitCount = itemTypeCounts.TryGetValue(itemDbDetails.Value.Parent, out var itemLimitCount); + var hasItemLimitCount = itemTypeCounts.TryGetValue( + itemDbDetails.Value.Parent, + out var itemLimitCount + ); if (!hasItemLimitCount && itemLimitCount?.Current > itemLimitCount?.Max) { return false; @@ -485,7 +507,7 @@ public class LootGenerator( result.Add(presetAndMods); if (itemLimitCount is not null) - // Increment item count as item has been chosen and its inside itemLimitCount dictionary + // Increment item count as item has been chosen and its inside itemLimitCount dictionary { itemLimitCount.Current++; } @@ -499,7 +521,9 @@ public class LootGenerator( /// /// sealed weapon container settings /// List of items with children lists - public List> GetSealedWeaponCaseLoot(SealedAirdropContainerSettings containerSettings) + public List> GetSealedWeaponCaseLoot( + SealedAirdropContainerSettings containerSettings + ) { List> itemsToReturn = []; @@ -513,7 +537,10 @@ public class LootGenerator( if (!weaponDetailsDb.Key) { _logger.Error( - _localisationService.GetText("loot-non_item_picked_as_sealed_weapon_crate_reward", chosenWeaponTpl) + _localisationService.GetText( + "loot-non_item_picked_as_sealed_weapon_crate_reward", + chosenWeaponTpl + ) ); return itemsToReturn; @@ -528,9 +555,14 @@ public class LootGenerator( if (chosenWeaponPreset is null) { _logger.Warning( - _localisationService.GetText("loot-default_preset_not_found_using_random", chosenWeaponTpl) + _localisationService.GetText( + "loot-default_preset_not_found_using_random", + chosenWeaponTpl + ) + ); + chosenWeaponPreset = _randomUtil.GetArrayValue( + _presetHelper.GetPresets(chosenWeaponTpl) ); - chosenWeaponPreset = _randomUtil.GetArrayValue(_presetHelper.GetPresets(chosenWeaponTpl)); } // Clean up Ids to ensure they're all unique and prevent collisions @@ -543,11 +575,17 @@ public class LootGenerator( // Get a random collection of weapon mods related to chosen weawpon and add them to result array var linkedItemsToWeapon = _ragfairLinkedItemService.GetLinkedDbItems(chosenWeaponTpl); itemsToReturn.AddRange( - GetSealedContainerWeaponModRewards(containerSettings, linkedItemsToWeapon, chosenWeaponPreset) + GetSealedContainerWeaponModRewards( + containerSettings, + linkedItemsToWeapon, + chosenWeaponPreset + ) ); // Handle non-weapon mod reward types - itemsToReturn.AddRange(GetSealedContainerNonWeaponModRewards(containerSettings, weaponDetailsDb.Value)); + itemsToReturn.AddRange( + GetSealedContainerNonWeaponModRewards(containerSettings, weaponDetailsDb.Value) + ); return itemsToReturn; } @@ -558,8 +596,10 @@ public class LootGenerator( /// Sealed weapon container settings /// Details for the weapon to reward player /// List of item with children lists - protected List> GetSealedContainerNonWeaponModRewards(SealedAirdropContainerSettings containerSettings, - TemplateItem weaponDetailsDb) + protected List> GetSealedContainerNonWeaponModRewards( + SealedAirdropContainerSettings containerSettings, + TemplateItem weaponDetailsDb + ) { List> rewards = []; @@ -576,11 +616,10 @@ public class LootGenerator( { // Get ammo boxes from db var ammoBoxesDetails = containerSettings.AmmoBoxWhitelist.Select(tpl => - { - var itemDetails = _itemHelper.GetItem(tpl); - return itemDetails.Value; - } - ); + { + var itemDetails = _itemHelper.GetItem(tpl); + return itemDetails.Value; + }); // Need to find boxes that matches weapons caliber var weaponCaliber = weaponDetailsDb.Properties.AmmoCaliber; @@ -602,11 +641,7 @@ public class LootGenerator( var chosenAmmoBox = _randomUtil.GetArrayValue(ammoBoxesMatchingCaliber); var ammoBoxReward = new List { - new() - { - Id = _hashUtil.Generate(), - Template = chosenAmmoBox.Id - } + new() { Id = _hashUtil.Generate(), Template = chosenAmmoBox.Id }, }; _itemHelper.AddCartridgesToAmmoBox(ammoBoxReward, chosenAmmoBox); rewards.Add(ammoBoxReward); @@ -616,13 +651,14 @@ public class LootGenerator( } // Get all items of the desired type + not quest items + not globally blacklisted - var rewardItemPool = _databaseService.GetItems() + var rewardItemPool = _databaseService + .GetItems() .Values.Where(item => - item.Parent == rewardKey && - string.Equals(item.Type, "item", StringComparison.OrdinalIgnoreCase) && - _itemFilterService.IsItemBlacklisted(item.Id) && - !(containerSettings.AllowBossItems || _itemFilterService.IsBossItem(item.Id)) && - item.Properties.QuestItem is null + item.Parent == rewardKey + && string.Equals(item.Type, "item", StringComparison.OrdinalIgnoreCase) + && _itemFilterService.IsItemBlacklisted(item.Id) + && !(containerSettings.AllowBossItems || _itemFilterService.IsBossItem(item.Id)) + && item.Properties.QuestItem is null ); if (!rewardItemPool.Any()) @@ -641,11 +677,7 @@ public class LootGenerator( var chosenRewardItem = _randomUtil.GetArrayValue(rewardItemPool); var rewardItem = new List { - new() - { - Id = _hashUtil.Generate(), - Template = chosenRewardItem.Id - } + new() { Id = _hashUtil.Generate(), Template = chosenRewardItem.Id }, }; rewards.Add(rewardItem); @@ -662,8 +694,11 @@ public class LootGenerator( /// All items that can be attached/inserted into weapon /// The weapon preset given to player as reward /// List of item with children lists - protected List> GetSealedContainerWeaponModRewards(SealedAirdropContainerSettings containerSettings, List linkedItemsToWeapon, - Preset chosenWeaponPreset) + protected List> GetSealedContainerWeaponModRewards( + SealedAirdropContainerSettings containerSettings, + List linkedItemsToWeapon, + Preset chosenWeaponPreset + ) { List> modRewards = []; @@ -678,7 +713,8 @@ public class LootGenerator( } // Get items that fulfil reward type criteria from items that fit on gun - var relatedItems = linkedItemsToWeapon?.Where(item => item?.Parent == rewardKey && !_itemFilterService.IsItemBlacklisted(item.Id) + var relatedItems = linkedItemsToWeapon?.Where(item => + item?.Parent == rewardKey && !_itemFilterService.IsItemBlacklisted(item.Id) ); if (relatedItems is null || !relatedItems.Any()) { @@ -698,11 +734,7 @@ public class LootGenerator( var chosenItem = _randomUtil.DrawRandomFromList(relatedItems.ToList()); var reward = new List { - new() - { - Id = _hashUtil.Generate(), - Template = chosenItem[0].Id - } + new() { Id = _hashUtil.Generate(), Template = chosenItem[0].Id }, }; modRewards.Add(reward); @@ -742,11 +774,7 @@ public class LootGenerator( List rewardItem = [ - new() - { - Id = _hashUtil.Generate(), - Template = chosenRewardItemTpl - } + new() { Id = _hashUtil.Generate(), Template = chosenRewardItemTpl }, ]; itemsToReturn.Add(rewardItem); } @@ -761,47 +789,33 @@ public class LootGenerator( /// Single tpl protected string PickRewardItem(RewardDetails rewardContainerDetails) { - if (rewardContainerDetails.RewardTplPool is not null && rewardContainerDetails.RewardTplPool.Count > 0) + if ( + rewardContainerDetails.RewardTplPool is not null + && rewardContainerDetails.RewardTplPool.Count > 0 + ) { return _weightedRandomHelper.GetWeightedValue(rewardContainerDetails.RewardTplPool); } return _randomUtil.GetArrayValue( GetItemRewardPool([], rewardContainerDetails.RewardTypePool, true, true, false) - .ItemPool.Select(item => item.Id - ) + .ItemPool.Select(item => item.Id) ); } public record ItemRewardPoolResults { - public List ItemPool - { - get; - set; - } + public List ItemPool { get; set; } - public HashSet Blacklist - { - get; - set; - } + public HashSet Blacklist { get; set; } } } public class ItemLimit { [JsonPropertyName("current")] - public int Current - { - get; - set; - } + public int Current { get; set; } [JsonPropertyName("max")] - public int Max - { - get; - set; - } + public int Max { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/PMCLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/PMCLootGenerator.cs index ead27e71..13ca614e 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/PMCLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/PMCLootGenerator.cs @@ -18,7 +18,8 @@ public class PMCLootGenerator( RagfairPriceService ragfairPriceService, SeasonalEventService seasonalEventService, WeightedRandomHelper weightedRandomHelper, - ConfigServer configServer) + ConfigServer configServer +) { private readonly PmcConfig _pmcConfig = configServer.GetConfig(); @@ -53,7 +54,12 @@ public class PMCLootGenerator( var blacklist = GetContainerLootBlacklist(); // Generate loot and cache - Also pass check to ensure only 1x2 items are allowed (Unheard bots have big pockets, hence the need for 1x2) - var pool = GenerateLootPool(pmcRole, allowedItemTypeWhitelist, blacklist, ItemFitsInto1By2Slot); + var pool = GenerateLootPool( + pmcRole, + allowedItemTypeWhitelist, + blacklist, + ItemFitsInto1By2Slot + ); _pocketLootPool.TryAdd(pmcRole, pool); return pool; @@ -83,7 +89,12 @@ public class PMCLootGenerator( blacklist.UnionWith(_pmcConfig.VestLoot.Blacklist); // Include vest-specific blacklist // Generate loot and cache - Also pass check to ensure items up to 2x2 are allowed, some vests have big slots - var pool = GenerateLootPool(pmcRole, allowedItemTypeWhitelist, blacklist, ItemFitsInto2By2Slot); + var pool = GenerateLootPool( + pmcRole, + allowedItemTypeWhitelist, + blacklist, + ItemFitsInto2By2Slot + ); _vestLootPool.TryAdd(pmcRole, pool); return pool; @@ -99,7 +110,6 @@ public class PMCLootGenerator( { lock (BackpackLock) { - // Already exists, return values if (_backpackLootPool.TryGetValue(pmcRole, out var existingLootPool)) { @@ -126,7 +136,12 @@ public class PMCLootGenerator( /// Item and parent blacklist /// An optional delegate to validate the TemplateItem object being processed /// Dictionary of items and weights inversely tied to the items price - protected Dictionary GenerateLootPool(string pmcRole, HashSet allowedItemTypeWhitelist, HashSet itemTplAndParentBlacklist, Func? genericItemCheck) + protected Dictionary GenerateLootPool( + string pmcRole, + HashSet allowedItemTypeWhitelist, + HashSet itemTplAndParentBlacklist, + Func? genericItemCheck + ) { var lootPool = new Dictionary(); var items = databaseService.GetItems(); @@ -136,13 +151,15 @@ public class PMCLootGenerator( // Filter all items in DB to ones we want with passed in whitelist + blacklist + generic 'IsValidItem' check // Also run Delegate if it's not null - var itemTplsToAdd = items.Where(item => - allowedItemTypeWhitelist.Contains(item.Value.Parent) && - itemHelper.IsValidItem(item.Value.Id) && - !itemTplAndParentBlacklist.Contains(item.Value.Id) && - !itemTplAndParentBlacklist.Contains(item.Value.Parent) && - (genericItemCheck?.Invoke(item.Value) ?? true) // if delegate is null, force check to be true - ).Select(x => x.Key); + var itemTplsToAdd = items + .Where(item => + allowedItemTypeWhitelist.Contains(item.Value.Parent) + && itemHelper.IsValidItem(item.Value.Id) + && !itemTplAndParentBlacklist.Contains(item.Value.Id) + && !itemTplAndParentBlacklist.Contains(item.Value.Parent) + && (genericItemCheck?.Invoke(item.Value) ?? true) // if delegate is null, force check to be true + ) + .Select(x => x.Key); // Store all items + price in above lootPool dictionary foreach (var tpl in itemTplsToAdd) @@ -202,7 +219,6 @@ public class PMCLootGenerator( logger.Error($"Unable to find price overrides for PMC: {pmcRole}"); return null; - } /// @@ -213,7 +229,10 @@ public class PMCLootGenerator( /// Rouble price protected double GetItemPrice(string tpl, Dictionary? pmcPriceOverrides = null) { - if (pmcPriceOverrides is not null && pmcPriceOverrides.TryGetValue(tpl, out var overridePrice)) + if ( + pmcPriceOverrides is not null + && pmcPriceOverrides.TryGetValue(tpl, out var overridePrice) + ) { // There's a price override for this item, use override instead of default price return overridePrice; @@ -245,7 +264,7 @@ public class PMCLootGenerator( return $"{item.Properties.Width}x{item.Properties.Height}" switch { "1x1" or "1x2" or "2x1" => true, - _ => false + _ => false, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/PlayerScavGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/PlayerScavGenerator.cs index 86544689..26ca760f 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/PlayerScavGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/PlayerScavGenerator.cs @@ -13,7 +13,6 @@ using SPTarkov.Server.Core.Utils.Cloners; using SPTarkov.Server.Core.Utils.Json; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Generators; [Injectable] @@ -54,9 +53,16 @@ public class PlayerScavGenerator( var scavKarmaLevel = GetScavKarmaLevel(pmcDataClone); // use karma level to get correct karmaSettings - if (!_playerScavConfig.KarmaLevel.TryGetValue(scavKarmaLevel.ToString(), out var playerScavKarmaSettings)) + if ( + !_playerScavConfig.KarmaLevel.TryGetValue( + scavKarmaLevel.ToString(), + out var playerScavKarmaSettings + ) + ) { - _logger.Error(_localisationService.GetText("scav-missing_karma_settings", scavKarmaLevel)); + _logger.Error( + _localisationService.GetText("scav-missing_karma_settings", scavKarmaLevel) + ); } if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -101,24 +107,20 @@ public class PlayerScavGenerator( scavData.Info.Level = GetScavLevel(existingScavDataClone); scavData.Info.Experience = GetScavExperience(existingScavDataClone); scavData.Quests = existingScavDataClone.Quests ?? []; - scavData.TaskConditionCounters = existingScavDataClone.TaskConditionCounters ?? new Dictionary(); - scavData.Notes = existingScavDataClone.Notes ?? - new Notes - { - DataNotes = new List() - }; - scavData.WishList = existingScavDataClone.WishList ?? new DictionaryOrList(new Dictionary(), new List()); + scavData.TaskConditionCounters = + existingScavDataClone.TaskConditionCounters + ?? new Dictionary(); + scavData.Notes = existingScavDataClone.Notes ?? new Notes { DataNotes = new List() }; + scavData.WishList = + existingScavDataClone.WishList + ?? new DictionaryOrList(new Dictionary(), new List()); scavData.Encyclopedia = pmcDataClone.Encyclopedia ?? new Dictionary(); // Add additional items to player scav as loot AddAdditionalLootToPlayerScavContainers( playerScavKarmaSettings.LootItemsToAddChancePercent, scavData, - [ - EquipmentSlots.TacticalVest, - EquipmentSlots.Pockets, - EquipmentSlots.Backpack - ] + [EquipmentSlots.TacticalVest, EquipmentSlots.Pockets, EquipmentSlots.Backpack] ); // Remove secure container @@ -139,8 +141,11 @@ public class PlayerScavGenerator( /// dict of tpl + % chance to be added /// /// Possible slotIds to add loot to - protected void AddAdditionalLootToPlayerScavContainers(Dictionary possibleItemsToAdd, BotBase scavData, - HashSet containersToAddTo) + protected void AddAdditionalLootToPlayerScavContainers( + Dictionary possibleItemsToAdd, + BotBase scavData, + HashSet containersToAddTo + ) { foreach (var tpl in possibleItemsToAdd) { @@ -153,7 +158,9 @@ public class PlayerScavGenerator( var itemResult = _itemHelper.GetItem(tpl.Key); if (!itemResult.Key) { - _logger.Warning(_localisationService.GetText("scav-unable_to_add_item_to_player_scav", tpl)); + _logger.Warning( + _localisationService.GetText("scav-unable_to_add_item_to_player_scav", tpl) + ); continue; } @@ -164,8 +171,8 @@ public class PlayerScavGenerator( { Id = _hashUtil.Generate(), Template = itemTemplate.Id, - Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(itemTemplate) - } + Upd = _botGeneratorHelper.GenerateExtraPropertiesForItem(itemTemplate), + }, }; var result = _botGeneratorHelper.AddItemWithChildrenToEquipmentSlot( @@ -197,7 +204,9 @@ public class PlayerScavGenerator( // can be empty during profile creation if (!pmcData.TradersInfo.TryGetValue(Traders.FENCE, out var fenceInfo)) { - _logger.Warning(_localisationService.GetText("scav-missing_karma_level_getting_default")); + _logger.Warning( + _localisationService.GetText("scav-missing_karma_level_getting_default") + ); return 0; } @@ -239,7 +248,10 @@ public class PlayerScavGenerator( /// /// Values to modify the bot template with /// bot template to modify according to karama level settings - protected void AdjustBotTemplateWithKarmaSpecificSettings(KarmaLevel karmaSettings, BotType baseBotNode) + protected void AdjustBotTemplateWithKarmaSpecificSettings( + KarmaLevel karmaSettings, + BotType baseBotNode + ) { // Adjust equipment chance values foreach (var equipmentKvP in karmaSettings.Modifiers.Equipment) @@ -251,8 +263,13 @@ public class PlayerScavGenerator( } // Try add new key with value - if (!baseBotNode.BotChances.EquipmentChances.TryAdd(equipmentKvP.Key, equipmentKvP.Value)) - // Unable to add new, update existing + if ( + !baseBotNode.BotChances.EquipmentChances.TryAdd( + equipmentKvP.Key, + equipmentKvP.Value + ) + ) + // Unable to add new, update existing { baseBotNode.BotChances.EquipmentChances[equipmentKvP.Key] += equipmentKvP.Value; } @@ -272,7 +289,6 @@ public class PlayerScavGenerator( baseBotNode.BotChances.WeaponModsChances.TryAdd(modKvP.Key, 0); baseBotNode.BotChances.WeaponModsChances[modKvP.Key] += value; } - ; } @@ -280,14 +296,19 @@ public class PlayerScavGenerator( var props = baseBotNode.BotGeneration.Items.GetType().GetProperties(); foreach (var itemLimitKvP in karmaSettings.ItemLimits) { - var prop = props.FirstOrDefault(x => string.Equals(x.Name, itemLimitKvP.Key, StringComparison.OrdinalIgnoreCase)); + var prop = props.FirstOrDefault(x => + string.Equals(x.Name, itemLimitKvP.Key, StringComparison.OrdinalIgnoreCase) + ); prop.SetValue(baseBotNode.BotGeneration.Items, itemLimitKvP.Value); } // Blacklist equipment, keyed by equipment slot foreach (var equipmentBlacklistKvP in karmaSettings.EquipmentBlacklist) { - baseBotNode.BotInventory.Equipment.TryGetValue(equipmentBlacklistKvP.Key, out var equipmentDict); + baseBotNode.BotInventory.Equipment.TryGetValue( + equipmentBlacklistKvP.Key, + out var equipmentDict + ); foreach (var itemToRemove in equipmentBlacklistKvP.Value) { equipmentDict.Remove(itemToRemove); @@ -311,7 +332,7 @@ public class PlayerScavGenerator( { Common = [], Mastering = [], - Points = 0 + Points = 0, }; } @@ -357,18 +378,26 @@ public class PlayerScavGenerator( protected PmcData SetScavCooldownTimer(PmcData scavData, PmcData pmcData) { // Get sum of all scav cooldown reduction timer bonuses - var modifier = 1d + pmcData.Bonuses - .Where(x => x.Type == BonusType.ScavCooldownTimer) - .Sum(bonus => (bonus?.Value ?? 1) / 100); + var modifier = + 1d + + pmcData + .Bonuses.Where(x => x.Type == BonusType.ScavCooldownTimer) + .Sum(bonus => (bonus?.Value ?? 1) / 100); var fenceInfo = _fenceService.GetFenceInfo(pmcData); modifier *= fenceInfo.SavageCooldownModifier ?? 1d; // Make sure to apply ScavCooldownTimer bonus from Hideout if the player has it. - var scavLockDuration = _databaseService.GetGlobals().Configuration.SavagePlayCooldown * modifier; + var scavLockDuration = + _databaseService.GetGlobals().Configuration.SavagePlayCooldown * modifier; var fullProfile = _profileHelper.GetFullProfile(pmcData?.SessionId); - if (fullProfile?.ProfileInfo?.Edition?.StartsWith(AccountTypes.SPT_DEVELOPER, StringComparison.OrdinalIgnoreCase) ?? false) + if ( + fullProfile?.ProfileInfo?.Edition?.StartsWith( + AccountTypes.SPT_DEVELOPER, + StringComparison.OrdinalIgnoreCase + ) ?? false + ) { // Force lock duration to 10seconds for dev profiles scavLockDuration = 10; @@ -376,7 +405,9 @@ public class PlayerScavGenerator( if (scavData?.Info != null) { - scavData.Info.SavageLockTime = Math.Round(_timeUtil.GetTimeStamp() + (scavLockDuration ?? 0)); + scavData.Info.SavageLockTime = Math.Round( + _timeUtil.GetTimeStamp() + (scavLockDuration ?? 0) + ); } return scavData; diff --git a/Libraries/SPTarkov.Server.Core/Generators/PmcWaveGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/PmcWaveGenerator.cs index 68b334ad..c7cef048 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/PmcWaveGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/PmcWaveGenerator.cs @@ -11,7 +11,8 @@ namespace SPTarkov.Server.Core.Generators; public class PmcWaveGenerator( ISptLogger logger, DatabaseService databaseService, - ConfigServer configServer) + ConfigServer configServer +) { protected readonly PmcConfig _pmcConfig = configServer.GetConfig(); diff --git a/Libraries/SPTarkov.Server.Core/Generators/RagfairAssortGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RagfairAssortGenerator.cs index 9ee5de6a..e7a179ce 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RagfairAssortGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RagfairAssortGenerator.cs @@ -31,7 +31,7 @@ public class RagfairAssortGenerator( BaseClasses.INVENTORY, BaseClasses.STATIONARY_CONTAINER, BaseClasses.POCKETS, - BaseClasses.BUILT_IN_INSERTS + BaseClasses.BUILT_IN_INSERTS, ]; /// @@ -53,7 +53,9 @@ public class RagfairAssortGenerator( List> results = []; // Get cloned items from db - var dbItemsClone = itemHelper.GetItems().Where(item => !string.Equals(item.Type, "Node", StringComparison.OrdinalIgnoreCase)); + var dbItemsClone = itemHelper + .GetItems() + .Where(item => !string.Equals(item.Type, "Node", StringComparison.OrdinalIgnoreCase)); // Store processed preset tpls so we don't add them when processing non-preset items HashSet processedArmorItems = []; @@ -76,7 +78,7 @@ public class RagfairAssortGenerator( { StackObjectsCount = 99999999, UnlimitedCount = true, - SptPresetId = preset.Id + SptPresetId = preset.Id, }; results.Add(presetAndMods); @@ -91,24 +93,21 @@ public class RagfairAssortGenerator( // Skip seasonal items when not in-season if ( - RagfairConfig.Dynamic.RemoveSeasonalItemsWhenNotInEvent && - !seasonalEventActive && - seasonalItemTplBlacklist.Contains(item.Id) + RagfairConfig.Dynamic.RemoveSeasonalItemsWhenNotInEvent + && !seasonalEventActive + && seasonalItemTplBlacklist.Contains(item.Id) ) { continue; } if (processedArmorItems.Contains(item.Id)) - // Already processed + // Already processed { continue; } - var ragfairAssort = CreateRagfairAssortRootItem( - item.Id, - item.Id - ); // tpl and id must be the same so hideout recipe rewards work + var ragfairAssort = CreateRagfairAssortRootItem(item.Id, item.Id); // tpl and id must be the same so hideout recipe rewards work results.Add([ragfairAssort]); } @@ -147,11 +146,7 @@ public class RagfairAssortGenerator( Template = tplId, ParentId = "hideout", SlotId = "hideout", - Upd = new Upd - { - StackObjectsCount = 99999999, - UnlimitedCount = true - } + Upd = new Upd { StackObjectsCount = 99999999, UnlimitedCount = true }, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/RagfairOfferGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RagfairOfferGenerator.cs index dbd2e5dd..eedd37bc 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RagfairOfferGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RagfairOfferGenerator.cs @@ -68,7 +68,15 @@ public class RagfairOfferGenerator( bool sellInOnePiece = false ) { - var offer = CreateOffer(userId, time, items, barterScheme, loyalLevel, quantity, sellInOnePiece); + var offer = CreateOffer( + userId, + time, + items, + barterScheme, + loyalLevel, + quantity, + sellInOnePiece + ); ragfairOfferService.AddOffer(offer); return offer; @@ -95,25 +103,25 @@ public class RagfairOfferGenerator( bool isPackOffer = false ) { - var offerRequirements = barterScheme.Select(barter => + var offerRequirements = barterScheme + .Select(barter => + { + var offerRequirement = new OfferRequirement { - var offerRequirement = new OfferRequirement - { - Template = barter.Template, - Count = Math.Round(barter.Count.Value, 2), - OnlyFunctional = barter.OnlyFunctional ?? false - }; + Template = barter.Template, + Count = Math.Round(barter.Count.Value, 2), + OnlyFunctional = barter.OnlyFunctional ?? false, + }; - // Dogtags define level and side - if (barter.Level != null) - { - offerRequirement.Level = barter.Level; - offerRequirement.Side = barter.Side; - } - - return offerRequirement; + // Dogtags define level and side + if (barter.Level != null) + { + offerRequirement.Level = barter.Level; + offerRequirement.Side = barter.Side; } - ) + + return offerRequirement; + }) .ToList(); // Clone to avoid modifying original array @@ -122,13 +130,21 @@ public class RagfairOfferGenerator( // Hydrate ammo boxes with cartridges + ensure only 1 item is present (ammo box) // On offer refresh don't re-add cartridges to ammo box that already has cartridges - if (itemHelper.IsOfBaseclass(itemsClone[0].Template, BaseClasses.AMMO_BOX) && itemsClone.Count == 1) + if ( + itemHelper.IsOfBaseclass(itemsClone[0].Template, BaseClasses.AMMO_BOX) + && itemsClone.Count == 1 + ) { - itemHelper.AddCartridgesToAmmoBox(itemsClone, itemHelper.GetItem(rootItem.Template).Value); + itemHelper.AddCartridgesToAmmoBox( + itemsClone, + itemHelper.GetItem(rootItem.Template).Value + ); } var roubleListingPrice = Math.Round(ConvertOfferRequirementsIntoRoubles(offerRequirements)); - var singleItemListingPrice = isPackOffer ? roubleListingPrice / quantity : roubleListingPrice; + var singleItemListingPrice = isPackOffer + ? roubleListingPrice / quantity + : roubleListingPrice; var offer = new RagfairOffer { @@ -146,7 +162,7 @@ public class RagfairOfferGenerator( LoyaltyLevel = loyalLevel, SellInOnePiece = isPackOffer, Locked = false, - Quantity = quantity + Quantity = quantity, }; offerCounter++; @@ -165,11 +181,7 @@ public class RagfairOfferGenerator( // Trader offer if (isTrader) { - return new RagfairOfferUser - { - Id = userId, - MemberType = MemberCategory.Trader - }; + return new RagfairOfferUser { Id = userId, MemberType = MemberCategory.Trader }; } var isPlayerOffer = profileHelper.IsPlayer(userId); @@ -185,7 +197,7 @@ public class RagfairOfferGenerator( Rating = playerProfile.RagfairInfo.Rating ?? 0, IsRatingGrowing = playerProfile.RagfairInfo.IsRatingGrowing, Avatar = null, - Aid = playerProfile.Aid + Aid = playerProfile.Aid, }; } @@ -201,7 +213,7 @@ public class RagfairOfferGenerator( ), IsRatingGrowing = randomUtil.GetBool(), Avatar = null, - Aid = hashUtil.GenerateAccountId() + Aid = hashUtil.GenerateAccountId(), }; } @@ -210,14 +222,17 @@ public class RagfairOfferGenerator( /// /// barter requirements for offer /// rouble cost of offer - protected double ConvertOfferRequirementsIntoRoubles(IEnumerable offerRequirements) + protected double ConvertOfferRequirementsIntoRoubles( + IEnumerable offerRequirements + ) { var roublePrice = 0d; foreach (var requirement in offerRequirements) { roublePrice += paymentHelper.IsMoneyTpl(requirement.Template) ? Math.Round(CalculateRoublePrice(requirement.Count.Value, requirement.Template)) - : ragfairPriceService.GetFleaPriceForItem(requirement.Template) * requirement.Count.Value; // Get flea price for barter offer items + : ragfairPriceService.GetFleaPriceForItem(requirement.Template) + * requirement.Count.Value; // Get flea price for barter offer items } return roublePrice; @@ -290,7 +305,10 @@ public class RagfairOfferGenerator( } // Generated pmc offer - return randomUtil.GetDouble(ragfairConfig.Dynamic.Rating.Min, ragfairConfig.Dynamic.Rating.Max); + return randomUtil.GetDouble( + ragfairConfig.Dynamic.Rating.Min, + ragfairConfig.Dynamic.Rating.Max + ); } /// @@ -301,13 +319,15 @@ public class RagfairOfferGenerator( protected bool GetRatingGrowing(string userID) { if (profileHelper.IsPlayer(userID)) - // player offer + // player offer { - return saveServer.GetProfile(userID).CharacterData?.PmcData?.RagfairInfo?.IsRatingGrowing ?? false; + return saveServer + .GetProfile(userID) + .CharacterData?.PmcData?.RagfairInfo?.IsRatingGrowing ?? false; } if (ragfairServerHelper.IsTrader(userID)) - // trader offer + // trader offer { return true; } @@ -328,20 +348,30 @@ public class RagfairOfferGenerator( if (profileHelper.IsPlayer(userID)) { // Player offer = current time + offerDurationTimeInHour; - var offerDurationTimeHours = databaseService.GetGlobals().Configuration.RagFair.OfferDurationTimeInHour; - return (long) (timeUtil.GetTimeStamp() + Math.Round((double) offerDurationTimeHours * TimeUtil.OneHourAsSeconds)); + var offerDurationTimeHours = databaseService + .GetGlobals() + .Configuration.RagFair.OfferDurationTimeInHour; + return (long)( + timeUtil.GetTimeStamp() + + Math.Round((double)offerDurationTimeHours * TimeUtil.OneHourAsSeconds) + ); } if (ragfairServerHelper.IsTrader(userID)) - // Trader offer + // Trader offer { - return (long) databaseService.GetTrader(userID).Base.NextResupply; + return (long)databaseService.GetTrader(userID).Base.NextResupply; } // Generated fake-player offer - return (long) Math.Round( - time + randomUtil.GetDouble(ragfairConfig.Dynamic.EndTimeSeconds.Min, ragfairConfig.Dynamic.EndTimeSeconds.Max) - ); + return (long) + Math.Round( + time + + randomUtil.GetDouble( + ragfairConfig.Dynamic.EndTimeSeconds.Min, + ragfairConfig.Dynamic.EndTimeSeconds.Max + ) + ); } /// @@ -360,7 +390,9 @@ public class RagfairOfferGenerator( stopwatch.Stop(); if (logger.IsLogEnabled(LogLevel.Debug) && stopwatch.ElapsedMilliseconds > 0) { - logger.Debug($"Took {stopwatch.ElapsedMilliseconds}ms to GetRagfairAssorts - {assortItemsToProcess.Count} items"); + logger.Debug( + $"Took {stopwatch.ElapsedMilliseconds}ms to GetRagfairAssorts - {assortItemsToProcess.Count} items" + ); } stopwatch.Restart(); @@ -369,10 +401,13 @@ public class RagfairOfferGenerator( { tasks.Add( Task.Factory.StartNew(() => - { - CreateOffersFromAssort(assortItem, replacingExpiredOffers, ragfairConfig.Dynamic); - } - ) + { + CreateOffersFromAssort( + assortItem, + replacingExpiredOffers, + ragfairConfig.Dynamic + ); + }) ); } @@ -408,7 +443,10 @@ public class RagfairOfferGenerator( // Armor presets can hold plates above the allowed flea level, remove if necessary if (isPreset && ragfairConfig.Dynamic.Blacklist.EnableBsgList) { - RemoveBannedPlatesFromPreset(assortItemWithChildren, ragfairConfig.Dynamic.Blacklist.ArmorPlate); + RemoveBannedPlatesFromPreset( + assortItemWithChildren, + ragfairConfig.Dynamic.Blacklist.ArmorPlate + ); } // Get number of offers to create @@ -427,7 +465,12 @@ public class RagfairOfferGenerator( clonedAssort[0].ParentId = null; clonedAssort[0].SlotId = null; - CreateSingleOfferForItem(hashUtil.Generate(), clonedAssort, isPreset, itemToSellDetails.Value); + CreateSingleOfferForItem( + hashUtil.Generate(), + clonedAssort, + isPreset, + itemToSellDetails.Value + ); } } @@ -443,14 +486,16 @@ public class RagfairOfferGenerator( ) { if (!itemHelper.ArmorItemCanHoldMods(presetWithChildren[0].Template)) - // Cant hold armor inserts, skip + // Cant hold armor inserts, skip { return false; } - var plateSlots = presetWithChildren.Where(item => itemHelper.GetRemovablePlateSlotIds().Contains(item.SlotId?.ToLower())).ToList(); + var plateSlots = presetWithChildren + .Where(item => itemHelper.GetRemovablePlateSlotIds().Contains(item.SlotId?.ToLower())) + .ToList(); if (plateSlots.Count == 0) - // Has no plate slots e.g. "front_plate", exit + // Has no plate slots e.g. "front_plate", exit { return false; } @@ -500,10 +545,10 @@ public class RagfairOfferGenerator( var isBarterOffer = randomUtil.GetChance100(ragfairConfig.Dynamic.Barter.ChancePercent); var isPackOffer = - randomUtil.GetChance100(ragfairConfig.Dynamic.Pack.ChancePercent) && - !isBarterOffer && - itemWithChildren.Count == 1 && - itemHelper.IsOfBaseclasses( + randomUtil.GetChance100(ragfairConfig.Dynamic.Pack.ChancePercent) + && !isBarterOffer + && itemWithChildren.Count == 1 + && itemHelper.IsOfBaseclasses( itemWithChildren[0].Template, ragfairConfig.Dynamic.Pack.ItemTypeWhitelist ); @@ -513,15 +558,21 @@ public class RagfairOfferGenerator( { var armorConfig = ragfairConfig.Dynamic.Armor; - var shouldRemovePlates = randomUtil.GetChance100(armorConfig.RemoveRemovablePlateChance); - if (shouldRemovePlates && itemHelper.ArmorItemHasRemovablePlateSlots(itemWithChildren[0].Template)) + var shouldRemovePlates = randomUtil.GetChance100( + armorConfig.RemoveRemovablePlateChance + ); + if ( + shouldRemovePlates + && itemHelper.ArmorItemHasRemovablePlateSlots(itemWithChildren[0].Template) + ) { var offerItemPlatesToRemove = itemWithChildren.Where(item => armorConfig.PlateSlotIdToRemovePool.Contains(item.SlotId?.ToLower()) ); // Latest first, to ensure we don't move later items off by 1 each time we remove an item below it - var indexesToRemove = offerItemPlatesToRemove.Select(plateItem => itemWithChildren.IndexOf(plateItem)) + var indexesToRemove = offerItemPlatesToRemove + .Select(plateItem => itemWithChildren.IndexOf(plateItem)) .ToHashSet(); foreach (var index in indexesToRemove.OrderByDescending(x => x)) { @@ -540,7 +591,11 @@ public class RagfairOfferGenerator( ); // Don't randomise pack items - barterScheme = CreateCurrencyBarterScheme(itemWithChildren, isPackOffer, desiredStackSize); + barterScheme = CreateCurrencyBarterScheme( + itemWithChildren, + isPackOffer, + desiredStackSize + ); } else if (isBarterOffer) { @@ -600,13 +655,14 @@ public class RagfairOfferGenerator( } var blacklist = ragfairConfig.Dynamic.Blacklist; - var childAssortItems = assortsClone.Items - .Where(x => !string.Equals(x.ParentId, "hideout", StringComparison.Ordinal)).ToList(); + var childAssortItems = assortsClone + .Items.Where(x => !string.Equals(x.ParentId, "hideout", StringComparison.Ordinal)) + .ToList(); foreach (var item in assortsClone.Items) { // We only want to process 'base/root' items, no children if (item.SlotId != "hideout") - // skip mod items + // skip mod items { continue; } @@ -617,12 +673,17 @@ public class RagfairOfferGenerator( var itemDetails = itemHelper.GetItem(item.Template); if (!itemDetails.Key) { - logger.Warning(localisationService.GetText("ragfair-tpl_not_a_valid_item", item.Template)); + logger.Warning( + localisationService.GetText("ragfair-tpl_not_a_valid_item", item.Template) + ); continue; } // Don't include items that BSG has blacklisted from flea - if (blacklist.EnableBsgList && !(itemDetails.Value?.Properties?.CanSellOnRagfair ?? false)) + if ( + blacklist.EnableBsgList + && !(itemDetails.Value?.Properties?.CanSellOnRagfair ?? false) + ) { continue; } @@ -631,7 +692,7 @@ public class RagfairOfferGenerator( var isPreset = presetHelper.IsPreset(item.Id); var items = isPreset ? ragfairServerHelper.GetPresetItems(item) - : [item, ..itemHelper.FindAndReturnChildrenByAssort(item.Id, childAssortItems)]; + : [item, .. itemHelper.FindAndReturnChildrenByAssort(item.Id, childAssortItems)]; if (!assortsClone.BarterScheme.TryGetValue(item.Id, out var barterScheme)) { @@ -642,7 +703,7 @@ public class RagfairOfferGenerator( { itemId = item.Id, tpl = item.Template, - name = trader.Base.Nickname + name = trader.Base.Nickname, } ) ); @@ -652,7 +713,14 @@ public class RagfairOfferGenerator( var barterSchemeItems = barterScheme[0]; var loyalLevel = assortsClone.LoyalLevelItems[item.Id]; - CreateAndAddFleaOffer(traderID, time, items, barterSchemeItems, loyalLevel, (int?) item.Upd.StackObjectsCount ?? 1); + CreateAndAddFleaOffer( + traderID, + time, + items, + barterSchemeItems, + loyalLevel, + (int?)item.Upd.StackObjectsCount ?? 1 + ); // Refresh complete, reset flag to false trader.Base.RefreshTraderRagfairOffers = false; @@ -666,7 +734,11 @@ public class RagfairOfferGenerator( /// ID of owner of item /// Item and mods, get condition of first item (only first array item is modified) /// DB details of first item - protected void RandomiseOfferItemUpdProperties(string userID, List itemWithMods, TemplateItem itemDetails) + protected void RandomiseOfferItemUpdProperties( + string userID, + List itemWithMods, + TemplateItem itemDetails + ) { // Add any missing properties to first item in array AddMissingConditions(itemWithMods[0]); @@ -675,13 +747,17 @@ public class RagfairOfferGenerator( { var parentId = GetDynamicConditionIdForTpl(itemDetails.Id); if (string.IsNullOrEmpty(parentId)) - // No condition details found, don't proceed with modifying item conditions + // No condition details found, don't proceed with modifying item conditions { return; } // Roll random chance to randomise item condition - if (randomUtil.GetChance100(ragfairConfig.Dynamic.Condition[parentId].ConditionChance * 100)) + if ( + randomUtil.GetChance100( + ragfairConfig.Dynamic.Condition[parentId].ConditionChance * 100 + ) + ) { RandomiseItemCondition(parentId, itemWithMods, itemDetails); } @@ -723,29 +799,35 @@ public class RagfairOfferGenerator( var rootItem = itemWithMods[0]; var itemConditionValues = ragfairConfig.Dynamic.Condition[conditionSettingsId]; - var maxMultiplier = randomUtil.GetDouble(itemConditionValues.Max.Min, itemConditionValues.Max.Min); + var maxMultiplier = randomUtil.GetDouble( + itemConditionValues.Max.Min, + itemConditionValues.Max.Min + ); var currentMultiplier = randomUtil.GetDouble( itemConditionValues.Current.Min, itemConditionValues.Current.Max ); // Randomise armor + plates + armor related things - if (itemHelper.ArmorItemCanHoldMods(rootItem.Template) || - itemHelper.IsOfBaseclasses(rootItem.Template, [BaseClasses.ARMOR_PLATE, BaseClasses.ARMORED_EQUIPMENT]) - ) + if ( + itemHelper.ArmorItemCanHoldMods(rootItem.Template) + || itemHelper.IsOfBaseclasses( + rootItem.Template, + [BaseClasses.ARMOR_PLATE, BaseClasses.ARMORED_EQUIPMENT] + ) + ) { RandomiseArmorDurabilityValues(itemWithMods, currentMultiplier, maxMultiplier); // Add hits to visor - var visorMod = itemWithMods.FirstOrDefault(item => item.ParentId == BaseClasses.ARMORED_EQUIPMENT && item.SlotId == "mod_equipment_000"); + var visorMod = itemWithMods.FirstOrDefault(item => + item.ParentId == BaseClasses.ARMORED_EQUIPMENT && item.SlotId == "mod_equipment_000" + ); if (randomUtil.GetChance100(25) && visorMod != null) { itemHelper.AddUpdObjectToItem(visorMod); - visorMod.Upd.FaceShield = new UpdFaceShield - { - Hits = randomUtil.GetInt(1, 3) - }; + visorMod.Upd.FaceShield = new UpdFaceShield { Hits = randomUtil.GetInt(1, 3) }; } return; @@ -754,7 +836,12 @@ public class RagfairOfferGenerator( // Randomise Weapons if (itemHelper.IsOfBaseclass(itemDetails.Id, BaseClasses.WEAPON)) { - RandomiseWeaponDurability(itemWithMods[0], itemDetails, maxMultiplier, currentMultiplier); + RandomiseWeaponDurability( + itemWithMods[0], + itemDetails, + maxMultiplier, + currentMultiplier + ); return; } @@ -762,7 +849,7 @@ public class RagfairOfferGenerator( if (rootItem.Upd?.MedKit != null) { // Randomize health - var hpResource = Math.Round((double) rootItem.Upd.MedKit.HpResource * maxMultiplier); + var hpResource = Math.Round((double)rootItem.Upd.MedKit.HpResource * maxMultiplier); rootItem.Upd.MedKit.HpResource = hpResource == 0D ? 1D : hpResource; return; } @@ -770,14 +857,15 @@ public class RagfairOfferGenerator( if (rootItem.Upd?.Key != null && itemDetails.Properties.MaximumNumberOfUsage > 1) { // Randomize key uses - rootItem.Upd.Key.NumberOfUsages = (int?) Math.Round(itemDetails.Properties.MaximumNumberOfUsage.Value * (1 - maxMultiplier)); + rootItem.Upd.Key.NumberOfUsages = (int?) + Math.Round(itemDetails.Properties.MaximumNumberOfUsage.Value * (1 - maxMultiplier)); return; } if (rootItem.Upd?.FoodDrink != null) { // randomize food/drink value - var hpPercent = Math.Round((double) itemDetails.Properties.MaxResource * maxMultiplier); + var hpPercent = Math.Round((double)itemDetails.Properties.MaxResource * maxMultiplier); rootItem.Upd.FoodDrink.HpPercent = hpPercent == 0D ? 1D : hpPercent; return; @@ -786,7 +874,9 @@ public class RagfairOfferGenerator( if (rootItem.Upd?.RepairKit != null) { // randomize repair kit (armor/weapon) uses - var resource = Math.Round((double) itemDetails.Properties.MaxRepairResource * maxMultiplier); + var resource = Math.Round( + (double)itemDetails.Properties.MaxRepairResource * maxMultiplier + ); rootItem.Upd.RepairKit.Resource = resource == 0D ? 1D : resource; return; @@ -795,11 +885,11 @@ public class RagfairOfferGenerator( if (itemHelper.IsOfBaseclass(itemDetails.Id, BaseClasses.FUEL)) { var totalCapacity = itemDetails.Properties.MaxResource; - var remainingFuel = Math.Round((double) totalCapacity * maxMultiplier); + var remainingFuel = Math.Round((double)totalCapacity * maxMultiplier); rootItem.Upd.Resource = new UpdResource { UnitsConsumed = totalCapacity - remainingFuel, - Value = remainingFuel + Value = remainingFuel, }; } } @@ -821,13 +911,19 @@ public class RagfairOfferGenerator( // Max var baseMaxDurability = itemDbDetails.Properties.MaxDurability; var lowestMaxDurability = randomUtil.GetDouble(maxMultiplier, 1) * baseMaxDurability; - var chosenMaxDurability = Math.Round(randomUtil.GetDouble((double) lowestMaxDurability, (double) baseMaxDurability)); + var chosenMaxDurability = Math.Round( + randomUtil.GetDouble((double)lowestMaxDurability, (double)baseMaxDurability) + ); // Current - var lowestCurrentDurability = randomUtil.GetDouble(currentMultiplier, 1) * chosenMaxDurability; - var chosenCurrentDurability = Math.Round(randomUtil.GetDouble(lowestCurrentDurability, chosenMaxDurability)); + var lowestCurrentDurability = + randomUtil.GetDouble(currentMultiplier, 1) * chosenMaxDurability; + var chosenCurrentDurability = Math.Round( + randomUtil.GetDouble(lowestCurrentDurability, chosenMaxDurability) + ); - item.Upd.Repairable.Durability = chosenCurrentDurability == 0 ? 1D : chosenCurrentDurability; // Never var value become 0 + item.Upd.Repairable.Durability = + chosenCurrentDurability == 0 ? 1D : chosenCurrentDurability; // Never var value become 0 item.Upd.Repairable.MaxDurability = chosenMaxDurability; } @@ -851,16 +947,22 @@ public class RagfairOfferGenerator( itemHelper.AddUpdObjectToItem(armorItem); var baseMaxDurability = itemDbDetails.Properties.MaxDurability; - var lowestMaxDurability = randomUtil.GetDouble(maxMultiplier, 1) * baseMaxDurability; - var chosenMaxDurability = Math.Round(randomUtil.GetDouble((double) lowestMaxDurability, (double) baseMaxDurability)); + var lowestMaxDurability = + randomUtil.GetDouble(maxMultiplier, 1) * baseMaxDurability; + var chosenMaxDurability = Math.Round( + randomUtil.GetDouble((double)lowestMaxDurability, (double)baseMaxDurability) + ); - var lowestCurrentDurability = randomUtil.GetDouble(currentMultiplier, 1) * chosenMaxDurability; - var chosenCurrentDurability = Math.Round(randomUtil.GetDouble(lowestCurrentDurability, chosenMaxDurability)); + var lowestCurrentDurability = + randomUtil.GetDouble(currentMultiplier, 1) * chosenMaxDurability; + var chosenCurrentDurability = Math.Round( + randomUtil.GetDouble(lowestCurrentDurability, chosenMaxDurability) + ); armorItem.Upd.Repairable = new UpdRepairable { Durability = chosenCurrentDurability == 0D ? 1D : chosenCurrentDurability, // Never var value become 0 - MaxDurability = chosenMaxDurability + MaxDurability = chosenMaxDurability, }; } } @@ -886,7 +988,7 @@ public class RagfairOfferGenerator( item.Upd.Repairable = new UpdRepairable { Durability = props.Durability, - MaxDurability = props.Durability + MaxDurability = props.Durability, }; return; @@ -894,20 +996,14 @@ public class RagfairOfferGenerator( if (isMedkit && props.MaxHpResource > 0) { - item.Upd.MedKit = new UpdMedKit - { - HpResource = props.MaxHpResource - }; + item.Upd.MedKit = new UpdMedKit { HpResource = props.MaxHpResource }; return; } if (isKey) { - item.Upd.Key = new UpdKey - { - NumberOfUsages = 0 - }; + item.Upd.Key = new UpdKey { NumberOfUsages = 0 }; return; } @@ -915,20 +1011,14 @@ public class RagfairOfferGenerator( // Food/drink if (isConsumable) { - item.Upd.FoodDrink = new UpdFoodDrink - { - HpPercent = props.MaxResource - }; + item.Upd.FoodDrink = new UpdFoodDrink { HpPercent = props.MaxResource }; return; } if (isRepairKit) { - item.Upd.RepairKit = new UpdRepairKit - { - Resource = props.MaxRepairResource - }; + item.Upd.RepairKit = new UpdRepairKit { Resource = props.MaxRepairResource }; } } @@ -938,7 +1028,10 @@ public class RagfairOfferGenerator( /// Items for sale in offer /// Barter config from ragfairConfig.Dynamic.barter /// Barter scheme - protected List CreateBarterBarterScheme(List offerItems, BarterDetails barterConfig) + protected List CreateBarterBarterScheme( + List offerItems, + BarterDetails barterConfig + ) { // Get flea price of item being sold var priceOfOfferItem = ragfairPriceService.GetDynamicOfferPriceForOffer( @@ -954,13 +1047,17 @@ public class RagfairOfferGenerator( } // Get a randomised number of barter items to list offer for - var barterItemCount = randomUtil.GetInt(barterConfig.ItemCountMin, barterConfig.ItemCountMax); + var barterItemCount = randomUtil.GetInt( + barterConfig.ItemCountMin, + barterConfig.ItemCountMax + ); // Get desired cost of individual item offer will be listed for e.g. offer = 15k, item count = 3, desired item cost = 5k var desiredItemCostRouble = Math.Round(priceOfOfferItem / barterItemCount); // Rouble amount to go above/below when looking for an item (Wiggle cost of item a little) - var offerCostVarianceRoubles = desiredItemCostRouble * barterConfig.PriceRangeVariancePercent / 100; + var offerCostVarianceRoubles = + desiredItemCostRouble * barterConfig.PriceRangeVariancePercent / 100; // Dict of items and their flea price (cached on first use) var itemFleaPrices = GetFleaPricesAsArray(); @@ -969,13 +1066,15 @@ public class RagfairOfferGenerator( var min = desiredItemCostRouble - offerCostVarianceRoubles; var max = desiredItemCostRouble + offerCostVarianceRoubles; var itemsInsidePriceBounds = itemFleaPrices.Where(itemAndPrice => - itemAndPrice.Price >= min && - itemAndPrice.Price <= max && - !string.Equals(itemAndPrice.Tpl, offerItems[0].Template, - StringComparison.OrdinalIgnoreCase) // Don't allow the item being sold to be chosen + itemAndPrice.Price >= min + && itemAndPrice.Price <= max + && !string.Equals( + itemAndPrice.Tpl, + offerItems[0].Template, + StringComparison.OrdinalIgnoreCase + ) // Don't allow the item being sold to be chosen ); - // No items on flea have a matching price, fall back to currency if (!itemsInsidePriceBounds.Any()) { @@ -985,14 +1084,7 @@ public class RagfairOfferGenerator( // Choose random item from price-filtered flea items var randomItem = randomUtil.GetArrayValue(itemsInsidePriceBounds.ToList()); - return - [ - new BarterScheme - { - Count = barterItemCount, - Template = randomItem.Tpl - } - ]; + return [new BarterScheme { Count = barterItemCount, Template = randomItem.Tpl }]; } /// @@ -1008,16 +1100,13 @@ public class RagfairOfferGenerator( // Only get prices for items that also exist in items.json var filteredFleaItems = fleaPrices - .Select(kvTpl => new TplWithFleaPrice - { - Tpl = kvTpl.Key, - Price = kvTpl.Value - } - ) + .Select(kvTpl => new TplWithFleaPrice { Tpl = kvTpl.Key, Price = kvTpl.Value }) .Where(item => itemHelper.GetItem(item.Tpl).Key); var itemTypeBlacklist = ragfairConfig.Dynamic.Barter.ItemTypeBlacklist; - allowedFleaPriceItemsForBarter = filteredFleaItems.Where(item => !itemHelper.IsOfBaseclasses(item.Tpl, itemTypeBlacklist)).ToList(); + allowedFleaPriceItemsForBarter = filteredFleaItems + .Where(item => !itemHelper.IsOfBaseclasses(item.Tpl, itemTypeBlacklist)) + .ToList(); } return allowedFleaPriceItemsForBarter; @@ -1037,15 +1126,13 @@ public class RagfairOfferGenerator( ) { var currency = ragfairServerHelper.GetDynamicOfferCurrency(); - var price = ragfairPriceService.GetDynamicOfferPriceForOffer(offerWithChildren, currency, isPackOffer) * multiplier; + var price = + ragfairPriceService.GetDynamicOfferPriceForOffer( + offerWithChildren, + currency, + isPackOffer + ) * multiplier; - return - [ - new BarterScheme - { - Count = price, - Template = currency - } - ]; + return [new BarterScheme { Count = price, Template = currency }]; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGenerator.cs index 6b7bc980..be7ade2d 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGenerator.cs @@ -37,29 +37,10 @@ public class RepeatableQuestGenerator( /// private static readonly Dictionary> _bodyPartsToClient = new() { - { - BodyParts.Arms, [ - BodyParts.LeftArm, - BodyParts.RightArm - ] - }, - { - BodyParts.Legs, [ - BodyParts.LeftLeg, - BodyParts.RightLeg - ] - }, - { - BodyParts.Head, [ - BodyParts.Head - ] - }, - { - BodyParts.Chest, [ - BodyParts.Chest, - BodyParts.Stomach - ] - }, + { BodyParts.Arms, [BodyParts.LeftArm, BodyParts.RightArm] }, + { BodyParts.Legs, [BodyParts.LeftLeg, BodyParts.RightLeg] }, + { BodyParts.Head, [BodyParts.Head] }, + { BodyParts.Chest, [BodyParts.Chest, BodyParts.Stomach] }, }; protected int _maxRandomNumberAttempts = 6; @@ -88,8 +69,8 @@ public class RepeatableQuestGenerator( var questType = _randomUtil.DrawRandomFromList(questTypePool.Types).First(); // Get traders from whitelist and filter by quest type availability - var traders = repeatableConfig.TraderWhitelist - .Where(x => x.QuestTypes.Contains(questType)) + var traders = repeatableConfig + .TraderWhitelist.Where(x => x.QuestTypes.Contains(questType)) .Select(x => x.TraderId) .ToList(); // filter out locked traders @@ -98,11 +79,34 @@ public class RepeatableQuestGenerator( return questType switch { - "Elimination" => GenerateEliminationQuest(sessionId, pmcLevel, traderId, questTypePool, repeatableConfig), - "Completion" => GenerateCompletionQuest(sessionId, pmcLevel, traderId, repeatableConfig), - "Exploration" => GenerateExplorationQuest(sessionId, pmcLevel, traderId, questTypePool, repeatableConfig), - "Pickup" => GeneratePickupQuest(sessionId, pmcLevel, traderId, questTypePool, repeatableConfig), - _ => null + "Elimination" => GenerateEliminationQuest( + sessionId, + pmcLevel, + traderId, + questTypePool, + repeatableConfig + ), + "Completion" => GenerateCompletionQuest( + sessionId, + pmcLevel, + traderId, + repeatableConfig + ), + "Exploration" => GenerateExplorationQuest( + sessionId, + pmcLevel, + traderId, + questTypePool, + repeatableConfig + ), + "Pickup" => GeneratePickupQuest( + sessionId, + pmcLevel, + traderId, + questTypePool, + repeatableConfig + ), + _ => null, }; } @@ -128,13 +132,31 @@ public class RepeatableQuestGenerator( { var rand = new Random(); - var eliminationConfig = _repeatableQuestHelper.GetEliminationConfigByPmcLevel(pmcLevel, repeatableConfig); + var eliminationConfig = _repeatableQuestHelper.GetEliminationConfigByPmcLevel( + pmcLevel, + repeatableConfig + ); var locationsConfig = repeatableConfig.Locations; - var targetsConfig = new ProbabilityObjectArray(_mathUtil, _cloner, eliminationConfig.Targets); - var bodyPartsConfig = new ProbabilityObjectArray>(_mathUtil, _cloner, eliminationConfig.BodyParts); - var weaponCategoryRequirementConfig = - new ProbabilityObjectArray>(_mathUtil, _cloner, eliminationConfig.WeaponCategoryRequirements); - var weaponRequirementConfig = new ProbabilityObjectArray>(_mathUtil, _cloner, eliminationConfig.WeaponRequirements); + var targetsConfig = new ProbabilityObjectArray( + _mathUtil, + _cloner, + eliminationConfig.Targets + ); + var bodyPartsConfig = new ProbabilityObjectArray>( + _mathUtil, + _cloner, + eliminationConfig.BodyParts + ); + var weaponCategoryRequirementConfig = new ProbabilityObjectArray>( + _mathUtil, + _cloner, + eliminationConfig.WeaponCategoryRequirements + ); + var weaponRequirementConfig = new ProbabilityObjectArray>( + _mathUtil, + _cloner, + eliminationConfig.WeaponRequirements + ); // the difficulty of the quest varies in difficulty depending on the condition // possible conditions are @@ -157,8 +179,7 @@ public class RepeatableQuestGenerator( // times the number of kills we have to perform): // The minimum difficulty is the difficulty for the most probable (= easiest target) with no additional conditions - var minDifficulty = - 1 / targetsConfig.MaxProbability(); // min difficulty is the lowest amount of scavs without any constraints + var minDifficulty = 1 / targetsConfig.MaxProbability(); // min difficulty is the lowest amount of scavs without any constraints // Target on bodyPart max. difficulty is that of the least probable element var maxTargetDifficulty = 1 / targetsConfig.MinProbability(); @@ -172,7 +193,10 @@ public class RepeatableQuestGenerator( var targetPool = questTypePool.Pool.Elimination; targetsConfig = targetsConfig.Filter(x => targetPool.Targets.ContainsKey(x.Key)); - if (targetsConfig.Count == 0 || targetsConfig.All(x => x.Data.IsBoss.GetValueOrDefault(false))) + if ( + targetsConfig.Count == 0 + || targetsConfig.All(x => x.Data.IsBoss.GetValueOrDefault(false)) + ) { // There are no more targets left for elimination; delete it as a possible quest type // also if only bosses are left we need to leave otherwise it's a guaranteed boss elimination @@ -190,9 +214,13 @@ public class RepeatableQuestGenerator( // we use any as location if "any" is in the pool, and we don't hit the specific location random // we use any also if the random condition is not met in case only "any" was in the pool var locationKey = "any"; - if (locations.Contains("any") && - (eliminationConfig.SpecificLocationProbability < rand.NextDouble() || locations.Count <= 1) - ) + if ( + locations.Contains("any") + && ( + eliminationConfig.SpecificLocationProbability < rand.NextDouble() + || locations.Count <= 1 + ) + ) { locationKey = "any"; targetPool.Targets.Remove(botTypeToEliminate); @@ -207,17 +235,21 @@ public class RepeatableQuestGenerator( locationKey = _randomUtil.DrawRandomFromList(locations).FirstOrDefault(); // Get a pool of locations the chosen bot type can be eliminated on - if (!targetPool.Targets.TryGetValue( + if ( + !targetPool.Targets.TryGetValue( botTypeToEliminate, out var possibleLocationPool - )) + ) + ) { - _logger.Warning($"Bot to kill: {botTypeToEliminate} not found in elimination dict"); + _logger.Warning( + $"Bot to kill: {botTypeToEliminate} not found in elimination dict" + ); } // Filter locations bot can be killed on to just those not chosen by key - possibleLocationPool.Locations = possibleLocationPool.Locations - .Where(location => location != locationKey) + possibleLocationPool.Locations = possibleLocationPool + .Locations.Where(location => location != locationKey) .ToList(); // None left after filtering @@ -231,7 +263,11 @@ public class RepeatableQuestGenerator( else { // Never should reach this if everything works out - _logger.Error(_localisationService.GetText("quest-repeatable_elimination_generation_failed_please_report")); + _logger.Error( + _localisationService.GetText( + "quest-repeatable_elimination_generation_failed_please_report" + ) + ); } } @@ -267,49 +303,54 @@ public class RepeatableQuestGenerator( // Draw a distance condition int? distance = null; var distanceDifficulty = 0; - var isDistanceRequirementAllowed = !eliminationConfig.DistLocationBlacklist.Contains(locationKey); + var isDistanceRequirementAllowed = !eliminationConfig.DistLocationBlacklist.Contains( + locationKey + ); if (targetsConfig.Data(botTypeToEliminate).IsBoss.GetValueOrDefault(false)) { // Get all boss spawn information - var bossSpawns = _databaseService.GetLocations() + var bossSpawns = _databaseService + .GetLocations() .GetDictionary() .Select(x => x.Value) .Where(x => x.Base?.Id != null) - .Select(x => new - { - x.Base.Id, - BossSpawn = x.Base.BossLocationSpawn - } - ); + .Select(x => new { x.Base.Id, BossSpawn = x.Base.BossLocationSpawn }); // filter for the current boss to spawn on map var thisBossSpawns = bossSpawns .Select(x => new - { - x.Id, - BossSpawn = x.BossSpawn - .Where(e => e.BossName == botTypeToEliminate) - } - ) + { + x.Id, + BossSpawn = x.BossSpawn.Where(e => e.BossName == botTypeToEliminate), + }) .Where(x => x.BossSpawn.Count() > 0); // remove blacklisted locations - var allowedSpawns = thisBossSpawns.Where(x => !eliminationConfig.DistLocationBlacklist.Contains(x.Id)); + var allowedSpawns = thisBossSpawns.Where(x => + !eliminationConfig.DistLocationBlacklist.Contains(x.Id) + ); // if the boss spawns on nom-blacklisted locations and the current location is allowed we can generate a distance kill requirement - isDistanceRequirementAllowed = isDistanceRequirementAllowed && allowedSpawns.Count() > 0; + isDistanceRequirementAllowed = + isDistanceRequirementAllowed && allowedSpawns.Count() > 0; } - if (eliminationConfig.DistanceProbability > rand.NextDouble() && isDistanceRequirementAllowed) + if ( + eliminationConfig.DistanceProbability > rand.NextDouble() + && isDistanceRequirementAllowed + ) { // Random distance with lower values more likely; simple distribution for starters... - distance = (int) Math.Floor( - Math.Abs(rand.NextDouble() - rand.NextDouble()) * - (1 + eliminationConfig.MaxDistance - eliminationConfig.MinDistance) + - eliminationConfig.MinDistance ?? - 0 - ); + distance = (int) + Math.Floor( + Math.Abs(rand.NextDouble() - rand.NextDouble()) + * (1 + eliminationConfig.MaxDistance - eliminationConfig.MinDistance) + + eliminationConfig.MinDistance + ?? 0 + ); - distance = (int) Math.Ceiling((decimal) (distance / 5)) * 5; - distanceDifficulty = (int) (maxDistDifficulty * distance / eliminationConfig.MaxDistance); + distance = (int)Math.Ceiling((decimal)(distance / 5)) * 5; + distanceDifficulty = (int)( + maxDistDifficulty * distance / eliminationConfig.MaxDistance + ); } string? allowedWeaponsCategory = null; @@ -321,18 +362,18 @@ public class RepeatableQuestGenerator( List weaponTypeBlacklist = ["Shotgun", "Pistol"]; // Filter out close range weapons from long distance requirement - weaponCategoryRequirementConfig - .RemoveAll(category => weaponTypeBlacklist - .Contains(category.Key)); + weaponCategoryRequirementConfig.RemoveAll(category => + weaponTypeBlacklist.Contains(category.Key) + ); } else if (distance < 20) { List weaponTypeBlacklist = ["MarksmanRifle", "DMR"]; // Filter out far range weapons from close distance requirement - weaponCategoryRequirementConfig - .RemoveAll(category => weaponTypeBlacklist - .Contains(category.Key)); + weaponCategoryRequirementConfig.RemoveAll(category => + weaponTypeBlacklist.Contains(category.Key) + ); } // Pick a weighted weapon category @@ -344,16 +385,25 @@ public class RepeatableQuestGenerator( // Only allow a specific weapon requirement if a weapon category was not chosen string? allowedWeapon = null; - if (allowedWeaponsCategory is not null && eliminationConfig.WeaponRequirementProbability > rand.NextDouble()) + if ( + allowedWeaponsCategory is not null + && eliminationConfig.WeaponRequirementProbability > rand.NextDouble() + ) { var weaponRequirement = weaponRequirementConfig.Draw(1, false); var specificAllowedWeaponCategory = weaponRequirementConfig.Data(weaponRequirement[0]); - var allowedWeapons = _itemHelper.GetItemTplsOfBaseType(specificAllowedWeaponCategory[0]); + var allowedWeapons = _itemHelper.GetItemTplsOfBaseType( + specificAllowedWeaponCategory[0] + ); allowedWeapon = _randomUtil.GetArrayValue(allowedWeapons); } // Draw how many npm kills are required - var desiredKillCount = GetEliminationKillCount(botTypeToEliminate, targetsConfig, eliminationConfig); + var desiredKillCount = GetEliminationKillCount( + botTypeToEliminate, + targetsConfig, + eliminationConfig + ); var killDifficulty = desiredKillCount; // not perfectly happy here; we give difficulty = 1 to the quest reward generation when we have the most difficult mission @@ -372,7 +422,12 @@ public class RepeatableQuestGenerator( // crazy maximum difficulty will lead to a higher difficulty reward gain factor than 1 var difficulty = _mathUtil.MapToRange(curDifficulty, minDifficulty, maxDifficulty, 0.5, 2); - var quest = GenerateRepeatableTemplate("Elimination", traderId, repeatableConfig.Side, sessionId); + var quest = GenerateRepeatableTemplate( + "Elimination", + traderId, + repeatableConfig.Side, + sessionId + ); // ASSUMPTION: All fence quests are for scavs if (traderId == Traders.FENCE) @@ -427,19 +482,29 @@ public class RepeatableQuestGenerator( protected int GetEliminationKillCount( string targetKey, ProbabilityObjectArray targetsConfig, - EliminationConfig eliminationConfig) + EliminationConfig eliminationConfig + ) { if (targetsConfig.Data(targetKey).IsBoss.GetValueOrDefault(false)) { - return _randomUtil.RandInt(eliminationConfig.MinBossKills.Value, eliminationConfig.MaxBossKills + 1); + return _randomUtil.RandInt( + eliminationConfig.MinBossKills.Value, + eliminationConfig.MaxBossKills + 1 + ); } if (targetsConfig.Data(targetKey).IsPmc.GetValueOrDefault(false)) { - return _randomUtil.RandInt(eliminationConfig.MinPmcKills.Value, eliminationConfig.MaxPmcKills + 1); + return _randomUtil.RandInt( + eliminationConfig.MinPmcKills.Value, + eliminationConfig.MaxPmcKills + 1 + ); } - return _randomUtil.RandInt(eliminationConfig.MinKills.Value, eliminationConfig.MaxKills + 1); + return _randomUtil.RandInt( + eliminationConfig.MinKills.Value, + eliminationConfig.MaxKills + 1 + ); } protected double DifficultyWeighing( @@ -447,7 +512,8 @@ public class RepeatableQuestGenerator( double bodyPart, int dist, int kill, - int weaponRequirement) + int weaponRequirement + ) { return Math.Sqrt(Math.Sqrt(target) + bodyPart + dist + weaponRequirement) * kill; } @@ -466,7 +532,7 @@ public class RepeatableQuestGenerator( Id = _hashUtil.Generate(), DynamicLocale = true, Target = new ListOrT(location, null), - ConditionType = "Location" + ConditionType = "Location", }; } @@ -495,12 +561,8 @@ public class RepeatableQuestGenerator( Value = 1, ResetOnSessionEnd = false, EnemyHealthEffects = [], - Daytime = new DaytimeCounter - { - From = 0, - To = 0 - }, - ConditionType = "Kills" + Daytime = new DaytimeCounter { From = 0, To = 0 }, + ConditionType = "Kills", }; if (target.StartsWith("boss")) @@ -521,7 +583,7 @@ public class RepeatableQuestGenerator( killConditionProps.Distance = new CounterConditionDistance { CompareMethod = ">=", - Value = distance.Value + Value = distance.Value, }; } @@ -567,39 +629,49 @@ public class RepeatableQuestGenerator( var levelsConfig = repeatableConfig.RewardScaling.Levels; var roublesConfig = repeatableConfig.RewardScaling.Roubles; - var quest = GenerateRepeatableTemplate("Completion", traderId, repeatableConfig.Side, sessionId); + var quest = GenerateRepeatableTemplate( + "Completion", + traderId, + repeatableConfig.Side, + sessionId + ); // Filter the items.json items to items the player must retrieve to complete quest: shouldn't be a quest item or "non-existent" - var itemsToRetrievePool = GetItemsToRetrievePool(completionConfig, repeatableConfig.RewardBlacklist); + var itemsToRetrievePool = GetItemsToRetrievePool( + completionConfig, + repeatableConfig.RewardBlacklist + ); // Be fair, don't value the items be more expensive than the reward var multiplier = _randomUtil.GetDouble(0.5, 1); var roublesBudget = Math.Floor( - (double) (_mathUtil.Interp1(pmcLevel, levelsConfig, roublesConfig) * multiplier) + (double)(_mathUtil.Interp1(pmcLevel, levelsConfig, roublesConfig) * multiplier) ); roublesBudget = Math.Max(roublesBudget, 5000d); - var itemSelection = itemsToRetrievePool.Where(itemTpl => _itemHelper.GetItemPrice(itemTpl) < roublesBudget - ) + var itemSelection = itemsToRetrievePool + .Where(itemTpl => _itemHelper.GetItemPrice(itemTpl) < roublesBudget) .ToList(); // We also have the option to use whitelist and/or blacklist which is defined in repeatableQuests.json as // [{"minPlayerLevel": 1, "itemIds": ["id1",...]}, {"minPlayerLevel": 15, "itemIds": ["id3",...]}] if (repeatableConfig.QuestConfig.Completion.UseWhitelist.GetValueOrDefault(false)) { - var itemWhitelist = _databaseService.GetTemplates().RepeatableQuests.Data.Completion.ItemsWhitelist; + var itemWhitelist = _databaseService + .GetTemplates() + .RepeatableQuests.Data.Completion.ItemsWhitelist; // Filter and concatenate items according to current player level var itemIdsWhitelisted = itemWhitelist .Where(p => p.MinPlayerLevel <= pmcLevel) .SelectMany(x => x.ItemIds) .ToHashSet(); //.Aggregate((a, p) => a.Concat(p.ItemIds), []); - itemSelection = itemSelection.Where(x => - { - // Whitelist can contain item tpls and item base type ids - return itemIdsWhitelisted.Any(v => _itemHelper.IsOfBaseclass(x, v)) || - itemIdsWhitelisted.Contains(x); - } - ) + itemSelection = itemSelection + .Where(x => + { + // Whitelist can contain item tpls and item base type ids + return itemIdsWhitelisted.Any(v => _itemHelper.IsOfBaseclass(x, v)) + || itemIdsWhitelisted.Contains(x); + }) .ToList(); // check if items are missing // var flatList = itemSelection.reduce((a, il) => a.concat(il[0]), []); @@ -608,7 +680,9 @@ public class RepeatableQuestGenerator( if (repeatableConfig.QuestConfig.Completion.UseBlacklist.GetValueOrDefault(false)) { - var itemBlacklist = _databaseService.GetTemplates().RepeatableQuests.Data.Completion.ItemsBlacklist; + var itemBlacklist = _databaseService + .GetTemplates() + .RepeatableQuests.Data.Completion.ItemsBlacklist; // Filter and concatenate the arrays according to current player level var itemIdsBlacklisted = itemBlacklist @@ -616,12 +690,12 @@ public class RepeatableQuestGenerator( .SelectMany(x => x.ItemIds) .ToHashSet(); //.Aggregate(List , (a, p) => a.Concat(p.ItemIds) ); - itemSelection = itemSelection.Where(x => - { - return itemIdsBlacklisted.All(v => !_itemHelper.IsOfBaseclass(x, v)) || - !itemIdsBlacklisted.Contains(x); - } - ) + itemSelection = itemSelection + .Where(x => + { + return itemIdsBlacklisted.All(v => !_itemHelper.IsOfBaseclass(x, v)) + || !itemIdsBlacklisted.Contains(x); + }) .ToList(); } @@ -638,7 +712,10 @@ public class RepeatableQuestGenerator( } // Store the indexes of items we are asking player to supply - var distinctItemsToRetrieveCount = _randomUtil.GetInt(1, completionConfig.UniqueItemCount.Value); + var distinctItemsToRetrieveCount = _randomUtil.GetInt( + 1, + completionConfig.UniqueItemCount.Value + ); var chosenRequirementItemsTpls = new List(); var usedItemIndexes = new HashSet(); for (var i = 0; i < distinctItemsToRetrieveCount; i++) @@ -664,11 +741,7 @@ public class RepeatableQuestGenerator( _logger.Error( _localisationService.GetText( "repeatable-no_reward_item_found_in_price_range", - new - { - minPrice = 0, - roublesBudget - } + new { minPrice = 0, roublesBudget } ) ); @@ -686,11 +759,11 @@ public class RepeatableQuestGenerator( var value = minValue; // Get the value range within budget - var x = (int) Math.Floor(roublesBudget / itemPrice); + var x = (int)Math.Floor(roublesBudget / itemPrice); maxValue = Math.Min(maxValue, x); if (maxValue > minValue) - // If it doesn't blow the budget we have for the request, draw a random amount of the selected - // Item type to be requested + // If it doesn't blow the budget we have for the request, draw a random amount of the selected + // Item type to be requested { value = _randomUtil.RandInt(minValue, maxValue + 1); } @@ -699,13 +772,20 @@ public class RepeatableQuestGenerator( // Push a CompletionCondition with the item and the amount of the item into quest chosenRequirementItemsTpls.Add(tplChosen); - quest.Conditions.AvailableForFinish.Add(GenerateCompletionAvailableForFinish(tplChosen, value, repeatableConfig.QuestConfig.Completion)); + quest.Conditions.AvailableForFinish.Add( + GenerateCompletionAvailableForFinish( + tplChosen, + value, + repeatableConfig.QuestConfig.Completion + ) + ); // Is there budget left for more items if (roublesBudget > 0) { // Reduce item pool to fit budget - itemSelection = itemSelection.Where(tpl => _itemHelper.GetItemPrice(tpl) < roublesBudget) + itemSelection = itemSelection + .Where(tpl => _itemHelper.GetItemPrice(tpl) < roublesBudget) .ToList(); if (!itemSelection.Any()) { @@ -737,35 +817,39 @@ public class RepeatableQuestGenerator( /// Completion quest type config /// Item tpls to not add to pool /// Set of item tpls - protected HashSet GetItemsToRetrievePool(Completion completionConfig, HashSet itemTplBlacklist) + protected HashSet GetItemsToRetrievePool( + Completion completionConfig, + HashSet itemTplBlacklist + ) { // Get seasonal items that should not be added to pool as seasonal event is not active var seasonalItems = _seasonalEventService.GetInactiveSeasonalEventItems(); // Check for specific base classes which don't make sense as reward item // also check if the price is greater than 0; there are some items whose price can not be found - return _databaseService.GetItems() + return _databaseService + .GetItems() .Values.Where(itemTemplate => + { + // Base "Item" item has no parent, ignore it + if (itemTemplate.Parent == string.Empty) { - // Base "Item" item has no parent, ignore it - if (itemTemplate.Parent == string.Empty) - { - return false; - } - - if (seasonalItems.Contains(itemTemplate.Id)) - { - return false; - } - - // Valid reward items share same logic as items to retrieve - return _repeatableQuestRewardGenerator.IsValidRewardItem( - itemTemplate.Id, - itemTplBlacklist, - completionConfig.RequiredItemTypeBlacklist - ); + return false; } - ).Select(item => item.Id) + + if (seasonalItems.Contains(itemTemplate.Id)) + { + return false; + } + + // Valid reward items share same logic as items to retrieve + return _repeatableQuestRewardGenerator.IsValidRewardItem( + itemTemplate.Id, + itemTplBlacklist, + completionConfig.RequiredItemTypeBlacklist + ); + }) + .Select(item => item.Id) .ToHashSet(); } @@ -779,13 +863,23 @@ public class RepeatableQuestGenerator( /// Amount of items of this specific type to request /// Completion config from quest.json /// object of "Completion"-condition - protected QuestCondition GenerateCompletionAvailableForFinish(string itemTpl, + protected QuestCondition GenerateCompletionAvailableForFinish( + string itemTpl, double value, - Completion completionConfig) + Completion completionConfig + ) { var onlyFoundInRaid = completionConfig.RequiredItemsAreFiR; - var minDurability = _itemHelper.IsOfBaseclasses(itemTpl, [BaseClasses.WEAPON, BaseClasses.ARMOR]) - ? _randomUtil.GetArrayValue([completionConfig.RequiredItemMinDurabilityMinMax.Min, completionConfig.RequiredItemMinDurabilityMinMax.Max]) + var minDurability = _itemHelper.IsOfBaseclasses( + itemTpl, + [BaseClasses.WEAPON, BaseClasses.ARMOR] + ) + ? _randomUtil.GetArrayValue( + [ + completionConfig.RequiredItemMinDurabilityMinMax.Min, + completionConfig.RequiredItemMinDurabilityMinMax.Max, + ] + ) : 0; // Dog tags MUST NOT be FiR for them to work @@ -809,7 +903,7 @@ public class RepeatableQuestGenerator( DogtagLevel = 0, OnlyFoundInRaid = onlyFoundInRaid, IsEncoded = false, - ConditionType = "HandoverItem" + ConditionType = "HandoverItem", }; } @@ -830,11 +924,13 @@ public class RepeatableQuestGenerator( int pmcLevel, string traderId, QuestTypePool questTypePool, - RepeatableQuestConfig repeatableConfig) + RepeatableQuestConfig repeatableConfig + ) { var explorationConfig = repeatableConfig.QuestConfig.Exploration; var requiresSpecificExtract = - _randomUtil.Random.Next() < repeatableConfig.QuestConfig.Exploration.SpecificExits.Probability; + _randomUtil.Random.Next() + < repeatableConfig.QuestConfig.Exploration.SpecificExits.Probability; if (questTypePool.Pool.Exploration.Locations.Count == 0) { @@ -845,7 +941,9 @@ public class RepeatableQuestGenerator( // If location drawn is factory, it's possible to either get factory4_day and factory4_night or only one // of the both - var locationKey = _randomUtil.DrawRandomFromDict(questTypePool.Pool.Exploration.Locations)[0]; + var locationKey = _randomUtil.DrawRandomFromDict(questTypePool.Pool.Exploration.Locations)[ + 0 + ]; var locationTarget = questTypePool.Pool.Exploration.Locations[locationKey]; // Remove the location from the available pool @@ -857,25 +955,34 @@ public class RepeatableQuestGenerator( : explorationConfig.MaximumExtracts + 1; var numExtracts = _randomUtil.RandInt(1, exitTimesMax); - var quest = GenerateRepeatableTemplate("Exploration", traderId, repeatableConfig.Side, sessionId); + var quest = GenerateRepeatableTemplate( + "Exploration", + traderId, + repeatableConfig.Side, + sessionId + ); var exitStatusCondition = new QuestConditionCounterCondition { Id = _hashUtil.Generate(), DynamicLocale = true, Status = ["Survived"], - ConditionType = "ExitStatus" + ConditionType = "ExitStatus", }; var locationCondition = new QuestConditionCounterCondition { Id = _hashUtil.Generate(), DynamicLocale = true, Target = new ListOrT(locationTarget, null), - ConditionType = "Location" + ConditionType = "Location", }; quest.Conditions.AvailableForFinish[0].Counter.Id = _hashUtil.Generate(); - quest.Conditions.AvailableForFinish[0].Counter.Conditions = [exitStatusCondition, locationCondition]; + quest.Conditions.AvailableForFinish[0].Counter.Conditions = + [ + exitStatusCondition, + locationCondition, + ]; quest.Conditions.AvailableForFinish[0].Value = numExtracts; quest.Conditions.AvailableForFinish[0].Id = _hashUtil.Generate(); quest.Location = GetQuestLocationByMapId(locationKey.ToString()); @@ -889,9 +996,10 @@ public class RepeatableQuestGenerator( var exitPool = mapExits.Where(exit => exit.Chance > 0).ToList(); // Exclude exits with a requirement to leave (e.g. car extracts) - var possibleExits = exitPool.Where(exit => - exit.PassageRequirement is not null || - repeatableConfig.QuestConfig.Exploration.SpecificExits.PassageRequirementWhitelist.Contains( + var possibleExits = exitPool + .Where(exit => + exit.PassageRequirement is not null + || repeatableConfig.QuestConfig.Exploration.SpecificExits.PassageRequirementWhitelist.Contains( "PassageRequirement" ) ) @@ -899,7 +1007,9 @@ public class RepeatableQuestGenerator( if (possibleExits.Count == 0) { - _logger.Error($"Unable to choose specific exit on map: {locationKey}, Possible exit pool was empty"); + _logger.Error( + $"Unable to choose specific exit on map: {locationKey}, Possible exit pool was empty" + ); } else { @@ -914,7 +1024,13 @@ public class RepeatableQuestGenerator( // Difficulty for exploration goes from 1 extract to maxExtracts // Difficulty for reward goes from 0.2...1 -> map - var difficulty = _mathUtil.MapToRange(numExtracts, 1, explorationConfig.MaximumExtracts.Value, 0.2, 1); + var difficulty = _mathUtil.MapToRange( + numExtracts, + 1, + explorationConfig.MaximumExtracts.Value, + 0.2, + 1 + ); quest.Rewards = _repeatableQuestRewardGenerator.GenerateReward( pmcLevel, difficulty, @@ -944,13 +1060,21 @@ public class RepeatableQuestGenerator( int pmcLevel, string traderId, QuestTypePool questTypePool, - RepeatableQuestConfig repeatableConfig) + RepeatableQuestConfig repeatableConfig + ) { var pickupConfig = repeatableConfig.QuestConfig.Pickup; - var quest = GenerateRepeatableTemplate("Pickup", traderId, repeatableConfig.Side, sessionId); + var quest = GenerateRepeatableTemplate( + "Pickup", + traderId, + repeatableConfig.Side, + sessionId + ); - var itemTypeToFetchWithCount = _randomUtil.GetArrayValue(pickupConfig.ItemTypeToFetchWithMaxCount); + var itemTypeToFetchWithCount = _randomUtil.GetArrayValue( + pickupConfig.ItemTypeToFetchWithMaxCount + ); var itemCountToFetch = _randomUtil.RandInt( itemTypeToFetchWithCount.MinimumPickupCount.Value, itemTypeToFetchWithCount.MaximumPickupCount + 1 @@ -959,18 +1083,25 @@ public class RepeatableQuestGenerator( // var locationKey: string = this.randomUtil.drawRandomFromDict(questTypePool.pool.Pickup.locations)[0]; // var locationTarget = questTypePool.pool.Pickup.locations[locationKey]; - var findCondition = quest.Conditions.AvailableForFinish.FirstOrDefault(x => x.ConditionType == "FindItem"); + var findCondition = quest.Conditions.AvailableForFinish.FirstOrDefault(x => + x.ConditionType == "FindItem" + ); findCondition.Target = new ListOrT([itemTypeToFetchWithCount.ItemType], null); findCondition.Value = itemCountToFetch; - var counterCreatorCondition = quest.Conditions.AvailableForFinish.FirstOrDefault(x => x.ConditionType == "CounterCreator" + var counterCreatorCondition = quest.Conditions.AvailableForFinish.FirstOrDefault(x => + x.ConditionType == "CounterCreator" ); // var locationCondition = counterCreatorCondition._props.counter.conditions.find(x => x._parent === "Location"); // (locationCondition._props as ILocationConditionProps).target = [...locationTarget]; - var equipmentCondition = counterCreatorCondition.Counter.Conditions.FirstOrDefault(x => x.ConditionType == "Equipment" + var equipmentCondition = counterCreatorCondition.Counter.Conditions.FirstOrDefault(x => + x.ConditionType == "Equipment" ); - equipmentCondition.EquipmentInclusive = [[itemTypeToFetchWithCount.ItemType]]; + equipmentCondition.EquipmentInclusive = + [ + [itemTypeToFetchWithCount.ItemType], + ]; // Add rewards quest.Rewards = _repeatableQuestRewardGenerator.GenerateReward( @@ -1007,7 +1138,7 @@ public class RepeatableQuestGenerator( Id = _hashUtil.Generate(), DynamicLocale = true, ExitName = exit.Name, - ConditionType = "ExitName" + ConditionType = "ExitName", }; } @@ -1027,7 +1158,8 @@ public class RepeatableQuestGenerator( string type, string traderId, string side, - string sessionId) + string sessionId + ) { RepeatableQuest questData = null; switch (type) @@ -1082,35 +1214,35 @@ public class RepeatableQuestGenerator( // Force REF templates to use prapors ID - solves missing text issue var desiredTraderId = traderId == Traders.REF ? Traders.PRAPOR : traderId; - questClone.Name = questClone.Name - .Replace("{traderId}", traderId) + questClone.Name = questClone + .Name.Replace("{traderId}", traderId) .Replace("{templateId}", questClone.TemplateId); - questClone.Note = questClone.Note - .Replace("{traderId}", desiredTraderId) + questClone.Note = questClone + .Note.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.Description = questClone.Description - .Replace("{traderId}", desiredTraderId) + questClone.Description = questClone + .Description.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.SuccessMessageText = questClone.SuccessMessageText - .Replace("{traderId}", desiredTraderId) + questClone.SuccessMessageText = questClone + .SuccessMessageText.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.FailMessageText = questClone.FailMessageText - .Replace("{traderId}", desiredTraderId) + questClone.FailMessageText = questClone + .FailMessageText.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.StartedMessageText = questClone.StartedMessageText - .Replace("{traderId}", desiredTraderId) + questClone.StartedMessageText = questClone + .StartedMessageText.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.ChangeQuestMessageText = questClone.ChangeQuestMessageText - .Replace("{traderId}", desiredTraderId) + questClone.ChangeQuestMessageText = questClone + .ChangeQuestMessageText.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.AcceptPlayerMessage = questClone.AcceptPlayerMessage - .Replace("{traderId}", desiredTraderId) + questClone.AcceptPlayerMessage = questClone + .AcceptPlayerMessage.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.DeclinePlayerMessage = questClone.DeclinePlayerMessage - .Replace("{traderId}", desiredTraderId) + questClone.DeclinePlayerMessage = questClone + .DeclinePlayerMessage.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); - questClone.CompletePlayerMessage = questClone.CompletePlayerMessage - .Replace("{traderId}", desiredTraderId) + questClone.CompletePlayerMessage = questClone + .CompletePlayerMessage.Replace("{traderId}", desiredTraderId) .Replace("{templateId}", questClone.TemplateId); questClone.QuestStatus.Id = _hashUtil.Generate(); diff --git a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestRewardGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestRewardGenerator.cs index 4c72752a..d2758588 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestRewardGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestRewardGenerator.cs @@ -64,10 +64,15 @@ public class RepeatableQuestRewardGenerator( string traderId, RepeatableQuestConfig repeatableConfig, BaseQuestConfig eliminationConfig, - List? rewardTplBlacklist = null) + List? rewardTplBlacklist = null + ) { // Get vars to configure rewards with - var rewardParams = GetQuestRewardValues(repeatableConfig.RewardScaling, difficulty, pmcLevel); + var rewardParams = GetQuestRewardValues( + repeatableConfig.RewardScaling, + difficulty, + pmcLevel + ); // Get budget to spend on item rewards (copy of raw roubles given) var itemRewardBudget = rewardParams.RewardRoubles; @@ -77,7 +82,7 @@ public class RepeatableQuestRewardGenerator( { Started = [], Success = [], - Fail = [] + Fail = [], }; // Start reward index to keep track @@ -95,28 +100,40 @@ public class RepeatableQuestRewardGenerator( AvailableInGameEditions = [], Index = rewardIndex, Value = rewardParams.RewardXP, - Type = RewardType.Experience + Type = RewardType.Experience, } ); rewardIndex++; } // Add money reward - rewards.Success.Add(GetMoneyReward(traderId, rewardParams.RewardRoubles.Value, rewardIndex)); + rewards.Success.Add( + GetMoneyReward(traderId, rewardParams.RewardRoubles.Value, rewardIndex) + ); rewardIndex++; // Add GP coin reward - rewards.Success.Add(GenerateItemReward(Money.GP, rewardParams.GpCoinRewardCount.Value, rewardIndex)); + rewards.Success.Add( + GenerateItemReward(Money.GP, rewardParams.GpCoinRewardCount.Value, rewardIndex) + ); rewardIndex++; // Add preset weapon to reward if checks pass - var traderWhitelistDetails = repeatableConfig.TraderWhitelist.FirstOrDefault(traderWhitelist => traderWhitelist.TraderId == traderId + var traderWhitelistDetails = repeatableConfig.TraderWhitelist.FirstOrDefault( + traderWhitelist => traderWhitelist.TraderId == traderId ); - if (traderWhitelistDetails?.RewardCanBeWeapon ?? - (false && _randomUtil.GetChance100(traderWhitelistDetails.WeaponRewardChancePercent ?? 0)) - ) + if ( + traderWhitelistDetails?.RewardCanBeWeapon + ?? ( + false + && _randomUtil.GetChance100(traderWhitelistDetails.WeaponRewardChancePercent ?? 0) + ) + ) { - var chosenWeapon = GetRandomWeaponPresetWithinBudget(itemRewardBudget.Value, rewardIndex); + var chosenWeapon = GetRandomWeaponPresetWithinBudget( + itemRewardBudget.Value, + rewardIndex + ); if (chosenWeapon is not null) { rewards.Success.Add(chosenWeapon.Value.Key); @@ -127,11 +144,16 @@ public class RepeatableQuestRewardGenerator( } } - var inBudgetRewardItemPool = ChooseRewardItemsWithinBudget(repeatableConfig, itemRewardBudget, traderId); + var inBudgetRewardItemPool = ChooseRewardItemsWithinBudget( + repeatableConfig, + itemRewardBudget, + traderId + ); if (rewardTplBlacklist is not null) { // Filter reward pool of items from blacklist, only use if there's at least 1 item remaining - var filteredRewardItemPool = inBudgetRewardItemPool.Where(item => !rewardTplBlacklist.Contains(item.Id) + var filteredRewardItemPool = inBudgetRewardItemPool.Where(item => + !rewardTplBlacklist.Contains(item.Id) ); if (filteredRewardItemPool.Count() > 0) { @@ -139,7 +161,6 @@ public class RepeatableQuestRewardGenerator( } } - if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( @@ -159,7 +180,9 @@ public class RepeatableQuestRewardGenerator( // Add item rewards foreach (var itemReward in itemsToReward) { - rewards.Success.Add(GenerateItemReward(itemReward.Key.Id, itemReward.Value, rewardIndex)); + rewards.Success.Add( + GenerateItemReward(itemReward.Key.Id, itemReward.Value, rewardIndex) + ); rewardIndex++; } } @@ -176,19 +199,21 @@ public class RepeatableQuestRewardGenerator( Target = traderId, Value = rewardParams.RewardReputation, Type = RewardType.TraderStanding, - Index = rewardIndex + Index = rewardIndex, }; rewards.Success.Add(reward); rewardIndex++; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Adding: {rewardParams.RewardReputation} {traderId} trader reputation reward"); + _logger.Debug( + $"Adding: {rewardParams.RewardReputation} {traderId} trader reputation reward" + ); } } // Chance of adding skill reward - if (_randomUtil.GetChance100((double) rewardParams.SkillRewardChance * 100)) + if (_randomUtil.GetChance100((double)rewardParams.SkillRewardChance * 100)) { var targetSkill = _randomUtil.GetArrayValue(eliminationConfig.PossibleSkillRewards); Reward reward = new() @@ -200,20 +225,26 @@ public class RepeatableQuestRewardGenerator( Target = targetSkill, Value = rewardParams.SkillPointReward, Type = RewardType.Skill, - Index = rewardIndex + Index = rewardIndex, }; rewards.Success.Add(reward); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Adding {rewardParams.SkillPointReward} skill points to {targetSkill}"); + _logger.Debug( + $"Adding {rewardParams.SkillPointReward} skill points to {targetSkill}" + ); } } return rewards; } - protected QuestRewardValues GetQuestRewardValues(RewardScaling? rewardScaling, double? difficulty, int pmcLevel) + protected QuestRewardValues GetQuestRewardValues( + RewardScaling? rewardScaling, + double? difficulty, + int pmcLevel + ) { // difficulty could go from 0.2 ... -> for lowest difficulty receive 0.2*nominal reward var levelsConfig = rewardScaling.Levels; @@ -258,61 +289,102 @@ public class RepeatableQuestRewardGenerator( gpCoinConfig, rewardSpreadConfig ), - RewardXP = GetRewardXp(effectiveDifficulty, pmcLevel, levelsConfig, xpConfig, rewardSpreadConfig) + RewardXP = GetRewardXp( + effectiveDifficulty, + pmcLevel, + levelsConfig, + xpConfig, + rewardSpreadConfig + ), }; } - protected double GetRewardXp(double? effectiveDifficulty, int pmcLevel, List? levelsConfig, - List? xpConfig, double? rewardSpreadConfig) + protected double GetRewardXp( + double? effectiveDifficulty, + int pmcLevel, + List? levelsConfig, + List? xpConfig, + double? rewardSpreadConfig + ) { return Math.Floor( - effectiveDifficulty * - _mathUtil.Interp1(pmcLevel, levelsConfig, xpConfig) * - _randomUtil.GetDouble((double) (1 - rewardSpreadConfig), (double) (1 + rewardSpreadConfig)) ?? - 0 + effectiveDifficulty + * _mathUtil.Interp1(pmcLevel, levelsConfig, xpConfig) + * _randomUtil.GetDouble( + (double)(1 - rewardSpreadConfig), + (double)(1 + rewardSpreadConfig) + ) + ?? 0 ); } - protected double GetGpCoinRewardCount(double? effectiveDifficulty, int pmcLevel, List? levelsConfig, + protected double GetGpCoinRewardCount( + double? effectiveDifficulty, + int pmcLevel, + List? levelsConfig, List? gpCoinConfig, - double? rewardSpreadConfig) + double? rewardSpreadConfig + ) { return Math.Ceiling( - effectiveDifficulty * - _mathUtil.Interp1(pmcLevel, levelsConfig, gpCoinConfig) * - _randomUtil.GetDouble((double) (1 - rewardSpreadConfig), (double) (1 + rewardSpreadConfig)) ?? - 0 + effectiveDifficulty + * _mathUtil.Interp1(pmcLevel, levelsConfig, gpCoinConfig) + * _randomUtil.GetDouble( + (double)(1 - rewardSpreadConfig), + (double)(1 + rewardSpreadConfig) + ) + ?? 0 ); } - protected double GetRewardRep(double? effectiveDifficulty, int pmcLevel, List? levelsConfig, + protected double GetRewardRep( + double? effectiveDifficulty, + int pmcLevel, + List? levelsConfig, List? reputationConfig, - double? rewardSpreadConfig) + double? rewardSpreadConfig + ) { return Math.Round( - 100 * - effectiveDifficulty * - _mathUtil.Interp1(pmcLevel, levelsConfig, reputationConfig) * - _randomUtil.GetDouble((double) (1 - rewardSpreadConfig), (double) (1 + rewardSpreadConfig)) ?? - 0 - ) / - 100; + 100 + * effectiveDifficulty + * _mathUtil.Interp1(pmcLevel, levelsConfig, reputationConfig) + * _randomUtil.GetDouble( + (double)(1 - rewardSpreadConfig), + (double)(1 + rewardSpreadConfig) + ) + ?? 0 + ) / 100; } - protected int GetRewardNumItems(int pmcLevel, List? levelsConfig, List? itemsConfig) + protected int GetRewardNumItems( + int pmcLevel, + List? levelsConfig, + List? itemsConfig + ) { - return _randomUtil.RandInt(1, (int) Math.Round(_mathUtil.Interp1(pmcLevel, levelsConfig, itemsConfig) ?? 0) + 1); + return _randomUtil.RandInt( + 1, + (int)Math.Round(_mathUtil.Interp1(pmcLevel, levelsConfig, itemsConfig) ?? 0) + 1 + ); } - protected double GetRewardRoubles(double? effectiveDifficulty, int pmcLevel, List? levelsConfig, + protected double GetRewardRoubles( + double? effectiveDifficulty, + int pmcLevel, + List? levelsConfig, List? roublesConfig, - double? rewardSpreadConfig) + double? rewardSpreadConfig + ) { return Math.Floor( - effectiveDifficulty * - _mathUtil.Interp1(pmcLevel, levelsConfig, roublesConfig) * - _randomUtil.GetDouble(1d - rewardSpreadConfig.Value, 1d + rewardSpreadConfig.Value) ?? - 0 + effectiveDifficulty + * _mathUtil.Interp1(pmcLevel, levelsConfig, roublesConfig) + * _randomUtil.GetDouble( + 1d - rewardSpreadConfig.Value, + 1d + rewardSpreadConfig.Value + ) + ?? 0 ); } @@ -324,8 +396,12 @@ public class RepeatableQuestRewardGenerator( /// Rouble budget all item rewards must fit in /// Config for quest type /// Dictionary of items and stack size - protected Dictionary GetRewardableItemsFromPoolWithinBudget(List itemPool, - int maxItemCount, double itemRewardBudget, RepeatableQuestConfig repeatableConfig) + protected Dictionary GetRewardableItemsFromPoolWithinBudget( + List itemPool, + int maxItemCount, + double itemRewardBudget, + RepeatableQuestConfig repeatableConfig + ) { var itemsToReturn = new Dictionary(); var exhausableItemPool = new ExhaustableArray(itemPool, _randomUtil, _cloner); @@ -346,7 +422,10 @@ public class RepeatableQuestRewardGenerator( if (_itemHelper.IsOfBaseclass(chosenItemFromPool.Id, BaseClasses.AMMO)) { // Don't reward ammo that stacks to less than what's allowed in config - if (chosenItemFromPool.Properties.StackMaxSize < repeatableConfig.RewardAmmoStackMinSize) + if ( + chosenItemFromPool.Properties.StackMaxSize + < repeatableConfig.RewardAmmoStackMinSize + ) { i--; continue; @@ -373,7 +452,9 @@ public class RepeatableQuestRewardGenerator( var calculatedItemRewardBudget = itemRewardBudget - rewardItemStackCount * itemCost; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Added item: {chosenItemFromPool.Id} with price: {rewardItemStackCount * itemCost}"); + _logger.Debug( + $"Added item: {chosenItemFromPool.Id} with price: {rewardItemStackCount * itemCost}" + ); } // If we still have budget narrow down possible items @@ -390,7 +471,9 @@ public class RepeatableQuestRewardGenerator( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Reward pool empty with: {calculatedItemRewardBudget} roubles of budget remaining"); + _logger.Debug( + $"Reward pool empty with: {calculatedItemRewardBudget} roubles of budget remaining" + ); } } } @@ -410,8 +493,11 @@ public class RepeatableQuestRewardGenerator( /// Rouble budget /// Count of rewarded items /// Count that fits budget (min 1) - protected int CalculateAmmoStackSizeThatFitsBudget(TemplateItem itemSelected, double roublesBudget, - int rewardNumItems) + protected int CalculateAmmoStackSizeThatFitsBudget( + TemplateItem itemSelected, + double roublesBudget, + int rewardNumItems + ) { // Calculate budget per reward item var stackRoubleBudget = roublesBudget / rewardNumItems; @@ -425,23 +511,22 @@ public class RepeatableQuestRewardGenerator( var stackMaxCount = Math.Min(itemSelected.Properties.StackMaxSize.Value, 100); // Ensure stack size is at least 1 + is no larger than the max possible stack size - return (int) Math.Max(1, Math.Min(stackSizeThatFitsBudget, stackMaxCount)); + return (int)Math.Max(1, Math.Min(stackSizeThatFitsBudget, stackMaxCount)); } - protected bool CanIncreaseRewardItemStackSize(TemplateItem item, int maxRoublePriceToStack, - int randomChanceToPass = 100) + protected bool CanIncreaseRewardItemStackSize( + TemplateItem item, + int maxRoublePriceToStack, + int randomChanceToPass = 100 + ) { var isEligibleForStackSizeIncrease = - _presetHelper.GetDefaultPresetOrItemPrice(item.Id) < maxRoublePriceToStack && - !_itemHelper.IsOfBaseclasses( + _presetHelper.GetDefaultPresetOrItemPrice(item.Id) < maxRoublePriceToStack + && !_itemHelper.IsOfBaseclasses( item.Id, - [ - BaseClasses.WEAPON, - BaseClasses.ARMORED_EQUIPMENT, - BaseClasses.AMMO - ] - ) && - !_itemHelper.ItemRequiresSoftInserts(item.Id); + [BaseClasses.WEAPON, BaseClasses.ARMORED_EQUIPMENT, BaseClasses.AMMO] + ) + && !_itemHelper.ItemRequiresSoftInserts(item.Id); return isEligibleForStackSizeIncrease && _randomUtil.GetChance100(randomChanceToPass); } @@ -460,7 +545,7 @@ public class RepeatableQuestRewardGenerator( { new(3000, [2, 3, 4]), new(10000, [2, 3]), - new(int.MaxValue, [2, 3, 4]) // Default for prices 10001+ RUB + new(int.MaxValue, [2, 3, 4]), // Default for prices 10001+ RUB }; // Find the appropriate price tier and return a random stack size from its options @@ -480,8 +565,11 @@ public class RepeatableQuestRewardGenerator( /// Total value of items to return /// ID of the trader who will give player reward /// List of reward items that fit budget - protected List ChooseRewardItemsWithinBudget(RepeatableQuestConfig repeatableConfig, - double? roublesBudget, string traderId) + protected List ChooseRewardItemsWithinBudget( + RepeatableQuestConfig repeatableConfig, + double? roublesBudget, + string traderId + ) { // First filter for type and baseclass to avoid lookup in handbook for non-available items var rewardableItemPool = GetRewardableItems(repeatableConfig, traderId); @@ -498,11 +586,7 @@ public class RepeatableQuestRewardGenerator( _logger.Warning( _localisationService.GetText( "repeatable-no_reward_item_found_in_price_range", - new - { - minPrice, - roublesBudget - } + new { minPrice, roublesBudget } ) ); @@ -522,15 +606,18 @@ public class RepeatableQuestRewardGenerator( /// The budget remaining for rewards /// The minimum priced item to include /// List of Items - protected List FilterRewardPoolWithinBudget(List rewardItems, double roublesBudget, - double minPrice) + protected List FilterRewardPoolWithinBudget( + List rewardItems, + double roublesBudget, + double minPrice + ) { - return rewardItems.Where(item => - { - var itemPrice = _presetHelper.GetDefaultPresetOrItemPrice(item.Id); - return itemPrice < roublesBudget && itemPrice > minPrice; - } - ) + return rewardItems + .Where(item => + { + var itemPrice = _presetHelper.GetDefaultPresetOrItemPrice(item.Id); + return itemPrice < roublesBudget && itemPrice > minPrice; + }) .ToList(); } @@ -540,7 +627,10 @@ public class RepeatableQuestRewardGenerator( /// Budget in roubles /// Index of the reward /// Dictionary of the reward and it's price, can return null. - protected KeyValuePair? GetRandomWeaponPresetWithinBudget(double roublesBudget, int rewardIndex) + protected KeyValuePair? GetRandomWeaponPresetWithinBudget( + double roublesBudget, + int rewardIndex + ) { // Add a random default preset weapon as reward var defaultPresetPool = new ExhaustableArray( @@ -568,7 +658,12 @@ public class RepeatableQuestRewardGenerator( var chosenPreset = _cloner.Clone(randomPreset); return new KeyValuePair( - GeneratePresetReward(chosenPreset.Encyclopedia, 1, rewardIndex, chosenPreset.Items), + GeneratePresetReward( + chosenPreset.Encyclopedia, + 1, + rewardIndex, + chosenPreset.Items + ), presetPrice ); } @@ -586,7 +681,13 @@ public class RepeatableQuestRewardGenerator( /// Optional list of preset items /// If generated Item is found in raid, default True /// Object of "Reward"-item-type - protected Reward GeneratePresetReward(string tpl, int count, int index, List? preset, bool foundInRaid = true) + protected Reward GeneratePresetReward( + string tpl, + int count, + int index, + List? preset, + bool foundInRaid = true + ) { var id = _hashUtil.Generate(); var questRewardItem = new Reward @@ -601,7 +702,7 @@ public class RepeatableQuestRewardGenerator( IsEncoded = false, FindInRaid = foundInRaid, Type = RewardType.Item, - Items = [] + Items = [], }; // Get presets root item @@ -630,7 +731,12 @@ public class RepeatableQuestRewardGenerator( /// All rewards will be appended to a list, for unknown reasons the client wants the index /// If generated Item is found in raid, default True /// Object of "Reward"-item-type - protected Reward GenerateItemReward(string tpl, double count, int index, bool foundInRaid = true) + protected Reward GenerateItemReward( + string tpl, + double count, + int index, + bool foundInRaid = true + ) { var id = _hashUtil.Generate(); var questRewardItem = new Reward @@ -645,18 +751,14 @@ public class RepeatableQuestRewardGenerator( IsEncoded = false, FindInRaid = foundInRaid, Type = RewardType.Item, - Items = [] + Items = [], }; var rootItem = new Item { Id = id, Template = tpl, - Upd = new Upd - { - StackObjectsCount = count, - SpawnedInSession = foundInRaid - } + Upd = new Upd { StackObjectsCount = count, SpawnedInSession = foundInRaid }, }; questRewardItem.Items = [rootItem]; @@ -667,17 +769,20 @@ public class RepeatableQuestRewardGenerator( { // Determine currency based on trader // PK and Fence use Euros, everyone else is Roubles - var currency = traderId is Traders.PEACEKEEPER or Traders.FENCE ? Money.EUROS : Money.ROUBLES; + var currency = traderId is Traders.PEACEKEEPER or Traders.FENCE + ? Money.EUROS + : Money.ROUBLES; // Convert reward amount to Euros if necessary var rewardAmountToGivePlayer = - currency == Money.EUROS ? _handbookHelper.FromRUB(rewardRoubles, Money.EUROS) : rewardRoubles; + currency == Money.EUROS + ? _handbookHelper.FromRUB(rewardRoubles, Money.EUROS) + : rewardRoubles; // Get chosen currency + amount and return return GenerateItemReward(currency, rewardAmountToGivePlayer, rewardIndex, false); } - /// /// Picks rewardable items from items.json
/// This means they must:
@@ -688,7 +793,10 @@ public class RepeatableQuestRewardGenerator( /// Config /// ID of trader who will give reward to player /// List of rewardable items [[_tpl, itemTemplate],...] - public List GetRewardableItems(RepeatableQuestConfig repeatableQuestConfig, string traderId) + public List GetRewardableItems( + RepeatableQuestConfig repeatableQuestConfig, + string traderId + ) { // Get an array of seasonal items that should not be shown right now as seasonal event is not active var seasonalItems = _seasonalEventService.GetInactiveSeasonalEventItems(); @@ -696,31 +804,32 @@ public class RepeatableQuestRewardGenerator( // Check for specific base classes which don't make sense as reward item // also check if the price is greater than 0; there are some items whose price can not be found // those are not in the game yet (e.g. AGS grenade launcher) - return _databaseService.GetItems() + return _databaseService + .GetItems() .Values.Where(itemTemplate => + { + // Base "Item" item has no parent, ignore it + if (itemTemplate.Parent == "") { - // Base "Item" item has no parent, ignore it - if (itemTemplate.Parent == "") - { - return false; - } - - if (seasonalItems.Contains(itemTemplate.Id)) - { - return false; - } - - var traderWhitelist = repeatableQuestConfig.TraderWhitelist.FirstOrDefault(trader => trader.TraderId == traderId - ); - - return IsValidRewardItem( - itemTemplate.Id, - repeatableQuestConfig.RewardBlacklist, - repeatableQuestConfig.RewardBaseTypeBlacklist, - traderWhitelist?.RewardBaseWhitelist - ); + return false; } - ) + + if (seasonalItems.Contains(itemTemplate.Id)) + { + return false; + } + + var traderWhitelist = repeatableQuestConfig.TraderWhitelist.FirstOrDefault(trader => + trader.TraderId == traderId + ); + + return IsValidRewardItem( + itemTemplate.Id, + repeatableQuestConfig.RewardBlacklist, + repeatableQuestConfig.RewardBaseTypeBlacklist, + traderWhitelist?.RewardBaseWhitelist + ); + }) .ToList(); } @@ -733,10 +842,12 @@ public class RepeatableQuestRewardGenerator( /// Specific item base types to ignore /// Default null, specific trader item base classes /// True if item is valid reward - public bool IsValidRewardItem(string tpl, + public bool IsValidRewardItem( + string tpl, HashSet itemTplBlacklist, HashSet itemTypeBlacklist, - List? itemBaseWhitelist = null) + List? itemBaseWhitelist = null + ) { // Return early if not valid item to give as reward if (!_itemHelper.IsValidItem(tpl)) @@ -746,10 +857,10 @@ public class RepeatableQuestRewardGenerator( // Check item is not blacklisted if ( - _itemFilterService.IsItemBlacklisted(tpl) || - _itemFilterService.IsItemRewardBlacklisted(tpl) || - itemTplBlacklist.Contains(tpl) || _itemFilterService.IsItemBlacklisted(tpl) + || _itemFilterService.IsItemRewardBlacklisted(tpl) + || itemTplBlacklist.Contains(tpl) + || _itemFilterService.IsItemBlacklisted(tpl) ) { return false; diff --git a/Libraries/SPTarkov.Server.Core/Generators/ScavCaseRewardGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/ScavCaseRewardGenerator.cs index e4855943..c00e35c2 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/ScavCaseRewardGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/ScavCaseRewardGenerator.cs @@ -53,7 +53,10 @@ public class ScavCaseRewardGenerator( // Get items that fit the price criteria as set by the scavCase config var commonPricedItems = GetFilteredItemsByPrice(_dbItemsCache, rewardItemCounts.Common); var rarePricedItems = GetFilteredItemsByPrice(_dbItemsCache, rewardItemCounts.Rare); - var superRarePricedItems = GetFilteredItemsByPrice(_dbItemsCache, rewardItemCounts.Superrare); + var superRarePricedItems = GetFilteredItemsByPrice( + _dbItemsCache, + rewardItemCounts.Superrare + ); // Get randomly picked items from each item collection, the count range of which is defined in hideout/scavcase.json var randomlyPickedCommonRewards = PickRandomRewards( @@ -65,7 +68,8 @@ public class ScavCaseRewardGenerator( var randomlyPickedRareRewards = PickRandomRewards( rarePricedItems, rewardItemCounts.Rare, - RewardRarity.Rare); + RewardRarity.Rare + ); var randomlyPickedSuperRareRewards = PickRandomRewards( superRarePricedItems, @@ -74,9 +78,18 @@ public class ScavCaseRewardGenerator( ); // Add randomised stack sizes to ammo and money rewards - var commonRewards = RandomiseContainerItemRewards(randomlyPickedCommonRewards, RewardRarity.Common); - var rareRewards = RandomiseContainerItemRewards(randomlyPickedRareRewards, RewardRarity.Rare); - var superRareRewards = RandomiseContainerItemRewards(randomlyPickedSuperRareRewards, RewardRarity.SuperRare); + var commonRewards = RandomiseContainerItemRewards( + randomlyPickedCommonRewards, + RewardRarity.Common + ); + var rareRewards = RandomiseContainerItemRewards( + randomlyPickedRareRewards, + RewardRarity.Rare + ); + var superRareRewards = RandomiseContainerItemRewards( + randomlyPickedSuperRareRewards, + RewardRarity.SuperRare + ); var result = new List>(); result = result.Concat(commonRewards).ToList(); @@ -97,120 +110,131 @@ public class ScavCaseRewardGenerator( var inactiveSeasonalItems = _seasonalEventService.GetInactiveSeasonalEventItems(); if (!_dbItemsCache.Any()) { - _dbItemsCache = _databaseService.GetItems() + _dbItemsCache = _databaseService + .GetItems() .Values.Where(item => + { + // Base "Item" item has no parent, ignore it + if (item.Parent == "") { - // Base "Item" item has no parent, ignore it - if (item.Parent == "") - { - return false; - } - - if (item.Type == "Node") - { - return false; - } - - if (item.Properties.QuestItem ?? false) - { - return false; - } - - // Skip item if item id is on blacklist - if ( - item.Type != "Item" || - _scavCaseConfig.RewardItemBlacklist.Contains(item.Id) || - _itemFilterService.IsItemBlacklisted(item.Id) - ) - { - return false; - } - - // Globally reward-blacklisted - if (_itemFilterService.IsItemRewardBlacklisted(item.Id)) - { - return false; - } - - if (!_scavCaseConfig.AllowBossItemsAsRewards && _itemFilterService.IsBossItem(item.Id)) - { - return false; - } - - // Skip item if parent id is blacklisted - if (_itemHelper.IsOfBaseclasses(item.Id, _scavCaseConfig.RewardItemParentBlacklist)) - { - return false; - } - - if (inactiveSeasonalItems.Contains(item.Id)) - { - return false; - } - - return true; + return false; } - ) + + if (item.Type == "Node") + { + return false; + } + + if (item.Properties.QuestItem ?? false) + { + return false; + } + + // Skip item if item id is on blacklist + if ( + item.Type != "Item" + || _scavCaseConfig.RewardItemBlacklist.Contains(item.Id) + || _itemFilterService.IsItemBlacklisted(item.Id) + ) + { + return false; + } + + // Globally reward-blacklisted + if (_itemFilterService.IsItemRewardBlacklisted(item.Id)) + { + return false; + } + + if ( + !_scavCaseConfig.AllowBossItemsAsRewards + && _itemFilterService.IsBossItem(item.Id) + ) + { + return false; + } + + // Skip item if parent id is blacklisted + if ( + _itemHelper.IsOfBaseclasses( + item.Id, + _scavCaseConfig.RewardItemParentBlacklist + ) + ) + { + return false; + } + + if (inactiveSeasonalItems.Contains(item.Id)) + { + return false; + } + + return true; + }) .ToList(); } if (!_dbAmmoItemsCache.Any()) { - _dbAmmoItemsCache = _databaseService.GetItems() + _dbAmmoItemsCache = _databaseService + .GetItems() .Values.Where(item => + { + // Base "Item" item has no parent, ignore it + if (item.Parent == "") { - // Base "Item" item has no parent, ignore it - if (item.Parent == "") - { - return false; - } - - if (item.Type != "Item") - { - return false; - } - - // Not ammo, skip - if (!_itemHelper.IsOfBaseclass(item.Id, BaseClasses.AMMO)) - { - return false; - } - - // Skip item if item id is on blacklist - if ( - _scavCaseConfig.RewardItemBlacklist.Contains(item.Id) || - _itemFilterService.IsItemBlacklisted(item.Id) - ) - { - return false; - } - - // Globally reward-blacklisted - if (_itemFilterService.IsItemRewardBlacklisted(item.Id)) - { - return false; - } - - if (!_scavCaseConfig.AllowBossItemsAsRewards && _itemFilterService.IsBossItem(item.Id)) - { - return false; - } - - // Skip seasonal items - if (inactiveSeasonalItems.Contains(item.Id)) - { - return false; - } - - // Skip ammo that doesn't stack as high as value in config - if (item.Properties.StackMaxSize < _scavCaseConfig.AmmoRewards.MinStackSize) - { - return false; - } - - return true; + return false; } - ) + + if (item.Type != "Item") + { + return false; + } + + // Not ammo, skip + if (!_itemHelper.IsOfBaseclass(item.Id, BaseClasses.AMMO)) + { + return false; + } + + // Skip item if item id is on blacklist + if ( + _scavCaseConfig.RewardItemBlacklist.Contains(item.Id) + || _itemFilterService.IsItemBlacklisted(item.Id) + ) + { + return false; + } + + // Globally reward-blacklisted + if (_itemFilterService.IsItemRewardBlacklisted(item.Id)) + { + return false; + } + + if ( + !_scavCaseConfig.AllowBossItemsAsRewards + && _itemFilterService.IsBossItem(item.Id) + ) + { + return false; + } + + // Skip seasonal items + if (inactiveSeasonalItems.Contains(item.Id)) + { + return false; + } + + // Skip ammo that doesn't stack as high as value in config + if (item.Properties.StackMaxSize < _scavCaseConfig.AmmoRewards.MinStackSize) + { + return false; + } + + return true; + }) .ToList(); } } @@ -224,13 +248,14 @@ public class ScavCaseRewardGenerator( protected List PickRandomRewards( List items, RewardCountAndPriceDetails itemFilters, - string rarity) + string rarity + ) { List result = []; var rewardWasMoney = false; var rewardWasAmmo = false; - var randomCount = _randomUtil.GetInt((int) itemFilters.MinCount, (int) itemFilters.MaxCount); + var randomCount = _randomUtil.GetInt((int)itemFilters.MinCount, (int)itemFilters.MaxCount); for (var i = 0; i < randomCount; i++) { if (RewardShouldBeMoney() && !rewardWasMoney) @@ -301,26 +326,30 @@ public class ScavCaseRewardGenerator( protected TemplateItem GetRandomAmmo(string rarity) { var possibleAmmoPool = _dbAmmoItemsCache.Where(ammo => - { - // Is ammo handbook price between desired range - var handbookPrice = _ragfairPriceService.GetStaticPriceForItem(ammo.Id); - if (_scavCaseConfig.AmmoRewards.AmmoRewardValueRangeRub.TryGetValue(rarity, - out var matchingAmmoRewardForRarity) && - handbookPrice >= matchingAmmoRewardForRarity.Min && - handbookPrice <= matchingAmmoRewardForRarity.Max + { + // Is ammo handbook price between desired range + var handbookPrice = _ragfairPriceService.GetStaticPriceForItem(ammo.Id); + if ( + _scavCaseConfig.AmmoRewards.AmmoRewardValueRangeRub.TryGetValue( + rarity, + out var matchingAmmoRewardForRarity ) - { - return true; - } - - return false; + && handbookPrice >= matchingAmmoRewardForRarity.Min + && handbookPrice <= matchingAmmoRewardForRarity.Max + ) + { + return true; } - ); + + return false; + }); if (!possibleAmmoPool.Any()) { // Filtered pool is empty - _logger.Warning(localisationService.GetText("scavcase-no_cartridges_found_matching_price")); + _logger.Warning( + localisationService.GetText("scavcase-no_cartridges_found_matching_price") + ); } // Get a random ammo and return it @@ -334,7 +363,10 @@ public class ScavCaseRewardGenerator( /// items to convert /// The rarity desired ammo reward is for /// Product array - protected List> RandomiseContainerItemRewards(List rewardItems, string rarity) + protected List> RandomiseContainerItemRewards( + List rewardItems, + string rarity + ) { // Each array is an item + children List> result = []; @@ -346,8 +378,8 @@ public class ScavCaseRewardGenerator( { Id = _hashUtil.Generate(), Template = rewardItemDb.Id, - Upd = null - } + Upd = null, + }, ]; var rootItem = resultItem.FirstOrDefault(); @@ -357,14 +389,16 @@ public class ScavCaseRewardGenerator( } // Armor or weapon = use default preset from globals.json else if ( - _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(rewardItemDb.Id) || - _itemHelper.IsOfBaseclass(rewardItemDb.Id, BaseClasses.WEAPON) + _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(rewardItemDb.Id) + || _itemHelper.IsOfBaseclass(rewardItemDb.Id, BaseClasses.WEAPON) ) { var preset = _presetHelper.GetDefaultPreset(rewardItemDb.Id); if (preset is null) { - _logger.Warning($"No preset for item: {rewardItemDb.Id} {rewardItemDb.Name}, skipping"); + _logger.Warning( + $"No preset for item: {rewardItemDb.Id} {rewardItemDb.Name}, skipping" + ); continue; } @@ -375,11 +409,13 @@ public class ScavCaseRewardGenerator( resultItem = presetAndMods; } - else if (_itemHelper.IsOfBaseclasses(rewardItemDb.Id, [BaseClasses.AMMO, BaseClasses.MONEY])) + else if ( + _itemHelper.IsOfBaseclasses(rewardItemDb.Id, [BaseClasses.AMMO, BaseClasses.MONEY]) + ) { rootItem.Upd = new Upd { - StackObjectsCount = GetRandomAmountRewardForScavCase(rewardItemDb, rarity) + StackObjectsCount = GetRandomAmountRewardForScavCase(rewardItemDb, rarity), }; } @@ -396,19 +432,23 @@ public class ScavCaseRewardGenerator( /// filtered dbItems array protected List GetFilteredItemsByPrice( List dbItems, - RewardCountAndPriceDetails itemFilters) + RewardCountAndPriceDetails itemFilters + ) { - return dbItems.Where(item => + return dbItems + .Where(item => + { + var handbookPrice = _ragfairPriceService.GetStaticPriceForItem(item.Id); + if ( + handbookPrice >= itemFilters.MinPriceRub + && handbookPrice <= itemFilters.MaxPriceRub + ) { - var handbookPrice = _ragfairPriceService.GetStaticPriceForItem(item.Id); - if (handbookPrice >= itemFilters.MinPriceRub && handbookPrice <= itemFilters.MaxPriceRub) - { - return true; - } - - return false; + return true; } - ) + + return false; + }) .ToList(); } @@ -417,7 +457,9 @@ public class ScavCaseRewardGenerator( ///
/// production.json/scavRecipes object /// ScavCaseRewardCountsAndPrices object - protected ScavCaseRewardCountsAndPrices GetScavCaseRewardCountsAndPrices(ScavRecipe scavCaseDetails) + protected ScavCaseRewardCountsAndPrices GetScavCaseRewardCountsAndPrices( + ScavRecipe scavCaseDetails + ) { return new ScavCaseRewardCountsAndPrices { @@ -427,22 +469,22 @@ public class ScavCaseRewardGenerator( MinCount = scavCaseDetails.EndProducts.Common.Min, MaxCount = scavCaseDetails.EndProducts.Common.Max, MinPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Common].Min, - MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Common].Max + MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Common].Max, }, Rare = new RewardCountAndPriceDetails { MinCount = scavCaseDetails.EndProducts.Rare.Min, MaxCount = scavCaseDetails.EndProducts.Rare.Max, MinPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Rare].Min, - MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Rare].Max + MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.Rare].Max, }, Superrare = new RewardCountAndPriceDetails { MinCount = scavCaseDetails.EndProducts.Superrare.Min, MaxCount = scavCaseDetails.EndProducts.Superrare.Max, MinPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.SuperRare].Min, - MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.SuperRare].Max - } + MaxPriceRub = _scavCaseConfig.RewardItemValueRangeRub[RewardRarity.SuperRare].Max, + }, }; } @@ -458,7 +500,7 @@ public class ScavCaseRewardGenerator( { BaseClasses.AMMO => GetRandomisedAmmoRewardStackSize(itemToCalculate), BaseClasses.MONEY => GetRandomisedMoneyRewardStackSize(itemToCalculate, rarity), - _ => 1 + _ => 1, }; } @@ -501,7 +543,7 @@ public class ScavCaseRewardGenerator( _scavCaseConfig.MoneyRewards.GpCount.GetByJsonProp>(rarity).Min, _scavCaseConfig.MoneyRewards.GpCount.GetByJsonProp>(rarity).Max ), - _ => 1 + _ => 1, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/BarrelInvetoryMagGen.cs b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/BarrelInvetoryMagGen.cs index 3a48e2d8..013d94cc 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/BarrelInvetoryMagGen.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/BarrelInvetoryMagGen.cs @@ -26,7 +26,7 @@ public class BarrelInvetoryMagGen( // Can't be done by _props.ammoType as grenade launcher shoots grenades with ammoType of "buckshot" double? randomisedAmmoStackSize; if (inventoryMagGen.GetAmmoTemplate().Properties.StackMaxRandom == 1) - // Doesn't stack + // Doesn't stack { randomisedAmmoStackSize = _randomUtil.GetInt(3, 6); } @@ -40,7 +40,7 @@ public class BarrelInvetoryMagGen( _botWeaponGeneratorHelper.AddAmmoIntoEquipmentSlots( inventoryMagGen.GetAmmoTemplate().Id, - (int) randomisedAmmoStackSize, + (int)randomisedAmmoStackSize, inventoryMagGen.GetPmcInventory(), null ); diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/ExternalInventoryMagGen.cs b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/ExternalInventoryMagGen.cs index 71f921c8..810859bd 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/ExternalInventoryMagGen.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/ExternalInventoryMagGen.cs @@ -42,7 +42,9 @@ public class ExternalInventoryMagGen( var defaultMagazineTpl = _botWeaponGeneratorHelper.GetWeaponsDefaultMagazineTpl(weapon); var isShotgun = _itemHelper.IsOfBaseclass(weapon.Id, BaseClasses.SHOTGUN); - var randomizedMagazineCount = _botWeaponGeneratorHelper.GetRandomizedMagazineCount(inventoryMagGen.GetMagCount()); + var randomizedMagazineCount = _botWeaponGeneratorHelper.GetRandomizedMagazineCount( + inventoryMagGen.GetMagCount() + ); for (var i = 0; i < randomizedMagazineCount; i++) { var magazineWithAmmo = _botWeaponGeneratorHelper.CreateMagazineWithAmmo( @@ -60,7 +62,7 @@ public class ExternalInventoryMagGen( ); if (fitsIntoInventory == ItemAddedResult.NO_CONTAINERS) - // No containers to fit magazines, stop trying + // No containers to fit magazines, stop trying { break; } @@ -73,7 +75,9 @@ public class ExternalInventoryMagGen( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Failed {fitAttempts} times to add magazine {magazineTpl} to bot inventory, stopping"); + _logger.Debug( + $"Failed {fitAttempts} times to add magazine {magazineTpl} to bot inventory, stopping" + ); } break; @@ -84,7 +88,7 @@ public class ExternalInventoryMagGen( * Temporary workaround to Killa spawning with no extra mags if he spawns with a drum mag */ if (magazineTpl == defaultMagazineTpl) - // We were already on default - stop here to prevent infinite loop + // We were already on default - stop here to prevent infinite loop { break; } @@ -93,13 +97,13 @@ public class ExternalInventoryMagGen( attemptedMagBlacklist.Add(magazineTpl); if (defaultMagazineTpl is null) - // No default to fall back to, stop trying to add mags + // No default to fall back to, stop trying to add mags { break; } if (defaultMagazineTpl == BaseClasses.MAGAZINE) - // Magazine base type, do not use + // Magazine base type, do not use { break; } @@ -110,7 +114,10 @@ public class ExternalInventoryMagGen( if (magTemplate is null) { _logger.Error( - _localisationService.GetText("bot-unable_to_find_default_magazine_item", magazineTpl) + _localisationService.GetText( + "bot-unable_to_find_default_magazine_item", + magazineTpl + ) ); break; @@ -152,7 +159,7 @@ public class ExternalInventoryMagGen( } if (fitsIntoInventory == ItemAddedResult.SUCCESS) - // Reset fit counter now it succeeded + // Reset fit counter now it succeeded { fitAttempts = 0; } @@ -165,27 +172,34 @@ public class ExternalInventoryMagGen( /// Weapon to get mag for /// Blacklisted magazines /// Item of chosen magazine - public TemplateItem? GetRandomExternalMagazineForInternalMagazineGun(string weaponTpl, List magazineBlacklist) + public TemplateItem? GetRandomExternalMagazineForInternalMagazineGun( + string weaponTpl, + List magazineBlacklist + ) { // The mag Slot data for the weapon - var magSlot = _itemHelper.GetItem(weaponTpl).Value.Properties.Slots.FirstOrDefault(x => x.Name == "mod_magazine"); + var magSlot = _itemHelper + .GetItem(weaponTpl) + .Value.Properties.Slots.FirstOrDefault(x => x.Name == "mod_magazine"); if (magSlot is null) { return null; } // All possible mags that fit into the weapon excluding blacklisted - var magazinePool = magSlot.Props.Filters[0] + var magazinePool = magSlot + .Props.Filters[0] .Filter.Where(x => !magazineBlacklist.Contains(x)) - .Select(x => _itemHelper.GetItem(x).Value - ); + .Select(x => _itemHelper.GetItem(x).Value); if (magazinePool is null) { return null; } // Non-internal magazines that fit into the weapon - var externalMagazineOnlyPool = magazinePool.Where(x => x.Properties.ReloadMagType != ReloadMode.InternalMagazine); + var externalMagazineOnlyPool = magazinePool.Where(x => + x.Properties.ReloadMagType != ReloadMode.InternalMagazine + ); if (externalMagazineOnlyPool is null || !externalMagazineOnlyPool.Any()) { return null; diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/InternalMagazineInventoryMagGen.cs b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/InternalMagazineInventoryMagGen.cs index 876d4568..4767b80c 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/InternalMagazineInventoryMagGen.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/InternalMagazineInventoryMagGen.cs @@ -5,9 +5,9 @@ using SPTarkov.Server.Core.Models.Enums; namespace SPTarkov.Server.Core.Generators.WeaponGen.Implementations; [Injectable] -public class InternalMagazineInventoryMagGen( - BotWeaponGeneratorHelper _botWeaponGeneratorHelper -) : InventoryMagGen, IInventoryMagGen +public class InternalMagazineInventoryMagGen(BotWeaponGeneratorHelper _botWeaponGeneratorHelper) + : InventoryMagGen, + IInventoryMagGen { public int GetPriority() { @@ -16,7 +16,8 @@ public class InternalMagazineInventoryMagGen( public bool CanHandleInventoryMagGen(InventoryMagGen inventoryMagGen) { - return inventoryMagGen.GetMagazineTemplate().Properties.ReloadMagType == ReloadMode.InternalMagazine; + return inventoryMagGen.GetMagazineTemplate().Properties.ReloadMagType + == ReloadMode.InternalMagazine; } public void Process(InventoryMagGen inventoryMagGen) @@ -27,7 +28,7 @@ public class InternalMagazineInventoryMagGen( ); _botWeaponGeneratorHelper.AddAmmoIntoEquipmentSlots( inventoryMagGen.GetAmmoTemplate().Id, - (int) bulletCount, + (int)bulletCount, inventoryMagGen.GetPmcInventory(), null ); diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/UbglExternalMagGen.cs b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/UbglExternalMagGen.cs index 332e0216..30c71db4 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/UbglExternalMagGen.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/Implementations/UbglExternalMagGen.cs @@ -5,9 +5,9 @@ using SPTarkov.Server.Core.Models.Enums; namespace SPTarkov.Server.Core.Generators.WeaponGen.Implementations; [Injectable] -public class UbglExternalMagGen( - BotWeaponGeneratorHelper _botWeaponGeneratorHelper -) : InventoryMagGen, IInventoryMagGen +public class UbglExternalMagGen(BotWeaponGeneratorHelper _botWeaponGeneratorHelper) + : InventoryMagGen, + IInventoryMagGen { public int GetPriority() { @@ -27,7 +27,7 @@ public class UbglExternalMagGen( ); _botWeaponGeneratorHelper.AddAmmoIntoEquipmentSlots( inventoryMagGen.GetAmmoTemplate().Id, - (int) bulletCount, + (int)bulletCount, inventoryMagGen.GetPmcInventory(), [EquipmentSlots.TacticalVest] ); diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/InventoryMagGen.cs b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/InventoryMagGen.cs index 95b7d88a..361bb33f 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/InventoryMagGen.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeaponGen/InventoryMagGen.cs @@ -12,14 +12,14 @@ public class InventoryMagGen() private readonly BotBaseInventory _pmcInventory; private readonly TemplateItem _weaponTemplate; - public InventoryMagGen - ( + public InventoryMagGen( GenerationData magCounts, TemplateItem magazineTemplate, TemplateItem weaponTemplate, TemplateItem ammoTemplate, BotBaseInventory pmcInventory - ) : this() + ) + : this() { _magCounts = magCounts; _magazineTemplate = magazineTemplate; diff --git a/Libraries/SPTarkov.Server.Core/Generators/WeatherGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/WeatherGenerator.cs index 255f4789..3901c893 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/WeatherGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/WeatherGenerator.cs @@ -81,16 +81,25 @@ public class WeatherGenerator( Temperature = 0, Fog = GetWeightedFog(weatherValues), RainIntensity = - rain > 1 ? GetRandomDouble(weatherValues.RainIntensity.Min, weatherValues.RainIntensity.Max) : 0, + rain > 1 + ? GetRandomDouble( + weatherValues.RainIntensity.Min, + weatherValues.RainIntensity.Max + ) + : 0, Rain = rain, - WindGustiness = GetRandomDouble(weatherValues.WindGustiness.Min, weatherValues.WindGustiness.Max, 2), + WindGustiness = GetRandomDouble( + weatherValues.WindGustiness.Min, + weatherValues.WindGustiness.Max, + 2 + ), WindDirection = GetWeightedWindDirection(weatherValues), WindSpeed = GetWeightedWindSpeed(weatherValues), Cloud = clouds, Time = "", Date = "", Timestamp = 0, - SptInRaidTimestamp = 0 + SptInRaidTimestamp = 0, }; SetCurrentDateTime(result, timestamp); @@ -102,7 +111,10 @@ public class WeatherGenerator( protected SeasonalValues GetWeatherValuesBySeason(Season currentSeason) { - var result = _weatherConfig.Weather.SeasonValues.TryGetValue(currentSeason.ToString(), out var value); + var result = _weatherConfig.Weather.SeasonValues.TryGetValue( + currentSeason.ToString(), + out var value + ); if (!result) { return _weatherConfig.Weather.SeasonValues["default"]; @@ -137,9 +149,13 @@ public class WeatherGenerator( { var inRaidTime = timestamp is null ? _weatherHelper.GetInRaidTime() - : _weatherHelper.GetInRaidTime(timestamp.Value); + : _weatherHelper.GetInRaidTime(timestamp.Value); var normalTime = GetBsgFormattedTime(inRaidTime); - var formattedDate = _timeUtil.FormatDate(timestamp.HasValue ? _timeUtil.GetDateTimeFromTimeStamp(timestamp.Value) : DateTime.UtcNow); + var formattedDate = _timeUtil.FormatDate( + timestamp.HasValue + ? _timeUtil.GetDateTimeFromTimeStamp(timestamp.Value) + : DateTime.UtcNow + ); var datetimeBsgFormat = $"{formattedDate} {normalTime}"; weather.Timestamp = timestamp ?? _timeUtil.GetTimeStamp(); // matches weather.date @@ -150,17 +166,23 @@ public class WeatherGenerator( protected WindDirection GetWeightedWindDirection(SeasonalValues weather) { - return _weightedRandomHelper.WeightedRandom(weather.WindDirection.Values, weather.WindDirection.Weights).Item; + return _weightedRandomHelper + .WeightedRandom(weather.WindDirection.Values, weather.WindDirection.Weights) + .Item; } protected double GetWeightedClouds(SeasonalValues weather) { - return _weightedRandomHelper.WeightedRandom(weather.Clouds.Values, weather.Clouds.Weights).Item; + return _weightedRandomHelper + .WeightedRandom(weather.Clouds.Values, weather.Clouds.Weights) + .Item; } protected double GetWeightedWindSpeed(SeasonalValues weather) { - return _weightedRandomHelper.WeightedRandom(weather.WindSpeed.Values, weather.WindSpeed.Weights).Item; + return _weightedRandomHelper + .WeightedRandom(weather.WindSpeed.Values, weather.WindSpeed.Weights) + .Item; } protected double GetWeightedFog(SeasonalValues weather) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/AssortHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/AssortHelper.cs index 06983144..f5e7a24d 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/AssortHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/AssortHelper.cs @@ -31,14 +31,17 @@ public class AssortHelper( string traderId, TraderAssort traderAssorts, Dictionary> mergedQuestAssorts, - bool isFlea = false) + bool isFlea = false + ) { var strippedTraderAssorts = traderAssorts; // Trader assort does not always contain loyal_level_items if (traderAssorts.LoyalLevelItems is null) { - _logger.Warning(_localisationService.GetText("assort-missing_loyalty_level_object", traderId)); + _logger.Warning( + _localisationService.GetText("assort-missing_loyalty_level_object", traderId) + ); return traderAssorts; } @@ -54,7 +57,10 @@ public class AssortHelper( } // Remove assort if quest in profile does not have status that unlocks assort - var questStatusInProfile = _questHelper.GetQuestStatus(pmcProfile, unlockValues.Value.Key); + var questStatusInProfile = _questHelper.GetQuestStatus( + pmcProfile, + unlockValues.Value.Key + ); if (!unlockValues.Value.Value.Contains(questStatusInProfile)) { strippedTraderAssorts = RemoveItemFromAssort(traderAssorts, assortId.Key, isFlea); @@ -72,14 +78,19 @@ public class AssortHelper( /// quest id + array of quest status the assort should show for protected KeyValuePair>? GetQuestIdAndStatusThatShowAssort( Dictionary> mergedQuestAssorts, - string assortId) + string assortId + ) { if (mergedQuestAssorts.TryGetValue("started", out var dict1) && dict1.ContainsKey(assortId)) - // Assort unlocked by starting quest, assort is visible to player when : started or ready to hand in + handed in + // Assort unlocked by starting quest, assort is visible to player when : started or ready to hand in + handed in { return new KeyValuePair>( mergedQuestAssorts["started"][assortId], - [QuestStatusEnum.Started, QuestStatusEnum.AvailableForFinish, QuestStatusEnum.Success] + [ + QuestStatusEnum.Started, + QuestStatusEnum.AvailableForFinish, + QuestStatusEnum.Success, + ] ); } @@ -109,14 +120,20 @@ public class AssortHelper( /// Traders id /// Traders assorts /// Trader assorts minus locked loyalty assorts - public TraderAssort StripLockedLoyaltyAssort(PmcData pmcProfile, string traderId, TraderAssort assort) + public TraderAssort StripLockedLoyaltyAssort( + PmcData pmcProfile, + string traderId, + TraderAssort assort + ) { var strippedAssort = assort; // Trader assort does not always contain loyal_level_items if (assort.LoyalLevelItems is null) { - _logger.Warning(_localisationService.GetText("assort-missing_loyalty_level_object", traderId)); + _logger.Warning( + _localisationService.GetText("assort-missing_loyalty_level_object", traderId) + ); return strippedAssort; } @@ -124,7 +141,10 @@ public class AssortHelper( // Remove items restricted by loyalty levels above those reached by the player foreach (var item in assort.LoyalLevelItems) { - if (pmcProfile.TradersInfo.TryGetValue(traderId, out var info) && assort.LoyalLevelItems[item.Key] > info.LoyaltyLevel) + if ( + pmcProfile.TradersInfo.TryGetValue(traderId, out var info) + && assort.LoyalLevelItems[item.Key] > info.LoyaltyLevel + ) { strippedAssort = RemoveItemFromAssort(assort, item.Key); } @@ -141,7 +161,11 @@ public class AssortHelper( /// Id of item to remove from assort /// Is the assort being modified the flea market assort /// Modified assort - public TraderAssort RemoveItemFromAssort(TraderAssort assort, string itemId, bool isFlea = false) + public TraderAssort RemoveItemFromAssort( + TraderAssort assort, + string itemId, + bool isFlea = false + ) { // Flea assort needs special handling, item must remain in assort but be flagged as locked if (isFlea && assort.BarterScheme.TryGetValue(itemId, out var listToUse)) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotDifficultyHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotDifficultyHelper.cs index c78ebce3..a5dbcb61 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotDifficultyHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotDifficultyHelper.cs @@ -30,7 +30,11 @@ public class BotDifficultyHelper( /// difficulty to get settings for (easy/normal etc) /// bots from database /// Difficulty object - public DifficultyCategories GetBotDifficultySettings(string type, string desiredDifficulty, Bots botDb) + public DifficultyCategories GetBotDifficultySettings( + string type, + string desiredDifficulty, + Bots botDb + ) { var desiredType = _botHelper.IsBotPmc(type) ? _botHelper.GetPmcSideByRole(type).ToLower() @@ -38,7 +42,9 @@ public class BotDifficultyHelper( if (!botDb.Types.ContainsKey(desiredType)) { // No bot found, get fallback difficulty values - _logger.Warning(_localisationService.GetText("bot-unable_to_get_bot_fallback_to_assault", type)); + _logger.Warning( + _localisationService.GetText("bot-unable_to_get_bot_fallback_to_assault", type) + ); botDb.Types[desiredType] = _cloner.Clone(botDb.Types["assault"]); } @@ -51,11 +57,7 @@ public class BotDifficultyHelper( _logger.Warning( _localisationService.GetText( "bot-unable_to_get_bot_difficulty_fallback_to_assault", - new - { - botType = desiredType, - difficulty = desiredDifficulty - } + new { botType = desiredType, difficulty = desiredDifficulty } ) ); botDb.Types[desiredType].BotDifficulty[desiredDifficulty] = _cloner.Clone( @@ -74,14 +76,19 @@ public class BotDifficultyHelper( /// Difficulty object protected DifficultyCategories GetDifficultySettings(string type, string difficulty) { - var difficultySetting = - string.Equals(_pmcConfig.Difficulty, "asonline", StringComparison.OrdinalIgnoreCase) - ? difficulty - : _pmcConfig.Difficulty.ToLower(); + var difficultySetting = string.Equals( + _pmcConfig.Difficulty, + "asonline", + StringComparison.OrdinalIgnoreCase + ) + ? difficulty + : _pmcConfig.Difficulty.ToLower(); difficultySetting = ConvertBotDifficultyDropdownToBotDifficulty(difficultySetting); - return _cloner.Clone(_databaseService.GetBots().Types[type].BotDifficulty[difficultySetting]); + return _cloner.Clone( + _databaseService.GetBots().Types[type].BotDifficulty[difficultySetting] + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs index 6d2dc695..a3a114f2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs @@ -1,6 +1,6 @@ using System.Collections.Frozen; -using SPTarkov.Server.Core.Constants; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Enums; using SPTarkov.Server.Core.Models.Spt.Bots; @@ -24,18 +24,19 @@ public class BotGeneratorHelper( ProfileActivityService _profileActivityService, LocalisationService _localisationService, ConfigServer _configServer - ) +) { // Equipment slot ids that do not conflict with other slots - private static readonly FrozenSet _slotsWithNoCompatIssues = [ + private static readonly FrozenSet _slotsWithNoCompatIssues = + [ EquipmentSlots.Scabbard.ToString(), EquipmentSlots.Backpack.ToString(), EquipmentSlots.SecuredContainer.ToString(), EquipmentSlots.Holster.ToString(), - EquipmentSlots.ArmBand.ToString() + EquipmentSlots.ArmBand.ToString(), ]; - private static readonly string[] _pmcTypes = [ Sides.PmcBear.ToLower(), Sides.PmcUsec.ToLower() ]; + private static readonly string[] _pmcTypes = [Sides.PmcBear.ToLower(), Sides.PmcUsec.ToLower()]; private readonly BotConfig _botConfig = _configServer.GetConfig(); @@ -49,62 +50,66 @@ public class BotGeneratorHelper( public Upd GenerateExtraPropertiesForItem(TemplateItem? itemTemplate, string? botRole = null) { // Get raid settings, if no raid, default to day - var raidSettings = _profileActivityService.GetFirstProfileActivityRaidData()?.RaidConfiguration; + var raidSettings = _profileActivityService + .GetFirstProfileActivityRaidData() + ?.RaidConfiguration; RandomisedResourceDetails randomisationSettings = null; if (botRole is not null) { - _botConfig.LootItemResourceRandomization.TryGetValue(botRole, out randomisationSettings); + _botConfig.LootItemResourceRandomization.TryGetValue( + botRole, + out randomisationSettings + ); } - Upd itemProperties = new(); var hasProperties = false; - if (itemTemplate?.Properties?.MaxDurability is not null && itemTemplate.Properties.MaxDurability > 0) + if ( + itemTemplate?.Properties?.MaxDurability is not null + && itemTemplate.Properties.MaxDurability > 0 + ) { if (itemTemplate.Properties.WeapClass is not null) { // Is weapon - itemProperties.Repairable = GenerateWeaponRepairableProperties(itemTemplate, botRole); + itemProperties.Repairable = GenerateWeaponRepairableProperties( + itemTemplate, + botRole + ); hasProperties = true; } else if (itemTemplate.Properties.ArmorClass is not null) { // Is armor - itemProperties.Repairable = GenerateArmorRepairableProperties(itemTemplate, botRole); + itemProperties.Repairable = GenerateArmorRepairableProperties( + itemTemplate, + botRole + ); hasProperties = true; } } if (itemTemplate?.Properties?.HasHinge ?? false) { - itemProperties.Togglable = new UpdTogglable - { - On = true - }; + itemProperties.Togglable = new UpdTogglable { On = true }; hasProperties = true; } if (itemTemplate?.Properties?.Foldable ?? false) { - itemProperties.Foldable = new UpdFoldable - { - Folded = false - }; + itemProperties.Foldable = new UpdFoldable { Folded = false }; hasProperties = true; } if (itemTemplate?.Properties?.WeapFireType?.Count == 0) { itemProperties.FireMode = itemTemplate.Properties.WeapFireType.Contains("fullauto") - ? new UpdFireMode - { - FireMode = "fullauto" - } + ? new UpdFireMode { FireMode = "fullauto" } : new UpdFireMode { - FireMode = _randomUtil.GetArrayValue(itemTemplate.Properties.WeapFireType) + FireMode = _randomUtil.GetArrayValue(itemTemplate.Properties.WeapFireType), }; hasProperties = true; } @@ -116,19 +121,22 @@ public class BotGeneratorHelper( HpResource = GetRandomizedResourceValue( itemTemplate.Properties.MaxHpResource ?? 0, randomisationSettings?.Meds - ) + ), }; hasProperties = true; } - if (itemTemplate?.Properties?.MaxResource is not null && itemTemplate.Properties?.FoodUseTime is not null) + if ( + itemTemplate?.Properties?.MaxResource is not null + && itemTemplate.Properties?.FoodUseTime is not null + ) { itemProperties.FoodDrink = new UpdFoodDrink { HpPercent = GetRandomizedResourceValue( itemTemplate.Properties.MaxResource ?? 0, randomisationSettings?.Food - ) + ), }; hasProperties = true; } @@ -136,13 +144,22 @@ public class BotGeneratorHelper( if (itemTemplate?.Parent == BaseClasses.FLASHLIGHT) { // Get chance from botconfig for bot type - var lightLaserActiveChance = raidSettings?.IsNightRaid ?? false - ? GetBotEquipmentSettingFromConfig(botRole, "lightIsActiveNightChancePercent", 50) - : GetBotEquipmentSettingFromConfig(botRole, "lightIsActiveDayChancePercent", 25); + var lightLaserActiveChance = + raidSettings?.IsNightRaid ?? false + ? GetBotEquipmentSettingFromConfig( + botRole, + "lightIsActiveNightChancePercent", + 50 + ) + : GetBotEquipmentSettingFromConfig( + botRole, + "lightIsActiveDayChancePercent", + 25 + ); itemProperties.Light = new UpdLight { IsActive = _randomUtil.GetChance100(lightLaserActiveChance), - SelectedMode = 0 + SelectedMode = 0, }; hasProperties = true; } @@ -157,7 +174,7 @@ public class BotGeneratorHelper( itemProperties.Light = new UpdLight { IsActive = _randomUtil.GetChance100(lightLaserActiveChance), - SelectedMode = 0 + SelectedMode = 0, }; hasProperties = true; } @@ -165,18 +182,22 @@ public class BotGeneratorHelper( if (itemTemplate?.Parent == BaseClasses.NIGHTVISION) { // Get chance from botconfig for bot type - var nvgActiveChance = raidSettings?.IsNightRaid ?? false - ? GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceNightPercent", 90) - : GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceDayPercent", 15); + var nvgActiveChance = + raidSettings?.IsNightRaid ?? false + ? GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceNightPercent", 90) + : GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceDayPercent", 15); itemProperties.Togglable = new UpdTogglable { - On = _randomUtil.GetChance100(nvgActiveChance) + On = _randomUtil.GetChance100(nvgActiveChance), }; hasProperties = true; } // Togglable face shield - if ((itemTemplate?.Properties?.HasHinge ?? false) && (itemTemplate.Properties.FaceShieldComponent ?? false)) + if ( + (itemTemplate?.Properties?.HasHinge ?? false) + && (itemTemplate.Properties.FaceShieldComponent ?? false) + ) { var faceShieldActiveChance = GetBotEquipmentSettingFromConfig( botRole, @@ -185,7 +206,7 @@ public class BotGeneratorHelper( ); itemProperties.Togglable = new UpdTogglable { - On = _randomUtil.GetChance100(faceShieldActiveChance) + On = _randomUtil.GetChance100(faceShieldActiveChance), }; hasProperties = true; } @@ -200,7 +221,10 @@ public class BotGeneratorHelper( /// Max resource value of medical items /// Value provided from config /// Randomized value from maxHpResource - protected double GetRandomizedResourceValue(double maxResource, RandomisedResourceValues? randomizationValues) + protected double GetRandomizedResourceValue( + double maxResource, + RandomisedResourceValues? randomizationValues + ) { if (randomizationValues is null) { @@ -225,7 +249,11 @@ public class BotGeneratorHelper( /// the setting of the weapon attachment/helmet equipment to be activated /// default value for the chance of activation if the botrole or bot equipment role is undefined /// Percent chance to be active - protected double? GetBotEquipmentSettingFromConfig(string? botRole, string setting, double defaultValue) + protected double? GetBotEquipmentSettingFromConfig( + string? botRole, + string setting, + double defaultValue + ) { if (botRole is null) { @@ -242,7 +270,7 @@ public class BotGeneratorHelper( { botRole, setting, - defaultValue + defaultValue, } ) ); @@ -251,8 +279,12 @@ public class BotGeneratorHelper( } var props = botEquipmentSettings.GetType().GetProperties(); - var propValue = (double?) props.FirstOrDefault(x => string.Equals(x.Name, setting, StringComparison.CurrentCultureIgnoreCase)) - ?.GetValue(botEquipmentSettings); + var propValue = (double?) + props + .FirstOrDefault(x => + string.Equals(x.Name, setting, StringComparison.CurrentCultureIgnoreCase) + ) + ?.GetValue(botEquipmentSettings); if (propValue is not null) { @@ -266,7 +298,7 @@ public class BotGeneratorHelper( { botRole, setting, - defaultValue + defaultValue, } ) ); @@ -280,9 +312,15 @@ public class BotGeneratorHelper( /// weapon object being generated for /// type of bot being generated for /// Repairable object - protected UpdRepairable GenerateWeaponRepairableProperties(TemplateItem itemTemplate, string? botRole = null) + protected UpdRepairable GenerateWeaponRepairableProperties( + TemplateItem itemTemplate, + string? botRole = null + ) { - var maxDurability = _durabilityLimitsHelper.GetRandomizedMaxWeaponDurability(itemTemplate, botRole); + var maxDurability = _durabilityLimitsHelper.GetRandomizedMaxWeaponDurability( + itemTemplate, + botRole + ); var currentDurability = _durabilityLimitsHelper.GetRandomizedWeaponDurability( itemTemplate, botRole, @@ -292,7 +330,7 @@ public class BotGeneratorHelper( return new UpdRepairable { Durability = Math.Round(currentDurability, 5), - MaxDurability = Math.Round(maxDurability, 5) + MaxDurability = Math.Round(maxDurability, 5), }; } @@ -302,7 +340,10 @@ public class BotGeneratorHelper( /// weapon object being generated for /// type of bot being generated for /// Repairable object - protected UpdRepairable GenerateArmorRepairableProperties(TemplateItem itemTemplate, string? botRole = null) + protected UpdRepairable GenerateArmorRepairableProperties( + TemplateItem itemTemplate, + string? botRole = null + ) { double maxDurability; double currentDurability; @@ -313,7 +354,10 @@ public class BotGeneratorHelper( } else { - maxDurability = _durabilityLimitsHelper.GetRandomizedMaxArmorDurability(itemTemplate, botRole); + maxDurability = _durabilityLimitsHelper.GetRandomizedMaxArmorDurability( + itemTemplate, + botRole + ); currentDurability = _durabilityLimitsHelper.GetRandomizedArmorDurability( itemTemplate, botRole, @@ -324,7 +368,7 @@ public class BotGeneratorHelper( return new UpdRepairable { Durability = Math.Round(currentDurability, 5), - MaxDurability = Math.Round(maxDurability, 5) + MaxDurability = Math.Round(maxDurability, 5), }; } @@ -335,7 +379,11 @@ public class BotGeneratorHelper( /// Tpl of the item to check for incompatibilities /// Slot the item will be placed into /// false if no incompatibilities, also has incompatibility reason - public ChooseRandomCompatibleModResult IsItemIncompatibleWithCurrentItems(List itemsEquipped, string tplToCheck, string equipmentSlot) + public ChooseRandomCompatibleModResult IsItemIncompatibleWithCurrentItems( + List itemsEquipped, + string tplToCheck, + string equipmentSlot + ) { // Skip slots that have no incompatibilities if (_slotsWithNoCompatIssues.Contains(equipmentSlot)) @@ -344,12 +392,14 @@ public class BotGeneratorHelper( { Incompatible = false, Found = false, - Reason = "" + Reason = "", }; } // TODO: Can probably be optimized to cache itemTemplates as items are added to inventory - var equippedItemsDb = itemsEquipped.Select(equippedItem => _itemHelper.GetItem(equippedItem.Template).Value).ToList(); + var equippedItemsDb = itemsEquipped + .Select(equippedItem => _itemHelper.GetItem(equippedItem.Template).Value) + .ToList(); var (itemIsValid, itemToEquip) = _itemHelper.GetItem(tplToCheck); if (!itemIsValid) @@ -357,11 +407,7 @@ public class BotGeneratorHelper( _logger.Warning( _localisationService.GetText( "bot-invalid_item_compatibility_check", - new - { - itemTpl = tplToCheck, - slot = equipmentSlot - } + new { itemTpl = tplToCheck, slot = equipmentSlot } ) ); @@ -369,7 +415,7 @@ public class BotGeneratorHelper( { Incompatible = true, Found = false, - Reason = $"item: {tplToCheck} does not exist in the database" + Reason = $"item: {tplToCheck} does not exist in the database", }; } @@ -382,7 +428,7 @@ public class BotGeneratorHelper( { id = itemToEquip?.Id, name = itemToEquip?.Name, - slot = equipmentSlot + slot = equipmentSlot, } ) ); @@ -391,51 +437,60 @@ public class BotGeneratorHelper( { Incompatible = true, Found = false, - Reason = $"item: {tplToCheck} does not have a _props field" + Reason = $"item: {tplToCheck} does not have a _props field", }; } // Does an equipped item have a property that blocks the desired item - check for prop "BlocksX" .e.g BlocksEarpiece / BlocksFaceCover var templateItems = equippedItemsDb.ToList(); - var blockingItem = templateItems.FirstOrDefault(item => HasBlockingProperty(item, equipmentSlot)); + var blockingItem = templateItems.FirstOrDefault(item => + HasBlockingProperty(item, equipmentSlot) + ); if (blockingItem is not null) - // this.logger.warning(`1 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._name} - {equipmentSlot}`); + // this.logger.warning(`1 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._name} - {equipmentSlot}`); { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} in slot: {equipmentSlot} blocked by: {blockingItem.Id} {blockingItem.Name}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} in slot: {equipmentSlot} blocked by: {blockingItem.Id} {blockingItem.Name}", + SlotBlocked = true, }; } // Check if any of the current inventory templates have the incoming item defined as incompatible - blockingItem = templateItems.FirstOrDefault(x => x?.Properties?.ConflictingItems?.Contains(tplToCheck) ?? false); + blockingItem = templateItems.FirstOrDefault(x => + x?.Properties?.ConflictingItems?.Contains(tplToCheck) ?? false + ); if (blockingItem is not null) - // this.logger.warning(`2 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._props.Name} - {equipmentSlot}`); + // this.logger.warning(`2 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._props.Name} - {equipmentSlot}`); { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} in slot: {equipmentSlot} blocked by: {blockingItem.Id} {blockingItem.Name}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} in slot: {equipmentSlot} blocked by: {blockingItem.Id} {blockingItem.Name}", + SlotBlocked = true, }; } // Does item being checked get blocked/block existing item if (itemToEquip.Properties.BlocksHeadwear ?? false) { - var existingHeadwear = itemsEquipped.FirstOrDefault(x => x.SlotId == Containers.Headwear); + var existingHeadwear = itemsEquipped.FirstOrDefault(x => + x.SlotId == Containers.Headwear + ); if (existingHeadwear is not null) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingHeadwear.Template} in slot: {existingHeadwear.SlotId}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingHeadwear.Template} in slot: {existingHeadwear.SlotId}", + SlotBlocked = true, }; } } @@ -443,15 +498,18 @@ public class BotGeneratorHelper( // Does item being checked get blocked/block existing item if (itemToEquip.Properties.BlocksFaceCover.GetValueOrDefault(false)) { - var existingFaceCover = itemsEquipped.FirstOrDefault(item => item.SlotId == Containers.FaceCover); + var existingFaceCover = itemsEquipped.FirstOrDefault(item => + item.SlotId == Containers.FaceCover + ); if (existingFaceCover is not null) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingFaceCover.Template} in slot: {existingFaceCover.SlotId}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingFaceCover.Template} in slot: {existingFaceCover.SlotId}", + SlotBlocked = true, }; } } @@ -459,15 +517,18 @@ public class BotGeneratorHelper( // Does item being checked get blocked/block existing item if (itemToEquip.Properties.BlocksEarpiece.GetValueOrDefault(false)) { - var existingEarpiece = itemsEquipped.FirstOrDefault(item => item.SlotId == Containers.Earpiece); + var existingEarpiece = itemsEquipped.FirstOrDefault(item => + item.SlotId == Containers.Earpiece + ); if (existingEarpiece is not null) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingEarpiece.Template} in slot: {existingEarpiece.SlotId}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingEarpiece.Template} in slot: {existingEarpiece.SlotId}", + SlotBlocked = true, }; } } @@ -475,42 +536,46 @@ public class BotGeneratorHelper( // Does item being checked get blocked/block existing item if (itemToEquip.Properties.BlocksArmorVest.GetValueOrDefault(false)) { - var existingArmorVest = itemsEquipped.FirstOrDefault(item => item.SlotId == Containers.ArmorVest); + var existingArmorVest = itemsEquipped.FirstOrDefault(item => + item.SlotId == Containers.ArmorVest + ); if (existingArmorVest is not null) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingArmorVest.Template} in slot: {existingArmorVest.SlotId}", - SlotBlocked = true + Reason = + $"{tplToCheck} {itemToEquip.Name} is blocked by: {existingArmorVest.Template} in slot: {existingArmorVest.SlotId}", + SlotBlocked = true, }; } } // Check if the incoming item has any inventory items defined as incompatible - var blockingInventoryItem = itemsEquipped.FirstOrDefault(x => itemToEquip.Properties.ConflictingItems?.Contains(x.Template) ?? false); + var blockingInventoryItem = itemsEquipped.FirstOrDefault(x => + itemToEquip.Properties.ConflictingItems?.Contains(x.Template) ?? false + ); if (blockingInventoryItem is not null) - // this.logger.warning(`3 incompatibility found between - {itemToEquip[1]._name} and {blockingInventoryItem._tpl} - {equipmentSlot}`) + // this.logger.warning(`3 incompatibility found between - {itemToEquip[1]._name} and {blockingInventoryItem._tpl} - {equipmentSlot}`) { return new ChooseRandomCompatibleModResult { Incompatible = true, Found = false, - Reason = $"{tplToCheck} blocks existing item {blockingInventoryItem.Template} in slot {blockingInventoryItem.SlotId}" + Reason = + $"{tplToCheck} blocks existing item {blockingInventoryItem.Template} in slot {blockingInventoryItem.SlotId}", }; } - return new ChooseRandomCompatibleModResult - { - Incompatible = false, - Reason = "" - }; + return new ChooseRandomCompatibleModResult { Incompatible = false, Reason = "" }; } protected bool HasBlockingProperty(TemplateItem? item, string blockingPropertyName) { - return item != null && item.Blocks.TryGetValue(blockingPropertyName, out var blocks) && blocks; + return item != null + && item.Blocks.TryGetValue(blockingPropertyName, out var blocks) + && blocks; } /// @@ -541,7 +606,8 @@ public class BotGeneratorHelper( string? rootItemTplId, List itemWithChildren, BotBaseInventory inventory, - HashSet? containersIdFull = null) + HashSet? containersIdFull = null + ) { // Track how many containers are unable to be found var missingContainerCount = 0; @@ -553,7 +619,9 @@ public class BotGeneratorHelper( } // Get container to put item into - var container = inventory.Items.FirstOrDefault(item => item.SlotId == equipmentSlotId.ToString()); + var container = inventory.Items.FirstOrDefault(item => + item.SlotId == equipmentSlotId.ToString() + ); if (container is null) { missingContainerCount++; @@ -578,20 +646,29 @@ public class BotGeneratorHelper( var (key, value) = _itemHelper.GetItem(container.Template); if (!key) { - _logger.Warning(_localisationService.GetText("bot-missing_container_with_tpl", container.Template)); + _logger.Warning( + _localisationService.GetText( + "bot-missing_container_with_tpl", + container.Template + ) + ); // Bad item, skip continue; } if (value?.Properties?.Grids?.Count == 0) - // Container has no slots to hold items + // Container has no slots to hold items { continue; } // Get x/y grid size of item - var itemSize = _inventoryHelper.GetItemSize(rootItemTplId, rootItemId, itemWithChildren); + var itemSize = _inventoryHelper.GetItemSize( + rootItemTplId, + rootItemId, + itemWithChildren + ); // Iterate over each grid in the container and look for a big enough space for the item to be placed in var currentGridCount = 1; @@ -599,27 +676,35 @@ public class BotGeneratorHelper( foreach (var slotGrid in value?.Properties?.Grids ?? []) { // Grid is empty, skip or item size is bigger than grid - if (slotGrid.Props?.CellsH == 0 || - slotGrid.Props?.CellsV == 0 || - itemSize[0] * itemSize[1] > slotGrid.Props?.CellsV * slotGrid.Props?.CellsH) + if ( + slotGrid.Props?.CellsH == 0 + || slotGrid.Props?.CellsV == 0 + || itemSize[0] * itemSize[1] > slotGrid.Props?.CellsV * slotGrid.Props?.CellsH + ) { continue; } // Can't put item type in grid, skip all grids as we're assuming they have the same rules if (!ItemAllowedInContainer(slotGrid, rootItemTplId)) - // Multiple containers, maybe next one allows item, only break out of loop for the containers grids + // Multiple containers, maybe next one allows item, only break out of loop for the containers grids { break; } // Get all root items in found container - var existingContainerItems = (inventory.Items ?? []).Where(item => item.ParentId == container.Id && item.SlotId == slotGrid.Name + var existingContainerItems = (inventory.Items ?? []).Where(item => + item.ParentId == container.Id && item.SlotId == slotGrid.Name ); // Get root items in container we can iterate over to find out what space is free - var containerItemsToCheck = existingContainerItems.Where(x => x.SlotId == slotGrid.Name); - var containerItemsWithChildren = GetContainerItemsWithChildren(containerItemsToCheck, inventory.Items); + var containerItemsToCheck = existingContainerItems.Where(x => + x.SlotId == slotGrid.Name + ); + var containerItemsWithChildren = GetContainerItemsWithChildren( + containerItemsToCheck, + inventory.Items + ); if (slotGrid.Props is not null) { @@ -632,7 +717,11 @@ public class BotGeneratorHelper( ); // Try to fit item into grid - var findSlotResult = _containerHelper.FindSlotForItem(slotGridMap, itemSize[0], itemSize[1]); + var findSlotResult = _containerHelper.FindSlotForItem( + slotGridMap, + itemSize[0], + itemSize[1] + ); // Free slot found, add item if (findSlotResult.Success ?? false) @@ -645,12 +734,14 @@ public class BotGeneratorHelper( parentItem.ParentId = container.Id; parentItem.SlotId = slotGrid.Name; parentItem.Location = new ItemLocation - { - X = findSlotResult.X, - Y = findSlotResult.Y, - R = findSlotResult.Rotation ?? false ? ItemRotation.Vertical : ItemRotation.Horizontal - } - ; + { + X = findSlotResult.X, + Y = findSlotResult.Y, + R = + findSlotResult.Rotation ?? false + ? ItemRotation.Vertical + : ItemRotation.Horizontal, + }; } (inventory.Items ?? []).AddRange(itemWithChildren); @@ -691,7 +782,10 @@ public class BotGeneratorHelper( /// /// /// - protected List GetContainerItemsWithChildren(IEnumerable containerRootItems, List inventoryItems) + protected List GetContainerItemsWithChildren( + IEnumerable containerRootItems, + List inventoryItems + ) { var result = new List(); if (!containerRootItems.Any()) @@ -706,7 +800,10 @@ public class BotGeneratorHelper( { // Check item in container for children, store for later insertion into `containerItemsToCheck` // (used later when figuring out how much space weapon takes up) - var itemWithChildItems = _itemHelper.FindAndReturnChildrenAsItems(itemsWithoutLocation, rootItem.Id); + var itemWithChildItems = _itemHelper.FindAndReturnChildrenAsItems( + itemsWithoutLocation, + rootItem.Id + ); // Item had children, replace existing data with item + its children result.Add(rootItem); @@ -729,7 +826,7 @@ public class BotGeneratorHelper( var filter = propFilters?.FirstOrDefault()?.Filter ?? []; if (propFilters?.Count == 0) - // no filters, item is fine to add + // no filters, item is fine to add { return true; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotHelper.cs index 558fa704..0f0e5d61 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotHelper.cs @@ -1,7 +1,7 @@ using System.Collections.Concurrent; using System.Collections.Frozen; -using SPTarkov.Server.Core.Constants; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Spt.Config; using SPTarkov.Server.Core.Models.Utils; @@ -20,12 +20,12 @@ public class BotHelper( ) { private static readonly FrozenSet _pmcTypeIds = - [ - Sides.Usec.ToLower(), - Sides.Bear.ToLower(), - Sides.PmcBear.ToLower(), - Sides.PmcUsec.ToLower() - ]; + [ + Sides.Usec.ToLower(), + Sides.Bear.ToLower(), + Sides.PmcBear.ToLower(), + Sides.PmcUsec.ToLower(), + ]; private readonly BotConfig _botConfig = _configServer.GetConfig(); private readonly PmcConfig _pmcConfig = _configServer.GetConfig(); @@ -60,7 +60,10 @@ public class BotHelper( public bool IsBotBoss(string botRole) { - return !IsBotFollower(botRole) && _botConfig.Bosses.Any(x => string.Equals(x, botRole, StringComparison.CurrentCultureIgnoreCase)); + return !IsBotFollower(botRole) + && _botConfig.Bosses.Any(x => + string.Equals(x, botRole, StringComparison.CurrentCultureIgnoreCase) + ); } public bool IsBotFollower(string botRole) @@ -88,7 +91,7 @@ public class BotHelper( difficultySettings.Mind[friendlyBotTypesKey] = new List(); } - ((List) difficultySettings.Mind[friendlyBotTypesKey]).Add(typeToAdd); + ((List)difficultySettings.Mind[friendlyBotTypesKey]).Add(typeToAdd); } /// @@ -112,7 +115,7 @@ public class BotHelper( difficultySettings.Mind[revengePropKey] = new List(); } - var revengeArray = (List) difficultySettings.Mind[revengePropKey]; + var revengeArray = (List)difficultySettings.Mind[revengePropKey]; foreach (var botTypeToAdd in typesToAdd) { if (!revengeArray.Contains(botTypeToAdd)) @@ -129,10 +132,12 @@ public class BotHelper( /// True if role is PMC public bool BotRoleIsPmc(string botRole) { - HashSet listToCheck = [_pmcConfig.UsecType.ToLower(), _pmcConfig.BearType.ToLower()]; - return listToCheck.Contains( - botRole.ToLower() - ); + HashSet listToCheck = + [ + _pmcConfig.UsecType.ToLower(), + _pmcConfig.BearType.ToLower(), + ]; + return listToCheck.Contains(botRole.ToLower()); } /// @@ -141,7 +146,10 @@ public class BotHelper( /// level of bot /// bot equipment json /// RandomisationDetails - public RandomisationDetails GetBotRandomizationDetails(int botLevel, EquipmentFilters botEquipConfig) + public RandomisationDetails GetBotRandomizationDetails( + int botLevel, + EquipmentFilters botEquipConfig + ) { // No randomisation details found, skip if (botEquipConfig is null || botEquipConfig.Randomisation is null) @@ -149,7 +157,8 @@ public class BotHelper( return null; } - return botEquipConfig.Randomisation.FirstOrDefault(randDetails => botLevel >= randDetails.LevelRange.Min && botLevel <= randDetails.LevelRange.Max + return botEquipConfig.Randomisation.FirstOrDefault(randDetails => + botLevel >= randDetails.LevelRange.Min && botLevel <= randDetails.LevelRange.Max ); } @@ -159,7 +168,9 @@ public class BotHelper( /// pmc role public string GetRandomizedPmcRole() { - return _randomUtil.GetChance100(_pmcConfig.IsUsec) ? _pmcConfig.UsecType : _pmcConfig.BearType; + return _randomUtil.GetChance100(_pmcConfig.IsUsec) + ? _pmcConfig.UsecType + : _pmcConfig.BearType; } /// @@ -199,18 +210,26 @@ public class BotHelper( /// name of PMC public string GetPmcNicknameOfMaxLength(int maxLength, string? side = null) { - var chosenFaction = (side ?? (_randomUtil.GetInt(0, 1) == 0 ? Sides.Usec : Sides.Bear)).ToLowerInvariant(); + var chosenFaction = ( + side ?? (_randomUtil.GetInt(0, 1) == 0 ? Sides.Usec : Sides.Bear) + ).ToLowerInvariant(); var cacheKey = $"{chosenFaction}{maxLength}"; if (!_pmcNameCache.TryGetValue(cacheKey, out var eligibleNames)) { - if (!_databaseService.GetBots().Types.TryGetValue(chosenFaction, out var chosenFactionDetails)) + if ( + !_databaseService + .GetBots() + .Types.TryGetValue(chosenFaction, out var chosenFactionDetails) + ) { _logger.Error($"Unknown faction: {chosenFaction} Defaulting to: {Sides.Usec}"); chosenFaction = Sides.Usec.ToLower(); chosenFactionDetails = _databaseService.GetBots().Types[chosenFaction]; } - var matchingNames = chosenFactionDetails.FirstNames.Where(name => name.Length <= maxLength).ToList(); + var matchingNames = chosenFactionDetails + .FirstNames.Where(name => name.Length <= maxLength) + .ToList(); if (!matchingNames.Any()) { _logger.Warning( diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotWeaponGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotWeaponGeneratorHelper.cs index 35c7df6d..1c21199d 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotWeaponGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotWeaponGeneratorHelper.cs @@ -21,7 +21,11 @@ public class BotWeaponGeneratorHelper( LocalisationService _localisationService ) { - private static readonly FrozenSet _magCheck = ["CylinderMagazine", "SpringDrivenCylinder"]; + private static readonly FrozenSet _magCheck = + [ + "CylinderMagazine", + "SpringDrivenCylinder", + ]; /// /// Get a randomized number of bullets for a specific magazine @@ -36,11 +40,16 @@ public class BotWeaponGeneratorHelper( double? chamberBulletCount = 0; if (MagazineIsCylinderRelated(parentItem.Name)) { - var firstSlotAmmoTpl = magTemplate.Properties.Cartridges.FirstOrDefault()?.Props.Filters[0].Filter.FirstOrDefault(); - var ammoMaxStackSize = _itemHelper.GetItem(firstSlotAmmoTpl).Value?.Properties?.StackMaxSize ?? 1; - chamberBulletCount = ammoMaxStackSize == 1 - ? 1 // Rotating grenade launcher - : magTemplate.Properties.Slots.Count; // Shotguns/revolvers. We count the number of camoras as the _max_count of the magazine is 0 + var firstSlotAmmoTpl = magTemplate + .Properties.Cartridges.FirstOrDefault() + ?.Props.Filters[0] + .Filter.FirstOrDefault(); + var ammoMaxStackSize = + _itemHelper.GetItem(firstSlotAmmoTpl).Value?.Properties?.StackMaxSize ?? 1; + chamberBulletCount = + ammoMaxStackSize == 1 + ? 1 // Rotating grenade launcher + : magTemplate.Properties.Slots.Count; // Shotguns/revolvers. We count the number of camoras as the _max_count of the magazine is 0 } else if (parentItem.Id == BaseClasses.UBGL) { @@ -64,7 +73,7 @@ public class BotWeaponGeneratorHelper( /// Numerical value of magazine count public int GetRandomizedMagazineCount(GenerationData magCounts) { - return (int) _weightedRandomHelper.GetWeightedValue(magCounts.Weights); + return (int)_weightedRandomHelper.GetWeightedValue(magCounts.Weights); } /// @@ -84,16 +93,13 @@ public class BotWeaponGeneratorHelper( /// Ammo to add to magazine /// Template object of magazine /// Item array - public List CreateMagazineWithAmmo(string magazineTpl, string ammoTpl, TemplateItem magTemplate) + public List CreateMagazineWithAmmo( + string magazineTpl, + string ammoTpl, + TemplateItem magTemplate + ) { - List magazine = - [ - new() - { - Id = _hashUtil.Generate(), - Template = magazineTpl - } - ]; + List magazine = [new() { Id = _hashUtil.Generate(), Template = magazineTpl }]; _itemHelper.FillMagazineWithCartridge(magazine, magTemplate, ammoTpl, 1); @@ -124,10 +130,7 @@ public class BotWeaponGeneratorHelper( { Id = _hashUtil.Generate(), Template = ammoTpl, - Upd = new Upd - { - StackObjectsCount = cartridgeCount - } + Upd = new Upd { StackObjectsCount = cartridgeCount }, } ); @@ -143,10 +146,12 @@ public class BotWeaponGeneratorHelper( if (result != ItemAddedResult.SUCCESS) { - _logger.Debug($"Unable to add ammo: {ammoItem.Template} to bot inventory, {result.ToString()}"); + _logger.Debug( + $"Unable to add ammo: {ammoItem.Template} to bot inventory, {result.ToString()}" + ); if (result == ItemAddedResult.NO_SPACE || result == ItemAddedResult.NO_CONTAINERS) - // If there's no space for 1 stack or no containers to hold item, there's no space for the others + // If there's no space for 1 stack or no containers to hold item, there's no space for the others { break; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/CertificateHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/CertificateHelper.cs index 8daf99ed..69d274f5 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/CertificateHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/CertificateHelper.cs @@ -149,13 +149,21 @@ public class CertificateHelper(ISptLogger _logger, FileUtil _ var distinguishedName = new X500DistinguishedName($"CN={subjectName}"); using var rsa = RSA.Create(2048); - var request = new CertificateRequest(distinguishedName, rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + var request = new CertificateRequest( + distinguishedName, + rsa, + HashAlgorithmName.SHA256, + RSASignaturePadding.Pkcs1 + ); request.CertificateExtensions.Add(sanBuilder.Build()); //Todo: Enable when Pfx methods can be removed //SavePrivateKey(rsa); - return request.CreateSelfSigned(new DateTimeOffset(DateTime.UtcNow.AddDays(-1)), new DateTimeOffset(DateTime.UtcNow.AddDays(3650))); + return request.CreateSelfSigned( + new DateTimeOffset(DateTime.UtcNow.AddDays(-1)), + new DateTimeOffset(DateTime.UtcNow.AddDays(3650)) + ); } /// @@ -167,9 +175,13 @@ public class CertificateHelper(ISptLogger _logger, FileUtil _ try { // Save as PEM (ensure the certificate is in PEM format) - var certPem = "-----BEGIN CERTIFICATE-----\n" + - Convert.ToBase64String(certificate.Export(X509ContentType.Cert), Base64FormattingOptions.InsertLineBreaks) + - "\n-----END CERTIFICATE-----"; + var certPem = + "-----BEGIN CERTIFICATE-----\n" + + Convert.ToBase64String( + certificate.Export(X509ContentType.Cert), + Base64FormattingOptions.InsertLineBreaks + ) + + "\n-----END CERTIFICATE-----"; _fileUtil.WriteFile(certificatePath, certPem); } catch (Exception ex) @@ -201,9 +213,10 @@ public class CertificateHelper(ISptLogger _logger, FileUtil _ var privateKeyBytes = privateKey.ExportPkcs8PrivateKey(); // Convert the private key to PEM format (Base64 encoded) - var privateKeyString = "-----BEGIN PRIVATE KEY-----\n" + - Convert.ToBase64String(privateKeyBytes, Base64FormattingOptions.InsertLineBreaks) + - "\n-----END PRIVATE KEY-----"; + var privateKeyString = + "-----BEGIN PRIVATE KEY-----\n" + + Convert.ToBase64String(privateKeyBytes, Base64FormattingOptions.InsertLineBreaks) + + "\n-----END PRIVATE KEY-----"; _fileUtil.WriteFile(certificateKeyPath, privateKeyString); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ContainerHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ContainerHelper.cs index 3ba8a377..7e99615f 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ContainerHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ContainerHelper.cs @@ -34,7 +34,7 @@ public class ContainerHelper for (var y = 0; y < limitY; y++) { if (container2D[y].All(x => x == 1)) - // Every item in row is full, skip row + // Every item in row is full, skip row { continue; } @@ -42,7 +42,17 @@ public class ContainerHelper // Go left to right across x-axis looking for free position for (var x = 0; x < limitX; x++) { - if (CanItemBePlacedInContainerAtPosition(container2D, containerX, containerY, x, y, itemX!.Value, itemY!.Value)) + if ( + CanItemBePlacedInContainerAtPosition( + container2D, + containerX, + containerY, + x, + y, + itemX!.Value, + itemY!.Value + ) + ) { // Success, return result return new FindSlotResult(true, x, y, rotation); @@ -55,7 +65,17 @@ public class ContainerHelper } // Bigger than 1x1, try rotating by swapping x and y values - if (!CanItemBePlacedInContainerAtPosition(container2D, containerX, containerY, x, y, itemY!.Value, itemX!.Value)) + if ( + !CanItemBePlacedInContainerAtPosition( + container2D, + containerX, + containerY, + x, + y, + itemY!.Value, + itemX!.Value + ) + ) { continue; } @@ -94,7 +114,8 @@ public class ContainerHelper int startXPos, int startYPos, int itemWidth, - int itemHeight) + int itemHeight + ) { // Check item isn't bigger than container when at position if (startXPos + itemWidth > containerWidth || startYPos + itemHeight > containerHeight) @@ -134,7 +155,8 @@ public class ContainerHelper int y, int? itemW, int? itemH, - bool rotate) + bool rotate + ) { // Swap height/width if we want to fit it in rotated var itemWidth = rotate ? itemH : itemW; @@ -144,13 +166,15 @@ public class ContainerHelper for (var tmpX = x; tmpX < x + itemWidth; tmpX++) { if (container2D[tmpY][tmpX] == 0) - // Flag slot as used + // Flag slot as used { container2D[tmpY][tmpX] = 1; } else { - throw new Exception($"Slot at({x}, {y}) is already filled. Cannot fit a {itemW} by {itemH} item"); + throw new Exception( + $"Slot at({x}, {y}) is already filled. Cannot fit a {itemW} by {itemH} item" + ); } } } @@ -171,35 +195,17 @@ public class FindSlotResult Rotation = rotation; } - public FindSlotResult() - { - } + public FindSlotResult() { } [JsonPropertyName("success")] - public bool? Success - { - get; - set; - } + public bool? Success { get; set; } [JsonPropertyName("x")] - public int? X - { - get; - set; - } + public int? X { get; set; } [JsonPropertyName("y")] - public int? Y - { - get; - set; - } + public int? Y { get; set; } [JsonPropertyName("rotation")] - public bool? Rotation - { - get; - set; - } + public bool? Rotation { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/AbstractDialogChatBot.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/AbstractDialogChatBot.cs index 75522662..1b0cb3f2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/AbstractDialogChatBot.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/AbstractDialogChatBot.cs @@ -14,8 +14,9 @@ public abstract class AbstractDialogChatBot( IEnumerable chatCommands ) : IDialogueChatBot { - protected IDictionary _chatCommands = - chatCommands.ToDictionary(command => command.GetCommandPrefix()); + protected IDictionary _chatCommands = chatCommands.ToDictionary(command => + command.GetCommandPrefix() + ); public abstract UserDialogInfo GetChatBot(); @@ -30,14 +31,18 @@ public abstract class AbstractDialogChatBot( var splitCommand = request.Text.Split(" "); - if (splitCommand.Length > 1 && - _chatCommands.TryGetValue(splitCommand[0], out var commando) && - commando.GetCommands().Contains(splitCommand[1])) + if ( + splitCommand.Length > 1 + && _chatCommands.TryGetValue(splitCommand[0], out var commando) + && commando.GetCommands().Contains(splitCommand[1]) + ) { return commando.Handle(splitCommand[1], GetChatBot(), sessionId, request); } - if (string.Equals(splitCommand.FirstOrDefault(), "help", StringComparison.OrdinalIgnoreCase)) + if ( + string.Equals(splitCommand.FirstOrDefault(), "help", StringComparison.OrdinalIgnoreCase) + ) { return SendPlayerHelpMessage(sessionId, request); } @@ -105,7 +110,9 @@ public abstract class AbstractDialogChatBot( var prefix = chatCommand.GetCommandPrefix(); if (!_chatCommands.TryAdd(prefix, chatCommand)) { - throw new Exception($"The command \"{prefix}\" attempting to be registered already exists."); + throw new Exception( + $"The command \"{prefix}\" attempting to be registered already exists." + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/IChatCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/IChatCommand.cs index 5619acdf..e072bde6 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/IChatCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/IChatCommand.cs @@ -8,5 +8,10 @@ public interface IChatCommand public string GetCommandPrefix(); public string GetCommandHelp(string command); public List GetCommands(); - public string Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request); + public string Handle( + string command, + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommandoCommands.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommandoCommands.cs index 547a8809..501c939a 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommandoCommands.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommandoCommands.cs @@ -24,8 +24,12 @@ public class SptCommandoCommands : IChatCommand _localisationService = localisationService; var coreConfigs = configServer.GetConfig(); var commandoId = coreConfigs.Features?.ChatbotFeatures.Ids.GetValueOrDefault("commando"); - if (!(coreConfigs.Features.ChatbotFeatures.CommandoFeatures.GiveCommandEnabled && - coreConfigs.Features.ChatbotFeatures.EnabledBots.ContainsKey(commandoId))) + if ( + !( + coreConfigs.Features.ChatbotFeatures.CommandoFeatures.GiveCommandEnabled + && coreConfigs.Features.ChatbotFeatures.EnabledBots.ContainsKey(commandoId) + ) + ) { _sptCommands.Remove("give"); } @@ -46,7 +50,12 @@ public class SptCommandoCommands : IChatCommand return _sptCommands.Keys.ToList(); } - public string Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) + public string Handle( + string command, + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ) { return _sptCommands[command].PerformAction(commandHandler, sessionId, request); } @@ -57,7 +66,10 @@ public class SptCommandoCommands : IChatCommand if (!_sptCommands.TryAdd(key, command)) { throw new Exception( - _localisationService.GetText("chat-unable_to_register_command_already_registered", key) + _localisationService.GetText( + "chat-unable_to_register_command_already_registered", + key + ) ); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.cs index 825747dd..9bab5cad 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.cs @@ -27,14 +27,16 @@ public class GiveSptCommand( ) : ISptCommand { private const double _acceptableConfidence = 0.9d; - private static readonly Regex _commandRegex = new(@"^spt give (((([a-z]{2,5}) )?""(.+)""|\w+) )?([0-9]+)$"); + private static readonly Regex _commandRegex = new( + @"^spt give (((([a-z]{2,5}) )?""(.+)""|\w+) )?([0-9]+)$" + ); // Exception for flares protected static readonly FrozenSet _excludedPresetItems = [ ItemTpl.FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_RED, ItemTpl.FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_GREEN, - ItemTpl.FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_YELLOW + ItemTpl.FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_YELLOW, ]; protected Dictionary _savedCommand = new(); @@ -46,13 +48,16 @@ public class GiveSptCommand( public string GetCommandHelp() { - return - "spt give\n========\nSends items to the player through the message system.\n\n\tspt give [template ID] [quantity]\n\t\tEx: " + - "spt give 544fb25a4bdc2dfb738b4567 2\n\n\tspt give [\"item name\"] [quantity]\n\t\tEx: spt give \"pack of sugar\" 10\n\n\tspt " + - "give [locale] [\"item name\"] [quantity]\n\t\tEx: spt give fr \"figurine de chat\" 3"; + return "spt give\n========\nSends items to the player through the message system.\n\n\tspt give [template ID] [quantity]\n\t\tEx: " + + "spt give 544fb25a4bdc2dfb738b4567 2\n\n\tspt give [\"item name\"] [quantity]\n\t\tEx: spt give \"pack of sugar\" 10\n\n\tspt " + + "give [locale] [\"item name\"] [quantity]\n\t\tEx: spt give fr \"figurine de chat\" 3"; } - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) + public string PerformAction( + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ) { if (!_commandRegex.IsMatch(request.Text)) { @@ -112,7 +117,10 @@ public class GiveSptCommand( } isItemName = (!string.IsNullOrEmpty(result.Groups[5].Value)); - item = (!string.IsNullOrEmpty(result.Groups[5].Value)) ? result.Groups[5].Value : result.Groups[2].Value; + item = + (!string.IsNullOrEmpty(result.Groups[5].Value)) + ? result.Groups[5].Value + : result.Groups[2].Value; quantity = +int.Parse(result.Groups[6].Value); if (quantity <= 0) { @@ -128,7 +136,8 @@ public class GiveSptCommand( { try { - locale = result.Groups[4].Value ?? _localeService.GetDesiredGameLocale() ?? "en"; + locale = + result.Groups[4].Value ?? _localeService.GetDesiredGameLocale() ?? "en"; } catch (Exception ex) { @@ -146,19 +155,19 @@ public class GiveSptCommand( var allAllowedItemNames = _itemHelper .GetItems() .Where(IsItemAllowed) - .Select(i => localizedGlobal - .GetValueOrDefault($"{i.Id} Name", i.Properties.Name) - ?.ToLower() + .Select(i => + localizedGlobal + .GetValueOrDefault($"{i.Id} Name", i.Properties.Name) + ?.ToLower() ) .Where(i => !string.IsNullOrEmpty(i)); var closestItemsMatchedByName = allAllowedItemNames .Select(i => new - { - Match = StringSimilarity.Match(item, i, 2, true), - ItemName = i - } - ) + { + Match = StringSimilarity.Match(item, i, 2, true), + ItemName = i, + }) .ToList(); closestItemsMatchedByName.Sort((a1, a2) => a2.Match.CompareTo(a1.Match)); @@ -172,8 +181,9 @@ public class GiveSptCommand( var i = 1; var slicedItems = closestItemsMatchedByName.Slice(0, 10); // max 10 item names and map them - var itemList = slicedItems - .Select(match => $"{i++}. {match.ItemName} (conf: {Math.Round(match.Match * 100d),2})"); + var itemList = slicedItems.Select(match => + $"{i++}. {match.ItemName} (conf: {Math.Round(match.Match * 100d), 2})" + ); _savedCommand.Add( sessionId, new SavedCommand( @@ -200,7 +210,9 @@ public class GiveSptCommand( ? _itemHelper .GetItems() .Where(IsItemAllowed) - .FirstOrDefault(i => (localizedGlobal[$"{i?.Id} Name"]?.ToLower() ?? i.Properties.Name) == item) + .FirstOrDefault(i => + (localizedGlobal[$"{i?.Id} Name"]?.ToLower() ?? i.Properties.Name) == item + ) .Id : item; @@ -232,11 +244,7 @@ public class GiveSptCommand( { List ammoBoxArray = []; ammoBoxArray.Add( - new Item - { - Id = _hashUtil.Generate(), - Template = checkedItem.Value.Id - } + new Item { Id = _hashUtil.Generate(), Template = checkedItem.Value.Id } ); // DO NOT generate the ammo box cartridges, the mail service does it for us! :) // _itemHelper.addCartridgesToAmmoBox(ammoBoxArray, checkedItem[1]); @@ -254,7 +262,7 @@ public class GiveSptCommand( { Id = _hashUtil.Generate(), Template = checkedItem.Value.Id, - Upd = _itemHelper.GenerateUpdForItem(checkedItem.Value) + Upd = _itemHelper.GenerateUpdForItem(checkedItem.Value), } ); } @@ -265,7 +273,7 @@ public class GiveSptCommand( { Id = _hashUtil.Generate(), Template = checkedItem.Value.Id, - Upd = _itemHelper.GenerateUpdForItem(checkedItem.Value) + Upd = _itemHelper.GenerateUpdForItem(checkedItem.Value), }; itemToSend.Upd.StackObjectsCount = quantity; try @@ -288,7 +296,11 @@ public class GiveSptCommand( // Flag the items as FiR _itemHelper.SetFoundInRaid(itemsToSend); - _mailSendService.SendSystemMessageToPlayer(sessionId, $"SPT GIVE DELIVERY: {item}", itemsToSend); + _mailSendService.SendSystemMessageToPlayer( + sessionId, + $"SPT GIVE DELIVERY: {item}", + itemsToSend + ); return request.DialogId; } @@ -310,17 +322,19 @@ public class GiveSptCommand( /// true if its obtainable protected bool IsItemAllowed(TemplateItem templateItem) { - return templateItem.Type != "Node" && - !_itemHelper.IsQuestItem(templateItem.Id) && - !_itemFilterService.IsItemBlacklisted(templateItem.Id) && - (templateItem.Properties?.Prefab?.Path ?? "") != "" && - !_itemHelper.IsOfBaseclasses( - templateItem.Id, - [ - BaseClasses.HIDEOUT_AREA_CONTAINER, BaseClasses.LOOT_CONTAINER, - BaseClasses.RANDOM_LOOT_CONTAINER, BaseClasses.MOB_CONTAINER, - BaseClasses.BUILT_IN_INSERTS - ] - ); + return templateItem.Type != "Node" + && !_itemHelper.IsQuestItem(templateItem.Id) + && !_itemFilterService.IsItemBlacklisted(templateItem.Id) + && (templateItem.Properties?.Prefab?.Path ?? "") != "" + && !_itemHelper.IsOfBaseclasses( + templateItem.Id, + [ + BaseClasses.HIDEOUT_AREA_CONTAINER, + BaseClasses.LOOT_CONTAINER, + BaseClasses.RANDOM_LOOT_CONTAINER, + BaseClasses.MOB_CONTAINER, + BaseClasses.BUILT_IN_INSERTS, + ] + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.cs index 823d3491..e70dd2f5 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.cs @@ -5,9 +5,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.Commando.SptCommands.GiveCommand [Injectable] public class SavedCommand { - public SavedCommand() - { - } + public SavedCommand() { } public SavedCommand(int quantity, List potentialItemNames, string locale) { @@ -16,21 +14,9 @@ public class SavedCommand Locale = locale; } - public int Quantity - { - get; - set; - } + public int Quantity { get; set; } - public List PotentialItemNames - { - get; - set; - } + public List PotentialItemNames { get; set; } - public string Locale - { - get; - set; - } + public string Locale { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/StringSimilarity.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/StringSimilarity.cs index c1e225f7..b19e849b 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/StringSimilarity.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/GiveCommand/StringSimilarity.cs @@ -5,7 +5,12 @@ public static class StringSimilarity /// /// Converted from: https://github.com/stephenjjbrown/string-similarity-js/blob/master/src/string-similarity.ts /// - public static double Match(string str1, string str2, int substringLength = 2, bool caseSensitive = false) + public static double Match( + string str1, + string str2, + int substringLength = 2, + bool caseSensitive = false + ) { if (!caseSensitive) { diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ISptCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ISptCommand.cs index ae07d3ec..d054e09b 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ISptCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ISptCommand.cs @@ -7,5 +7,9 @@ public interface ISptCommand { public string GetCommand(); public string GetCommandHelp(); - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request); + public string PerformAction( + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.cs index 693803bb..2e1e3de8 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.cs @@ -26,7 +26,8 @@ public class ProfileSptCommand( /// spt profile skill metabolism 10 /// protected static readonly Regex _commandRegex = new( - @"^spt profile (?level|skill)((?<=.*skill) (?[\w]+))? (?(?!0+)[0-9]+)$"); + @"^spt profile (?level|skill)((?<=.*skill) (?[\w]+))? (?(?!0+)[0-9]+)$" + ); protected static readonly Regex _examineRegex = new(@"^spt profile (?examine)"); @@ -37,13 +38,16 @@ public class ProfileSptCommand( public string GetCommandHelp() { - return - "spt profile\n========\nSets the profile level or skill to the desired level through the message system.\n\n\tspt " + - "profile level [desired level]\n\t\tEx: spt profile level 20\n\n\tspt profile skill [skill name] [quantity]\n\t\tEx: " + - "spt profile skill metabolism 51"; + return "spt profile\n========\nSets the profile level or skill to the desired level through the message system.\n\n\tspt " + + "profile level [desired level]\n\t\tEx: spt profile level 20\n\n\tspt profile skill [skill name] [quantity]\n\t\tEx: " + + "spt profile skill metabolism 51"; } - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) + public string PerformAction( + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ) { var isCommand = _commandRegex.IsMatch(request.Text); var isExamine = _examineRegex.IsMatch(request.Text); @@ -60,9 +64,13 @@ public class ProfileSptCommand( var result = _commandRegex.Match(request.Text); - var command = result.Groups["command"].Length > 0 ? result.Groups["command"].Captures[0].Value : null; - var skill = result.Groups["skill"].Length > 0 ? result.Groups["skill"].Captures[0].Value : null; - var quantity = int.Parse(result.Groups["quantity"].Length > 0 ? result.Groups["quantity"].Captures[0].Value : "0"); + var command = + result.Groups["command"].Length > 0 ? result.Groups["command"].Captures[0].Value : null; + var skill = + result.Groups["skill"].Length > 0 ? result.Groups["skill"].Captures[0].Value : null; + var quantity = int.Parse( + result.Groups["quantity"].Length > 0 ? result.Groups["quantity"].Captures[0].Value : "0" + ); ProfileChangeEvent profileChangeEvent; switch (command) @@ -81,40 +89,41 @@ public class ProfileSptCommand( profileChangeEvent = HandleLevelCommand(quantity); break; case "skill": + { + var enumSkill = Enum.GetValues() + .Cast() + .FirstOrDefault(t => + string.Equals(t?.ToString(), skill, StringComparison.OrdinalIgnoreCase) + ); + + if (enumSkill == null) { - var enumSkill = Enum.GetValues() - .Cast() - .FirstOrDefault(t => string.Equals(t?.ToString(), skill, StringComparison.OrdinalIgnoreCase) - ); - - if (enumSkill == null) - { - _mailSendService.SendUserMessageToPlayer( - sessionId, - commandHandler, - "Invalid use of profile command, the skill was not found. Use 'help' for more information." - ); - return request.DialogId; - } - - if (quantity is < 0 or > 51) - { - _mailSendService.SendUserMessageToPlayer( - sessionId, - commandHandler, - "Invalid use of profile command, the skill level was outside bounds: 1 to 51. Use 'help' for more information." - ); - return request.DialogId; - } - - profileChangeEvent = HandleSkillCommand(enumSkill, quantity); - break; + _mailSendService.SendUserMessageToPlayer( + sessionId, + commandHandler, + "Invalid use of profile command, the skill was not found. Use 'help' for more information." + ); + return request.DialogId; } + + if (quantity is < 0 or > 51) + { + _mailSendService.SendUserMessageToPlayer( + sessionId, + commandHandler, + "Invalid use of profile command, the skill level was outside bounds: 1 to 51. Use 'help' for more information." + ); + return request.DialogId; + } + + profileChangeEvent = HandleSkillCommand(enumSkill, quantity); + break; + } case "examine": - { - profileChangeEvent = HandleExamineCommand(); - break; - } + { + profileChangeEvent = HandleExamineCommand(); + break; + } default: _mailSendService.SendUserMessageToPlayer( sessionId, @@ -132,13 +141,10 @@ public class ProfileSptCommand( { Id = _hashUtil.Generate(), Template = Money.ROUBLES, - Upd = new Upd - { - StackObjectsCount = 1 - }, + Upd = new Upd { StackObjectsCount = 1 }, ParentId = _hashUtil.Generate(), - SlotId = "main" - } + SlotId = "main", + }, ], 999999, [profileChangeEvent] @@ -154,7 +160,7 @@ public class ProfileSptCommand( Id = _hashUtil.Generate(), Type = "SkillPoints", Value = level * 100, - Entity = skill.ToString() + Entity = skill.ToString(), }; return profileChangeEvent; } @@ -167,7 +173,7 @@ public class ProfileSptCommand( Id = _hashUtil.Generate(), Type = "ProfileLevel", Value = exp, - Entity = null + Entity = null, }; return profileChangeEvent; } @@ -179,7 +185,7 @@ public class ProfileSptCommand( Id = _hashUtil.Generate(), Type = "ExamineAllItems", Value = null, - Entity = null + Entity = null, }; return profileChangeEvent; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.cs index b50fbce1..8bcd613c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.cs @@ -18,7 +18,8 @@ public class TraderSptCommand( ISptLogger _logger, HashUtil _hashUtil, TraderHelper _traderHelper, - MailSendService _mailSendService) : ISptCommand + MailSendService _mailSendService +) : ISptCommand { protected Regex _commandRegex = new( @"^spt trader (?[\w]+) (?rep|spend) (?(?!0+)[0-9]+)$" @@ -31,11 +32,14 @@ public class TraderSptCommand( public string GetCommandHelp() { - return - "spt trader \n ======== \n Sets the reputation or money spent to the input quantity through the message system.\n\n\tspt trader [trader] rep [quantity]\n\t\tEx: spt trader prapor rep 2\n\n\tspt trader [trader] spend [quantity]\n\t\tEx: spt trader therapist spend 1000000"; + return "spt trader \n ======== \n Sets the reputation or money spent to the input quantity through the message system.\n\n\tspt trader [trader] rep [quantity]\n\t\tEx: spt trader prapor rep 2\n\n\tspt trader [trader] spend [quantity]\n\t\tEx: spt trader therapist spend 1000000"; } - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) + public string PerformAction( + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ) { if (!_commandRegex.IsMatch(request.Text)) { @@ -49,9 +53,19 @@ public class TraderSptCommand( var result = _commandRegex.Match(request.Text); - var trader = result.Groups["trader"].Captures.Count > 0 ? result.Groups["trader"].Captures[0].Value : null; - var command = result.Groups["command"].Captures.Count > 0 ? result.Groups["command"].Captures[0].Value : null; - var quantity = double.Parse(result.Groups["command"].Captures.Count > 0 ? result.Groups["quantity"].Captures[0].Value : "0"); + var trader = + result.Groups["trader"].Captures.Count > 0 + ? result.Groups["trader"].Captures[0].Value + : null; + var command = + result.Groups["command"].Captures.Count > 0 + ? result.Groups["command"].Captures[0].Value + : null; + var quantity = double.Parse( + result.Groups["command"].Captures.Count > 0 + ? result.Groups["quantity"].Captures[0].Value + : "0" + ); var dbTrader = _traderHelper.GetTraderByNickName(trader); if (dbTrader == null) @@ -76,15 +90,15 @@ public class TraderSptCommand( profileChangeEventType = NotificationEventType.TraderSalesSum; break; default: - { - _mailSendService.SendUserMessageToPlayer( - sessionId, - commandHandler, - "Invalid use of trader command, ProfileChangeEventType was not found. Use 'help' for more information." - ); + { + _mailSendService.SendUserMessageToPlayer( + sessionId, + commandHandler, + "Invalid use of trader command, ProfileChangeEventType was not found. Use 'help' for more information." + ); - return request.DialogId; - } + return request.DialogId; + } } _mailSendService.SendSystemMessageToPlayer( @@ -95,13 +109,10 @@ public class TraderSptCommand( { Id = _hashUtil.Generate(), Template = Money.ROUBLES, - Upd = new Upd - { - StackObjectsCount = 1 - }, + Upd = new Upd { StackObjectsCount = 1 }, ParentId = _hashUtil.Generate(), - SlotId = "main" - } + SlotId = "main", + }, ], 999999, [CreateProfileChangeEvent(profileChangeEventType, quantity, dbTrader.Id)] @@ -110,14 +121,18 @@ public class TraderSptCommand( return request.DialogId; } - protected ProfileChangeEvent CreateProfileChangeEvent(NotificationEventType profileChangeEventType, double quantity, string dbTraderId) + protected ProfileChangeEvent CreateProfileChangeEvent( + NotificationEventType profileChangeEventType, + double quantity, + string dbTraderId + ) { return new ProfileChangeEvent { Id = _hashUtil.Generate(), Type = profileChangeEventType.ToString(), Value = quantity, - Entity = dbTraderId + Entity = dbTraderId, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/CommandoDialogChatBot.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/CommandoDialogChatBot.cs index 8c2f928d..fb8bd028 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/CommandoDialogChatBot.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/CommandoDialogChatBot.cs @@ -32,8 +32,8 @@ public class CommandoDialogChatBot( MemberCategory = MemberCategory.Developer, SelectedMemberCategory = MemberCategory.Developer, Nickname = "Commando", - Side = "Usec" - } + Side = "Usec", + }, }; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/AreYouABotMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/AreYouABotMessageHandler.cs index 0717bae6..85c5a46a 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/AreYouABotMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/AreYouABotMessageHandler.cs @@ -7,9 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class AreYouABotMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil) : IChatMessageHandler +public class AreYouABotMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { public int GetPriority() { @@ -21,12 +20,19 @@ public class AreYouABotMessageHandler( return string.Equals(message, "are you a bot", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue(["beep boop", "**sad boop**", "probably", "sometimes", "yeah lol"]), + _randomUtil.GetArrayValue( + ["beep boop", "**sad boop**", "probably", "sometimes", "yeah lol"] + ), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/FishMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/FishMessageHandler.cs index ff205109..bf370114 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/FishMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/FishMessageHandler.cs @@ -6,8 +6,7 @@ using SPTarkov.Server.Core.Services; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class FishMessageHandler( - MailSendService _mailSendService) : IChatMessageHandler +public class FishMessageHandler(MailSendService _mailSendService) : IChatMessageHandler { public int GetPriority() { @@ -19,14 +18,13 @@ public class FishMessageHandler( return string.Equals(message, "fish", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { - _mailSendService.SendUserMessageToPlayer( - sessionId, - sptFriendUser, - "blub", - [], - null - ); + _mailSendService.SendUserMessageToPlayer(sessionId, sptFriendUser, "blub", [], null); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs index c8a6de87..07077b3e 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs @@ -12,7 +12,8 @@ public class ForceChristmasMessageHandler( LocalisationService _localisationService, MailSendService _mailSendService, RandomUtil _randomUtil, - SeasonalEventService _seasonalEventService) : IChatMessageHandler + SeasonalEventService _seasonalEventService +) : IChatMessageHandler { public int GetPriority() { @@ -24,9 +25,16 @@ public class ForceChristmasMessageHandler( return string.Equals(message, "hohoho", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { - var enableEventResult = _seasonalEventService.ForceSeasonalEvent(SeasonalEventType.Christmas); + var enableEventResult = _seasonalEventService.ForceSeasonalEvent( + SeasonalEventType.Christmas + ); if (enableEventResult) { _mailSendService.SendUserMessageToPlayer( @@ -34,7 +42,10 @@ public class ForceChristmasMessageHandler( sptFriendUser, _randomUtil.GetArrayValue( [ - _localisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Christmas) + _localisationService.GetText( + "chatbot-forced_event_enabled", + SeasonalEventType.Christmas + ), ] ), [], diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs index f1873a62..a93f6f6c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs @@ -12,7 +12,8 @@ public class ForceHalloweenMessageHandler( LocalisationService _localisationService, MailSendService _mailSendService, RandomUtil _randomUtil, - SeasonalEventService _seasonalEventService) : IChatMessageHandler + SeasonalEventService _seasonalEventService +) : IChatMessageHandler { public int GetPriority() { @@ -24,9 +25,16 @@ public class ForceHalloweenMessageHandler( return string.Equals(message, "veryspooky", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { - var enableEventResult = _seasonalEventService.ForceSeasonalEvent(SeasonalEventType.Halloween); + var enableEventResult = _seasonalEventService.ForceSeasonalEvent( + SeasonalEventType.Halloween + ); if (enableEventResult) { _mailSendService.SendUserMessageToPlayer( @@ -34,7 +42,10 @@ public class ForceHalloweenMessageHandler( sptFriendUser, _randomUtil.GetArrayValue( [ - _localisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Halloween) + _localisationService.GetText( + "chatbot-forced_event_enabled", + SeasonalEventType.Halloween + ), ] ), [], diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSnowMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSnowMessageHandler.cs index 1a9bb5f3..423e9669 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSnowMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSnowMessageHandler.cs @@ -14,7 +14,8 @@ public class ForceSnowMessageHandler( LocalisationService _localisationService, MailSendService _mailSendService, RandomUtil _randomUtil, - ConfigServer _configServer) : IChatMessageHandler + ConfigServer _configServer +) : IChatMessageHandler { private readonly WeatherConfig _weatherConfig = _configServer.GetConfig(); @@ -28,7 +29,12 @@ public class ForceSnowMessageHandler( return string.Equals(message, "itsonlysnowalan", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _weatherConfig.OverrideSeason = Season.WINTER; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSummerMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSummerMessageHandler.cs index 183fcce6..3b9e3b33 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSummerMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceSummerMessageHandler.cs @@ -14,7 +14,8 @@ public class ForceSummerMessageHandler( LocalisationService _localisationService, MailSendService _mailSendService, RandomUtil _randomUtil, - ConfigServer _configServer) : IChatMessageHandler + ConfigServer _configServer +) : IChatMessageHandler { private readonly WeatherConfig _weatherConfig = _configServer.GetConfig(); @@ -28,7 +29,12 @@ public class ForceSummerMessageHandler( return string.Equals(message, "givemesunshine", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _weatherConfig.OverrideSeason = Season.SUMMER; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GarbageMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GarbageMessageHandler.cs index 57387463..6d571a5d 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GarbageMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GarbageMessageHandler.cs @@ -7,9 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class GarbageMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil) : IChatMessageHandler +public class GarbageMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { public int GetPriority() { @@ -21,7 +20,12 @@ public class GarbageMessageHandler( return string.Equals(message, "garbage", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { var beforeCollect = GC.GetTotalMemory(false) / 1024 / 1024; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GiveMeSpaceMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GiveMeSpaceMessageHandler.cs index 52c68e93..799c7bbb 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GiveMeSpaceMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/GiveMeSpaceMessageHandler.cs @@ -14,7 +14,8 @@ public class GiveMeSpaceMessageHandler( LocalisationService _localisationService, MailSendService _mailSendService, RandomUtil _randomUtil, - ConfigServer _configServer) : IChatMessageHandler + ConfigServer _configServer +) : IChatMessageHandler { private readonly CoreConfig _coreConfig = _configServer.GetConfig(); @@ -28,11 +29,23 @@ public class GiveMeSpaceMessageHandler( return string.Equals(message, "givemespace", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { const string stashRowGiftId = "StashRows"; - var maxGiftsToSendCount = _coreConfig.Features.ChatbotFeatures.CommandUseLimits[stashRowGiftId] ?? 5; - if (_profileHelper.PlayerHasRecievedMaxNumberOfGift(sessionId, stashRowGiftId, maxGiftsToSendCount)) + var maxGiftsToSendCount = + _coreConfig.Features.ChatbotFeatures.CommandUseLimits[stashRowGiftId] ?? 5; + if ( + _profileHelper.PlayerHasRecievedMaxNumberOfGift( + sessionId, + stashRowGiftId, + maxGiftsToSendCount + ) + ) { _mailSendService.SendUserMessageToPlayer( sessionId, @@ -50,15 +63,17 @@ public class GiveMeSpaceMessageHandler( sessionId, sptFriendUser, _randomUtil.GetArrayValue( - [ - _localisationService.GetText("chatbot-added_stash_rows_please_restart") - ] + [_localisationService.GetText("chatbot-added_stash_rows_please_restart")] ), [], null ); - _profileHelper.FlagGiftReceivedInProfile(sessionId, stashRowGiftId, maxGiftsToSendCount); + _profileHelper.FlagGiftReceivedInProfile( + sessionId, + stashRowGiftId, + maxGiftsToSendCount + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs index 050c87c2..8355638c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs @@ -9,12 +9,18 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class HelloMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil) : IChatMessageHandler +public class HelloMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { - protected static readonly FrozenSet _listOfGreetings = ["hello", "hi", "sup", "yo", "hey", "bonjour"]; - + protected static readonly FrozenSet _listOfGreetings = + [ + "hello", + "hi", + "sup", + "yo", + "hey", + "bonjour", + ]; public int GetPriority() { @@ -26,7 +32,12 @@ public class HelloMessageHandler( return _listOfGreetings.Contains(message, StringComparer.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _mailSendService.SendUserMessageToPlayer( sessionId, @@ -43,7 +54,7 @@ public class HelloMessageHandler( "Heyyyyy", "Hey there", "OH its you", - $"Hello {sender?.Info?.Nickname}" + $"Hello {sender?.Info?.Nickname}", ] ), [], @@ -51,7 +62,6 @@ public class HelloMessageHandler( ); } - public string GetCommand() { return "hello"; @@ -67,7 +77,11 @@ public class HelloMessageHandler( return "'hello' replies to the player with a random greeting"; } - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) + public string PerformAction( + UserDialogInfo commandHandler, + string sessionId, + SendMessageRequest request + ) { _mailSendService.SendUserMessageToPlayer( sessionId, @@ -83,7 +97,7 @@ public class HelloMessageHandler( "Sup", "Heyyyyy", "Hey there", - "OH its you" + "OH its you", ] ), [], diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/IChatMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/IChatMessageHandler.cs index e46f5c30..3303cb21 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/IChatMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/IChatMessageHandler.cs @@ -9,5 +9,10 @@ public interface IChatMessageHandler int GetPriority(); public bool CanHandle(string? message); - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null); + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs index d8c0a950..790a2fe8 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs @@ -7,10 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class LoveYouChatMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil -) : IChatMessageHandler +public class LoveYouChatMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { public int GetPriority() { @@ -22,7 +20,12 @@ public class LoveYouChatMessageHandler( return string.Equals(message, "love you", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _mailSendService.SendUserMessageToPlayer( sessionId, @@ -32,7 +35,7 @@ public class LoveYouChatMessageHandler( "That's quite forward but i love you too in a purely chatbot-human way", "I love you too buddy :3!", "uwu", - $"love you too {sender?.Info?.Nickname}" + $"love you too {sender?.Info?.Nickname}", ] ), [], diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs index 8b30e567..19c4e648 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs @@ -7,9 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class NikitaMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil) : IChatMessageHandler +public class NikitaMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { public int GetPriority() { @@ -21,7 +20,12 @@ public class NikitaMessageHandler( return string.Equals(message, "nikita", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _mailSendService.SendUserMessageToPlayer( sessionId, @@ -32,7 +36,7 @@ public class NikitaMessageHandler( "Cool guy, he made EFT!", "Legend", "The mastermind of my suffering", - "Remember when he said webel-webel-webel-webel, classic Nikita moment" + "Remember when he said webel-webel-webel-webel, classic Nikita moment", ] ), [], diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs index 08d29888..eefa6281 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs @@ -15,7 +15,8 @@ public class SendGiftMessageHandler( MailSendService _mailSendService, RandomUtil _randomUtil, GiftService _giftService, - ConfigServer _configServer) : IChatMessageHandler + ConfigServer _configServer +) : IChatMessageHandler { private readonly CoreConfig _coreConfig = _configServer.GetConfig(); @@ -29,7 +30,12 @@ public class SendGiftMessageHandler( return _giftService.GiftExists(message); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData sender, + object? extraInfo = null + ) { // Gifts may be disabled via config if (!_coreConfig.Features.ChatbotFeatures.SptFriendGiftsEnabled) @@ -37,7 +43,7 @@ public class SendGiftMessageHandler( return; } - var messageTest = ((SendMessageRequest) extraInfo).Text; + var messageTest = ((SendMessageRequest)extraInfo).Text; var giftSent = _giftService.SendGiftToPlayer(sessionId, messageTest); switch (giftSent) { @@ -51,7 +57,7 @@ public class SendGiftMessageHandler( "A secret code, how exciting!", "You found a gift code!", "A gift code! incredible", - "A gift! what could it be!" + "A gift! what could it be!", ] ), [], @@ -63,7 +69,9 @@ public class SendGiftMessageHandler( _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue(["Looks like you already used that code", "You already have that!!"]), + _randomUtil.GetArrayValue( + ["Looks like you already used that code", "You already have that!!"] + ), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SptMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SptMessageHandler.cs index d0316544..4d6021cb 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SptMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SptMessageHandler.cs @@ -7,9 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands; [Injectable] -public class SptMessageHandler( - MailSendService _mailSendService, - RandomUtil _randomUtil) : IChatMessageHandler +public class SptMessageHandler(MailSendService _mailSendService, RandomUtil _randomUtil) + : IChatMessageHandler { public int GetPriority() { @@ -21,7 +20,12 @@ public class SptMessageHandler( return string.Equals(message, "spt", StringComparison.OrdinalIgnoreCase); } - public void Process(string sessionId, UserDialogInfo sptFriendUser, PmcData? sender, object? extraInfo = null) + public void Process( + string sessionId, + UserDialogInfo sptFriendUser, + PmcData? sender, + object? extraInfo = null + ) { _mailSendService.SendUserMessageToPlayer( sessionId, diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SptDialogueChatBot.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SptDialogueChatBot.cs index 71edeed0..030267db 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SptDialogueChatBot.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SptDialogueChatBot.cs @@ -21,7 +21,9 @@ public class SptDialogueChatBot( IEnumerable chatMessageHandlers ) : IDialogueChatBot { - protected IEnumerable _chatMessageHandlers = ChatMessageHandlerSetup(chatMessageHandlers); + protected IEnumerable _chatMessageHandlers = ChatMessageHandlerSetup( + chatMessageHandlers + ); protected CoreConfig _coreConfig = _configServer.GetConfig(); public UserDialogInfo GetChatBot() @@ -36,8 +38,8 @@ public class SptDialogueChatBot( MemberCategory = MemberCategory.Developer, SelectedMemberCategory = MemberCategory.Developer, Nickname = _coreConfig.SptFriendNickname, - Side = "Usec" - } + Side = "Usec", + }, }; } @@ -70,7 +72,9 @@ public class SptDialogueChatBot( return request.DialogId; } - protected static List ChatMessageHandlerSetup(IEnumerable components) + protected static List ChatMessageHandlerSetup( + IEnumerable components + ) { var chatMessageHandlers = components.ToList(); chatMessageHandlers.Sort((a, b) => a.GetPriority() - b.GetPriority()); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/DialogueHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/DialogueHelper.cs index cc3867f3..cc3a83be 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/DialogueHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/DialogueHelper.cs @@ -35,7 +35,7 @@ public class DialogueHelper( DateTime = message?.DateTime, MessageType = message?.MessageType, TemplateId = message?.TemplateId, - UserId = dialogue?.Id + UserId = dialogue?.Id, }; if (message?.Text is not null) @@ -64,7 +64,8 @@ public class DialogueHelper( var dialogueData = fullProfile.DialogueRecords; foreach (var dialogue in dialogueData) { - var message = dialogueData[dialogue.Key].Messages.FirstOrDefault(x => x.Id == messageID); + var message = dialogueData[dialogue.Key] + .Messages.FirstOrDefault(x => x.Id == messageID); if (message is null) { continue; @@ -107,7 +108,8 @@ public class DialogueHelper( public Dictionary GetDialogsForProfile(string sessionId) { var profile = _profileHelper.GetFullProfile(sessionId); - return profile.DialogueRecords ?? (profile.DialogueRecords = new Dictionary()); + return profile.DialogueRecords + ?? (profile.DialogueRecords = new Dictionary()); } /// diff --git a/Libraries/SPTarkov.Server.Core/Helpers/DurabilityLimitsHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/DurabilityLimitsHelper.cs index 8262a4ae..2e7cf926 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/DurabilityLimitsHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/DurabilityLimitsHelper.cs @@ -12,7 +12,8 @@ public class DurabilityLimitsHelper( ISptLogger _logger, RandomUtil _randomUtil, BotHelper _botHelper, - ConfigServer _configServer) + ConfigServer _configServer +) { private readonly BotConfig _botConfig = _configServer.GetConfig(); @@ -22,7 +23,10 @@ public class DurabilityLimitsHelper( /// UNUSED - Item to get durability for /// Role of bot to get max durability for /// Max durability of weapon - public double GetRandomizedMaxWeaponDurability(TemplateItem itemTemplate, string? botRole = null) + public double GetRandomizedMaxWeaponDurability( + TemplateItem itemTemplate, + string? botRole = null + ) { var durabilityRole = GetDurabilityRole(botRole); @@ -35,7 +39,10 @@ public class DurabilityLimitsHelper( /// Item to get max durability for /// Role of bot to get max durability for /// max durability - public double GetRandomizedMaxArmorDurability(TemplateItem? itemTemplate, string? botRole = null) + public double GetRandomizedMaxArmorDurability( + TemplateItem? itemTemplate, + string? botRole = null + ) { var itemMaxDurability = itemTemplate.Properties.MaxDurability.Value; if (botRole is null) @@ -68,7 +75,11 @@ public class DurabilityLimitsHelper( /// Role of bot to get current durability for /// Max durability of weapon /// Current weapon durability - public double GetRandomizedWeaponDurability(TemplateItem itemTemplate, string? botRole, double maxDurability) + public double GetRandomizedWeaponDurability( + TemplateItem itemTemplate, + string? botRole, + double maxDurability + ) { var durabilityRole = GetDurabilityRole(botRole); @@ -110,7 +121,9 @@ public class DurabilityLimitsHelper( var roleExistsInConfig = _botConfig.Durability.BotDurabilities.ContainsKey(botRole); if (!roleExistsInConfig) { - _logger.Debug($"{botRole} doesn't exist in bot config durability values, using default fallback"); + _logger.Debug( + $"{botRole} doesn't exist in bot config durability values, using default fallback" + ); return "default"; } @@ -125,7 +138,11 @@ public class DurabilityLimitsHelper( /// Role of bot to get current durability for /// Max durability of armor /// Current armor durability - public double GetRandomizedArmorDurability(TemplateItem? itemTemplate, string? botRole, double maxDurability) + public double GetRandomizedArmorDurability( + TemplateItem? itemTemplate, + string? botRole, + double maxDurability + ) { var durabilityRole = GetDurabilityRole(botRole); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/GameEventHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/GameEventHelper.cs index dd8fe9ef..660ecfaa 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/GameEventHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/GameEventHelper.cs @@ -3,6 +3,4 @@ namespace SPTarkov.Server.Core.Helpers; [Injectable] -public class GameEventHelper -{ -} +public class GameEventHelper { } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HandbookHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HandbookHelper.cs index 2139aa56..066ddcc8 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HandbookHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HandbookHelper.cs @@ -41,7 +41,7 @@ public class HandbookHelper( { Id = key, ParentId = priceOverride.ParentId, - Price = priceOverride.Price + Price = priceOverride.Price, } ); itemToUpdate = handbook.Items.FirstOrDefault(item => item.Id == key); @@ -98,7 +98,9 @@ public class HandbookHelper( return itemPrice; } - var handbookItem = _databaseService.GetHandbook().Items?.FirstOrDefault(item => item.Id == tpl); + var handbookItem = _databaseService + .GetHandbook() + .Items?.FirstOrDefault(item => item.Id == tpl); if (handbookItem is null) { const int newValue = 0; @@ -198,14 +200,14 @@ public class HandbookHelper( // Get price of currency from handbook var price = GetTemplatePrice(currencyTypeTo); - return price > 0 - ? Math.Max(1, Math.Round(roubleCurrencyCount / price)) - : 0; + return price > 0 ? Math.Max(1, Math.Round(roubleCurrencyCount / price)) : 0; } public HandbookCategory GetCategoryById(string handbookId) { - return _databaseService.GetHandbook().Categories.FirstOrDefault(category => category.Id == handbookId); + return _databaseService + .GetHandbook() + .Categories.FirstOrDefault(category => category.Id == handbookId); } protected record LookupItem @@ -216,17 +218,9 @@ public class HandbookHelper( ByParent = new Dictionary>(); } - public Dictionary ById - { - get; - set; - } + public Dictionary ById { get; set; } - public Dictionary> ByParent - { - get; - set; - } + public Dictionary> ByParent { get; set; } } protected record LookupCollection @@ -237,16 +231,8 @@ public class HandbookHelper( Categories = new LookupItem(); } - public LookupItem Items - { - get; - set; - } + public LookupItem Items { get; set; } - public LookupItem Categories - { - get; - set; - } + public LookupItem Categories { get; set; } } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs index fdb4e045..7433363e 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs @@ -41,81 +41,67 @@ public class HealthHelper( Health = null, Energy = 0, Temperature = 0, - Hydration = 0 + Hydration = 0, }; vitality.Health = new Dictionary { { - "Head", new BodyPartHealth + "Head", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "Chest", new BodyPartHealth + "Chest", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "Stomach", new BodyPartHealth + "Stomach", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "LeftArm", new BodyPartHealth + "LeftArm", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "RightArm", new BodyPartHealth + "RightArm", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "LeftLeg", new BodyPartHealth + "LeftLeg", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "RightLeg", new BodyPartHealth + "RightLeg", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } - } + }, }; } @@ -130,19 +116,18 @@ public class HealthHelper( PmcData pmcData, BotBaseHealth postRaidHealth, string sessionID, - bool isDead) + bool isDead + ) { var fullProfile = _saveServer.GetProfile(sessionID); var profileEdition = fullProfile.ProfileInfo.Edition; var profileSide = fullProfile.CharacterData.PmcData.Info.Side; - + // Get matching 'side e.g. USEC var matchingSide = _profileHelper.GetProfileTemplateForSide(profileEdition, profileSide); - var defaultTemperature = matchingSide?.Character?.Health?.Temperature ?? new CurrentMinMax - { - Current = 36.6 - }; + var defaultTemperature = + matchingSide?.Character?.Health?.Temperature ?? new CurrentMinMax { Current = 36.6 }; StoreHydrationEnergyTempInProfile( fullProfile, @@ -157,19 +142,24 @@ public class HealthHelper( // Effects if (postRaidHealth.BodyParts[bodyPart.Key].Effects is not null) { - fullProfile.VitalityData.Health[bodyPart.Key].Effects = postRaidHealth.BodyParts[bodyPart.Key].Effects; + fullProfile.VitalityData.Health[bodyPart.Key].Effects = postRaidHealth + .BodyParts[bodyPart.Key] + .Effects; } // Limb hp if (!isDead) - // Player alive, not is limb alive + // Player alive, not is limb alive { - fullProfile.VitalityData.Health[bodyPart.Key].Health.Current = postRaidHealth.BodyParts[bodyPart.Key].Health.Current ?? 0; + fullProfile.VitalityData.Health[bodyPart.Key].Health.Current = + postRaidHealth.BodyParts[bodyPart.Key].Health.Current ?? 0; } else { fullProfile.VitalityData.Health[bodyPart.Key].Health.Current = - pmcData.Health.BodyParts[bodyPart.Key].Health.Maximum * _healthConfig.HealthMultipliers.Death ?? 0; + pmcData.Health.BodyParts[bodyPart.Key].Health.Maximum + * _healthConfig.HealthMultipliers.Death + ?? 0; } } @@ -189,7 +179,8 @@ public class HealthHelper( SptProfile fullProfile, double hydration, double energy, - double temperature) + double temperature + ) { fullProfile.VitalityData.Hydration = hydration; fullProfile.VitalityData.Energy = energy; @@ -201,7 +192,10 @@ public class HealthHelper( /// /// Post-raid body part data /// Player profile on server - protected void TransferPostRaidLimbEffectsToProfile(Dictionary postRaidBodyParts, PmcData profileData) + protected void TransferPostRaidLimbEffectsToProfile( + Dictionary postRaidBodyParts, + PmcData profileData + ) { // Iterate over each body part HashSet effectsToIgnore = ["Dehydration", "Exhaustion"]; @@ -209,17 +203,18 @@ public class HealthHelper( { // Get effects on body part from profile var bodyPartEffects = postRaidBodyParts[bodyPartId.Key].Effects; - foreach (var(key, effectDetails) in bodyPartEffects) + foreach (var (key, effectDetails) in bodyPartEffects) { // Null guard - profileData.Health.BodyParts[bodyPartId.Key].Effects ??= new Dictionary(); + profileData.Health.BodyParts[bodyPartId.Key].Effects ??= + new Dictionary(); // Effect already exists on limb in server profile, skip var profileBodyPartEffects = profileData.Health.BodyParts[bodyPartId.Key].Effects; if (profileBodyPartEffects.ContainsKey(key)) { if (effectsToIgnore.Contains(key)) - // Get rid of certain effects we don't want to persist out of raid + // Get rid of certain effects we don't want to persist out of raid { profileBodyPartEffects[key] = null; } @@ -228,15 +223,12 @@ public class HealthHelper( } if (effectsToIgnore.Contains(key)) - // Do not pass some effects to out of raid profile + // Do not pass some effects to out of raid profile { continue; } - var effectToAdd = new BodyPartEffectProperties - { - Time = effectDetails.Time ?? -1 - }; + var effectToAdd = new BodyPartEffectProperties { Time = effectDetails.Time ?? -1 }; // Add effect to server profile if (profileBodyPartEffects.TryAdd(key, effectToAdd)) { @@ -288,10 +280,13 @@ public class HealthHelper( if (profileHealth.Health[bodyPart.Key].Health.Current == 0) { - profileHealth.Health[bodyPart.Key].Health.Current = bodyPart.Value.Health.Maximum * _healthConfig.HealthMultipliers.Blacked; + profileHealth.Health[bodyPart.Key].Health.Current = + bodyPart.Value.Health.Maximum * _healthConfig.HealthMultipliers.Blacked; } - bodyPart.Value.Health.Current = Math.Round(profileHealth.Health[bodyPart.Key].Health.Current ?? 0); + bodyPart.Value.Health.Current = Math.Round( + profileHealth.Health[bodyPart.Key].Health.Current ?? 0 + ); } } @@ -308,7 +303,8 @@ public class HealthHelper( PmcData pmcData, string sessionID, Dictionary bodyPartsWithEffects, - bool deleteExistingEffects = true) + bool deleteExistingEffects = true + ) { // TODO: this will need to change, typing is all fucked up if (!_healthConfig.Save.Effects) @@ -321,7 +317,8 @@ public class HealthHelper( // clear effects from profile bodyPart if (deleteExistingEffects) { - pmcData.Health.BodyParts[bodyPart.Key].Effects = new Dictionary(); + pmcData.Health.BodyParts[bodyPart.Key].Effects = + new Dictionary(); } foreach (var effectType in bodyPartsWithEffects[bodyPart.Key].Effects) @@ -346,14 +343,15 @@ public class HealthHelper( /// Body part to edit /// Effect to add to body part /// How long the effect has left in seconds (-1 by default, no duration). - protected void AddEffect(PmcData pmcData, KeyValuePair effectType, double? duration = -1) + protected void AddEffect( + PmcData pmcData, + KeyValuePair effectType, + double? duration = -1 + ) { var profileBodyPart = pmcData.Health.BodyParts[effectType.Key]; profileBodyPart.Effects ??= new Dictionary(); - profileBodyPart.Effects[effectType.Key] = new BodyPartEffectProperties - { - Time = duration - }; + profileBodyPart.Effects[effectType.Key] = new BodyPartEffectProperties { Time = duration }; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs index f4b3bde7..3cf982a2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs @@ -46,14 +46,22 @@ public class HideoutHelper( public void RegisterProduction( PmcData pmcData, HideoutSingleProductionStartRequestData productionRequest, - string sessionID) + string sessionID + ) { var recipe = _databaseService .GetHideout() - .Production.Recipes.FirstOrDefault(production => production.Id == productionRequest.RecipeId); + .Production.Recipes.FirstOrDefault(production => + production.Id == productionRequest.RecipeId + ); if (recipe is null) { - _logger.Error(_localisationService.GetText("hideout-missing_recipe_in_db", productionRequest.RecipeId)); + _logger.Error( + _localisationService.GetText( + "hideout-missing_recipe_in_db", + productionRequest.RecipeId + ) + ); _httpResponseUtil.AppendErrorToOutput(_eventOutputHolder.GetOutput(sessionID)); } @@ -66,7 +74,10 @@ public class HideoutHelper( pmcData.Hideout.Production = new Dictionary(); } - var modifiedProductionTime = GetAdjustedCraftTimeWithSkills(pmcData, productionRequest.RecipeId); + var modifiedProductionTime = GetAdjustedCraftTimeWithSkills( + pmcData, + productionRequest.RecipeId + ); var production = InitProduction( productionRequest.RecipeId, @@ -81,7 +92,9 @@ public class HideoutHelper( foreach (var tool in productionRequest.Tools) { - var toolItem = _cloner.Clone(pmcData.Inventory.Items.FirstOrDefault(x => x.Id == tool.Id)); + var toolItem = _cloner.Clone( + pmcData.Inventory.Items.FirstOrDefault(x => x.Id == tool.Id) + ); // Make sure we only return as many as we took _itemHelper.AddUpdObjectToItem(toolItem); @@ -93,7 +106,7 @@ public class HideoutHelper( { Id = _hashUtil.Generate(), Template = toolItem.Template, - Upd = toolItem.Upd + Upd = toolItem.Upd, } ); } @@ -112,14 +125,22 @@ public class HideoutHelper( public void RegisterProduction( PmcData pmcData, HideoutContinuousProductionStartRequestData productionRequest, - string sessionID) + string sessionID + ) { var recipe = _databaseService .GetHideout() - .Production.Recipes.FirstOrDefault(production => production.Id == productionRequest.RecipeId); + .Production.Recipes.FirstOrDefault(production => + production.Id == productionRequest.RecipeId + ); if (recipe is null) { - _logger.Error(_localisationService.GetText("hideout-missing_recipe_in_db", productionRequest.RecipeId)); + _logger.Error( + _localisationService.GetText( + "hideout-missing_recipe_in_db", + productionRequest.RecipeId + ) + ); _httpResponseUtil.AppendErrorToOutput(_eventOutputHolder.GetOutput(sessionID)); } @@ -132,7 +153,10 @@ public class HideoutHelper( pmcData.Hideout.Production = new Dictionary(); } - var modifiedProductionTime = GetAdjustedCraftTimeWithSkills(pmcData, productionRequest.RecipeId); + var modifiedProductionTime = GetAdjustedCraftTimeWithSkills( + pmcData, + productionRequest.RecipeId + ); var production = InitProduction( productionRequest.RecipeId, @@ -150,7 +174,8 @@ public class HideoutHelper( public Production InitProduction( string recipeId, double productionTime, - bool? needFuelForAllProductionTime) + bool? needFuelForAllProductionTime + ) { return new Production { @@ -164,7 +189,7 @@ public class HideoutHelper( Interrupted = false, NeedFuelForAllProductionTime = needFuelForAllProductionTime, // Used when sending to client needFuelForAllProductionTime = needFuelForAllProductionTime, // used when stored in production.json - SkipTime = 0 + SkipTime = 0, }; } @@ -179,18 +204,25 @@ public class HideoutHelper( switch (bonus.Type) { case BonusType.StashSize: + { + // Find stash item and adjust tpl to new tpl from bonus + var stashItem = profileData.Inventory.Items.FirstOrDefault(x => + x.Id == profileData.Inventory.Stash + ); + if (stashItem is null) { - // Find stash item and adjust tpl to new tpl from bonus - var stashItem = profileData.Inventory.Items.FirstOrDefault(x => x.Id == profileData.Inventory.Stash); - if (stashItem is null) - { - _logger.Warning(_localisationService.GetText("hideout-unable_to_apply_stashsize_bonus_no_stash_found", profileData.Inventory.Stash)); - } - - stashItem.Template = bonus.TemplateId; - - break; + _logger.Warning( + _localisationService.GetText( + "hideout-unable_to_apply_stashsize_bonus_no_stash_found", + profileData.Inventory.Stash + ) + ); } + + stashItem.Template = bonus.TemplateId; + + break; + } case BonusType.MaximumEnergyReserve: // Amend max energy in profile profileData.Health.Energy.Maximum += bonus.Value; @@ -236,16 +268,23 @@ public class HideoutHelper( /// Hideout-related values protected HideoutProperties GetHideoutProperties(PmcData pmcData) { - var bitcoinFarm = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.BitcoinFarm); + var bitcoinFarm = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.BitcoinFarm + ); var bitcoinCount = (bitcoinFarm?.Slots).Count(slot => slot.Items is not null); // Get slots with an item property var hideoutProperties = new HideoutProperties { BtcFarmGcs = bitcoinCount, - IsGeneratorOn = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.Generator)?.Active ?? false, + IsGeneratorOn = + pmcData + .Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.Generator) + ?.Active ?? false, WaterCollectorHasFilter = DoesWaterCollectorHaveFilter( - pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.WaterCollector) - ) + pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.WaterCollector + ) + ), }; return hideoutProperties; @@ -260,7 +299,7 @@ public class HideoutHelper( { // Can put filters in from L3 if (waterCollector.Level == 3) - // Has filter in at least one slot + // Has filter in at least one slot { return waterCollector.Slots.Any(slot => slot.Items is not null); } @@ -274,9 +313,7 @@ public class HideoutHelper( /// /// Profile to check for productions and update /// Hideout properties - protected void UpdateProductionTimers( - PmcData pmcData, - HideoutProperties hideoutProperties) + protected void UpdateProductionTimers(PmcData pmcData, HideoutProperties hideoutProperties) { var recipes = _databaseService.GetHideout().Production; @@ -294,7 +331,10 @@ public class HideoutHelper( if (craft.Progress == null) { _logger.Warning( - _localisationService.GetText("hideout-craft_has_undefined_progress_value_defaulting", prodId) + _localisationService.GetText( + "hideout-craft_has_undefined_progress_value_defaulting", + prodId + ) ); craft.Progress = 0; } @@ -345,7 +385,9 @@ public class HideoutHelper( var recipe = recipes?.Recipes?.FirstOrDefault(r => r.Id == prodId.Key); if (recipe is null) { - _logger.Error(_localisationService.GetText("hideout-missing_recipe_for_area", prodId)); + _logger.Error( + _localisationService.GetText("hideout-missing_recipe_for_area", prodId) + ); continue; } @@ -373,7 +415,9 @@ public class HideoutHelper( case HideoutAreas.CircleOfCultists: return craft.SptIsCultistCircle ?? false; default: - _logger.Error($"Unhandled hideout area: {hideoutType}, assuming craft: {craft.RecipeId} is not of this type"); + _logger.Error( + $"Unhandled hideout area: {hideoutType}, assuming craft: {craft.RecipeId} is not of this type" + ); return false; } } @@ -386,8 +430,7 @@ public class HideoutHelper( /// True when craft is complete protected bool IsCraftComplete(Production craft) { - return craft.Progress >= craft.ProductionTime && - !_idCheck.Contains(craft.RecipeId); + return craft.Progress >= craft.ProductionTime && !_idCheck.Contains(craft.RecipeId); } /// @@ -399,9 +442,13 @@ public class HideoutHelper( protected void UpdateWaterCollectorProductionTimer( PmcData pmcData, string productionId, - HideoutProperties hideoutProperties) + HideoutProperties hideoutProperties + ) { - var timeElapsed = GetTimeElapsedSinceLastServerTick(pmcData, hideoutProperties.IsGeneratorOn); + var timeElapsed = GetTimeElapsedSinceLastServerTick( + pmcData, + hideoutProperties.IsGeneratorOn + ); if (hideoutProperties.WaterCollectorHasFilter) { pmcData.Hideout.Production[productionId].Progress += timeElapsed; @@ -419,7 +466,8 @@ public class HideoutHelper( PmcData pmcData, string prodId, HideoutProduction recipe, - HideoutProperties hideoutProperties) + HideoutProperties hideoutProperties + ) { // Production is complete, no need to do any calculations if (DoesProgressMatchProductionTime(pmcData, prodId)) @@ -428,27 +476,37 @@ public class HideoutHelper( } // Get seconds since last hideout update + now - var timeElapsed = GetTimeElapsedSinceLastServerTick(pmcData, hideoutProperties.IsGeneratorOn, recipe); + var timeElapsed = GetTimeElapsedSinceLastServerTick( + pmcData, + hideoutProperties.IsGeneratorOn, + recipe + ); // Increment progress by time passed pmcData.Hideout.Production.TryGetValue(prodId, out var production); // Some items NEED power to craft (e.g. DSP) - if (production.needFuelForAllProductionTime.GetValueOrDefault() && hideoutProperties.IsGeneratorOn) + if ( + production.needFuelForAllProductionTime.GetValueOrDefault() + && hideoutProperties.IsGeneratorOn + ) { production.Progress += timeElapsed; } else if (!production.needFuelForAllProductionTime.GetValueOrDefault()) - // Increment progress if production does not necessarily need fuel to continue + // Increment progress if production does not necessarily need fuel to continue { production.Progress += timeElapsed; } // Limit progress to total production time if progress is over (don't run for continuous crafts) if (!(recipe.Continuous ?? false)) - // If progress is larger than prod time, return ProductionTime, hard cap the value + // If progress is larger than prod time, return ProductionTime, hard cap the value { - production.Progress = Math.Min(production.Progress ?? 0, production.ProductionTime ?? 0); + production.Progress = Math.Min( + production.Progress ?? 0, + production.ProductionTime ?? 0 + ); } } @@ -457,13 +515,17 @@ public class HideoutHelper( pmcData.Hideout.Production.TryGetValue(prodId, out var production); // Check if we're already complete, skip - if ((production.AvailableForFinish ?? false) && !production.InProgress.GetValueOrDefault(false)) + if ( + (production.AvailableForFinish ?? false) + && !production.InProgress.GetValueOrDefault(false) + ) { return; } // Get seconds since last hideout update - var timeElapsedSeconds = _timeUtil.GetTimeStamp() - pmcData.Hideout.SptUpdateLastRunTimestamp; + var timeElapsedSeconds = + _timeUtil.GetTimeStamp() - pmcData.Hideout.SptUpdateLastRunTimestamp; // Increment progress by time passed if progress is less than time needed if (production.Progress < production.ProductionTime) @@ -501,7 +563,8 @@ public class HideoutHelper( /// progress matches productionTime from recipe protected static bool DoesProgressMatchProductionTime(PmcData pmcData, string prodId) { - return pmcData.Hideout.Production[prodId].Progress == pmcData.Hideout.Production[prodId].ProductionTime; + return pmcData.Hideout.Production[prodId].Progress + == pmcData.Hideout.Production[prodId].ProductionTime; } /// @@ -512,9 +575,9 @@ public class HideoutHelper( protected void UpdateScavCaseProductionTimer(PmcData pmcData, string productionId) { var timeElapsed = - _timeUtil.GetTimeStamp() - - pmcData.Hideout.Production[productionId].StartTimestamp - - pmcData.Hideout.Production[productionId].Progress; + _timeUtil.GetTimeStamp() + - pmcData.Hideout.Production[productionId].StartTimestamp + - pmcData.Hideout.Production[productionId].Progress; pmcData.Hideout.Production[productionId].Progress += timeElapsed; } @@ -528,7 +591,8 @@ public class HideoutHelper( protected void UpdateAreasWithResources( string sessionID, PmcData pmcData, - HideoutProperties hideoutProperties) + HideoutProperties hideoutProperties + ) { foreach (var area in pmcData.Hideout.Areas) { @@ -567,8 +631,8 @@ public class HideoutHelper( // 1 resource last 14 min 27 sec, 1/14.45/60 = 0.00115 // 10-10-2021 From wiki, 1 resource last 12 minutes 38 seconds, 1/12.63333/60 = 0.00131 var fuelUsedSinceLastTick = - _databaseService.GetHideout().Settings.GeneratorFuelFlowRate * - GetTimeElapsedSinceLastServerTick(pmcData, isGeneratorOn); + _databaseService.GetHideout().Settings.GeneratorFuelFlowRate + * GetTimeElapsedSinceLastServerTick(pmcData, isGeneratorOn); // Get all fuel consumption bonuses, returns an empty array if none found var profileFuelConsomptionBonusSum = _profileHelper.GetBonusValueFromProfile( @@ -582,7 +646,8 @@ public class HideoutHelper( // An increase in hideout management bonus is a decrease in consumption var hideoutManagementConsumptionBonusRate = GetHideoutManagementConsumptionBonus(pmcData); - var combinedBonus = 1.0 - (fuelConsumptionBonusRate + hideoutManagementConsumptionBonusRate); + var combinedBonus = + 1.0 - (fuelConsumptionBonusRate + hideoutManagementConsumptionBonusRate); // Sanity check, never let fuel consumption go negative, otherwise it returns fuel to the player if (combinedBonus < 0) @@ -598,21 +663,21 @@ public class HideoutHelper( { var generatorSlot = generatorArea.Slots[i]; if (generatorSlot?.Items is null) - // No item in slot, skip + // No item in slot, skip { continue; } var fuelItemInSlot = generatorSlot?.Items.FirstOrDefault(); if (fuelItemInSlot is null) - // No item in slot, skip + // No item in slot, skip { continue; } var fuelRemaining = fuelItemInSlot.Upd?.Resource?.Value; if (fuelRemaining == 0) - // No fuel left, skip + // No fuel left, skip { continue; } @@ -627,7 +692,9 @@ public class HideoutHelper( else { // Fuel exists already, deduct fuel from item remaining value - pointsConsumed = (double) ((fuelItemInSlot.Upd.Resource.UnitsConsumed ?? 0) + fuelUsedSinceLastTick); + pointsConsumed = (double)( + (fuelItemInSlot.Upd.Resource.UnitsConsumed ?? 0) + fuelUsedSinceLastTick + ); fuelRemaining -= fuelUsedSinceLastTick; } @@ -646,11 +713,18 @@ public class HideoutHelper( if (fuelRemaining > 0) { // Deducted all used fuel from this container, clean up and exit loop - fuelItemInSlot.Upd = GetAreaUpdObject(1, fuelRemaining, pointsConsumed, isFuelItemFoundInRaid); + fuelItemInSlot.Upd = GetAreaUpdObject( + 1, + fuelRemaining, + pointsConsumed, + isFuelItemFoundInRaid + ); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Profile: {pmcData.Id} Generator has: {fuelRemaining} fuel left in slot {i + 1}"); + _logger.Debug( + $"Profile: {pmcData.Id} Generator has: {fuelRemaining} fuel left in slot {i + 1}" + ); } hasFuelRemaining = true; @@ -679,7 +753,8 @@ public class HideoutHelper( string sessionId, PmcData pmcData, BotHideoutArea area, - HideoutProperties hideoutProperties) + HideoutProperties hideoutProperties + ) { // Skip water collector when not level 3 (cant collect until 3) if (area.Level != 3) @@ -691,9 +766,12 @@ public class HideoutHelper( { return; } - + // Canister with purified water craft exists - if (pmcData.Hideout.Production.TryGetValue(WaterCollector, out var purifiedWaterCraft) && purifiedWaterCraft.GetType() == typeof(Production)) + if ( + pmcData.Hideout.Production.TryGetValue(WaterCollector, out var purifiedWaterCraft) + && purifiedWaterCraft.GetType() == typeof(Production) + ) { // Update craft time to account for increases in players craft time skill purifiedWaterCraft.ProductionTime = GetAdjustedCraftTimeWithSkills( @@ -714,7 +792,7 @@ public class HideoutHelper( Action = "HideoutSingleProductionStart", Items = [], Tools = [], - Timestamp = _timeUtil.GetTimeStamp() + Timestamp = _timeUtil.GetTimeStamp(), }; RegisterProduction(pmcData, recipe, sessionId); @@ -731,7 +809,8 @@ public class HideoutHelper( public double? GetAdjustedCraftTimeWithSkills( PmcData pmcData, string recipeId, - bool applyHideoutManagementBonus = false) + bool applyHideoutManagementBonus = false + ) { var globalSkillsDb = _databaseService.GetGlobals().Configuration.SkillsSettings; @@ -749,7 +828,7 @@ public class HideoutHelper( // Bitcoin farm is excluded from crafting skill cooldown reduction if (recipeId != BitcoinFarm) - // Seconds to deduct from crafts total time + // Seconds to deduct from crafts total time { timeReductionSeconds += GetSkillProductionTimeReduction( pmcData, @@ -796,7 +875,8 @@ public class HideoutHelper( BotHideoutArea waterFilterArea, Production production, bool isGeneratorOn, - PmcData pmcData) + PmcData pmcData + ) { var filterDrainRate = GetWaterFilterDrainRate(pmcData); var craftProductionTime = GetTotalProductionTimeSeconds(WaterCollector); @@ -814,7 +894,7 @@ public class HideoutHelper( // Check progress against the productions craft time (don't use base time as it doesn't include any time bonuses profile has) if (production.Progress > production.ProductionTime) - // Craft is complete nothing to do + // Craft is complete nothing to do { return; } @@ -842,7 +922,8 @@ public class HideoutHelper( } else { - pointsConsumed = (waterFilterItemInSlot.Upd.Resource.UnitsConsumed ?? 0) + filterDrainRate; + pointsConsumed = + (waterFilterItemInSlot.Upd.Resource.UnitsConsumed ?? 0) + filterDrainRate; resourceValue -= filterDrainRate; } @@ -897,7 +978,8 @@ public class HideoutHelper( long secondsSinceServerTick, double totalProductionTime, double productionProgress, - double baseFilterDrainRate) + double baseFilterDrainRate + ) { var drainTimeSeconds = secondsSinceServerTick > totalProductionTime @@ -947,12 +1029,10 @@ public class HideoutHelper( /// Seconds to produce item protected double GetTotalProductionTimeSeconds(string prodId) { - return _databaseService.GetHideout() - .Production.Recipes.FirstOrDefault(prod => - prod.Id == prodId - ) - ?.ProductionTime ?? - 0; + return _databaseService + .GetHideout() + .Production.Recipes.FirstOrDefault(prod => prod.Id == prodId) + ?.ProductionTime ?? 0; } /// @@ -967,7 +1047,8 @@ public class HideoutHelper( double stackCount, double? resourceValue, double resourceUnitsConsumed, - bool isFoundInRaid) + bool isFoundInRaid + ) { return new Upd { @@ -975,13 +1056,17 @@ public class HideoutHelper( Resource = new UpdResource { Value = resourceValue, - UnitsConsumed = resourceUnitsConsumed + UnitsConsumed = resourceUnitsConsumed, }, - SpawnedInSession = isFoundInRaid + SpawnedInSession = isFoundInRaid, }; } - protected void UpdateAirFilters(BotHideoutArea airFilterArea, PmcData pmcData, bool isGeneratorOn) + protected void UpdateAirFilters( + BotHideoutArea airFilterArea, + PmcData pmcData, + bool isGeneratorOn + ) { // 300 resources last 20 hrs, 300/20/60/60 = 0.00416 /* 10-10-2021 from WIKI (https://escapefromtarkov.fandom.com/wiki/FP-100_filter_absorber) @@ -989,8 +1074,8 @@ public class HideoutHelper( 300/17.64694/60/60 = 0.004722 */ var filterDrainRate = - _databaseService.GetHideout().Settings.AirFilterUnitFlowRate * - GetTimeElapsedSinceLastServerTick(pmcData, isGeneratorOn); + _databaseService.GetHideout().Settings.AirFilterUnitFlowRate + * GetTimeElapsedSinceLastServerTick(pmcData, isGeneratorOn); // Hideout management resource consumption bonus: var hideoutManagementConsumptionBonus = 1.0 - GetHideoutManagementConsumptionBonus(pmcData); @@ -1012,7 +1097,10 @@ public class HideoutHelper( } else { - pointsConsumed = (airFilterArea.Slots[i].Items[0].Upd.Resource.UnitsConsumed ?? 0) + filterDrainRate ?? 0; + pointsConsumed = + (airFilterArea.Slots[i].Items[0].Upd.Resource.UnitsConsumed ?? 0) + + filterDrainRate + ?? 0; resourceValue -= filterDrainRate; } @@ -1034,8 +1122,8 @@ public class HideoutHelper( Resource = new UpdResource { Value = resourceValue, - UnitsConsumed = pointsConsumed - } + UnitsConsumed = pointsConsumed, + }, }; if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -1063,7 +1151,8 @@ public class HideoutHelper( PmcData pmcData, Production? btcProduction, int? btcFarmCGs, - bool isGeneratorOn) + bool isGeneratorOn + ) { if (btcProduction is null) { @@ -1114,7 +1203,7 @@ public class HideoutHelper( */ // Needs power to function if (!isGeneratorOn) - // Return with no changes + // Return with no changes { return; } @@ -1136,8 +1225,11 @@ public class HideoutHelper( // BSG finally fixed their settings, they now get loaded from the settings and used in the client var adjustedCraftTime = - (_profileHelper.IsDeveloperAccount(pmcData.SessionId) ? 40 : bitcoinProdData.ProductionTime) / - (1 + (btcFarmCGs - 1) * _databaseService.GetHideout().Settings.GpuBoostRate); + ( + _profileHelper.IsDeveloperAccount(pmcData.SessionId) + ? 40 + : bitcoinProdData.ProductionTime + ) / (1 + (btcFarmCGs - 1) * _databaseService.GetHideout().Settings.GpuBoostRate); // The progress should be adjusted based on the GPU boost rate, but the target is still the base productionTime var timeMultiplier = bitcoinProdData.ProductionTime / adjustedCraftTime; @@ -1147,12 +1239,12 @@ public class HideoutHelper( while (btcProduction.Progress >= bitcoinProdData.ProductionTime) { if (btcProduction.Products.Count < coinSlotCount) - // Has space to add a coin to production rewards + // Has space to add a coin to production rewards { AddBtcToProduction(btcProduction, bitcoinProdData.ProductionTime ?? 0); } else - // Filled up bitcoin storage + // Filled up bitcoin storage { btcProduction.Progress = 0; } @@ -1173,10 +1265,7 @@ public class HideoutHelper( { Id = _hashUtil.Generate(), Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, - Upd = new Upd - { - StackObjectsCount = 1 - } + Upd = new Upd { StackObjectsCount = 1 }, } ); @@ -1194,16 +1283,19 @@ public class HideoutHelper( protected long? GetTimeElapsedSinceLastServerTick( PmcData pmcData, bool isGeneratorOn, - HideoutProduction? recipe = null) + HideoutProduction? recipe = null + ) { // Reduce time elapsed (and progress) when generator is off var timeElapsed = _timeUtil.GetTimeStamp() - pmcData.Hideout.SptUpdateLastRunTimestamp; if (recipe is not null) { - var hideoutArea = _databaseService.GetHideout().Areas.FirstOrDefault(area => area.Type == recipe.AreaType); + var hideoutArea = _databaseService + .GetHideout() + .Areas.FirstOrDefault(area => area.Type == recipe.AreaType); if (!(hideoutArea.NeedsFuel ?? false)) - // e.g. Lavatory works at 100% when power is on / off + // e.g. Lavatory works at 100% when power is on / off { return timeElapsed; } @@ -1211,7 +1303,9 @@ public class HideoutHelper( if (!isGeneratorOn) { - timeElapsed = (long) (timeElapsed * _databaseService.GetHideout().Settings.GeneratorSpeedWithoutFuel); + timeElapsed = (long)( + timeElapsed * _databaseService.GetHideout().Settings.GeneratorSpeedWithoutFuel + ); } return timeElapsed; @@ -1228,7 +1322,10 @@ public class HideoutHelper( .GetHideout() .Production.Recipes.FirstOrDefault(production => production.Id == BitcoinFarm); var productionSlots = bitcoinProductions?.ProductionLimitCount ?? 3; // Default to 3 if none found - var hasManagementSkillSlots = _profileHelper.HasEliteSkillLevel(SkillTypes.HideoutManagement, pmcData); + var hasManagementSkillSlots = _profileHelper.HasEliteSkillLevel( + SkillTypes.HideoutManagement, + pmcData + ); var managementSlotsCount = GetEliteSkillAdditionalBitcoinSlotCount() ?? 2; return productionSlots + (hasManagementSkillSlots ? managementSlotsCount : 0); @@ -1239,9 +1336,9 @@ public class HideoutHelper( /// protected double? GetEliteSkillAdditionalBitcoinSlotCount() { - return _databaseService.GetGlobals() - .Configuration.SkillsSettings.HideoutManagement.EliteSlots.BitcoinFarm - .Container; + return _databaseService + .GetGlobals() + .Configuration.SkillsSettings.HideoutManagement.EliteSlots.BitcoinFarm.Container; } /// @@ -1252,7 +1349,10 @@ public class HideoutHelper( /// Consumption bonus protected double? GetHideoutManagementConsumptionBonus(PmcData pmcData) { - var hideoutManagementSkill = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.HideoutManagement); + var hideoutManagementSkill = _profileHelper.GetSkillFromProfile( + pmcData, + SkillTypes.HideoutManagement + ); if (hideoutManagementSkill is null || hideoutManagementSkill.Progress == 0) { return 0; @@ -1264,11 +1364,11 @@ public class HideoutHelper( var roundedLevel = Math.Floor(hideoutManagementSkill.Progress / 100 ?? 0D); roundedLevel = roundedLevel == 51 ? roundedLevel - 1 : roundedLevel; - return roundedLevel * - _databaseService.GetGlobals() - .Configuration.SkillsSettings.HideoutManagement - .ConsumptionReductionPerLevel / - 100; + return roundedLevel + * _databaseService + .GetGlobals() + .Configuration.SkillsSettings.HideoutManagement.ConsumptionReductionPerLevel + / 100; } /// @@ -1278,7 +1378,11 @@ public class HideoutHelper( /// Player skill from profile /// Value from globals.config.SkillsSettings - `PerLevel` /// Multiplier from 0 to 1 - protected double GetSkillBonusMultipliedBySkillLevel(PmcData pmcData, SkillTypes skill, double valuePerLevel) + protected double GetSkillBonusMultipliedBySkillLevel( + PmcData pmcData, + SkillTypes skill, + double valuePerLevel + ) { var profileSkill = _profileHelper.GetSkillFromProfile(pmcData, skill); if (profileSkill is null || profileSkill.Progress == 0) @@ -1306,9 +1410,14 @@ public class HideoutHelper( PmcData pmcData, double productionTime, SkillTypes skill, - double amountPerLevel) + double amountPerLevel + ) { - var skillTimeReductionMultiplier = GetSkillBonusMultipliedBySkillLevel(pmcData, skill, amountPerLevel); + var skillTimeReductionMultiplier = GetSkillBonusMultipliedBySkillLevel( + pmcData, + skill, + amountPerLevel + ); return productionTime * skillTimeReductionMultiplier; } @@ -1325,7 +1434,8 @@ public class HideoutHelper( PmcData pmcData, HideoutTakeProductionRequestData request, string sessionId, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { // Get how many coins were crafted and ready to pick up pmcData.Hideout.Production.TryGetValue(BitcoinFarm, out var bitcoinCraft); @@ -1349,11 +1459,8 @@ public class HideoutHelper( { Id = _hashUtil.Generate(), Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, - Upd = new Upd - { - StackObjectsCount = 1 - } - } + Upd = new Upd { StackObjectsCount = 1 }, + }, ] ); } @@ -1364,7 +1471,7 @@ public class HideoutHelper( ItemsWithModsToAdd = itemsToAdd, FoundInRaid = true, UseSortingTable = false, - Callback = null + Callback = null, }; // Add FiR coins to player inventory @@ -1377,10 +1484,9 @@ public class HideoutHelper( // Is at max capacity + we collected all coins - reset production start time var coinSlotCount = GetBTCSlots(pmcData); if (pmcData.Hideout.Production[BitcoinFarm].Products.Count >= coinSlotCount) - // Set start to now + // Set start to now { - pmcData.Hideout.Production[BitcoinFarm].StartTimestamp = _timeUtil - .GetTimeStamp(); + pmcData.Hideout.Production[BitcoinFarm].StartTimestamp = _timeUtil.GetTimeStamp(); } // Remove crafted coins from production in profile now they've been collected @@ -1395,7 +1501,9 @@ public class HideoutHelper( public void UnlockHideoutWallInProfile(PmcData profileData) { var profileHideoutAreas = profileData.Hideout.Areas; - var waterCollector = profileHideoutAreas.FirstOrDefault(x => x.Type == HideoutAreas.WaterCollector); + var waterCollector = profileHideoutAreas.FirstOrDefault(x => + x.Type == HideoutAreas.WaterCollector + ); var medStation = profileHideoutAreas.FirstOrDefault(x => x.Type == HideoutAreas.MedStation); var wall = profileHideoutAreas.FirstOrDefault(x => x.Type == HideoutAreas.EmergencyWall); @@ -1430,13 +1538,20 @@ public class HideoutHelper( { foreach (var improvementId in profileData.Hideout.Improvements) { - if (!profileData.Hideout.Improvements.TryGetValue(improvementId.Key, out var improvementDetails)) + if ( + !profileData.Hideout.Improvements.TryGetValue( + improvementId.Key, + out var improvementDetails + ) + ) { continue; } - if (improvementDetails.Completed == false && improvementDetails.ImproveCompleteTimestamp < _timeUtil.GetTimeStamp() - ) + if ( + improvementDetails.Completed == false + && improvementDetails.ImproveCompleteTimestamp < _timeUtil.GetTimeStamp() + ) { improvementDetails.Completed = true; } @@ -1449,7 +1564,9 @@ public class HideoutHelper( /// Player profile public void ApplyPlaceOfFameDogtagBonus(PmcData pmcData) { - var fameAreaProfile = pmcData.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.PlaceOfFame); + var fameAreaProfile = pmcData.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.PlaceOfFame + ); // Get hideout area 16 bonus array var fameAreaDb = _databaseService @@ -1457,21 +1574,29 @@ public class HideoutHelper( .Areas.FirstOrDefault(area => area.Type == HideoutAreas.PlaceOfFame); // Get SkillGroupLevelingBoost object - var combatBoostBonusDb = fameAreaDb.Stages[fameAreaProfile.Level.ToString()] - .Bonuses.FirstOrDefault(bonus => bonus.Type.ToString() == "SkillGroupLevelingBoost" - ); + var combatBoostBonusDb = fameAreaDb + .Stages[fameAreaProfile.Level.ToString()] + .Bonuses.FirstOrDefault(bonus => bonus.Type.ToString() == "SkillGroupLevelingBoost"); // Get SkillGroupLevelingBoost object in profile - var combatBonusProfile = pmcData.Bonuses.FirstOrDefault(bonus => bonus.Id == combatBoostBonusDb.Id); + var combatBonusProfile = pmcData.Bonuses.FirstOrDefault(bonus => + bonus.Id == combatBoostBonusDb.Id + ); // Get all slotted dogtag items - var activeDogtags = pmcData.Inventory.Items.Where(item => item?.SlotId?.StartsWith("dogtag") ?? false).ToList(); + var activeDogtags = pmcData + .Inventory.Items.Where(item => item?.SlotId?.StartsWith("dogtag") ?? false) + .ToList(); // Calculate bonus percent (apply hideoutManagement bonus) - var hideoutManagementSkill = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.HideoutManagement); + var hideoutManagementSkill = _profileHelper.GetSkillFromProfile( + pmcData, + SkillTypes.HideoutManagement + ); var hideoutManagementSkillBonusPercent = 1 + hideoutManagementSkill.Progress / 10000; // 5100 becomes 0.51, add 1 to it, 1.51 var bonus = - GetDogtagCombatSkillBonusPercent(pmcData, activeDogtags) * hideoutManagementSkillBonusPercent; + GetDogtagCombatSkillBonusPercent(pmcData, activeDogtags) + * hideoutManagementSkillBonusPercent; // Update bonus value to above calcualted value combatBonusProfile.Value = Math.Round(bonus ?? 0, 2); @@ -1484,7 +1609,10 @@ public class HideoutHelper( /// Player profile /// Active dogtags in place of fame dogtag slots /// Combat bonus - protected static double GetDogtagCombatSkillBonusPercent(PmcData pmcData, List activeDogtags) + protected static double GetDogtagCombatSkillBonusPercent( + PmcData pmcData, + List activeDogtags + ) { // Not own dogtag // Side = opposite of player @@ -1531,6 +1659,8 @@ public class HideoutHelper( } // Remove the wall bonuses from profile by id - pmcData.Bonuses = pmcData.Bonuses.Where(bonus => !bonusIdsToRemove.Contains(bonus.Id)).ToList(); + pmcData.Bonuses = pmcData + .Bonuses.Where(bonus => !bonusIdsToRemove.Contains(bonus.Id)) + .ToList(); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HttpServerHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HttpServerHelper.cs index ceabd17a..bffb11bc 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HttpServerHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HttpServerHelper.cs @@ -21,7 +21,7 @@ public class HttpServerHelper(ConfigServer configServer) { "json", "application/json" }, { "png", "image/png" }, { "svg", "image/svg+xml" }, - { "txt", "text/plain" } + { "txt", "text/plain" }, }; public string? GetMimeText(string key) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/InRaidHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/InRaidHelper.cs index 5e13bec5..d22008c1 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/InRaidHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/InRaidHelper.cs @@ -18,7 +18,13 @@ public class InRaidHelper( DatabaseService _databaseService ) { - protected static readonly List _pocketSlots = ["pocket1", "pocket2", "pocket3", "pocket4"]; + protected static readonly List _pocketSlots = + [ + "pocket1", + "pocket2", + "pocket3", + "pocket4", + ]; protected InRaidConfig _inRaidConfig = _configServer.GetConfig(); protected LostOnDeathConfig _lostOnDeathConfig = _configServer.GetConfig(); @@ -50,7 +56,8 @@ public class InRaidHelper( PmcData serverProfile, PmcData postRaidProfile, bool isSurvived, - bool isTransfer) + bool isTransfer + ) { // Store insurance (as removeItem() removes insured items) var insured = _cloner.Clone(serverProfile.InsuredItems); @@ -59,7 +66,11 @@ public class InRaidHelper( _inventoryHelper.RemoveItem(serverProfile, serverProfile.Inventory.Equipment, sessionID); // Remove quest items stored on player from server profile in preparation for data from client being added - _inventoryHelper.RemoveItem(serverProfile, serverProfile.Inventory.QuestRaidItems, sessionID); + _inventoryHelper.RemoveItem( + serverProfile, + serverProfile.Inventory.QuestRaidItems, + sessionID + ); // Get all items that have a parent of `serverProfile.Inventory.equipment` (All items player had on them at end of raid) var postRaidInventoryItems = _itemHelper.FindAndReturnChildrenAsItems( @@ -99,16 +110,15 @@ public class InRaidHelper( var dbItems = _databaseService.GetItems(); var itemsToRemovePropertyFrom = items.Where(item => - { - // Has upd object + upd.SpawnedInSession property + not a quest item - return (item.Upd?.SpawnedInSession ?? false) && - !(dbItems[item.Template].Properties.QuestItem ?? false) && - !( - _inRaidConfig.KeepFiRSecureContainerOnDeath && - _itemHelper.ItemIsInsideContainer(item, "SecuredContainer", items) - ); - } - ); + { + // Has upd object + upd.SpawnedInSession property + not a quest item + return (item.Upd?.SpawnedInSession ?? false) + && !(dbItems[item.Template].Properties.QuestItem ?? false) + && !( + _inRaidConfig.KeepFiRSecureContainerOnDeath + && _itemHelper.ItemIsInsideContainer(item, "SecuredContainer", items) + ); + }); foreach (var item in itemsToRemovePropertyFrom) { @@ -124,12 +134,17 @@ public class InRaidHelper( /// /// Items we want to add /// Location to add items to - protected void AddItemsToInventory(IEnumerable itemsToAdd, List serverInventoryItems) + protected void AddItemsToInventory( + IEnumerable itemsToAdd, + List serverInventoryItems + ) { foreach (var itemToAdd in itemsToAdd) { // Try to find index of item to determine if we should add or replace - var existingItemIndex = serverInventoryItems.FindIndex(inventoryItem => inventoryItem.Id == itemToAdd.Id); + var existingItemIndex = serverInventoryItems.FindIndex(inventoryItem => + inventoryItem.Id == itemToAdd.Id + ); if (existingItemIndex != -1) { // Replace existing item @@ -150,9 +165,10 @@ public class InRaidHelper( public void DeleteInventory(PmcData pmcData, string sessionId) { // Get inventory item ids to remove from players profile - var itemIdsToDeleteFromProfile = GetInventoryItemsLostOnDeath(pmcData).Select(item => item.Id); + var itemIdsToDeleteFromProfile = GetInventoryItemsLostOnDeath(pmcData) + .Select(item => item.Id); foreach (var itemIdToDelete in itemIdsToDeleteFromProfile) - // Items inside containers are handled as part of function + // Items inside containers are handled as part of function { _inventoryHelper.RemoveItem(pmcData, itemIdToDelete, sessionId); } @@ -170,7 +186,8 @@ public class InRaidHelper( public void RemoveFiRStatusFromItemsInContainer( string sessionId, PmcData pmcData, - string secureContainerSlotId) + string secureContainerSlotId + ) { if (!pmcData.Inventory.Items.Any(item => item.SlotId == secureContainerSlotId)) { @@ -178,15 +195,27 @@ public class InRaidHelper( } List itemsInsideContainer = []; - foreach (var inventoryItem in pmcData.Inventory.Items.Where(item => item.Upd is not null && item.SlotId != "hideout")) + foreach ( + var inventoryItem in pmcData.Inventory.Items.Where(item => + item.Upd is not null && item.SlotId != "hideout" + ) + ) { - if (_itemHelper.ItemIsInsideContainer(inventoryItem, secureContainerSlotId, pmcData.Inventory.Items)) + if ( + _itemHelper.ItemIsInsideContainer( + inventoryItem, + secureContainerSlotId, + pmcData.Inventory.Items + ) + ) { itemsInsideContainer.Add(inventoryItem); } } - foreach (var item in itemsInsideContainer.Where(item => item.Upd?.SpawnedInSession ?? false)) + foreach ( + var item in itemsInsideContainer.Where(item => item.Upd?.SpawnedInSession ?? false) + ) { item.Upd.SpawnedInSession = false; } @@ -203,33 +232,37 @@ public class InRaidHelper( var equipmentRootId = pmcProfile?.Inventory?.Equipment; var questRaidItemContainerId = pmcProfile?.Inventory?.QuestRaidItems; - return inventoryItems.Where(item => + return inventoryItems + .Where(item => + { + // Keep items flagged as kept after death + if (IsItemKeptAfterDeath(pmcProfile, item)) { - // Keep items flagged as kept after death - if (IsItemKeptAfterDeath(pmcProfile, item)) - { - return false; - } - - // Remove normal items or quest raid items - if (item.ParentId == equipmentRootId || item.ParentId == questRaidItemContainerId) - { - return true; - } - - // Pocket items are lost on death - // Ensure we dont pick up pocket items from manniquins - if ( - item.SlotId.StartsWith("pocket") && - _inventoryHelper.DoesItemHaveRootId(pmcProfile, item, pmcProfile.Inventory.Equipment) - ) - { - return true; - } - return false; } - ) + + // Remove normal items or quest raid items + if (item.ParentId == equipmentRootId || item.ParentId == questRaidItemContainerId) + { + return true; + } + + // Pocket items are lost on death + // Ensure we dont pick up pocket items from manniquins + if ( + item.SlotId.StartsWith("pocket") + && _inventoryHelper.DoesItemHaveRootId( + pmcProfile, + item, + pmcProfile.Inventory.Equipment + ) + ) + { + return true; + } + + return false; + }) .ToList(); } @@ -253,7 +286,7 @@ public class InRaidHelper( // Check slot id against config, true = delete, false = keep, undefined = delete var discard = _lostOnDeathConfig.Equipment.GetByJsonProp(itemToCheck.SlotId); if (discard) - // Lost on death + // Lost on death { return false; } @@ -268,13 +301,19 @@ public class InRaidHelper( } // Is quest item + quest item not lost on death - if (itemToCheck.ParentId == pmcData.Inventory.QuestRaidItems && !_lostOnDeathConfig.QuestItems) + if ( + itemToCheck.ParentId == pmcData.Inventory.QuestRaidItems + && !_lostOnDeathConfig.QuestItems + ) { return true; } // special slots are always kept after death - if ((itemToCheck.SlotId?.Contains("SpecialSlot") ?? false) && _lostOnDeathConfig.SpecialSlotItems) + if ( + (itemToCheck.SlotId?.Contains("SpecialSlot") ?? false) + && _lostOnDeathConfig.SpecialSlotItems + ) { return true; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs index 245d5d3a..ba0a00ce 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs @@ -36,7 +36,11 @@ public class InventoryHelper( ICloner _cloner ) { - private static readonly FrozenSet _variableSizeItemTypes = [BaseClasses.WEAPON, BaseClasses.FUNCTIONAL_MOD]; + private static readonly FrozenSet _variableSizeItemTypes = + [ + BaseClasses.WEAPON, + BaseClasses.FUNCTIONAL_MOD, + ]; protected InventoryConfig _inventoryConfig = _configServer.GetConfig(); /// @@ -50,7 +54,8 @@ public class InventoryHelper( string sessionId, AddItemsDirectRequest request, PmcData pmcData, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { // Check all items fit into inventory before adding if (!CanPlaceItemsInInventory(sessionId, request.ItemsWithModsToAdd)) @@ -72,7 +77,7 @@ public class InventoryHelper( ItemWithModsToAdd = itemToAdd, FoundInRaid = request.FoundInRaid, UseSortingTable = request.UseSortingTable, - Callback = request.Callback + Callback = request.Callback, }; // Add to player inventory @@ -95,7 +100,8 @@ public class InventoryHelper( string sessionId, AddItemDirectRequest request, PmcData pmcData, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { var itemWithModsToAddClone = _cloner.Clone(request.ItemWithModsToAdd); @@ -120,13 +126,16 @@ public class InventoryHelper( output ); if (output.Warnings?.Count > 0) - // Failed to place, error out + // Failed to place, error out { return; } // Apply/remove FiR to item + mods - SetFindInRaidStatusForItem(itemWithModsToAddClone, request.FoundInRaid.GetValueOrDefault(false)); + SetFindInRaidStatusForItem( + itemWithModsToAddClone, + request.FoundInRaid.GetValueOrDefault(false) + ); // Remove trader properties from root item RemoveTraderRagfairRelatedUpdProperties(itemWithModsToAddClone[0].Upd); @@ -136,7 +145,7 @@ public class InventoryHelper( { if (request.Callback is not null) { - request.Callback((int) (itemWithModsToAddClone[0].Upd.StackObjectsCount ?? 0)); + request.Callback((int)(itemWithModsToAddClone[0].Upd.StackObjectsCount ?? 0)); } } catch (Exception ex) @@ -151,8 +160,7 @@ public class InventoryHelper( // Add item + mods to output and profile inventory - output.ProfileChanges[sessionId] - .Items.NewItems.AddRange(itemWithModsToAddClone); + output.ProfileChanges[sessionId].Items.NewItems.AddRange(itemWithModsToAddClone); pmcData.Inventory.Items.AddRange(itemWithModsToAddClone); if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -223,7 +231,9 @@ public class InventoryHelper( } // False if ALL items don't fit - return itemsWithChildren.All(itemWithChildren => CanPlaceItemInContainer(stashFS2D, itemWithChildren)); + return itemsWithChildren.All(itemWithChildren => + CanPlaceItemInContainer(stashFS2D, itemWithChildren) + ); } /// @@ -234,7 +244,9 @@ public class InventoryHelper( /// True all fit public bool CanPlaceItemsInContainer(int[][] containerFS2D, List> itemsWithChildren) { - return itemsWithChildren.All(itemWithChildren => CanPlaceItemInContainer(containerFS2D, itemWithChildren)); + return itemsWithChildren.All(itemWithChildren => + CanPlaceItemInContainer(containerFS2D, itemWithChildren) + ); } /// @@ -250,7 +262,11 @@ public class InventoryHelper( var itemSize = GetItemSize(rootItem.Template, rootItem.Id, itemWithChildren); // Look for a place to slot item into - var findSlotResult = _containerHelper.FindSlotForItem(containerFS2D, itemSize[0], itemSize[1]); + var findSlotResult = _containerHelper.FindSlotForItem( + containerFS2D, + itemSize[0], + itemSize[1] + ); if (findSlotResult.Success.GetValueOrDefault(false)) { try @@ -266,7 +282,12 @@ public class InventoryHelper( } catch (Exception ex) { - _logger.Error(_localisationService.GetText("inventory-unable_to_fit_item_into_inventory", ex.Message)); + _logger.Error( + _localisationService.GetText( + "inventory-unable_to_fit_item_into_inventory", + ex.Message + ) + ); return false; } @@ -289,14 +310,19 @@ public class InventoryHelper( int[][] containerFS2D, List itemWithChildren, string containerId, - string desiredSlotId = "hideout") + string desiredSlotId = "hideout" + ) { // Get x/y size of item var rootItemAdded = itemWithChildren[0]; var itemSize = GetItemSize(rootItemAdded.Template, rootItemAdded.Id, itemWithChildren); // Look for a place to slot item into - var findSlotResult = _containerHelper.FindSlotForItem(containerFS2D, itemSize[0], itemSize[1]); + var findSlotResult = _containerHelper.FindSlotForItem( + containerFS2D, + itemSize[0], + itemSize[1] + ); if (findSlotResult.Success.GetValueOrDefault(false)) { try @@ -312,7 +338,9 @@ public class InventoryHelper( } catch (Exception ex) { - _logger.Error(_localisationService.GetText("inventory-fill_container_failed", ex.Message)); + _logger.Error( + _localisationService.GetText("inventory-fill_container_failed", ex.Message) + ); return; } @@ -324,8 +352,10 @@ public class InventoryHelper( { X = findSlotResult.X, Y = findSlotResult.Y, - R = findSlotResult.Rotation.GetValueOrDefault(false) ? ItemRotation.Vertical : ItemRotation.Horizontal, - Rotation = findSlotResult.Rotation + R = findSlotResult.Rotation.GetValueOrDefault(false) + ? ItemRotation.Vertical + : ItemRotation.Horizontal, + Rotation = findSlotResult.Rotation, }; // Success! exit @@ -347,7 +377,8 @@ public class InventoryHelper( List itemWithChildren, BotBaseInventory playerInventory, bool useSortingTable, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { // Get x/y size of item var rootItem = itemWithChildren[0]; @@ -383,7 +414,7 @@ public class InventoryHelper( X = findSlotResult.X, Y = findSlotResult.Y, R = findSlotResult.Rotation.Value ? ItemRotation.Vertical : ItemRotation.Horizontal, - Rotation = findSlotResult.Rotation + Rotation = findSlotResult.Rotation, }; // Success! exit @@ -423,8 +454,10 @@ public class InventoryHelper( { X = findSortingSlotResult.X, Y = findSortingSlotResult.Y, - R = findSortingSlotResult.Rotation.Value ? ItemRotation.Vertical : ItemRotation.Horizontal, - Rotation = findSortingSlotResult.Rotation + R = findSortingSlotResult.Rotation.Value + ? ItemRotation.Vertical + : ItemRotation.Horizontal, + Rotation = findSortingSlotResult.Rotation, }; } else @@ -441,7 +474,10 @@ public class InventoryHelper( { _logger.Error(_localisationService.GetText("inventory-fill_container_failed", errorText)); - _httpResponseUtil.AppendErrorToOutput(output, _localisationService.GetText("inventory-no_stash_space")); + _httpResponseUtil.AppendErrorToOutput( + output, + _localisationService.GetText("inventory-no_stash_space") + ); } /// @@ -453,17 +489,27 @@ public class InventoryHelper( /// Items id to remove /// Session id /// OPTIONAL - ItemEventRouterResponse - public void RemoveItem(PmcData profile, string? itemId, string sessionId, ItemEventRouterResponse? output = null) + public void RemoveItem( + PmcData profile, + string? itemId, + string sessionId, + ItemEventRouterResponse? output = null + ) { if (itemId is null) { - _logger.Warning(_localisationService.GetText("inventory-unable_to_remove_item_no_id_given")); + _logger.Warning( + _localisationService.GetText("inventory-unable_to_remove_item_no_id_given") + ); return; } // Get children of item, they get deleted too - var itemAndChildrenToRemove = _itemHelper.FindAndReturnChildrenAsItems(profile.Inventory.Items, itemId); + var itemAndChildrenToRemove = _itemHelper.FindAndReturnChildrenAsItems( + profile.Inventory.Items, + itemId + ); if (itemAndChildrenToRemove.Count == 0) { if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -471,11 +517,7 @@ public class InventoryHelper( _logger.Debug( _localisationService.GetText( "inventory-unable_to_remove_item_id_not_found", - new - { - ChildId = itemId, - ProfileId = profile.Id - } + new { ChildId = itemId, ProfileId = profile.Id } ) ); } @@ -489,20 +531,16 @@ public class InventoryHelper( // We have output object, inform client of root item deletion, not children if (output is not null) { - output.ProfileChanges[sessionId] - .Items.DeletedItems.Add( - new Item - { - Id = itemId - } - ); + output.ProfileChanges[sessionId].Items.DeletedItems.Add(new Item { Id = itemId }); } foreach (var item in itemAndChildrenToRemove) { // We expect that each inventory item and each insured item has unique "_id", respective "itemId". // Therefore, we want to use a NON-Greedy function and escape the iteration as soon as we find requested item. - var inventoryIndex = inventoryItems.FindIndex(inventoryItem => inventoryItem.Id == item.Id); + var inventoryIndex = inventoryItems.FindIndex(inventoryItem => + inventoryItem.Id == item.Id + ); if (inventoryIndex != -1) { inventoryItems.RemoveAt(inventoryIndex); @@ -512,16 +550,14 @@ public class InventoryHelper( _logger.Warning( _localisationService.GetText( "inventory-unable_to_remove_item_id_not_found", - new - { - childId = item.Id, - ProfileId = profile.Id - } + new { childId = item.Id, ProfileId = profile.Id } ) ); } - var insuredItemIndex = insuredItems.FindIndex(insuredItem => insuredItem.ItemId == item.Id); + var insuredItemIndex = insuredItems.FindIndex(insuredItem => + insuredItem.ItemId == item.Id + ); if (insuredItemIndex != -1) { insuredItems.RemoveAt(insuredItemIndex); @@ -535,8 +571,11 @@ public class InventoryHelper( /// Session id /// Remove request /// OPTIONAL - ItemEventRouterResponse - public void RemoveItemAndChildrenFromMailRewards(string sessionId, InventoryRemoveRequestData removeRequest, - ItemEventRouterResponse? output) + public void RemoveItemAndChildrenFromMailRewards( + string sessionId, + InventoryRemoveRequestData removeRequest, + ItemEventRouterResponse? output + ) { var fullProfile = _profileHelper.GetFullProfile(sessionId); @@ -544,8 +583,9 @@ public class InventoryHelper( var dialogs = fullProfile.DialogueRecords; foreach (var (_, dialog) in dialogs) { - var messageWithReward = - dialog.Messages.FirstOrDefault(message => message.Id == removeRequest.FromOwner.Id); + var messageWithReward = dialog.Messages.FirstOrDefault(message => + message.Id == removeRequest.FromOwner.Id + ); if (messageWithReward is not null) { // Find item + any possible children and remove them from mails items array @@ -565,7 +605,7 @@ public class InventoryHelper( new { item = removeRequest.Item, - mailId = removeRequest.FromOwner.Id + mailId = removeRequest.FromOwner.Id, } ) ); @@ -593,8 +633,13 @@ public class InventoryHelper( /// Session id /// ItemEventRouterResponse /// ItemEventRouterResponse - public ItemEventRouterResponse RemoveItemByCount(PmcData pmcData, string? itemId, int countToRemove, - string sessionId, ItemEventRouterResponse? output) + public ItemEventRouterResponse RemoveItemByCount( + PmcData pmcData, + string? itemId, + int countToRemove, + string sessionId, + ItemEventRouterResponse? output + ) { if (itemId is null) { @@ -602,7 +647,10 @@ public class InventoryHelper( } // Goal is to keep removing items until we can remove part of an items stack - var itemsToReduce = _itemHelper.FindAndReturnChildrenAsItems(pmcData.Inventory.Items, itemId); + var itemsToReduce = _itemHelper.FindAndReturnChildrenAsItems( + pmcData.Inventory.Items, + itemId + ); var remainingCount = countToRemove; foreach (var itemToReduce in itemsToReduce) { @@ -625,7 +673,7 @@ public class InventoryHelper( } if (remainingCount == 0) - // Desired count of item has been removed / we ran out of items to remove + // Desired count of item has been removed / we ran out of items to remove { break; } @@ -655,13 +703,19 @@ public class InventoryHelper( /// Items id /// Hashmap of inventory items /// An array representing the [width, height] of the item - protected List GetSizeByInventoryItemHash(string itemTpl, string itemId, InventoryItemHash inventoryItemHash) + protected List GetSizeByInventoryItemHash( + string itemTpl, + string itemId, + InventoryItemHash inventoryItemHash + ) { // Invalid item var (isValidItem, itemTemplate) = _itemHelper.GetItem(itemTpl); if (!isValidItem) { - _logger.Error(_localisationService.GetText("inventory-invalid_item_missing_from_db", itemTpl)); + _logger.Error( + _localisationService.GetText("inventory-invalid_item_missing_from_db", itemTpl) + ); } // Item found but no _props property @@ -669,11 +723,7 @@ public class InventoryHelper( { _localisationService.GetText( "inventory-item_missing_props_property", - new - { - itemTpl, - itemName = itemTemplate?.Name - } + new { itemTpl, itemName = itemTemplate?.Name } ); } @@ -694,8 +744,14 @@ public class InventoryHelper( // The slot that can be folded on root e.g. "mod_stock" var foldedSlot = itemTemplate.Properties.FoldedSlot; - int sizeUp = 0, sizeDown = 0, sizeLeft = 0, sizeRight = 0; - int forcedUp = 0, forcedDown = 0, forcedLeft = 0, forcedRight = 0; + int sizeUp = 0, + sizeDown = 0, + sizeLeft = 0, + sizeRight = 0; + int forcedUp = 0, + forcedDown = 0, + forcedLeft = 0, + forcedRight = 0; var outX = itemTemplate.Properties.Width; var outY = itemTemplate.Properties.Height; @@ -723,7 +779,9 @@ public class InventoryHelper( foreach (var childItem in children) { // Skip mods that don't increase size. e.g. cartridges - if (!childItem.SlotId.StartsWith("mod_", StringComparison.OrdinalIgnoreCase)) + if ( + !childItem.SlotId.StartsWith("mod_", StringComparison.OrdinalIgnoreCase) + ) { continue; } @@ -744,9 +802,14 @@ public class InventoryHelper( } var childIsFoldable = template.Properties.Foldable.GetValueOrDefault(false); - var childIsFolded = childItem.Upd?.Foldable?.Folded.GetValueOrDefault(false) ?? false; + var childIsFolded = + childItem.Upd?.Foldable?.Folded.GetValueOrDefault(false) ?? false; - if (rootIsFoldable && foldedSlot == childItem.SlotId && (rootIsFolded || childIsFolded)) + if ( + rootIsFoldable + && foldedSlot == childItem.SlotId + && (rootIsFolded || childIsFolded) + ) { continue; } @@ -767,18 +830,22 @@ public class InventoryHelper( } else { - sizeUp = sizeUp < template.Properties.ExtraSizeUp - ? template.Properties.ExtraSizeUp.Value - : sizeUp; - sizeDown = sizeDown < template.Properties.ExtraSizeDown - ? template.Properties.ExtraSizeDown.Value - : sizeDown; - sizeLeft = sizeLeft < template.Properties.ExtraSizeLeft - ? template.Properties.ExtraSizeLeft.Value - : sizeLeft; - sizeRight = sizeRight < template.Properties.ExtraSizeRight - ? template.Properties.ExtraSizeRight.Value - : sizeRight; + sizeUp = + sizeUp < template.Properties.ExtraSizeUp + ? template.Properties.ExtraSizeUp.Value + : sizeUp; + sizeDown = + sizeDown < template.Properties.ExtraSizeDown + ? template.Properties.ExtraSizeDown.Value + : sizeDown; + sizeLeft = + sizeLeft < template.Properties.ExtraSizeLeft + ? template.Properties.ExtraSizeLeft.Value + : sizeLeft; + sizeRight = + sizeRight < template.Properties.ExtraSizeRight + ? template.Properties.ExtraSizeRight.Value + : sizeRight; } } } @@ -791,7 +858,7 @@ public class InventoryHelper( return [ outX.Value + sizeLeft + sizeRight + forcedLeft + forcedRight, - outY.Value + sizeUp + sizeDown + forcedUp + forcedDown + outY.Value + sizeUp + sizeDown + forcedUp + forcedDown, ]; } @@ -813,7 +880,7 @@ public class InventoryHelper( // Get subset of items that belong to the desired container if (!inventoryItemHash.ByParentId.TryGetValue(containerId, out var containerItemHash)) - // No items in container, exit early + // No items in container, exit early { return containerYX; } @@ -829,13 +896,15 @@ public class InventoryHelper( } else { - itemLocation = (ItemLocation?) item.Location; + itemLocation = (ItemLocation?)item.Location; } if (itemLocation is null) { // Item has no location property - _logger.Error($"Unable to find 'location' property on item with id: {item.Id}, skipping"); + _logger.Error( + $"Unable to find 'location' property on item with id: {item.Id}, skipping" + ); continue; } @@ -855,7 +924,9 @@ public class InventoryHelper( var containerX = containerYX.ElementAtOrDefault(rowIndex.Value); if (containerX is null) { - _logger.Error($"Unable to find container: {containerId} row line: {itemLocation.Y + y}"); + _logger.Error( + $"Unable to find container: {containerId} row line: {itemLocation.Y + y}" + ); } // Fill the corresponding cells in the container map to show the slot is taken @@ -866,11 +937,7 @@ public class InventoryHelper( _logger.Error( _localisationService.GetText( "inventory-unable_to_fill_container", - new - { - id = item.Id, - error = $"{ex.Message} {ex.StackTrace}" - } + new { id = item.Id, error = $"{ex.Message} {ex.StackTrace}" } ) ); } @@ -883,8 +950,13 @@ public class InventoryHelper( protected bool IsVertical(ItemLocation itemLocation) { var castValue = itemLocation.R.ToString(); - return castValue == "1" || string.Equals(castValue, "vertical", StringComparison.OrdinalIgnoreCase) || - string.Equals(itemLocation.Rotation?.ToString(), "vertical", StringComparison.OrdinalIgnoreCase); + return castValue == "1" + || string.Equals(castValue, "vertical", StringComparison.OrdinalIgnoreCase) + || string.Equals( + itemLocation.Rotation?.ToString(), + "vertical", + StringComparison.OrdinalIgnoreCase + ); } protected InventoryItemHash GetInventoryItemHash(List inventoryItems) @@ -892,7 +964,7 @@ public class InventoryHelper( var inventoryItemHash = new InventoryItemHash { ByItemId = new Dictionary(), - ByParentId = new Dictionary>() + ByParentId = new Dictionary>(), }; foreach (var item in inventoryItems) { @@ -926,7 +998,8 @@ public class InventoryHelper( public OwnerInventoryItems GetOwnerInventoryItems( InventoryBaseActionRequestData request, string? item, - string sessionId) + string sessionId + ) { var pmcItems = _profileHelper.GetPmcProfile(sessionId).Inventory.Items; var scavProfile = _profileHelper.GetScavProfile(sessionId); @@ -940,10 +1013,16 @@ public class InventoryHelper( fromInventoryItems = scavProfile.Inventory.Items; fromType = "scav"; } - else if (string.Equals(request.FromOwner.Type, "mail", StringComparison.OrdinalIgnoreCase)) + else if ( + string.Equals(request.FromOwner.Type, "mail", StringComparison.OrdinalIgnoreCase) + ) { // Split requests don't use 'use' but 'splitItem' property - fromInventoryItems = _dialogueHelper.GetMessageItemContents(request.FromOwner.Id, sessionId, item); + fromInventoryItems = _dialogueHelper.GetMessageItemContents( + request.FromOwner.Id, + sessionId, + item + ); fromType = "mail"; } } @@ -968,7 +1047,7 @@ public class InventoryHelper( From = fromInventoryItems, To = toInventoryItems, SameInventory = movingToSameInventory, - IsMail = fromType == "mail" + IsMail = fromType == "mail", }; } @@ -1024,7 +1103,9 @@ public class InventoryHelper( protected List GetPlayerStashSize(string sessionId) { var profile = _profileHelper.GetPmcProfile(sessionId); - var stashRowBonus = profile.Bonuses.FirstOrDefault(bonus => bonus.Type == BonusType.StashRows); + var stashRowBonus = profile.Bonuses.FirstOrDefault(bonus => + bonus.Type == BonusType.StashRows + ); // this sets automatically a stash size from items.json (it's not added anywhere yet because we still use base stash) var stashTPL = GetStashType(sessionId); @@ -1050,7 +1131,7 @@ public class InventoryHelper( // Player has a bonus, apply to vertical size if (stashRowBonus is not null) { - stashV += (int) stashRowBonus.Value; + stashV += (int)stashRowBonus.Value; } return [stashH.Value, stashV.Value]; @@ -1064,7 +1145,9 @@ public class InventoryHelper( protected string? GetStashType(string sessionId) { var pmcData = _profileHelper.GetPmcProfile(sessionId); - var stashObj = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == pmcData.Inventory.Stash); + var stashObj = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == pmcData.Inventory.Stash + ); if (stashObj is null) { _logger.Error(_localisationService.GetText("inventory-unable_to_find_stash")); @@ -1079,7 +1162,11 @@ public class InventoryHelper( /// Inventory of the source (can be non-player) /// Inventory of the destination /// Move request - public void MoveItemToProfile(List sourceItems, List toItems, InventoryMoveRequestData request) + public void MoveItemToProfile( + List sourceItems, + List toItems, + InventoryMoveRequestData request + ) { HandleCartridges(sourceItems, request); @@ -1090,7 +1177,9 @@ public class InventoryHelper( var itemToMove = sourceItems.FirstOrDefault(item => item.Id == itemId); if (itemToMove is null) { - _logger.Error(_localisationService.GetText("inventory-unable_to_find_item_to_move", itemId)); + _logger.Error( + _localisationService.GetText("inventory-unable_to_find_item_to_move", itemId) + ); continue; } @@ -1101,12 +1190,12 @@ public class InventoryHelper( itemToMove.SlotId = request.To.Container; if (request.To.Location is not null) - // Update location object + // Update location object { itemToMove.Location = request.To.Location; } else - // No location in request, delete it + // No location in request, delete it { itemToMove.Location = null; } @@ -1129,16 +1218,20 @@ public class InventoryHelper( PmcData pmcData, List inventoryItems, InventoryMoveRequestData moveRequest, - out string errorMessage) + out string errorMessage + ) { errorMessage = string.Empty; HandleCartridges(inventoryItems, moveRequest); // Find item we want to 'move' - var matchingInventoryItem = inventoryItems.FirstOrDefault(item => item.Id == moveRequest.Item); + var matchingInventoryItem = inventoryItems.FirstOrDefault(item => + item.Id == moveRequest.Item + ); if (matchingInventoryItem is null) { - var noMatchingItemMesage = $"Unable to move item: {moveRequest.Item}, cannot find in inventory"; + var noMatchingItemMesage = + $"Unable to move item: {moveRequest.Item}, cannot find in inventory"; _logger.Error(noMatchingItemMesage); errorMessage = noMatchingItemMesage; @@ -1153,7 +1246,10 @@ public class InventoryHelper( } // Don't move shells from camora to cartridges (happens when loading shells into mts-255 revolver shotgun) - if (matchingInventoryItem.SlotId?.Contains("camora_") is null && moveRequest.To.Container == "cartridges") + if ( + matchingInventoryItem.SlotId?.Contains("camora_") is null + && moveRequest.To.Container == "cartridges" + ) { _logger.Warning( _localisationService.GetText( @@ -1161,7 +1257,7 @@ public class InventoryHelper( new { slotId = matchingInventoryItem.SlotId, - container = moveRequest.To.Container + container = moveRequest.To.Container, } ) ); @@ -1208,7 +1304,9 @@ public class InventoryHelper( } // Get moved items parent (should be container item was put into) - var itemParent = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == itemBeingMoved.ParentId); + var itemParent = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == itemBeingMoved.ParentId + ); if (itemParent is null) { return; @@ -1296,7 +1394,8 @@ public class InventoryHelper( public void ValidateInventoryUsesMongoIds(List itemsToValidate) { - var errors = itemsToValidate.Where(item => !_hashUtil.IsValidMongoId(item.Id)) + var errors = itemsToValidate + .Where(item => !_hashUtil.IsValidMongoId(item.Id)) .Select(item => $"Id: {item.Id} - tpl: {item.Template}") .ToList(); foreach (var message in errors) @@ -1328,7 +1427,9 @@ public class InventoryHelper( } // Otherwise get the parent item - currentItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == currentItem.ParentId); + currentItem = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == currentItem.ParentId + ); } return false; @@ -1338,16 +1439,8 @@ public class InventoryHelper( public class InventoryItemHash { [JsonPropertyName("byItemId")] - public Dictionary ByItemId - { - get; - set; - } + public Dictionary ByItemId { get; set; } [JsonPropertyName("byParentId")] - public Dictionary> ByParentId - { - get; - set; - } + public Dictionary> ByParentId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs index 74b74313..cb08b267 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs @@ -36,7 +36,7 @@ public class ItemHelper( BaseClasses.SORTING_TABLE, BaseClasses.INVENTORY, BaseClasses.STATIONARY_CONTAINER, - BaseClasses.POCKETS + BaseClasses.POCKETS, ]; protected static readonly FrozenSet _slotsAsStrings = @@ -54,7 +54,7 @@ public class ItemHelper( nameof(EquipmentSlots.FirstPrimaryWeapon), nameof(EquipmentSlots.SecondPrimaryWeapon), nameof(EquipmentSlots.Holster), - nameof(EquipmentSlots.Scabbard) + nameof(EquipmentSlots.Scabbard), ]; protected static readonly FrozenSet _dogTagTpls = @@ -68,7 +68,7 @@ public class ItemHelper( ItemTpl.BARTER_DOGTAG_BEAR_PRESTIGE_1, ItemTpl.BARTER_DOGTAG_BEAR_PRESTIGE_2, ItemTpl.BARTER_DOGTAG_USEC_PRESTIGE_1, - ItemTpl.BARTER_DOGTAG_USEC_PRESTIGE_2 + ItemTpl.BARTER_DOGTAG_USEC_PRESTIGE_2, ]; protected static readonly FrozenSet _softInsertIds = @@ -86,7 +86,7 @@ public class ItemHelper( "helmet_back", "helmet_eyes", "helmet_jaw", - "helmet_ears" + "helmet_ears", ]; protected static readonly FrozenSet _removablePlateSlotIds = @@ -94,14 +94,14 @@ public class ItemHelper( "front_plate", "back_plate", "left_side_plate", - "right_side_plate" + "right_side_plate", ]; protected static readonly FrozenSet _armorSlotsThatCanHoldMods = [ BaseClasses.HEADWEAR, BaseClasses.VEST, - BaseClasses.ARMOR + BaseClasses.ARMOR, ]; /// @@ -114,12 +114,16 @@ public class ItemHelper( public bool HasItemWithTpl(IEnumerable itemPool, string item, string slotId = "") { // Filter the pool by slotId if provided - var filteredPool = string.IsNullOrEmpty(slotId) + var filteredPool = string.IsNullOrEmpty(slotId) ? itemPool - : itemPool.Where(item => item.SlotId?.StartsWith(slotId, StringComparison.OrdinalIgnoreCase) ?? false); + : itemPool.Where(item => + item.SlotId?.StartsWith(slotId, StringComparison.OrdinalIgnoreCase) ?? false + ); // Check if any item in the filtered pool matches the provided item - return filteredPool.Any(poolItem => string.Equals(poolItem.Template, item, StringComparison.OrdinalIgnoreCase)); + return filteredPool.Any(poolItem => + string.Equals(poolItem.Template, item, StringComparison.OrdinalIgnoreCase) + ); } /// @@ -134,10 +138,14 @@ public class ItemHelper( // Filter the pool by slotId if provided var filteredPool = string.IsNullOrEmpty(slotId) ? itemPool - : itemPool.Where(item => item.SlotId?.StartsWith(slotId, StringComparison.OrdinalIgnoreCase) ?? false); + : itemPool.Where(item => + item.SlotId?.StartsWith(slotId, StringComparison.OrdinalIgnoreCase) ?? false + ); // Check if any item in the filtered pool matches the provided item - return filteredPool.FirstOrDefault(poolItem => poolItem.Template.Equals(tpl, StringComparison.OrdinalIgnoreCase)); + return filteredPool.FirstOrDefault(poolItem => + poolItem.Template.Equals(tpl, StringComparison.OrdinalIgnoreCase) + ); } /// @@ -148,7 +156,11 @@ public class ItemHelper( /// second item with all its children to compare /// Upd properties to compare between the items /// true if they are the same - public bool IsSameItems(ICollection item1, ICollection item2, HashSet? compareUpdProperties = null) + public bool IsSameItems( + ICollection item1, + ICollection item2, + HashSet? compareUpdProperties = null + ) { if (item1.Count != item2.Count) { @@ -158,7 +170,9 @@ public class ItemHelper( foreach (var itemOf1 in item1) { - var itemOf2 = item2.FirstOrDefault(i2 => i2.Template.Equals(itemOf1.Template, StringComparison.OrdinalIgnoreCase)); + var itemOf2 = item2.FirstOrDefault(i2 => + i2.Template.Equals(itemOf1.Template, StringComparison.OrdinalIgnoreCase) + ); if (itemOf2 is null) { return false; @@ -211,24 +225,46 @@ public class ItemHelper( var comparers = new Dictionary> { { "Key", (upd1, upd2) => upd1.Key?.NumberOfUsages == upd2.Key?.NumberOfUsages }, - { "Buff", (upd1, upd2) => upd1.Buff?.Value == upd2.Buff?.Value && upd1.Buff?.BuffType == upd2.Buff?.BuffType }, - { "CultistAmulet", (upd1, upd2) => upd1.CultistAmulet?.NumberOfUsages == upd2.CultistAmulet?.NumberOfUsages }, + { + "Buff", + (upd1, upd2) => + upd1.Buff?.Value == upd2.Buff?.Value + && upd1.Buff?.BuffType == upd2.Buff?.BuffType + }, + { + "CultistAmulet", + (upd1, upd2) => + upd1.CultistAmulet?.NumberOfUsages == upd2.CultistAmulet?.NumberOfUsages + }, { "Dogtag", (upd1, upd2) => upd1.Dogtag?.ProfileId == upd2.Dogtag?.ProfileId }, { "FaceShield", (upd1, upd2) => upd1.FaceShield?.Hits == upd2.FaceShield?.Hits }, - { "Foldable", (upd1, upd2) => upd1.Foldable?.Folded.GetValueOrDefault(false) == upd2.Foldable?.Folded.GetValueOrDefault(false) }, + { + "Foldable", + (upd1, upd2) => + upd1.Foldable?.Folded.GetValueOrDefault(false) + == upd2.Foldable?.Folded.GetValueOrDefault(false) + }, { "FoodDrink", (upd1, upd2) => upd1.FoodDrink?.HpPercent == upd2.FoodDrink?.HpPercent }, { "MedKit", (upd1, upd2) => upd1.MedKit?.HpResource == upd2.MedKit?.HpResource }, - { "RecodableComponent", (upd1, upd2) => upd1.RecodableComponent?.IsEncoded == upd2.RecodableComponent?.IsEncoded }, + { + "RecodableComponent", + (upd1, upd2) => + upd1.RecodableComponent?.IsEncoded == upd2.RecodableComponent?.IsEncoded + }, { "RepairKit", (upd1, upd2) => upd1.RepairKit?.Resource == upd2.RepairKit?.Resource }, - { "Resource", (upd1, upd2) => upd1.Resource?.UnitsConsumed == upd2.Resource?.UnitsConsumed } + { + "Resource", + (upd1, upd2) => upd1.Resource?.UnitsConsumed == upd2.Resource?.UnitsConsumed + }, }; // Choose above keys or passed in keys to compare items with - var valuesToCompare = compareUpdProperties?.Count > 0 ? compareUpdProperties : comparers.Keys.ToHashSet(); + var valuesToCompare = + compareUpdProperties?.Count > 0 ? compareUpdProperties : comparers.Keys.ToHashSet(); foreach (var propertyName in valuesToCompare) { if (!comparers.TryGetValue(propertyName, out var comparer)) - // Key not found, skip + // Key not found, skip { continue; } @@ -257,40 +293,31 @@ public class ItemHelper( itemProperties.Repairable = new UpdRepairable { Durability = itemTemplate.Properties.MaxDurability, - MaxDurability = itemTemplate.Properties.MaxDurability + MaxDurability = itemTemplate.Properties.MaxDurability, }; } if (itemTemplate.Properties.HasHinge ?? false) { - itemProperties.Togglable = new UpdTogglable - { - On = true - }; + itemProperties.Togglable = new UpdTogglable { On = true }; } if (itemTemplate.Properties.Foldable ?? false) { - itemProperties.Foldable = new UpdFoldable - { - Folded = false - }; + itemProperties.Foldable = new UpdFoldable { Folded = false }; } if (itemTemplate.Properties.WeapFireType?.Any() ?? false) { if (itemTemplate.Properties.WeapFireType.Contains("fullauto")) { - itemProperties.FireMode = new UpdFireMode - { - FireMode = "fullauto" - }; + itemProperties.FireMode = new UpdFireMode { FireMode = "fullauto" }; } else { itemProperties.FireMode = new UpdFireMode { - FireMode = _randomUtil.GetArrayValue(itemTemplate.Properties.WeapFireType) + FireMode = _randomUtil.GetArrayValue(itemTemplate.Properties.WeapFireType), }; } } @@ -299,50 +326,42 @@ public class ItemHelper( { itemProperties.MedKit = new UpdMedKit { - HpResource = itemTemplate.Properties.MaxHpResource + HpResource = itemTemplate.Properties.MaxHpResource, }; } - if (itemTemplate.Properties.MaxResource is not null && itemTemplate.Properties.FoodUseTime is not null) + if ( + itemTemplate.Properties.MaxResource is not null + && itemTemplate.Properties.FoodUseTime is not null + ) { itemProperties.FoodDrink = new UpdFoodDrink { - HpPercent = itemTemplate.Properties.MaxResource + HpPercent = itemTemplate.Properties.MaxResource, }; } if (itemTemplate.Parent == BaseClasses.FLASHLIGHT) { - itemProperties.Light = new UpdLight - { - IsActive = false, - SelectedMode = 0 - }; + itemProperties.Light = new UpdLight { IsActive = false, SelectedMode = 0 }; } else if (itemTemplate.Parent == BaseClasses.TACTICAL_COMBO) { - itemProperties.Light = new UpdLight - { - IsActive = false, - SelectedMode = 0 - }; + itemProperties.Light = new UpdLight { IsActive = false, SelectedMode = 0 }; } if (itemTemplate.Parent == BaseClasses.NIGHTVISION) { - itemProperties.Togglable = new UpdTogglable - { - On = false - }; + itemProperties.Togglable = new UpdTogglable { On = false }; } // Toggleable face shield - if ((itemTemplate.Properties.HasHinge ?? false) && (itemTemplate.Properties.FaceShieldComponent ?? false)) + if ( + (itemTemplate.Properties.HasHinge ?? false) + && (itemTemplate.Properties.FaceShieldComponent ?? false) + ) { - itemProperties.Togglable = new UpdTogglable - { - On = false - }; + itemProperties.Togglable = new UpdTogglable { On = false }; } return itemProperties; @@ -369,11 +388,11 @@ public class ItemHelper( return false; } - return !(itemDetails.Value.Properties.QuestItem ?? false) && - string.Equals(itemDetails.Value.Type, "Item", StringComparison.OrdinalIgnoreCase) && - baseTypes.All(x => !IsOfBaseclass(tpl, x)) && - GetItemPrice(tpl) > 0 && - !_itemFilterService.IsItemBlacklisted(tpl); + return !(itemDetails.Value.Properties.QuestItem ?? false) + && string.Equals(itemDetails.Value.Type, "Item", StringComparison.OrdinalIgnoreCase) + && baseTypes.All(x => !IsOfBaseclass(tpl, x)) + && GetItemPrice(tpl) > 0 + && !_itemFilterService.IsItemBlacklisted(tpl); } /// @@ -434,7 +453,9 @@ public class ItemHelper( { var itemTemplate = GetItem(itemTpl); - return itemTemplate.Value.Properties.Slots.Any(slot => _removablePlateSlotIds.Contains(slot.Name.ToLower())); + return itemTemplate.Value.Properties.Slots.Any(slot => + _removablePlateSlotIds.Contains(slot.Name.ToLower()) + ); } /// @@ -500,7 +521,10 @@ public class ItemHelper( public double GetItemAndChildrenPrice(IEnumerable tpls) { // Run getItemPrice for each tpl in tpls array, return sum - return tpls.Aggregate(0, (total, tpl) => total + (int) GetItemPrice(tpl).GetValueOrDefault(0)); + return tpls.Aggregate( + 0, + (total, tpl) => total + (int)GetItemPrice(tpl).GetValueOrDefault(0) + ); } /// @@ -573,10 +597,7 @@ public class ItemHelper( public Item FixItemStackCount(Item item) { // Ensure item has 'Upd' object - item.Upd ??= new Upd - { - StackObjectsCount = 1 - }; + item.Upd ??= new Upd { StackObjectsCount = 1 }; // Ensure item has 'StackObjectsCount' property item.Upd.StackObjectsCount ??= 1; @@ -640,7 +661,10 @@ public class ItemHelper( /// An offers item to process /// Skip over armor items without durability /// % quality modifier between 0 and 1 - public double GetItemQualityModifierForItems(List itemWithChildren, bool skipArmorItemsWithoutDurability = false) + public double GetItemQualityModifierForItems( + List itemWithChildren, + bool skipArmorItemsWithoutDurability = false + ) { if (IsOfBaseclass(itemWithChildren[0].Template, BaseClasses.WEAPON)) { @@ -663,7 +687,7 @@ public class ItemHelper( } if (itemsWithQualityCount == 0) - // Can happen when rigs without soft inserts or plates are listed + // Can happen when rigs without soft inserts or plates are listed { return 1; } @@ -687,13 +711,18 @@ public class ItemHelper( var itemDetails = GetItem(item.Template).Value; if (itemDetails?.Properties is null) { - _logger.Warning($"Item: {item.Template} lacks properties, cannot ascertain quality level, assuming 100%"); + _logger.Warning( + $"Item: {item.Template} lacks properties, cannot ascertain quality level, assuming 100%" + ); return 1; } - if (skipArmorItemsWithoutDurability && IsOfBaseclass(item.Template, BaseClasses.ARMOR) && itemDetails?.Properties?.MaxDurability == 0 - ) + if ( + skipArmorItemsWithoutDurability + && IsOfBaseclass(item.Template, BaseClasses.ARMOR) + && itemDetails?.Properties?.MaxDurability == 0 + ) { return -1; } @@ -703,7 +732,8 @@ public class ItemHelper( if (item.Upd.MedKit is not null) { // Meds - result = (item.Upd.MedKit.HpResource ?? 0) / (itemDetails.Properties.MaxHpResource ?? 0); + result = + (item.Upd.MedKit.HpResource ?? 0) / (itemDetails.Properties.MaxHpResource ?? 0); } else if (item.Upd.Repairable is not null) { @@ -711,13 +741,18 @@ public class ItemHelper( } else if (item.Upd.FoodDrink is not null) { - result = (item.Upd.FoodDrink.HpPercent ?? 0) / (itemDetails.Properties.MaxResource ?? 0); + result = + (item.Upd.FoodDrink.HpPercent ?? 0) / (itemDetails.Properties.MaxResource ?? 0); } - else if (item.Upd.Key?.NumberOfUsages > 0 && itemDetails.Properties.MaximumNumberOfUsage > 0) + else if ( + item.Upd.Key?.NumberOfUsages > 0 + && itemDetails.Properties.MaximumNumberOfUsage > 0 + ) { // keys - keys count upwards, not down like everything else var maxNumOfUsages = itemDetails.Properties.MaximumNumberOfUsage; - result = (maxNumOfUsages ?? 0 - item.Upd.Key.NumberOfUsages ?? 0) / maxNumOfUsages ?? 0; + result = + (maxNumOfUsages ?? 0 - item.Upd.Key.NumberOfUsages ?? 0) / maxNumOfUsages ?? 0; } else if (item.Upd.Resource?.UnitsConsumed > 0) { @@ -726,11 +761,13 @@ public class ItemHelper( } else if (item.Upd.RepairKit is not null) { - result = (item.Upd.RepairKit.Resource ?? 0) / (itemDetails.Properties.MaxRepairResource ?? 0); + result = + (item.Upd.RepairKit.Resource ?? 0) + / (itemDetails.Properties.MaxRepairResource ?? 0); } if (result == 0) - // make item non-zero but still very low + // make item non-zero but still very low { result = 0.01; } @@ -746,7 +783,11 @@ public class ItemHelper( /// Repairable properties /// Item quality value is for /// number between 0 and 1 - protected double GetRepairableItemQualityValue(TemplateItem itemDetails, UpdRepairable repairable, Item item) + protected double GetRepairableItemQualityValue( + TemplateItem itemDetails, + UpdRepairable repairable, + Item item + ) { // Edge case, durability above max if (repairable.Durability > repairable.MaxDurability) @@ -758,12 +799,18 @@ public class ItemHelper( } // Attempt to get the max durability from _props. If not available, use Repairable max durability value instead. - var maxPossibleDurability = itemDetails.Properties?.MaxDurability ?? repairable.MaxDurability; + var maxPossibleDurability = + itemDetails.Properties?.MaxDurability ?? repairable.MaxDurability; var durability = repairable.Durability / maxPossibleDurability; if (durability == 0) { - _logger.Error(_localisationService.GetText("item-durability_value_invalid_use_default", item.Template)); + _logger.Error( + _localisationService.GetText( + "item-durability_value_invalid_use_default", + item.Template + ) + ); return 1; } @@ -801,7 +848,11 @@ public class ItemHelper( /// Parent item's id /// OPTIONAL - Include only mod items, exclude items stored inside root item /// list of Item objects - public List FindAndReturnChildrenAsItems(IEnumerable items, string baseItemId, bool modsOnly = false) + public List FindAndReturnChildrenAsItems( + IEnumerable items, + string baseItemId, + bool modsOnly = false + ) { // Use dictionary to make key lookup faster, convert to list before being returned OrderedDictionary result = []; @@ -822,7 +873,10 @@ public class ItemHelper( } // Items parentId matches root item AND returned items doesn't contain current child - if (!result.ContainsKey(childItem.Id) && string.Equals(childItem.ParentId, baseItemId, StringComparison.Ordinal)) + if ( + !result.ContainsKey(childItem.Id) + && string.Equals(childItem.ParentId, baseItemId, StringComparison.Ordinal) + ) { foreach (var item in FindAndReturnChildrenAsItems(items, childItem.Id)) { @@ -846,11 +900,20 @@ public class ItemHelper( foreach (var itemFromAssort in assort) { // Parent matches desired item + all items in list do not match - if (string.Equals(itemFromAssort.ParentId, itemIdToFind, StringComparison.OrdinalIgnoreCase) - && list.All(item => !string.Equals(itemFromAssort.Id, item.Id, StringComparison.Ordinal))) + if ( + string.Equals( + itemFromAssort.ParentId, + itemIdToFind, + StringComparison.OrdinalIgnoreCase + ) + && list.All(item => + !string.Equals(itemFromAssort.Id, item.Id, StringComparison.Ordinal) + ) + ) { list.Add(itemFromAssort); - list = list.Concat(FindAndReturnChildrenByAssort(itemFromAssort.Id, assort)).ToList(); + list = list.Concat(FindAndReturnChildrenByAssort(itemFromAssort.Id, assort)) + .ToList(); } } @@ -864,7 +927,8 @@ public class ItemHelper( /// true if it has buy restrictions public bool HasBuyRestrictions(Item itemToCheck) { - return itemToCheck.Upd?.BuyRestrictionCurrent is not null && itemToCheck.Upd?.BuyRestrictionMax is not null; + return itemToCheck.Upd?.BuyRestrictionCurrent is not null + && itemToCheck.Upd?.BuyRestrictionMax is not null; } /// @@ -889,7 +953,7 @@ public class ItemHelper( return item.SlotId; } - var LocationTyped = (ItemLocation) item.Location; + var LocationTyped = (ItemLocation)item.Location; return $"{item.SlotId},{LocationTyped.X},{LocationTyped.Y}"; } @@ -948,7 +1012,6 @@ public class ItemHelper( return rootAndChildren; } - /// /// Splits the item stack if it exceeds its items StackMaxSize property into child items of the passed parent. /// TODO: untested @@ -1004,7 +1067,10 @@ public class ItemHelper( // item already within bounds of stack size, return it if (itemToSplit.Upd?.StackObjectsCount <= itemMaxStackSize) { - return [[itemToSplit]]; + return + [ + [itemToSplit], + ]; } // Split items stack into chunks @@ -1031,22 +1097,27 @@ public class ItemHelper( /// Array of items to iterate over. /// Desired barter item ids. /// List of Item objects. - public List FindBarterItems(string by, List itemsToSearch, object desiredBarterItemIds) + public List FindBarterItems( + string by, + List itemsToSearch, + object desiredBarterItemIds + ) { // Find required items to take after buying (handles multiple items) var desiredBarterIds = - desiredBarterItemIds.GetType() == typeof(string) ? [(string) desiredBarterItemIds] : (List) desiredBarterItemIds; + desiredBarterItemIds.GetType() == typeof(string) + ? [(string)desiredBarterItemIds] + : (List)desiredBarterItemIds; List matchingItems = []; foreach (var barterId in desiredBarterIds) { var filterResult = itemsToSearch.Where(item => - { - return by == "tpl" - ? item.Template.Equals(barterId, StringComparison.OrdinalIgnoreCase) - : item.Id.Equals(barterId, StringComparison.OrdinalIgnoreCase); - } - ); + { + return by == "tpl" + ? item.Template.Equals(barterId, StringComparison.OrdinalIgnoreCase) + : item.Id.Equals(barterId, StringComparison.OrdinalIgnoreCase); + }); matchingItems.AddRange(filterResult); } @@ -1088,7 +1159,10 @@ public class ItemHelper( /// /// /// - public void ReplaceProfileInventoryIds(BotBaseInventory inventory, List? insuredItems = null) + public void ReplaceProfileInventoryIds( + BotBaseInventory inventory, + List? insuredItems = null + ) { // Blacklist var itemIdBlacklist = new HashSet(); @@ -1100,7 +1174,7 @@ public class ItemHelper( inventory.QuestStashItems, inventory.SortingTable, inventory.Stash, - inventory.HideoutCustomizationStashId + inventory.HideoutCustomizationStashId, } ); itemIdBlacklist.UnionWith(inventory.HideoutAreaStashes.Values); @@ -1111,7 +1185,6 @@ public class ItemHelper( itemIdBlacklist.UnionWith(insuredItems.Select(x => x.ItemId)); } - foreach (var item in inventory.Items) { if (itemIdBlacklist.Contains(item.Id)) @@ -1129,7 +1202,9 @@ public class ItemHelper( item.Id = newId; // Find all children of item and update their parent ids to match - var childItems = inventory.Items.Where(x => string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase)); + var childItems = inventory.Items.Where(x => + string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase) + ); foreach (var childItem in childItems) { childItem.ParentId = newId; @@ -1168,7 +1243,9 @@ public class ItemHelper( item.Id = newId; // Find all children of item and update their parent ids to match - var childItems = items.Where(x => string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase)); + var childItems = items.Where(x => + string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase) + ); foreach (var childItem in childItems) { childItem.ParentId = newId; @@ -1191,7 +1268,8 @@ public class ItemHelper( List originalItems, PmcData? pmcData, List? insuredItems = null, - Dictionary? fastPanel = null) + Dictionary? fastPanel = null + ) { // Blacklist var itemIdBlacklist = new HashSet(); @@ -1206,20 +1284,18 @@ public class ItemHelper( pmcData.Inventory.QuestStashItems, pmcData.Inventory.SortingTable, pmcData.Inventory.Stash, - pmcData.Inventory.HideoutCustomizationStashId + pmcData.Inventory.HideoutCustomizationStashId, } ); itemIdBlacklist.UnionWith(pmcData.Inventory.HideoutAreaStashes.Keys); } - // Add insured items ids to blacklist if (insuredItems is not null) { itemIdBlacklist.UnionWith(insuredItems.Select(x => x.ItemId)); } - foreach (var item in originalItems) { if (itemIdBlacklist.Contains(item.Id)) @@ -1237,7 +1313,9 @@ public class ItemHelper( item.Id = newId; // Find all children of item and update their parent ids to match - var childItems = originalItems.Where(x => string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase)); + var childItems = originalItems.Where(x => + string.Equals(x.ParentId, originalId, StringComparison.OrdinalIgnoreCase) + ); foreach (var childItem in childItems) { childItem.ParentId = newId; @@ -1386,11 +1464,10 @@ public class ItemHelper( var isRequiredSlot = false; if (parentTemplate.Key && parentTemplate.Value?.Properties?.Slots != null) { - isRequiredSlot = parentTemplate.Value?.Properties?.Slots?.Any(slot => - slot?.Name == item?.SlotId && - (slot?.Required ?? false) - ) ?? - false; + isRequiredSlot = + parentTemplate.Value?.Properties?.Slots?.Any(slot => + slot?.Name == item?.SlotId && (slot?.Required ?? false) + ) ?? false; } return itemTemplate.Key && parentTemplate.Key && !(isNotRaidModdable || isRequiredSlot); @@ -1434,9 +1511,11 @@ public class ItemHelper( { HashSet check = ["hideout", "main"]; - return !(check.Contains(item.SlotId) // Is root item - || _slotsAsStrings.Contains(item.SlotId) // Is root item in equipment slot e.g. `Headwear` - || int.TryParse(item.SlotId, out _)); // Has int as slotId, is inside container. e.g. cartridges + return !( + check.Contains(item.SlotId) // Is root item + || _slotsAsStrings.Contains(item.SlotId) // Is root item in equipment slot e.g. `Headwear` + || int.TryParse(item.SlotId, out _) + ); // Has int as slotId, is inside container. e.g. cartridges } /// @@ -1477,7 +1556,12 @@ public class ItemHelper( /// ItemSize object (width and height) public ItemSize GetItemSize(ICollection items, string rootItemId) { - var rootTemplate = GetItem(items.Where(x => x.Id.Equals(rootItemId, StringComparison.OrdinalIgnoreCase)).ToList()[0].Template).Value; + var rootTemplate = GetItem( + items + .Where(x => x.Id.Equals(rootItemId, StringComparison.OrdinalIgnoreCase)) + .ToList()[0] + .Template + ).Value; var width = rootTemplate.Properties.Width; var height = rootTemplate.Properties.Height; @@ -1506,17 +1590,29 @@ public class ItemHelper( } else { - sizeUp = sizeUp < itemTemplate.Properties.ExtraSizeUp ? itemTemplate.Properties.ExtraSizeUp.Value : sizeUp; - sizeDown = sizeDown < itemTemplate.Properties.ExtraSizeDown ? itemTemplate.Properties.ExtraSizeDown.Value : sizeDown; - sizeLeft = sizeLeft < itemTemplate.Properties.ExtraSizeLeft ? itemTemplate.Properties.ExtraSizeLeft.Value : sizeLeft; - sizeRight = sizeRight < itemTemplate.Properties.ExtraSizeRight ? itemTemplate.Properties.ExtraSizeRight.Value : sizeRight; + sizeUp = + sizeUp < itemTemplate.Properties.ExtraSizeUp + ? itemTemplate.Properties.ExtraSizeUp.Value + : sizeUp; + sizeDown = + sizeDown < itemTemplate.Properties.ExtraSizeDown + ? itemTemplate.Properties.ExtraSizeDown.Value + : sizeDown; + sizeLeft = + sizeLeft < itemTemplate.Properties.ExtraSizeLeft + ? itemTemplate.Properties.ExtraSizeLeft.Value + : sizeLeft; + sizeRight = + sizeRight < itemTemplate.Properties.ExtraSizeRight + ? itemTemplate.Properties.ExtraSizeRight.Value + : sizeRight; } } return new ItemSize { Width = (width ?? 0) + sizeLeft + sizeRight + forcedLeft + forcedRight, - Height = (height ?? 0) + sizeUp + sizeDown + forcedUp + forcedDown + Height = (height ?? 0) + sizeUp + sizeDown + forcedUp + forcedDown, }; } @@ -1527,7 +1623,10 @@ public class ItemHelper( /// Valid caliber for cartridge public string? GetRandomCompatibleCaliberTemplateId(TemplateItem item) { - var cartridges = item?.Properties?.Cartridges?.FirstOrDefault()?.Props?.Filters?.FirstOrDefault()?.Filter; + var cartridges = item + ?.Properties?.Cartridges?.FirstOrDefault() + ?.Props?.Filters?.FirstOrDefault() + ?.Filter; if (cartridges is null) { _logger.Warning($"Failed to find cartridge for item: {item?.Id} {item?.Name}"); @@ -1545,12 +1644,19 @@ public class ItemHelper( public void AddCartridgesToAmmoBox(List ammoBox, TemplateItem ammoBoxDetails) { var ammoBoxMaxCartridgeCount = ammoBoxDetails.Properties.StackSlots[0].MaxCount; - var cartridgeTpl = ammoBoxDetails.Properties.StackSlots[0].Props.Filters[0].Filter.FirstOrDefault(); + var cartridgeTpl = ammoBoxDetails + .Properties.StackSlots[0] + .Props.Filters[0] + .Filter.FirstOrDefault(); var cartridgeDetails = GetItem(cartridgeTpl); var cartridgeMaxStackSize = cartridgeDetails.Value.Properties.StackMaxSize; // Exit early if ammo already exists in box - if (ammoBox.Any(item => item.Template.Equals(cartridgeTpl, StringComparison.OrdinalIgnoreCase))) + if ( + ammoBox.Any(item => + item.Template.Equals(cartridgeTpl, StringComparison.OrdinalIgnoreCase) + ) + ) { return; } @@ -1570,7 +1676,7 @@ public class ItemHelper( var cartridgeItemToAdd = CreateCartridges( ammoBox[0].Id, cartridgeTpl, - (int) cartridgeCountToAdd, + (int)cartridgeCountToAdd, location ); @@ -1595,14 +1701,11 @@ public class ItemHelper( public void AddSingleStackCartridgesToAmmoBox(List ammoBox, TemplateItem ammoBoxDetails) { var ammoBoxMaxCartridgeCount = ammoBoxDetails.Properties?.StackSlots?[0].MaxCount ?? 0; - var cartridgeTpl = ammoBoxDetails.Properties?.StackSlots?[0].Props?.Filters?[0].Filter?.FirstOrDefault(); + var cartridgeTpl = ammoBoxDetails.Properties?.StackSlots?[0].Props?.Filters?[ + 0 + ].Filter?.FirstOrDefault(); ammoBox.Add( - CreateCartridges( - ammoBox[0].Id, - cartridgeTpl, - (int) ammoBoxMaxCartridgeCount, - 0 - ) + CreateCartridges(ammoBox[0].Id, cartridgeTpl, (int)ammoBoxMaxCartridgeCount, 0) ); } @@ -1613,12 +1716,18 @@ public class ItemHelper( /// Name of slot to check item is in e.g. SecuredContainer/Backpack /// Inventory with child parent items to check /// True when item is in container - public bool ItemIsInsideContainer(Item itemToCheck, string desiredContainerSlotId, List items) + public bool ItemIsInsideContainer( + Item itemToCheck, + string desiredContainerSlotId, + List items + ) { // Get items parent - var parent = items.FirstOrDefault(item => item.Id.Equals(itemToCheck.ParentId, StringComparison.OrdinalIgnoreCase)); + var parent = items.FirstOrDefault(item => + item.Id.Equals(itemToCheck.ParentId, StringComparison.OrdinalIgnoreCase) + ); if (parent is null) - // No parent, end of line, not inside container + // No parent, end of line, not inside container { return false; } @@ -1648,7 +1757,8 @@ public class ItemHelper( string? caliber = null, double minSizePercent = 0.25, string? defaultCartridgeTpl = null, - TemplateItem? weapon = null) + TemplateItem? weapon = null + ) { var chosenCaliber = caliber ?? GetRandomValidCaliber(magTemplate); @@ -1663,13 +1773,16 @@ public class ItemHelper( chosenCaliber, staticAmmoDist, defaultCartridgeTpl, - weapon?.Properties?.Chambers?.FirstOrDefault()?.Props?.Filters?.FirstOrDefault()?.Filter ?? null + weapon?.Properties?.Chambers?.FirstOrDefault()?.Props?.Filters?.FirstOrDefault()?.Filter + ?? null ); if (cartridgeTpl is null) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to fill item: {magazine.FirstOrDefault().Id} {magTemplate.Name} with cartridges, none found."); + _logger.Debug( + $"Unable to fill item: {magazine.FirstOrDefault().Id} {magTemplate.Name} with cartridges, none found." + ); } return; @@ -1694,7 +1807,7 @@ public class ItemHelper( { var isUBGL = IsOfBaseclass(magTemplate.Id, BaseClasses.UBGL); if (isUBGL) - // UBGL don't have mags + // UBGL don't have mags { return; } @@ -1714,26 +1827,32 @@ public class ItemHelper( // Get max number of cartridges in magazine, choose random value between min/max var magProps = magTemplate.Properties; - var magazineCartridgeMaxCount = IsOfBaseclass(magTemplate.Id, BaseClasses.SPRING_DRIVEN_CYLINDER) + var magazineCartridgeMaxCount = IsOfBaseclass( + magTemplate.Id, + BaseClasses.SPRING_DRIVEN_CYLINDER + ) ? magProps?.Slots?.Count // Edge case for rotating grenade launcher magazine : magProps?.Cartridges?.FirstOrDefault()?.MaxCount; if (magazineCartridgeMaxCount is null) { - _logger.Warning($"Magazine: {magTemplate.Id} {magTemplate.Name} lacks a Cartridges array, unable to fill magazine with ammo"); + _logger.Warning( + $"Magazine: {magTemplate.Id} {magTemplate.Name} lacks a Cartridges array, unable to fill magazine with ammo" + ); return; } var desiredStackCount = _randomUtil.GetInt( - (int) - Math.Round(minSizeMultiplier * magazineCartridgeMaxCount ?? 0), - (int) magazineCartridgeMaxCount + (int)Math.Round(minSizeMultiplier * magazineCartridgeMaxCount ?? 0), + (int)magazineCartridgeMaxCount ); if (magazineWithChildCartridges.Count > 1) { - _logger.Warning($"Magazine {magTemplate.Name} already has cartridges defined, this may cause issues"); + _logger.Warning( + $"Magazine {magTemplate.Name} already has cartridges defined, this may cause issues" + ); } // Loop over cartridge count and add stacks to magazine @@ -1743,7 +1862,9 @@ public class ItemHelper( { // Get stack size of cartridges var cartridgeCountToAdd = - desiredStackCount <= cartridgeMaxStackSize ? desiredStackCount : cartridgeMaxStackSize; + desiredStackCount <= cartridgeMaxStackSize + ? desiredStackCount + : cartridgeMaxStackSize; // Ensure we don't go over the max stackCount size var remainingSpace = desiredStackCount - currentStoredCartridgeCount; @@ -1807,14 +1928,18 @@ public class ItemHelper( var ammos = staticAmmoDist.GetValueOrDefault(caliber, []); if (ammos.Count == 0 && fallbackCartridgeTpl is not null) { - _logger.Warning($"Unable to pick a cartridge for caliber: {caliber}, staticAmmoDist has no data. using fallback value of {fallbackCartridgeTpl}"); + _logger.Warning( + $"Unable to pick a cartridge for caliber: {caliber}, staticAmmoDist has no data. using fallback value of {fallbackCartridgeTpl}" + ); return fallbackCartridgeTpl; } if (ammos.Count == 0 && fallbackCartridgeTpl is null) { - _logger.Warning($"Unable to pick a cartridge for caliber: {caliber}, staticAmmoDist has no data. No fallback value provided"); + _logger.Warning( + $"Unable to pick a cartridge for caliber: {caliber}, staticAmmoDist has no data. No fallback value provided" + ); return null; } @@ -1829,7 +1954,13 @@ public class ItemHelper( continue; } - ammoArray.Add(new ProbabilityObject(icd.Tpl, (double) icd.RelativeProbability, null)); + ammoArray.Add( + new ProbabilityObject( + icd.Tpl, + (double)icd.RelativeProbability, + null + ) + ); } return ammoArray.Draw().FirstOrDefault(); @@ -1843,12 +1974,7 @@ public class ItemHelper( /// Count of cartridges inside parent /// Location inside parent (e.g. 0, 1) /// Item - public Item CreateCartridges( - string parentId, - string ammoTpl, - int stackCount, - double location - ) + public Item CreateCartridges(string parentId, string ammoTpl, int stackCount, double location) { return new Item { @@ -1857,10 +1983,7 @@ public class ItemHelper( ParentId = parentId, SlotId = "cartridges", Location = location, - Upd = new Upd - { - StackObjectsCount = stackCount - } + Upd = new Upd { StackObjectsCount = stackCount }, }; } @@ -1873,7 +1996,7 @@ public class ItemHelper( { if (item.Upd?.StackObjectsCount is not null) { - return (int) item.Upd.StackObjectsCount; + return (int)item.Upd.StackObjectsCount; } return 1; @@ -1903,9 +2026,9 @@ public class ItemHelper( /// Array of tpls public List GetItemTplsOfBaseType(string desiredBaseType) { - return _databaseService.GetItems() - .Values - .Where(item => item.Parent == desiredBaseType) + return _databaseService + .GetItems() + .Values.Where(item => item.Parent == desiredBaseType) .Select(item => item.Id) .ToList(); } @@ -1939,7 +2062,7 @@ public class ItemHelper( if (modSpawnChanceDict is not null && !(slot.Required ?? false)) { // only roll chance to not include mod if dict exists and has value for this mod type (e.g. front_plate) - if(modSpawnChanceDict.ContainsKey(slot.Name.ToLower())) + if (modSpawnChanceDict.ContainsKey(slot.Name.ToLower())) { if (!_randomUtil.GetChance100(modSpawnChanceDict[slot.Name.ToLower()])) { @@ -1980,7 +2103,7 @@ public class ItemHelper( Id = _hashUtil.Generate(), Template = chosenTpl, ParentId = result[0].Id, - SlotId = slot.Name + SlotId = slot.Name, }; // Add chosen item to weapon array @@ -2001,7 +2124,10 @@ public class ItemHelper( /// Tpls to randomly choose from /// Incompatible tpls to not allow /// Chosen tpl or undefined - public string? GetCompatibleTplFromArray(HashSet possibleTpls, HashSet incompatibleModTpls) + public string? GetCompatibleTplFromArray( + HashSet possibleTpls, + HashSet incompatibleModTpls + ) { if (!possibleTpls.Any()) { @@ -2068,8 +2194,11 @@ public class ItemHelper( } // Has parentId + no remapping exists for its parent - if (mod.ParentId is not null && (!idMappings.ContainsKey(mod.ParentId) || idMappings?[mod.ParentId] is null)) - // Make remapping for items parentId + if ( + mod.ParentId is not null + && (!idMappings.ContainsKey(mod.ParentId) || idMappings?[mod.ParentId] is null) + ) + // Make remapping for items parentId { idMappings[mod.ParentId] = _hashUtil.Generate(); } @@ -2084,7 +2213,9 @@ public class ItemHelper( // Force item's details into first location of presetItems if (itemWithChildren[0].Template != rootItem.Template) { - _logger.Warning($"Reassigning root item from {itemWithChildren[0].Template} to {rootItem.Template}"); + _logger.Warning( + $"Reassigning root item from {itemWithChildren[0].Template} to {rootItem.Template}" + ); } itemWithChildren[0] = rootItem; @@ -2114,7 +2245,9 @@ public class ItemHelper( } // Child with parent of root, update - if (string.Equals(item.ParentId, rootItemExistingId, StringComparison.OrdinalIgnoreCase)) + if ( + string.Equals(item.ParentId, rootItemExistingId, StringComparison.OrdinalIgnoreCase) + ) { item.ParentId = newId; } @@ -2135,7 +2268,9 @@ public class ItemHelper( foreach (var item in items) { // Check if the item's parent exists. - var parentExists = items.Any(parentItem => parentItem.Id.Equals(item.ParentId, StringComparison.OrdinalIgnoreCase)); + var parentExists = items.Any(parentItem => + parentItem.Id.Equals(item.ParentId, StringComparison.OrdinalIgnoreCase) + ); // If the parent does not exist and the item is not already a 'hideout' item, adopt the orphaned item by // setting the parent ID to the PMCs inventory equipment ID, the slot ID to 'hideout', and remove the location. @@ -2210,7 +2345,7 @@ public class ItemHelper( { var result = GetItem(tpl); if (!result.Key) - // Not an item + // Not an item { return null; } @@ -2219,13 +2354,13 @@ public class ItemHelper( while (currentItem is not null) { if (currentItem.Type == "Node" && !rootOnly) - // Hit first base type + // Hit first base type { return currentItem.Id; } if (currentItem.Parent is null) - // No parent, reached root + // No parent, reached root { return currentItem.Id; } @@ -2282,8 +2417,6 @@ public class ItemHelper( //return x; - return Enumerable.Range(0, containerY) - .Select(_ => new int[containerX]) - .ToArray(); + return Enumerable.Range(0, containerY).Select(_ => new int[containerX]).ToArray(); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ModHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ModHelper.cs index 7a2f3ac4..04ef1893 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ModHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ModHelper.cs @@ -10,9 +10,7 @@ public class ModHelper private readonly FileUtil _fileUtil; private readonly JsonUtil _jsonUtil; - public ModHelper( - FileUtil fileUtil, - JsonUtil jsonUtil) + public ModHelper(FileUtil fileUtil, JsonUtil jsonUtil) { _fileUtil = fileUtil; _jsonUtil = jsonUtil; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/NotificationSendHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/NotificationSendHelper.cs index 59e44d51..f2ecf9ca 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/NotificationSendHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/NotificationSendHelper.cs @@ -31,13 +31,17 @@ public class NotificationSendHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Send message for {sessionID} started, message: {_jsonUtil.Serialize(notificationMessage)}"); + _logger.Debug( + $"Send message for {sessionID} started, message: {_jsonUtil.Serialize(notificationMessage)}" + ); } if (_sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID)) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Send message for {sessionID} websocket available, message being sent"); + _logger.Debug( + $"Send message for {sessionID} websocket available, message being sent" + ); } _sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage); } @@ -45,7 +49,9 @@ public class NotificationSendHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Send message for {sessionID} websocket not available, queuing into profile"); + _logger.Debug( + $"Send message for {sessionID} websocket not available, queuing into profile" + ); } _notificationService.Add(sessionID, notificationMessage); } @@ -62,7 +68,8 @@ public class NotificationSendHelper( string sessionId, UserDialogInfo senderDetails, string messageText, - MessageType messageType) + MessageType messageType + ) { var dialog = GetDialog(sessionId, messageType, senderDetails); @@ -76,7 +83,7 @@ public class NotificationSendHelper( Text = messageText, HasRewards = null, RewardCollected = null, - Items = null + Items = null, }; dialog.Messages.Add(message); @@ -85,7 +92,7 @@ public class NotificationSendHelper( EventType = NotificationEventType.new_message, EventIdentifier = message.Id, DialogId = message.UserId, - Message = message + Message = message, }; SendMessage(sessionId, notification); } @@ -97,7 +104,11 @@ public class NotificationSendHelper( /// Type of message to generate /// Who is sending the message /// Dialogue - protected Models.Eft.Profile.Dialogue GetDialog(string sessionId, MessageType messageType, UserDialogInfo senderDetails) + protected Models.Eft.Profile.Dialogue GetDialog( + string sessionId, + MessageType messageType, + UserDialogInfo senderDetails + ) { // Use trader id if sender is trader, otherwise use nickname var dialogKey = senderDetails.Id; @@ -106,12 +117,19 @@ public class NotificationSendHelper( var dialogueData = _saveServer.GetProfile(sessionId).DialogueRecords; // Ensure empty dialog exists based on sender details passed in - dialogueData.TryAdd(dialogKey, GetEmptyDialogTemplate(dialogKey, messageType, senderDetails)); + dialogueData.TryAdd( + dialogKey, + GetEmptyDialogTemplate(dialogKey, messageType, senderDetails) + ); return dialogueData[dialogKey]; } - protected Models.Eft.Profile.Dialogue GetEmptyDialogTemplate(string dialogKey, MessageType messageType, UserDialogInfo senderDetails) + protected Models.Eft.Profile.Dialogue GetEmptyDialogTemplate( + string dialogKey, + MessageType messageType, + UserDialogInfo senderDetails + ) { return new Models.Eft.Profile.Dialogue { @@ -121,7 +139,8 @@ public class NotificationSendHelper( Pinned = false, New = 0, AttachmentsNew = 0, - Users = senderDetails.Info.MemberCategory == MemberCategory.Trader ? null : [senderDetails] + Users = + senderDetails.Info.MemberCategory == MemberCategory.Trader ? null : [senderDetails], }; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs index a7124472..1ba1ebf2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs @@ -6,9 +6,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers; [Injectable(InjectionType.Singleton)] -public class NotifierHelper( - HttpServerHelper httpServerHelper, - HashUtil hashUtil) +public class NotifierHelper(HttpServerHelper httpServerHelper, HashUtil hashUtil) { protected static WsPing ping = new(); @@ -25,7 +23,8 @@ public class NotifierHelper( */ public WsRagfairOfferSold CreateRagfairOfferSoldNotification( Message dialogueMessage, - MessageContentRagfair ragfairData) + MessageContentRagfair ragfairData + ) { return new WsRagfairOfferSold { @@ -33,7 +32,7 @@ public class NotifierHelper( EventIdentifier = dialogueMessage.Id, OfferId = ragfairData.OfferId, HandbookId = ragfairData.HandbookId, - Count = (int) ragfairData.Count + Count = (int)ragfairData.Count, }; } @@ -49,7 +48,7 @@ public class NotifierHelper( EventType = NotificationEventType.new_message, EventIdentifier = dialogueMessage.Id, DialogId = dialogueMessage.UserId, - Message = dialogueMessage + Message = dialogueMessage, }; } @@ -60,7 +59,7 @@ public class NotifierHelper( EventType = NotificationEventType.RagfairNewRating, EventIdentifier = hashUtil.Generate(), Rating = rating, - IsRatingGrowing = isGrowing + IsRatingGrowing = isGrowing, }; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PaymentHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PaymentHelper.cs index 06447f70..b6c8d695 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PaymentHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PaymentHelper.cs @@ -10,7 +10,13 @@ public class PaymentHelper(ConfigServer configServer) { protected bool _addedCustomMoney; protected readonly InventoryConfig _inventoryConfig = configServer.GetConfig(); - protected readonly HashSet _moneyTpls = [Money.DOLLARS, Money.EUROS, Money.ROUBLES, Money.GP]; + protected readonly HashSet _moneyTpls = + [ + Money.DOLLARS, + Money.EUROS, + Money.ROUBLES, + Money.GP, + ]; /// /// Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) @@ -26,7 +32,7 @@ public class PaymentHelper(ConfigServer configServer) { _moneyTpls.Add(customMoney); } - + _addedCustomMoney = true; } @@ -46,7 +52,7 @@ public class PaymentHelper(ConfigServer configServer) CurrencyType.USD => Money.DOLLARS, CurrencyType.RUB => Money.ROUBLES, CurrencyType.GP => Money.GP, - _ => string.Empty + _ => string.Empty, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PresetHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PresetHelper.cs index 21e59621..b3fd6287 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PresetHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PresetHelper.cs @@ -8,11 +8,7 @@ using SPTarkov.Server.Core.Utils.Cloners; namespace SPTarkov.Server.Core.Helpers; [Injectable(InjectionType.Singleton)] -public class PresetHelper( - DatabaseService _databaseService, - ItemHelper _itemHelper, - ICloner _cloner -) +public class PresetHelper(DatabaseService _databaseService, ItemHelper _itemHelper, ICloner _cloner) { protected Dictionary _defaultEquipmentPresets; protected Dictionary _defaultWeaponPresets; @@ -64,9 +60,10 @@ public class PresetHelper( if (_defaultWeaponPresets is null) { var tempPresets = _databaseService.GetGlobals().ItemPresets; - _defaultWeaponPresets = tempPresets.Where(p => - p.Value.Encyclopedia != null && - _itemHelper.IsOfBaseclass(p.Value.Encyclopedia, BaseClasses.WEAPON) + _defaultWeaponPresets = tempPresets + .Where(p => + p.Value.Encyclopedia != null + && _itemHelper.IsOfBaseclass(p.Value.Encyclopedia, BaseClasses.WEAPON) ) .ToDictionary(); } @@ -83,9 +80,10 @@ public class PresetHelper( if (_defaultEquipmentPresets == null) { var tempPresets = _databaseService.GetGlobals().ItemPresets; - _defaultEquipmentPresets = tempPresets.Where(p => - p.Value.Encyclopedia != null && - _itemHelper.ArmorItemCanHoldMods(p.Value.Encyclopedia) + _defaultEquipmentPresets = tempPresets + .Where(p => + p.Value.Encyclopedia != null + && _itemHelper.ArmorItemCanHoldMods(p.Value.Encyclopedia) ) .ToDictionary(); } @@ -158,9 +156,11 @@ public class PresetHelper( } // Use gathered preset ids to get full preset objects, clone and return - return _cloner.Clone(presetDetailsForTpl.PresetIds - .Select(x => _databaseService.GetGlobals().ItemPresets[x]) - .ToList()); + return _cloner.Clone( + presetDetailsForTpl + .PresetIds.Select(x => _databaseService.GetGlobals().ItemPresets[x]) + .ToList() + ); } /// @@ -187,7 +187,9 @@ public class PresetHelper( if (!_defaultEquipmentPresets.TryGetValue(presetDetails.DefaultId, out defaultPreset)) { // Default not found in weapon or equipment, return first preset in list - return _cloner.Clone(_databaseService.GetGlobals().ItemPresets[presetDetails.PresetIds.First()]); + return _cloner.Clone( + _databaseService.GetGlobals().ItemPresets[presetDetails.PresetIds.First()] + ); } } @@ -216,7 +218,7 @@ public class PresetHelper( return rootItem.Template; } - + /// /// Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists /// @@ -228,7 +230,9 @@ public class PresetHelper( var defaultPreset = GetDefaultPreset(tpl); // Bundle up tpls we want price for - var tpls = defaultPreset is not null ? defaultPreset.Items.Select(item => item.Template) : [tpl]; + var tpls = defaultPreset is not null + ? defaultPreset.Items.Select(item => item.Template) + : [tpl]; // Get price of tpls return _itemHelper.GetItemAndChildrenPrice(tpls); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs index 1424a20b..ff5576f5 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs @@ -24,7 +24,8 @@ public class PrestigeHelper DatabaseService databaseService, MailSendService mailSendService, ProfileHelper profileHelper, - RewardHelper rewardHelper) + RewardHelper rewardHelper + ) { _logger = logger; _timeUtil = timeUtil; @@ -34,7 +35,11 @@ public class PrestigeHelper _rewardHelper = rewardHelper; } - public void ProcessPendingPrestige(SptProfile oldProfile, SptProfile newProfile, PendingPrestige prestige) + public void ProcessPendingPrestige( + SptProfile oldProfile, + SptProfile newProfile, + PendingPrestige prestige + ) { var prePrestigePmc = oldProfile.CharacterData.PmcData; var sessionId = newProfile.ProfileInfo.ProfileId; @@ -48,7 +53,9 @@ public class PrestigeHelper { // Set progress 5% of what it was skillToCopy.Progress = skillToCopy.Progress * 0.05; - var existingSkill = newProfile.CharacterData.PmcData.Skills.Common.FirstOrDefault(skill => skill.Id == skillToCopy.Id); + var existingSkill = newProfile.CharacterData.PmcData.Skills.Common.FirstOrDefault( + skill => skill.Id == skillToCopy.Id + ); if (existingSkill is not null) { existingSkill.Progress = skillToCopy.Progress; @@ -64,7 +71,10 @@ public class PrestigeHelper { // Set progress 5% of what it was skillToCopy.Progress = skillToCopy.Progress * 0.05; - var existingSkill = newProfile.CharacterData.PmcData.Skills.Mastering.FirstOrDefault(skill => skill.Id == skillToCopy.Id); + var existingSkill = + newProfile.CharacterData.PmcData.Skills.Mastering.FirstOrDefault(skill => + skill.Id == skillToCopy.Id + ); if (existingSkill is not null) { existingSkill.Progress = skillToCopy.Progress; @@ -85,7 +95,9 @@ public class PrestigeHelper } // Assumes Prestige data is in descending order - var currentPrestigeData = _databaseService.GetTemplates().Prestige.Elements[indexOfPrestigeObtained]; + var currentPrestigeData = _databaseService.GetTemplates().Prestige.Elements[ + indexOfPrestigeObtained + ]; var prestigeRewards = _databaseService .GetTemplates() .Prestige.Elements.Slice(0, indexOfPrestigeObtained + 1) @@ -94,17 +106,22 @@ public class PrestigeHelper AddPrestigeRewardsToProfile(sessionId, newProfile, prestigeRewards); // Flag profile as having achieved this prestige level - newProfile.CharacterData.PmcData.Prestige[currentPrestigeData.Id] = _timeUtil.GetTimeStamp(); + newProfile.CharacterData.PmcData.Prestige[currentPrestigeData.Id] = + _timeUtil.GetTimeStamp(); var itemsToTransfer = new List(); // Copy transferred items foreach (var transferRequest in prestige.Items ?? []) { - var item = prePrestigePmc.Inventory.Items.FirstOrDefault(item => item.Id == transferRequest.Id); + var item = prePrestigePmc.Inventory.Items.FirstOrDefault(item => + item.Id == transferRequest.Id + ); if (item is null) { - _logger.Error($"Unable to find item with id: {transferRequest.Id} in profile: {sessionId}, skipping"); + _logger.Error( + $"Unable to find item with id: {transferRequest.Id} in profile: {sessionId}, skipping" + ); continue; } @@ -116,7 +133,11 @@ public class PrestigeHelper newProfile.CharacterData.PmcData.Info.PrestigeLevel = prestige.PrestigeLevel; } - private void AddPrestigeRewardsToProfile(string sessionId, SptProfile newProfile, IEnumerable rewards) + private void AddPrestigeRewardsToProfile( + string sessionId, + SptProfile newProfile, + IEnumerable rewards + ) { var itemsToSend = new List(); @@ -125,10 +146,14 @@ public class PrestigeHelper switch (reward.Type) { case RewardType.CustomizationDirect: - { - _profileHelper.AddHideoutCustomisationUnlock(newProfile, reward, CustomisationSource.PRESTIGE); - break; - } + { + _profileHelper.AddHideoutCustomisationUnlock( + newProfile, + reward, + CustomisationSource.PRESTIGE + ); + break; + } case RewardType.Skill: if (Enum.TryParse(reward.Target, out SkillTypes result)) { @@ -145,15 +170,19 @@ public class PrestigeHelper break; case RewardType.Item: - { - itemsToSend.AddRange(reward.Items); - break; - } + { + itemsToSend.AddRange(reward.Items); + break; + } case RewardType.ExtraDailyQuest: - { - _profileHelper.AddExtraRepeatableQuest(newProfile, reward.Target, (double) reward.Value); - break; - } + { + _profileHelper.AddExtraRepeatableQuest( + newProfile, + reward.Target, + (double)reward.Value + ); + break; + } default: _logger.Error($"Unhandled prestige reward type: {reward.Type}"); break; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ProbabilityHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ProbabilityHelper.cs index dd7e9a02..cc24edeb 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ProbabilityHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ProbabilityHelper.cs @@ -5,10 +5,7 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Helpers; [Injectable] -public class ProbabilityHelper( - ISptLogger _logger, - RandomUtil _randomUtil -) +public class ProbabilityHelper(ISptLogger _logger, RandomUtil _randomUtil) { /// /// Chance to roll a number out of 100 @@ -18,6 +15,6 @@ public class ProbabilityHelper( /// true if success public bool RollChance(double chance, double scale = 1) { - return _randomUtil.GetInt(1, (int) (100 * scale)) / (1 * scale) <= chance; + return _randomUtil.GetInt(1, (int)(100 * scale)) / (1 * scale) <= chance; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs index 7644b51a..76fcdae8 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs @@ -28,7 +28,11 @@ public class ProfileHelper( ConfigServer _configServer ) { - protected static readonly FrozenSet gameEditionsWithFreeRefresh = ["edge_of_darkness", "unheard_edition"]; + protected static readonly FrozenSet gameEditionsWithFreeRefresh = + [ + "edge_of_darkness", + "unheard_edition", + ]; protected InventoryConfig _inventoryConfig = _configServer.GetConfig(); /// @@ -36,7 +40,10 @@ public class ProfileHelper( /// /// Session id /// Quest with condition to remove - public void RemoveQuestConditionFromProfile(PmcData pmcData, Dictionary questConditionId) + public void RemoveQuestConditionFromProfile( + PmcData pmcData, + Dictionary questConditionId + ) { foreach (var questId in questConditionId) { @@ -111,9 +118,13 @@ public class ProfileHelper( // Find a profile that doesn't have same session id but has same name return allProfiles.Any(p => - ProfileHasInfoProperty(p) && - !StringsMatch(p.ProfileInfo.ProfileId, sessionID) && // SessionIds dont match - StringsMatch(p.CharacterData.PmcData.Info.LowerNickname.ToLower(), nicknameRequest.Nickname.ToLower()) + ProfileHasInfoProperty(p) + && !StringsMatch(p.ProfileInfo.ProfileId, sessionID) + && // SessionIds dont match + StringsMatch( + p.CharacterData.PmcData.Info.LowerNickname.ToLower(), + nicknameRequest.Nickname.ToLower() + ) ); // Nicknames do } @@ -152,7 +163,10 @@ public class ProfileHelper( /// PmcData public PmcData? GetProfileByPmcId(string pmcId) { - return _saveServer.GetProfiles().Values.First(p => p.CharacterData?.PmcData?.Id == pmcId).CharacterData.PmcData; + return _saveServer + .GetProfiles() + .Values.First(p => p.CharacterData?.PmcData?.Id == pmcId) + .CharacterData.PmcData; } /// @@ -204,7 +218,7 @@ public class ProfileHelper( Migrations = new Dictionary(), CultistRewards = new Dictionary(), PendingPrestige = null, - ExtraRepeatableQuests = new Dictionary() + ExtraRepeatableQuests = new Dictionary(), }; } @@ -231,7 +245,10 @@ public class ProfileHelper( _logger.Error($"Account {accountID} does not exist"); } - return _saveServer.GetProfiles().FirstOrDefault(p => p.Value?.ProfileInfo?.Aid == aid).Value; + return _saveServer + .GetProfiles() + .FirstOrDefault(p => p.Value?.ProfileInfo?.Aid == aid) + .Value; } /// @@ -267,8 +284,8 @@ public class ProfileHelper( Side = pmcProfile.Info.Side, Level = pmcProfile.Info.Level, MemberCategory = pmcProfile.Info.MemberCategory, - SelectedMemberCategory = pmcProfile.Info.SelectedMemberCategory - } + SelectedMemberCategory = pmcProfile.Info.SelectedMemberCategory, + }, }; } @@ -320,27 +337,21 @@ public class ProfileHelper( { LethalDamagePart = "Head", LethalDamage = null, - BodyParts = new BodyPartsDamageHistory() + BodyParts = new BodyPartsDamageHistory(), }, DroppedItems = new List(), ExperienceBonusMult = 0, FoundInRaidItems = new List(), LastPlayerState = null, LastSessionDate = 0, - OverallCounters = new OverallCounters - { - Items = [] - }, - SessionCounters = new SessionCounters - { - Items = [] - }, + OverallCounters = new OverallCounters { Items = [] }, + SessionCounters = new SessionCounters { Items = [] }, SessionExperienceMult = 0, SurvivorClass = "Unknown", TotalInGameTime = 0, TotalSessionExperience = 0, - Victims = new List() - } + Victims = new List(), + }, }; } @@ -367,10 +378,15 @@ public class ProfileHelper( if (secureContainer is not null) { // Find and remove container + children - var childItemsInSecureContainer = _itemHelper.FindAndReturnChildrenByItems(items, secureContainer.Id); + var childItemsInSecureContainer = _itemHelper.FindAndReturnChildrenByItems( + items, + secureContainer.Id + ); // Remove child items + secure container - profile.Inventory.Items = items.Where(i => !childItemsInSecureContainer.Contains(i.Id)).ToList(); + profile.Inventory.Items = items + .Where(i => !childItemsInSecureContainer.Contains(i.Id)) + .ToList(); } return profile; @@ -388,7 +404,9 @@ public class ProfileHelper( var profileToUpdate = GetFullProfile(playerId); profileToUpdate.SptData.ReceivedGifts ??= new List(); - var giftData = profileToUpdate.SptData.ReceivedGifts.FirstOrDefault(g => g.GiftId == giftId); + var giftData = profileToUpdate.SptData.ReceivedGifts.FirstOrDefault(g => + g.GiftId == giftId + ); if (giftData != null) { // Increment counter @@ -402,7 +420,7 @@ public class ProfileHelper( { GiftId = giftId, TimestampLastAccepted = _timeUtil.GetTimeStamp(), - Current = 1 + Current = 1, } ); } @@ -432,7 +450,9 @@ public class ProfileHelper( return false; } - var giftDataFromProfile = profile.SptData.ReceivedGifts.FirstOrDefault(g => g.GiftId == giftId); + var giftDataFromProfile = profile.SptData.ReceivedGifts.FirstOrDefault(g => + g.GiftId == giftId + ); if (giftDataFromProfile == null) { return false; @@ -487,20 +507,32 @@ public class ProfileHelper( /// Skill to add points to /// Points to add /// Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - public void AddSkillPointsToPlayer(PmcData pmcProfile, SkillTypes skill, double? pointsToAdd, bool useSkillProgressRateMultiplier = false) + public void AddSkillPointsToPlayer( + PmcData pmcProfile, + SkillTypes skill, + double? pointsToAdd, + bool useSkillProgressRateMultiplier = false + ) { var pointsToAddToSkill = pointsToAdd; if (pointsToAddToSkill < 0D) { - _logger.Warning(_localisationService.GetText("player-attempt_to_increment_skill_with_negative_value", skill)); + _logger.Warning( + _localisationService.GetText( + "player-attempt_to_increment_skill_with_negative_value", + skill + ) + ); return; } var profileSkills = pmcProfile?.Skills?.Common; if (profileSkills == null) { - _logger.Warning($"Unable to add {pointsToAddToSkill} points to {skill}, Profile has no skills"); + _logger.Warning( + $"Unable to add {pointsToAddToSkill} points to {skill}, Profile has no skills" + ); return; } @@ -513,7 +545,9 @@ public class ProfileHelper( if (useSkillProgressRateMultiplier) { - var skillProgressRate = _databaseService.GetGlobals().Configuration.SkillsSettings.SkillProgressRate; + var skillProgressRate = _databaseService + .GetGlobals() + .Configuration.SkillsSettings.SkillProgressRate; pointsToAddToSkill *= skillProgressRate; } @@ -542,7 +576,9 @@ public class ProfileHelper( var skillToReturn = pmcData?.Skills?.Common.FirstOrDefault(s => s.Id == skill); if (skillToReturn == null) { - _logger.Warning($"Profile {pmcData.SessionId} does not have a skill named: {skill.ToString()}"); + _logger.Warning( + $"Profile {pmcData.SessionId} does not have a skill named: {skill.ToString()}" + ); } return skillToReturn; @@ -555,7 +591,9 @@ public class ProfileHelper( /// True if account is developer public bool IsDeveloperAccount(string sessionID) { - return GetFullProfile(sessionID)?.ProfileInfo?.Edition?.ToLower().StartsWith("spt developer") ?? false; + return GetFullProfile(sessionID) + ?.ProfileInfo?.Edition?.ToLower() + .StartsWith("spt developer") ?? false; } /// @@ -582,7 +620,7 @@ public class ProfileHelper( Type = BonusType.StashRows, IsPassive = true, IsVisible = true, - IsProduction = false + IsProduction = false, } ); } @@ -613,7 +651,9 @@ public class ProfileHelper( public bool PlayerIsFleaBanned(PmcData pmcProfile) { var currentTimestamp = _timeUtil.GetTimeStamp(); - return pmcProfile?.Info?.Bans?.Any(b => b.BanType == BanType.RagFair && currentTimestamp < b.DateTime) ?? false; + return pmcProfile?.Info?.Bans?.Any(b => + b.BanType == BanType.RagFair && currentTimestamp < b.DateTime + ) ?? false; } public bool HasAccessToRepeatableFreeRefreshSystem(PmcData pmcProfile) @@ -633,7 +673,9 @@ public class ProfileHelper( var pockets = pmcProfile.Inventory.Items.Where(i => i.SlotId == "Pockets"); if (!pockets.Any()) { - _logger.Error($"Unable to replace profile: {pmcProfile.Id} pocket tpl with: {newPocketTpl} as Pocket item could not be found."); + _logger.Error( + $"Unable to replace profile: {pmcProfile.Id} pocket tpl with: {newPocketTpl} as Pocket item could not be found." + ); return; } @@ -650,7 +692,9 @@ public class ProfileHelper( /// List of item objects public List GetQuestItemsInProfile(PmcData profile) { - return profile?.Inventory?.Items.Where(i => i.ParentId == profile.Inventory.QuestRaidItems).ToList(); + return profile + ?.Inventory?.Items.Where(i => i.ParentId == profile.Inventory.QuestRaidItems) + .ToList(); } /// @@ -665,7 +709,10 @@ public class ProfileHelper( foreach (var itemId in profile.Inventory?.FavoriteItems ?? []) { // When viewing another users profile, the client expects a full item with children, so get that - var itemAndChildren = _itemHelper.FindAndReturnChildrenAsItems(profile.Inventory.Items, itemId); + var itemAndChildren = _itemHelper.FindAndReturnChildrenAsItems( + profile.Inventory.Items, + itemId + ); if (itemAndChildren?.Count > 0) { // To get the client to actually see the items, we set the main item's parent to null, so it's treated as a root item @@ -688,7 +735,9 @@ public class ProfileHelper( if (fullProfile?.CustomisationUnlocks?.Any(u => u.Id == reward.Target) ?? false) { - _logger.Warning($"Profile: {fullProfile.ProfileInfo.ProfileId} already has hideout customisation reward: {reward.Target}, skipping"); + _logger.Warning( + $"Profile: {fullProfile.ProfileInfo.ProfileId} already has hideout customisation reward: {reward.Target}, skipping" + ); return; } @@ -701,7 +750,7 @@ public class ProfileHelper( { Id = reward.Target, Source = source, - Type = null + Type = null, }; switch (matchingCustomisation.Parent) @@ -731,7 +780,9 @@ public class ProfileHelper( rewardToStore.Type = CustomisationType.SHOOTING_RANGE_MARK; break; default: - _logger.Error($"Unhandled customisation unlock type: {matchingCustomisation.Parent} not added to profile"); + _logger.Error( + $"Unhandled customisation unlock type: {matchingCustomisation.Parent} not added to profile" + ); return; } @@ -745,7 +796,11 @@ public class ProfileHelper( /// Profile to add the extra repeatable to /// The ID of the type of repeatable to increase /// The number of extra repeatables to add - public void AddExtraRepeatableQuest(SptProfile fullProfile, string repeatableId, double rewardValue) + public void AddExtraRepeatableQuest( + SptProfile fullProfile, + string repeatableId, + double rewardValue + ) { fullProfile.SptData.ExtraRepeatableQuests ??= new Dictionary(); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/QuestConditionHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/QuestConditionHelper.cs index 6b9b2e5d..e72fcf64 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/QuestConditionHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/QuestConditionHelper.cs @@ -8,28 +8,32 @@ public class QuestConditionHelper { public List GetQuestConditions( List questConditions, - Func>? furtherFilter = null) + Func>? furtherFilter = null + ) { return FilterConditions(questConditions, "Quest", furtherFilter); } public List GetLevelConditions( List questConditions, - Func>? furtherFilter = null) + Func>? furtherFilter = null + ) { return FilterConditions(questConditions, "Level", furtherFilter); } public List GetLoyaltyConditions( List questConditions, - Func>? furtherFilter = null) + Func>? furtherFilter = null + ) { return FilterConditions(questConditions, "TraderLoyalty", furtherFilter); } public List GetStandingConditions( List questConditions, - Func>? furtherFilter = null) + Func>? furtherFilter = null + ) { return FilterConditions(questConditions, "TraderStanding", furtherFilter); } @@ -37,19 +41,20 @@ public class QuestConditionHelper protected List FilterConditions( List questConditions, string questType, - Func>? furtherFilter = null) + Func>? furtherFilter = null + ) { - var filteredQuests = questConditions.Where(c => + var filteredQuests = questConditions + .Where(c => + { + if (c.ConditionType == questType) + // return true or run the passed in function { - if (c.ConditionType == questType) - // return true or run the passed in function - { - return furtherFilter is null || furtherFilter(c).Any(); - } - - return false; + return furtherFilter is null || furtherFilter(c).Any(); } - ) + + return false; + }) .ToList(); return filteredQuests; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs index 0ba21353..8db07359 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs @@ -37,7 +37,11 @@ public class QuestHelper( ICloner _cloner ) { - protected readonly HashSet _startedOrAvailToFinish = [QuestStatusEnum.Started, QuestStatusEnum.AvailableForFinish]; + protected readonly HashSet _startedOrAvailToFinish = + [ + QuestStatusEnum.Started, + QuestStatusEnum.AvailableForFinish, + ]; protected readonly QuestConfig _questConfig = _configServer.GetConfig(); private Dictionary>? _sellToTraderQuestConditionCache; @@ -47,7 +51,7 @@ public class QuestHelper( /// protected virtual Dictionary> SellToTraderQuestConditionCache { - get { return _sellToTraderQuestConditionCache ??= GetSellToTraderQuests(); } + get { return _sellToTraderQuestConditionCache ??= GetSellToTraderQuests(); } } /// @@ -91,7 +95,10 @@ public class QuestHelper( return playerLevel == conditionValue; default: _logger.Error( - _localisationService.GetText("quest-unable_to_find_compare_condition", condition.CompareMethod) + _localisationService.GetText( + "quest-unable_to_find_compare_condition", + condition.CompareMethod + ) ); return false; @@ -128,7 +135,7 @@ public class QuestHelper( public int AdjustSkillExpForLowLevels(CommonSkill profileSkill, int progressAmount) { // TODO: what used this? can't find any uses in node - var currentLevel = Math.Floor((double) (profileSkill.Progress / 100)); + var currentLevel = Math.Floor((double)(profileSkill.Progress / 100)); // Only run this if the current level is under 9 if (currentLevel >= 9) @@ -158,12 +165,14 @@ public class QuestHelper( var adjustedProgressToAdd = 10 / (currentLevel + 1) * progressToAdd; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Progress To Add: {progressToAdd} Adjusted for level: {adjustedProgressToAdd}"); + _logger.Debug( + $"Progress To Add: {progressToAdd} Adjusted for level: {adjustedProgressToAdd}" + ); } // Add the progress amount adjusted by level - adjustedSkillProgress += (int) adjustedProgressToAdd; - remainingProgress -= (int) progressToAdd; + adjustedSkillProgress += (int)adjustedProgressToAdd; + remainingProgress -= (int)progressToAdd; startingLevelProgress = 0; currentLevel++; } @@ -196,15 +205,20 @@ public class QuestHelper( /// true if loyalty is high enough to fulfill quest requirement public bool TraderLoyaltyLevelRequirementCheck(QuestCondition questProperties, PmcData profile) { - if (!profile.TradersInfo.TryGetValue( + if ( + !profile.TradersInfo.TryGetValue( questProperties.Target.IsItem ? questProperties.Target.Item : questProperties.Target.List.FirstOrDefault(), out var trader - )) + ) + ) { _logger.Error( - _localisationService.GetText("quest-unable_to_find_trader_in_profile", questProperties.Target) + _localisationService.GetText( + "quest-unable_to_find_trader_in_profile", + questProperties.Target + ) ); } @@ -224,19 +238,28 @@ public class QuestHelper( public bool TraderStandingRequirementCheck(QuestCondition questProperties, PmcData profile) { var requiredLoyaltyLevel = int.Parse(questProperties.Value.ToString()); - if (!profile.TradersInfo.TryGetValue( + if ( + !profile.TradersInfo.TryGetValue( questProperties.Target.IsItem ? questProperties.Target.Item : questProperties.Target.List.FirstOrDefault(), out var trader - )) + ) + ) { _logger.Error( - _localisationService.GetText("quest-unable_to_find_trader_in_profile", questProperties.Target) + _localisationService.GetText( + "quest-unable_to_find_trader_in_profile", + questProperties.Target + ) ); } - return CompareAvailableForValues(trader.Standing ?? 1, requiredLoyaltyLevel, questProperties.CompareMethod); + return CompareAvailableForValues( + trader.Standing ?? 1, + requiredLoyaltyLevel, + questProperties.CompareMethod + ); } /// @@ -264,7 +287,9 @@ public class QuestHelper( return current == required; default: - _logger.Error(_localisationService.GetText("quest-compare_operator_unhandled", compareMethod)); + _logger.Error( + _localisationService.GetText("quest-compare_operator_unhandled", compareMethod) + ); return false; } @@ -284,7 +309,11 @@ public class QuestHelper( /// State the new quest should be in when returned /// Details of accepted quest from client /// quest status object for storage in profile - public QuestStatus GetQuestReadyForProfile(PmcData pmcData, QuestStatusEnum newState, AcceptQuestRequestData acceptedQuest) + public QuestStatus GetQuestReadyForProfile( + PmcData pmcData, + QuestStatusEnum newState, + AcceptQuestRequestData acceptedQuest + ) { var currentTimestamp = _timeUtil.GetTimeStamp(); var existingQuest = pmcData.Quests.FirstOrDefault(q => q.QId == acceptedQuest.QuestId); @@ -310,7 +339,7 @@ public class QuestHelper( QId = acceptedQuest.QuestId, StartTime = currentTimestamp, Status = newState, - StatusTimers = new Dictionary() + StatusTimers = new Dictionary(), }; // Check if quest has a prereq to be placed in a 'pending' state, otherwise set status timers value @@ -320,16 +349,14 @@ public class QuestHelper( _logger.Error( _localisationService.GetText( "quest-unable_to_find_quest_in_db", - new - { - questId = acceptedQuest.QuestId, - questType = acceptedQuest.Type - } + new { questId = acceptedQuest.QuestId, questType = acceptedQuest.Type } ) ); } - var waitTime = questDbData?.Conditions.AvailableForStart.FirstOrDefault(x => x.AvailableAfter > 0); + var waitTime = questDbData?.Conditions.AvailableForStart.FirstOrDefault(x => + x.AvailableAfter > 0 + ); if (waitTime is not null && acceptedQuest.Type != "repeatable") { // Quest should be put into 'pending' state @@ -352,89 +379,106 @@ public class QuestHelper( /// Quest started by player /// Session/Player id /// Quests accessible to player including newly unlocked quests now quest (startedQuestId) was started - public List GetNewlyAccessibleQuestsWhenStartingQuest(string startedQuestId, string sessionID) + public List GetNewlyAccessibleQuestsWhenStartingQuest( + string startedQuestId, + string sessionID + ) { // Get quest acceptance data from profile var profile = _profileHelper.GetPmcProfile(sessionID); - var startedQuestInProfile = profile.Quests.FirstOrDefault(profileQuest => profileQuest.QId == startedQuestId); + var startedQuestInProfile = profile.Quests.FirstOrDefault(profileQuest => + profileQuest.QId == startedQuestId + ); // Get quests that var eligibleQuests = GetQuestsFromDb() .Where(quest => + { + // Quest is accessible to player when the accepted quest passed into param is started + // e.g. Quest A passed in, quest B is looped over and has requirement of A to be started, include it + var matchingQuestCondition = quest.Conditions.AvailableForStart.FirstOrDefault( + condition => + condition.ConditionType == "Quest" + && ( + (condition.Target?.Item?.Contains(startedQuestId) ?? false) + || (condition.Target?.List?.Contains(startedQuestId) ?? false) + ) + && (condition.Status?.Contains(QuestStatusEnum.Started) ?? false) + ); + + // Has a matching quest condition in another quest (Accepting this quest gives access to found quest too) check if it also has a level requirement that passes + if (matchingQuestCondition is not null) { - // Quest is accessible to player when the accepted quest passed into param is started - // e.g. Quest A passed in, quest B is looped over and has requirement of A to be started, include it - var matchingQuestCondition = quest.Conditions.AvailableForStart - .FirstOrDefault(condition => condition.ConditionType == "Quest" - && ((condition.Target?.Item?.Contains(startedQuestId) ?? false) - || (condition.Target?.List?.Contains(startedQuestId) ?? false)) - && (condition.Status?.Contains(QuestStatusEnum.Started) ?? false)); - - // Has a matching quest condition in another quest (Accepting this quest gives access to found quest too) check if it also has a level requirement that passes - if (matchingQuestCondition is not null) - { - var matchingLevelRequirement = quest.Conditions.AvailableForStart.FirstOrDefault(condition => condition.ConditionType == "Level"); - if (matchingLevelRequirement is not null && profile.Info.Level < matchingLevelRequirement.Value) - { - // Player doesn't fulfil level requirement for quest, don't show it to player - return false; - } - } - - // Not found, skip quest - if (matchingQuestCondition is null) + var matchingLevelRequirement = + quest.Conditions.AvailableForStart.FirstOrDefault(condition => + condition.ConditionType == "Level" + ); + if ( + matchingLevelRequirement is not null + && profile.Info.Level < matchingLevelRequirement.Value + ) { + // Player doesn't fulfil level requirement for quest, don't show it to player return false; } - - // Skip locked event quests - if (!ShowEventQuestToPlayer(quest.Id)) - { - return false; - } - - // Skip quest if it's flagged as for other side - if (QuestIsForOtherSide(profile.Info.Side, quest.Id)) - { - return false; - } - - if (QuestIsProfileBlacklisted(profile.Info.GameVersion, quest.Id)) - { - return false; - } - - if (QuestIsProfileWhitelisted(profile.Info.GameVersion, quest.Id)) - { - return false; - } - - var standingRequirements = _questConditionHelper.GetStandingConditions( - quest.Conditions.AvailableForStart - ); - foreach (var condition in standingRequirements) - { - if (!TraderStandingRequirementCheck(condition, profile)) - { - return false; - } - } - - var loyaltyRequirements = _questConditionHelper.GetLoyaltyConditions( - quest.Conditions.AvailableForStart - ); - foreach (var condition in loyaltyRequirements) - { - if (!TraderLoyaltyLevelRequirementCheck(condition, profile)) - { - return false; - } - } - - // Include if quest found in profile and is started or ready to hand in - return startedQuestInProfile is not null && _startedOrAvailToFinish.Contains((QuestStatusEnum) startedQuestInProfile.Status); } - ); + + // Not found, skip quest + if (matchingQuestCondition is null) + { + return false; + } + + // Skip locked event quests + if (!ShowEventQuestToPlayer(quest.Id)) + { + return false; + } + + // Skip quest if it's flagged as for other side + if (QuestIsForOtherSide(profile.Info.Side, quest.Id)) + { + return false; + } + + if (QuestIsProfileBlacklisted(profile.Info.GameVersion, quest.Id)) + { + return false; + } + + if (QuestIsProfileWhitelisted(profile.Info.GameVersion, quest.Id)) + { + return false; + } + + var standingRequirements = _questConditionHelper.GetStandingConditions( + quest.Conditions.AvailableForStart + ); + foreach (var condition in standingRequirements) + { + if (!TraderStandingRequirementCheck(condition, profile)) + { + return false; + } + } + + var loyaltyRequirements = _questConditionHelper.GetLoyaltyConditions( + quest.Conditions.AvailableForStart + ); + foreach (var condition in loyaltyRequirements) + { + if (!TraderLoyaltyLevelRequirementCheck(condition, profile)) + { + return false; + } + } + + // Include if quest found in profile and is started or ready to hand in + return startedQuestInProfile is not null + && _startedOrAvailToFinish.Contains( + (QuestStatusEnum)startedQuestInProfile.Status + ); + }); return GetQuestsWithOnlyLevelRequirementStartCondition(eligibleQuests); } @@ -450,22 +494,28 @@ public class QuestHelper( var isHalloweenEventActive = _seasonalEventService.HalloweenEventEnabled(); // Not christmas + quest is for christmas - if (!isChristmasEventActive && - _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.Christmas)) + if ( + !isChristmasEventActive + && _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.Christmas) + ) { return false; } // Not halloween + quest is for halloween - if (!isHalloweenEventActive && - _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.Halloween)) + if ( + !isHalloweenEventActive + && _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.Halloween) + ) { return false; } // Should non-season event quests be shown to player - if (!(_questConfig.ShowNonSeasonalEventQuests ?? false) && - _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.None)) + if ( + !(_questConfig.ShowNonSeasonalEventQuests ?? false) + && _seasonalEventService.IsQuestRelatedToEvent(questId, SeasonalEventType.None) + ) { return false; } @@ -483,13 +533,13 @@ public class QuestHelper( { var isUsec = string.Equals(playerSide, "usec", StringComparison.OrdinalIgnoreCase); if (isUsec && _questConfig.BearOnlyQuests.Contains(questId)) - // Player is usec and quest is bear only, skip + // Player is usec and quest is bear only, skip { return true; } if (!isUsec && _questConfig.UsecOnlyQuests.Contains(questId)) - // Player is bear and quest is usec only, skip + // Player is bear and quest is usec only, skip { return true; } @@ -528,7 +578,7 @@ public class QuestHelper( { var questBlacklist = _questConfig.ProfileBlacklist.GetValueOrDefault(gameVersion); if (questBlacklist is null) - // Not blacklisted + // Not blacklisted { return false; } @@ -549,21 +599,20 @@ public class QuestHelper( var quests = GetQuestsFromDb() .Where(q => + { + var acceptedQuestCondition = q.Conditions.AvailableForStart.FirstOrDefault(c => + c.ConditionType == "Quest" + && (c.Target.IsList ? c.Target.List : [c.Target.Item]).Contains(failedQuestId) + && c.Status[0] == QuestStatusEnum.Fail + ); + + if (acceptedQuestCondition is null) { - var acceptedQuestCondition = q.Conditions.AvailableForStart.FirstOrDefault(c => c.ConditionType == "Quest" && - (c.Target.IsList ? c.Target.List : [c.Target.Item]) - .Contains(failedQuestId) && - c.Status[0] == QuestStatusEnum.Fail - ); - - if (acceptedQuestCondition is null) - { - return false; - } - - return profileQuest is not null && profileQuest.Status == QuestStatusEnum.Fail; + return false; } - ) + + return profileQuest is not null && profileQuest.Status == QuestStatusEnum.Fail; + }) .ToList(); if (quests.Any()) @@ -587,13 +636,16 @@ public class QuestHelper( string itemId, int newStackSize, string sessionID, - ItemEventRouterResponse output) + ItemEventRouterResponse output + ) { //TODO: maybe merge this function and the one from customization var inventoryItemIndex = pmcData.Inventory.Items.FindIndex(item => item.Id == itemId); if (inventoryItemIndex < 0) { - _logger.Error(_localisationService.GetText("quest-item_not_found_in_inventory", itemId)); + _logger.Error( + _localisationService.GetText("quest-item_not_found_in_inventory", itemId) + ); return; } @@ -611,13 +663,7 @@ public class QuestHelper( { // this case is probably dead Code right now, since the only calling function // checks explicitly for Value > 0. - output.ProfileChanges[sessionID] - .Items.DeletedItems.Add( - new Item - { - Id = itemId - } - ); + output.ProfileChanges[sessionID].Items.DeletedItems.Add(new Item { Id = itemId }); pmcData.Inventory.Items.RemoveAt(inventoryItemIndex); } } @@ -631,9 +677,11 @@ public class QuestHelper( protected void AddItemStackSizeChangeIntoEventResponse( ItemEventRouterResponse output, string sessionId, - Item item) + Item item + ) { - output.ProfileChanges[sessionId] + output + .ProfileChanges[sessionId] .Items.ChangedItems.Add( new Item { @@ -642,10 +690,7 @@ public class QuestHelper( ParentId = item.ParentId, SlotId = item.SlotId, Location = item.Location, - Upd = new Upd - { - StackObjectsCount = item.Upd.StackObjectsCount - } + Upd = new Upd { StackObjectsCount = item.Upd.StackObjectsCount }, } ); } @@ -668,14 +713,13 @@ public class QuestHelper( public Quest GetQuestWithOnlyLevelRequirementStartCondition(Quest quest) { var updatedQuest = _cloner.Clone(quest); - updatedQuest.Conditions.AvailableForStart = updatedQuest.Conditions.AvailableForStart.Where(q => q.ConditionType == "Level" - ) + updatedQuest.Conditions.AvailableForStart = updatedQuest + .Conditions.AvailableForStart.Where(q => q.ConditionType == "Level") .ToList(); return updatedQuest; } - /// /// Get all quests with finish condition `SellItemToTrader`. /// The first time this method is called it will cache the conditions by quest id in ` and return that thereafter. @@ -709,7 +753,9 @@ public class QuestHelper( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"GetSellToTraderQuests found: {SellToTraderQuestConditionCache.Count} quests"); + _logger.Debug( + $"GetSellToTraderQuests found: {SellToTraderQuestConditionCache.Count} quests" + ); } return result; @@ -722,8 +768,12 @@ public class QuestHelper( /// List of active TaskConditionCounters protected List? GetActiveSellToTraderConditionCounters(PmcData pmcData) { - return pmcData.TaskConditionCounters?.Values.Where(condition => SellToTraderQuestConditionCache.ContainsKey(condition.SourceId) - && condition.Type == "SellItemToTrader").ToList(); + return pmcData + .TaskConditionCounters?.Values.Where(condition => + SellToTraderQuestConditionCache.ContainsKey(condition.SourceId) + && condition.Type == "SellItemToTrader" + ) + .ToList(); } /// @@ -736,7 +786,7 @@ public class QuestHelper( PmcData profileWithItemsToSell, PmcData profileToReceiveMoney, ProcessSellTradeRequestData sellRequest - ) + ) { var activeConditionCounters = GetActiveSellToTraderConditionCounters(profileToReceiveMoney); @@ -751,13 +801,23 @@ public class QuestHelper( // Condition is in profile, but quest doesn't exist in database if (!SellToTraderQuestConditionCache.TryGetValue(counter.SourceId, out var conditions)) { - _logger.Error(_localisationService.GetText("quest_unable_to_find_quest_in_db_no_type", counter.SourceId)); + _logger.Error( + _localisationService.GetText( + "quest_unable_to_find_quest_in_db_no_type", + counter.SourceId + ) + ); continue; } foreach (var condition in conditions) { - IncrementSoldToTraderCounter(profileWithItemsToSell, counter, condition, sellRequest); + IncrementSoldToTraderCounter( + profileWithItemsToSell, + counter, + condition, + sellRequest + ); } } } @@ -774,17 +834,23 @@ public class QuestHelper( TaskConditionCounter taskCounter, QuestCondition questCondition, ProcessSellTradeRequestData sellRequest - ) + ) { var itemsTplsThatIncrement = questCondition.Target; foreach (var itemSoldToTrader in sellRequest.Items) { // Get sold items' details from profile - var itemDetails = profileWithItemsToSell.Inventory?.Items?.FirstOrDefault(inventoryItem => inventoryItem.Id == itemSoldToTrader.Id + var itemDetails = profileWithItemsToSell.Inventory?.Items?.FirstOrDefault( + inventoryItem => inventoryItem.Id == itemSoldToTrader.Id ); if (itemDetails is null) { - _logger.Error(_localisationService.GetText("trader-unable_to_find_inventory_item_for_selltotrader_counter", taskCounter.SourceId)); + _logger.Error( + _localisationService.GetText( + "trader-unable_to_find_inventory_item_for_selltotrader_counter", + taskCounter.SourceId + ) + ); continue; } @@ -808,7 +874,8 @@ public class QuestHelper( PmcData pmcData, FailQuestRequestData failRequest, string sessionID, - ItemEventRouterResponse? output = null) + ItemEventRouterResponse? output = null + ) { // Prepare response to send back to client var updatedOutput = output ?? _eventOutputHolder.GetOutput(sessionID); @@ -826,8 +893,8 @@ public class QuestHelper( var quest = GetQuestFromDb(failRequest.QuestId, pmcData); // Merge all daily/weekly/scav daily quests into one array and look for the matching quest by id - var matchingRepeatableQuest = pmcData.RepeatableQuests.SelectMany(repeatableType => repeatableType.ActiveQuests - ) + var matchingRepeatableQuest = pmcData + .RepeatableQuests.SelectMany(repeatableType => repeatableType.ActiveQuests) .FirstOrDefault(activeQuest => activeQuest.Id == failRequest.QuestId); // Quest found and no repeatable found @@ -841,12 +908,14 @@ public class QuestHelper( MessageType.QuestFail, quest.FailMessageText, questRewards.ToList(), - _timeUtil.GetHoursAsSeconds((int) GetMailItemRedeemTimeHoursForProfile(pmcData)) + _timeUtil.GetHoursAsSeconds((int)GetMailItemRedeemTimeHoursForProfile(pmcData)) ); } } - updatedOutput.ProfileChanges[sessionID].Quests.AddRange(FailedUnlocked(failRequest.QuestId, sessionID)); + updatedOutput + .ProfileChanges[sessionID] + .Quests.AddRange(FailedUnlocked(failRequest.QuestId, sessionID)); } /// @@ -874,8 +943,8 @@ public class QuestHelper( } // Check daily/weekly objects - return pmcData.RepeatableQuests - .SelectMany(x => x.ActiveQuests) + return pmcData + .RepeatableQuests.SelectMany(x => x.ActiveQuests) .FirstOrDefault(x => x.Id == questId); } @@ -890,10 +959,10 @@ public class QuestHelper( // Blank or is a guid, use description instead var startedMessageText = GetQuestLocaleIdFromDb(startedMessageTextId); if ( - startedMessageText is null || - startedMessageText.Trim() == "" || - string.Equals(startedMessageText, "test", StringComparison.OrdinalIgnoreCase) || - startedMessageText.Length == 24 + startedMessageText is null + || startedMessageText.Trim() == "" + || string.Equals(startedMessageText, "test", StringComparison.OrdinalIgnoreCase) + || startedMessageText.Length == 24 ) { return questDescriptionId; @@ -988,15 +1057,17 @@ public class QuestHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Unable to find quest: {questId} in db, cannot get 'FindItem' condition, skipping"); + _logger.Debug( + $"Unable to find quest: {questId} in db, cannot get 'FindItem' condition, skipping" + ); } continue; } - var condition = questInDb.Conditions.AvailableForFinish.FirstOrDefault(c => c.ConditionType == "FindItem" && - ((c.Target.IsList ? c.Target.List : [c.Target.Item]) - ?.Contains(itemTpl) ?? false) + var condition = questInDb.Conditions.AvailableForFinish.FirstOrDefault(c => + c.ConditionType == "FindItem" + && ((c.Target.IsList ? c.Target.List : [c.Target.Item])?.Contains(itemTpl) ?? false) ); if (condition is not null) { @@ -1040,7 +1111,7 @@ public class QuestHelper( Status = statuses[^1], // Get last status in list as currently active status StatusTimers = statusesDict, CompletedConditions = [], - AvailableAfter = 0 + AvailableAfter = 0, }; // Check if the quest already exists in the profile @@ -1077,22 +1148,21 @@ public class QuestHelper( public List GetQuestsFailedByCompletingQuest(string completedQuestId) { var questsInDb = GetQuestsFromDb(); - return questsInDb.Where(quest => + return questsInDb + .Where(quest => + { + // No fail conditions, exit early + if (quest.Conditions.Fail is null || quest.Conditions.Fail.Count == 0) { - // No fail conditions, exit early - if (quest.Conditions.Fail is null || quest.Conditions.Fail.Count == 0) - { - return false; - } - - return quest.Conditions.Fail.Any(condition => - (condition.Target.IsList ? condition.Target.List : [condition.Target.Item])?.Contains( - completedQuestId - ) ?? - false - ); + return false; } - ) + + return quest.Conditions.Fail.Any(condition => + ( + condition.Target.IsList ? condition.Target.List : [condition.Target.Item] + )?.Contains(completedQuestId) ?? false + ); + }) .ToList(); } @@ -1123,7 +1193,11 @@ public class QuestHelper( /// Client request /// Player/session id /// Client response - public ItemEventRouterResponse CompleteQuest(PmcData pmcData, CompleteQuestRequestData request, string sessionID) + public ItemEventRouterResponse CompleteQuest( + PmcData pmcData, + CompleteQuestRequestData request, + string sessionID + ) { var completeQuestResponse = _eventOutputHolder.GetOutput(sessionID); if (!completeQuestResponse.ProfileChanges.TryGetValue(sessionID, out var profileChanges)) @@ -1160,7 +1234,12 @@ public class QuestHelper( } // Show success modal on player screen - SendSuccessDialogMessageOnQuestComplete(sessionID, pmcData, completedQuestId, questRewards.ToList()); + SendSuccessDialogMessageOnQuestComplete( + sessionID, + pmcData, + completedQuestId, + questRewards.ToList() + ); // Add diff of quests before completion vs after for client response var questDelta = GetDeltaQuests(clientQuestsClone, GetClientQuests(sessionID)); @@ -1174,9 +1253,11 @@ public class QuestHelper( // If a repeatable quest. Remove from scav profile quests array foreach (var currentRepeatable in pmcData.RepeatableQuests) { - var repeatableQuest = currentRepeatable.ActiveQuests?.FirstOrDefault(activeRepeatable => activeRepeatable.Id == completedQuestId); + var repeatableQuest = currentRepeatable.ActiveQuests?.FirstOrDefault(activeRepeatable => + activeRepeatable.Id == completedQuestId + ); if (repeatableQuest is not null) - // Need to remove redundant scav quest object as its no longer necessary, is tracked in pmc profile + // Need to remove redundant scav quest object as its no longer necessary, is tracked in pmc profile { if (repeatableQuest.Side == "Scav") { @@ -1186,7 +1267,10 @@ public class QuestHelper( } // Hydrate client response questsStatus array with data - var questStatusChanges = GetQuestsWithDifferentStatuses(preCompleteProfileQuestsClone, pmcData.Quests); + var questStatusChanges = GetQuestsWithDifferentStatuses( + preCompleteProfileQuestsClone, + pmcData.Quests + ); profileChanges.QuestsStatus.AddRange(questStatusChanges); return completeQuestResponse; @@ -1252,12 +1336,22 @@ public class QuestHelper( continue; } - var questRequirements = _questConditionHelper.GetQuestConditions(quest.Conditions.AvailableForStart); - var loyaltyRequirements = _questConditionHelper.GetLoyaltyConditions(quest.Conditions.AvailableForStart); - var standingRequirements = _questConditionHelper.GetStandingConditions(quest.Conditions.AvailableForStart); + var questRequirements = _questConditionHelper.GetQuestConditions( + quest.Conditions.AvailableForStart + ); + var loyaltyRequirements = _questConditionHelper.GetLoyaltyConditions( + quest.Conditions.AvailableForStart + ); + var standingRequirements = _questConditionHelper.GetStandingConditions( + quest.Conditions.AvailableForStart + ); // Quest has no conditions, standing or loyalty conditions, add to visible quest list - if (questRequirements.Count == 0 && loyaltyRequirements.Count == 0 && standingRequirements.Count == 0) + if ( + questRequirements.Count == 0 + && loyaltyRequirements.Count == 0 + && standingRequirements.Count == 0 + ) { quest.SptStatus = QuestStatusEnum.AvailableForStart; questsToShowPlayer.Add(quest); @@ -1270,14 +1364,15 @@ public class QuestHelper( foreach (var conditionToFulfil in questRequirements) { // If the previous quest isn't in the user profile, it hasn't been completed or started - var questIdsToFulfil = (conditionToFulfil.Target.IsList - ? conditionToFulfil.Target.List - : conditionToFulfil.Target.Item == null - ? null - : [conditionToFulfil.Target.Item]) ?? - []; - var prerequisiteQuest = - profile.Quests.FirstOrDefault(profileQuest => questIdsToFulfil.Contains(profileQuest.QId)); + var questIdsToFulfil = + ( + conditionToFulfil.Target.IsList ? conditionToFulfil.Target.List + : conditionToFulfil.Target.Item == null ? null + : [conditionToFulfil.Target.Item] + ) ?? []; + var prerequisiteQuest = profile.Quests.FirstOrDefault(profileQuest => + questIdsToFulfil.Contains(profileQuest.QId) + ); if (prerequisiteQuest is null) { @@ -1337,7 +1432,11 @@ public class QuestHelper( } } - if (haveCompletedPreviousQuest && passesLoyaltyRequirements && passesStandingRequirements) + if ( + haveCompletedPreviousQuest + && passesLoyaltyRequirements + && passesStandingRequirements + ) { quest.SptStatus = QuestStatusEnum.AvailableForStart; questsToShowPlayer.Add(quest); @@ -1367,65 +1466,78 @@ public class QuestHelper( continue; } - propsAsDict[rewardType.Key] = ((List) propsAsDict[rewardType.Key]) - .Where(reward => - _rewardHelper.RewardIsForGameEdition(reward, gameVersion) - ) + propsAsDict[rewardType.Key] = ((List)propsAsDict[rewardType.Key]) + .Where(reward => _rewardHelper.RewardIsForGameEdition(reward, gameVersion)) .ToList(); } } return modifiedQuests; } + /// /// Return a list of quests that would fail when supplied quest is completed /// /// Quest completed id /// /// Collection of Quest objects - protected List GetQuestsFromProfileFailedByCompletingQuest(string completedQuestId, PmcData pmcProfile) + protected List GetQuestsFromProfileFailedByCompletingQuest( + string completedQuestId, + PmcData pmcProfile + ) { var questsInDb = GetQuestsFromDb(); - return questsInDb.Where(quest => + return questsInDb + .Where(quest => + { + // No fail conditions, skip + if (quest.Conditions?.Fail is null || quest.Conditions.Fail.Count == 0) { - // No fail conditions, skip - if (quest.Conditions?.Fail is null || quest.Conditions.Fail.Count == 0) - { - return false; - } - - // Quest already exists in profile and is failed, skip - if (pmcProfile.Quests.Any(profileQuest => profileQuest.QId == quest.Id && profileQuest.Status == QuestStatusEnum.Fail)) - { - return false; - } - - // Check if completed quest is inside iterated quests fail conditions - foreach (var condition in quest.Conditions.Fail) - { - // No target, cant be failed by our completed quest - if (condition?.Target is null) - { - continue; - } - - // 'Target' property can be Collection or string, handle each differently - if (condition.Target.IsList && condition.Target.List.Contains(completedQuestId)) - { - // Check if completed quest id exists in fail condition - return true; - } - - if (condition.Target.IsItem && string.Equals(condition.Target.Item, completedQuestId, StringComparison.InvariantCultureIgnoreCase)) - { - // Not a list, plain string - return true; - } - } - return false; } - ) + + // Quest already exists in profile and is failed, skip + if ( + pmcProfile.Quests.Any(profileQuest => + profileQuest.QId == quest.Id && profileQuest.Status == QuestStatusEnum.Fail + ) + ) + { + return false; + } + + // Check if completed quest is inside iterated quests fail conditions + foreach (var condition in quest.Conditions.Fail) + { + // No target, cant be failed by our completed quest + if (condition?.Target is null) + { + continue; + } + + // 'Target' property can be Collection or string, handle each differently + if (condition.Target.IsList && condition.Target.List.Contains(completedQuestId)) + { + // Check if completed quest id exists in fail condition + return true; + } + + if ( + condition.Target.IsItem + && string.Equals( + condition.Target.Item, + completedQuestId, + StringComparison.InvariantCultureIgnoreCase + ) + ) + { + // Not a list, plain string + return true; + } + } + + return false; + }) .ToList(); } @@ -1447,12 +1559,18 @@ public class QuestHelper( foreach (var questToFail in questsToFail) { // Skip failing a quest that has a fail status of something other than success - if (questToFail.Conditions.Fail?.Any(x => x.Status?.Any(status => status != QuestStatusEnum.Success) ?? false) ?? false) + if ( + questToFail.Conditions.Fail?.Any(x => + x.Status?.Any(status => status != QuestStatusEnum.Success) ?? false + ) ?? false + ) { continue; } - var isActiveQuestInPlayerProfile = pmcData.Quests.FirstOrDefault(quest => quest.QId == questToFail.Id); + var isActiveQuestInPlayerProfile = pmcData.Quests.FirstOrDefault(quest => + quest.QId == questToFail.Id + ); if (isActiveQuestInPlayerProfile is not null) { if (isActiveQuestInPlayerProfile.Status != QuestStatusEnum.Fail) @@ -1461,7 +1579,7 @@ public class QuestHelper( { Action = "QuestFail", QuestId = questToFail.Id, - RemoveExcessItems = true + RemoveExcessItems = true, }; FailQuest(pmcData, failBody, sessionID, output); } @@ -1478,13 +1596,12 @@ public class QuestHelper( statusTimers[QuestStatusEnum.Fail] = _timeUtil.GetTimeStamp(); var questData = new QuestStatus - { - QId = questToFail.Id, - StartTime = _timeUtil.GetTimeStamp(), - StatusTimers = statusTimers, - Status = QuestStatusEnum.Fail - } - ; + { + QId = questToFail.Id, + StartTime = _timeUtil.GetTimeStamp(), + StatusTimers = statusTimers, + Status = QuestStatusEnum.Fail, + }; pmcData.Quests.Add(questData); } } @@ -1512,7 +1629,7 @@ public class QuestHelper( MessageType.QuestSuccess, quest.SuccessMessageText, questRewards, - _timeUtil.GetHoursAsSeconds((int) GetMailItemRedeemTimeHoursForProfile(pmcData)) + _timeUtil.GetHoursAsSeconds((int)GetMailItemRedeemTimeHoursForProfile(pmcData)) ); } @@ -1522,20 +1639,29 @@ public class QuestHelper( * @param quests Quests to look for wait conditions in * @param completedQuestId Quest just completed */ - protected void AddTimeLockedQuestsToProfile(PmcData pmcData, List quests, string completedQuestId) + protected void AddTimeLockedQuestsToProfile( + PmcData pmcData, + List quests, + string completedQuestId + ) { // Iterate over quests, look for quests with right criteria foreach (var quest in quests) { // If quest has prereq of completed quest + availableAfter value > 0 (quest has wait time) var nextQuestWaitCondition = quest.Conditions?.AvailableForStart?.FirstOrDefault(x => - ((x.Target?.List?.Contains(completedQuestId) ?? false) || (x.Target?.Item?.Contains(completedQuestId) ?? false)) && x.AvailableAfter > 0 + ( + (x.Target?.List?.Contains(completedQuestId) ?? false) + || (x.Target?.Item?.Contains(completedQuestId) ?? false) + ) + && x.AvailableAfter > 0 ); // as we have to use the ListOrT type now, check both List and Item for the above checks if (nextQuestWaitCondition is not null) { // Now + wait time - var availableAfterTimestamp = _timeUtil.GetTimeStamp() + nextQuestWaitCondition.AvailableAfter; + var availableAfterTimestamp = + _timeUtil.GetTimeStamp() + nextQuestWaitCondition.AvailableAfter; // Update quest in profile with status of AvailableAfter var existingQuestInProfile = pmcData.Quests.FirstOrDefault(x => x.QId == quest.Id); @@ -1557,9 +1683,9 @@ public class QuestHelper( Status = QuestStatusEnum.AvailableAfter, StatusTimers = new Dictionary { - { QuestStatusEnum.AvailableAfter, _timeUtil.GetTimeStamp() } + { QuestStatusEnum.AvailableAfter, _timeUtil.GetTimeStamp() }, }, - AvailableAfter = availableAfterTimestamp + AvailableAfter = availableAfterTimestamp, } ); } @@ -1574,17 +1700,15 @@ public class QuestHelper( protected void RemoveQuestFromScavProfile(string sessionId, string questIdToRemove) { var fullProfile = _profileHelper.GetFullProfile(sessionId); - var repeatableInScavProfile = fullProfile.CharacterData.ScavData.Quests?.FirstOrDefault(x => x.QId == questIdToRemove); + var repeatableInScavProfile = fullProfile.CharacterData.ScavData.Quests?.FirstOrDefault(x => + x.QId == questIdToRemove + ); if (repeatableInScavProfile is null) { _logger.Warning( _localisationService.GetText( "quest-unable_to_remove_scav_quest_from_profile", - new - { - scavQuestId = questIdToRemove, - profileId = sessionId - } + new { scavQuestId = questIdToRemove, profileId = sessionId } ) ); @@ -1629,18 +1753,20 @@ public class QuestHelper( protected bool PlayerLevelFulfillsQuestRequirement(Quest quest, double playerLevel) { if (quest.Conditions is null) - // No conditions + // No conditions { return true; } - var levelConditions = _questConditionHelper.GetLevelConditions(quest.Conditions.AvailableForStart); + var levelConditions = _questConditionHelper.GetLevelConditions( + quest.Conditions.AvailableForStart + ); if (levelConditions is not null) { foreach (var levelCondition in levelConditions) { if (!DoesPlayerLevelFulfilCondition(playerLevel, levelCondition)) - // Not valid, exit out + // Not valid, exit out { return false; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/QuestRewardHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/QuestRewardHelper.cs index a6a6f9a4..b2562bf2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/QuestRewardHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/QuestRewardHelper.cs @@ -38,12 +38,8 @@ public class QuestRewardHelper( /// Value can be modified by modders by overriding this value with new traders. /// Ensure to add Lightkeeper's ID (638f541a29ffd1183d187f57) and BTR Driver's ID (656f0f98d80a697f855d34b1) /// - protected string[] InGameTraders = - [ - Traders.LIGHTHOUSEKEEPER, - Traders.BTR - ]; - + protected string[] InGameTraders = [Traders.LIGHTHOUSEKEEPER, Traders.BTR]; + /// /// Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned /// SKIP quests completed in-game @@ -54,8 +50,13 @@ public class QuestRewardHelper( /// Session id /// Response to send back to client /// Array of reward items player was given - public IEnumerable ApplyQuestReward(PmcData profileData, string questId, QuestStatusEnum state, string sessionId, - ItemEventRouterResponse questResponse) + public IEnumerable ApplyQuestReward( + PmcData profileData, + string questId, + QuestStatusEnum state, + string sessionId, + ItemEventRouterResponse questResponse + ) { // Repeatable quest base data is always in PMCProfile, `profileData` may be scav profile // TODO: Move repeatable quest data to profile-agnostic location @@ -71,7 +72,12 @@ public class QuestRewardHelper( var questDetails = GetQuestFromDb(questId, pmcProfile); if (questDetails is null) { - _logger.Warning(_localisationService.GetText("quest-unable_to_find_quest_in_db_no_quest_rewards", questId)); + _logger.Warning( + _localisationService.GetText( + "quest-unable_to_find_quest_in_db_no_quest_rewards", + questId + ) + ); return []; } @@ -129,7 +135,10 @@ public class QuestRewardHelper( } // Group daily/weekly/scav repeatable subtypes into one collection and find first that matched desired quest id - return pmcData.RepeatableQuests?.SelectMany(repeatableQuestSubType => repeatableQuestSubType.ActiveQuests) + return pmcData + .RepeatableQuests?.SelectMany(repeatableQuestSubType => + repeatableQuestSubType.ActiveQuests + ) .FirstOrDefault(repeatableQuest => repeatableQuest.Id == questId); } @@ -141,25 +150,31 @@ public class QuestRewardHelper( protected double GetQuestMoneyRewardBonusMultiplier(PmcData pmcData) { // Check player has intel center - var moneyRewardBonuses = pmcData.Bonuses.Where(bonus => bonus.Type == BonusType.QuestMoneyReward); + var moneyRewardBonuses = pmcData.Bonuses.Where(bonus => + bonus.Type == BonusType.QuestMoneyReward + ); // Get a total of the quest money reward percent bonuses - var moneyRewardBonusPercent = moneyRewardBonuses.Aggregate(0D, (accumulate, bonus) => accumulate + bonus.Value ?? 0); + var moneyRewardBonusPercent = moneyRewardBonuses.Aggregate( + 0D, + (accumulate, bonus) => accumulate + bonus.Value ?? 0 + ); // Calculate hideout management bonus as a percentage (up to 51% bonus) - var hideoutManagementSkill = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.HideoutManagement); + var hideoutManagementSkill = _profileHelper.GetSkillFromProfile( + pmcData, + SkillTypes.HideoutManagement + ); // 5100 becomes 0.51, add 1 to it, 1.51 // We multiply the money reward bonuses by the hideout management skill multiplier, giving the new result - var hideoutManagementBonusMultiplier = hideoutManagementSkill != null - ? 2 + hideoutManagementSkill.Progress / 1000 - : 1; + var hideoutManagementBonusMultiplier = + hideoutManagementSkill != null ? 2 + hideoutManagementSkill.Progress / 1000 : 1; // e.g 15% * 1.4 return moneyRewardBonusPercent + hideoutManagementBonusMultiplier ?? 1; } - /// /// Adjust a quests money rewards by supplied multiplier /// @@ -176,12 +191,12 @@ public class QuestRewardHelper( } // Grab just the money rewards from quest reward pool - var moneyRewards = clonedQuest.Rewards.Success - .Where(reward => - reward.Type == RewardType.Item && - reward.Items != null && reward.Items.Count > 0 && - _paymentHelper.IsMoneyTpl(reward.Items.FirstOrDefault().Template) - ); + var moneyRewards = clonedQuest.Rewards.Success.Where(reward => + reward.Type == RewardType.Item + && reward.Items != null + && reward.Items.Count > 0 + && _paymentHelper.IsMoneyTpl(reward.Items.FirstOrDefault().Template) + ); foreach (var moneyReward in moneyRewards) { @@ -189,12 +204,16 @@ public class QuestRewardHelper( var rewardItem = moneyReward.Items?.FirstOrDefault(); if (rewardItem is null) { - _logger.Error($"Unable to apply money reward bonus to quest: {quest.Name} as no money item found"); + _logger.Error( + $"Unable to apply money reward bonus to quest: {quest.Name} as no money item found" + ); continue; } - var newCurrencyAmount = Math.Floor((rewardItem.Upd.StackObjectsCount ?? 0) * (1 + (bonusPercent / 100))); + var newCurrencyAmount = Math.Floor( + (rewardItem.Upd.StackObjectsCount ?? 0) * (1 + (bonusPercent / 100)) + ); rewardItem.Upd.StackObjectsCount = newCurrencyAmount; moneyReward.Value = newCurrencyAmount; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairHelper.cs index 115bc5b7..07ceebea 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairHelper.cs @@ -59,16 +59,14 @@ public class RagfairHelper( if (!string.IsNullOrEmpty(request.LinkedSearchId)) { var data = ragfairLinkedItemService.GetLinkedItems(request.LinkedSearchId); - result = [..data]; + result = [.. data]; } // Case: category if (!string.IsNullOrEmpty(request.HandbookId)) { var handbook = GetCategoryList(request.HandbookId); - result = result?.Count > 0 - ? utilityHelper.ArrayIntersect(result, handbook) - : handbook; + result = result?.Count > 0 ? utilityHelper.ArrayIntersect(result, handbook) : handbook; } return result; @@ -77,9 +75,11 @@ public class RagfairHelper( public Dictionary GetDisplayableAssorts(string sessionId) { var result = new Dictionary(); - foreach (var traderId in databaseService.GetTraders() - .Keys - .Where(traderId => _ragfairConfig.Traders.ContainsKey(traderId))) + foreach ( + var traderId in databaseService + .GetTraders() + .Keys.Where(traderId => _ragfairConfig.Traders.ContainsKey(traderId)) + ) { result[traderId] = traderAssortHelper.GetAssort(sessionId, traderId, true); } @@ -98,7 +98,7 @@ public class RagfairHelper( { foreach (var subCategory in handbookHelper.ChildrenCategories(category)) { - result = [..result, ..handbookHelper.TemplatesWithParent(subCategory)]; + result = [.. result, .. handbookHelper.TemplatesWithParent(subCategory)]; } } @@ -111,8 +111,13 @@ public class RagfairHelper( // list all item of the category result = handbookHelper.TemplatesWithParent(handbookId); - return handbookHelper.ChildrenCategories(handbookId) - .Aggregate(result, (current, category) => [..current, ..handbookHelper.TemplatesWithParent(category)]); + return handbookHelper + .ChildrenCategories(handbookId) + .Aggregate( + result, + (current, category) => + [.. current, .. handbookHelper.TemplatesWithParent(category)] + ); } // It's a specific item searched @@ -154,7 +159,7 @@ public class RagfairHelper( } } - return [rootItem, ..list]; + return [rootItem, .. list]; } /** @@ -169,7 +174,7 @@ public class RagfairHelper( { Money.EUROS => "€", Money.DOLLARS => "$", - _ => "₽" + _ => "₽", }; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairOfferHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairOfferHelper.cs index c177ad52..a6192fcc 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairOfferHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairOfferHelper.cs @@ -38,7 +38,8 @@ public class RagfairOfferHelper( RagfairRequiredItemsService _ragfairRequiredItemsService, ProfileHelper _profileHelper, EventOutputHolder _eventOutputHolder, - ConfigServer _configServer) + ConfigServer _configServer +) { protected const string _goodSoldTemplate = "5bdabfb886f7743e152e867e 0"; // Your {soldItem} {itemCount} items were bought by {buyerNickname}. @@ -58,47 +59,48 @@ public class RagfairOfferHelper( SearchRequestData searchRequest, List itemsToAdd, Dictionary traderAssorts, - PmcData pmcData) + PmcData pmcData + ) { var playerIsFleaBanned = _profileHelper.PlayerIsFleaBanned(pmcData); var tieredFlea = _ragfairConfig.TieredFlea; var tieredFleaLimitTypes = tieredFlea.UnlocksType; - return _ragfairOfferService.GetOffers() + return _ragfairOfferService + .GetOffers() .Where(offer => + { + if (!PassesSearchFilterCriteria(searchRequest, offer, pmcData)) { - if (!PassesSearchFilterCriteria(searchRequest, offer, pmcData)) - { - return false; - } - - var isDisplayable = IsDisplayableOffer( - searchRequest, - itemsToAdd, - traderAssorts, - offer, - pmcData, - playerIsFleaBanned - ); - - if (!isDisplayable) - { - return false; - } - - // Not trader offer + tiered flea enabled - if (tieredFlea.Enabled && !OfferIsFromTrader(offer)) - { - CheckAndLockOfferFromPlayerTieredFlea( - tieredFlea, - offer, - tieredFleaLimitTypes.Keys.ToList(), - pmcData.Info.Level.Value - ); - } - - return true; + return false; } - ) + + var isDisplayable = IsDisplayableOffer( + searchRequest, + itemsToAdd, + traderAssorts, + offer, + pmcData, + playerIsFleaBanned + ); + + if (!isDisplayable) + { + return false; + } + + // Not trader offer + tiered flea enabled + if (tieredFlea.Enabled && !OfferIsFromTrader(offer)) + { + CheckAndLockOfferFromPlayerTieredFlea( + tieredFlea, + offer, + tieredFleaLimitTypes.Keys.ToList(), + pmcData.Info.Level.Value + ); + } + + return true; + }) .ToList(); } @@ -113,15 +115,22 @@ public class RagfairOfferHelper( TieredFlea tieredFlea, RagfairOffer offer, List tieredFleaLimitTypes, - int playerLevel) + int playerLevel + ) { var offerItemTpl = offer.Items.FirstOrDefault().Template; // Check if offer item is ammo - if (tieredFlea.AmmoTplUnlocks is not null && _itemHelper.IsOfBaseclass(offerItemTpl, BaseClasses.AMMO)) + if ( + tieredFlea.AmmoTplUnlocks is not null + && _itemHelper.IsOfBaseclass(offerItemTpl, BaseClasses.AMMO) + ) { // Check if ammo is flagged with a level requirement - if (tieredFlea.AmmoTplUnlocks.TryGetValue(offerItemTpl, out var unlockLevel) && playerLevel < unlockLevel) + if ( + tieredFlea.AmmoTplUnlocks.TryGetValue(offerItemTpl, out var unlockLevel) + && playerLevel < unlockLevel + ) { // Lock the offer if player's level is below the ammo's unlock requirement offer.Locked = true; @@ -149,9 +158,11 @@ public class RagfairOfferHelper( } // Check if the item belongs to any restricted type and if player level is insufficient - if (tieredFleaLimitTypes - .Where(tieredItemType => _itemHelper.IsOfBaseclass(offerItemTpl, tieredItemType)) - .Any(tieredItemType => playerLevel < tieredFlea.UnlocksType[tieredItemType])) + if ( + tieredFleaLimitTypes + .Where(tieredItemType => _itemHelper.IsOfBaseclass(offerItemTpl, tieredItemType)) + .Any(tieredItemType => playerLevel < tieredFlea.UnlocksType[tieredItemType]) + ) { // Players level is below matching types requirement, flag as locked offer.Locked = true; @@ -165,18 +176,25 @@ public class RagfairOfferHelper( /// Search request from client /// Player profile /// Matching RagfairOffer objects - public List GetOffersThatRequireItem(SearchRequestData searchRequest, PmcData pmcData) + public List GetOffersThatRequireItem( + SearchRequestData searchRequest, + PmcData pmcData + ) { // Get all offers that require the desired item and filter out offers from non traders if player below ragfair unlock - var offerIDsForItem = _ragfairRequiredItemsService.GetRequiredOffersById(searchRequest.NeededSearchId); + var offerIDsForItem = _ragfairRequiredItemsService.GetRequiredOffersById( + searchRequest.NeededSearchId + ); var tieredFlea = _ragfairConfig.TieredFlea; var tieredFleaLimitTypes = tieredFlea.UnlocksType; var result = new List(); - foreach (var offer in offerIDsForItem - .Select(_ragfairOfferService.GetOfferByOfferId) - .Where(offer => PassesSearchFilterCriteria(searchRequest, offer, pmcData))) + foreach ( + var offer in offerIDsForItem + .Select(_ragfairOfferService.GetOfferByOfferId) + .Where(offer => PassesSearchFilterCriteria(searchRequest, offer, pmcData)) + ) { if (tieredFlea.Enabled && !OfferIsFromTrader(offer)) { @@ -206,7 +224,8 @@ public class RagfairOfferHelper( SearchRequestData searchRequest, List itemsToAdd, Dictionary traderAssorts, - PmcData pmcData) + PmcData pmcData + ) { var offersMap = new Dictionary>(); var offersToReturn = new List(); @@ -218,7 +237,7 @@ public class RagfairOfferHelper( { var matchingOffers = _ragfairOfferService.GetOffersOfType(desiredItemTpl.Key); if (matchingOffers is null) - // No offers found for this item, skip + // No offers found for this item, skip { continue; } @@ -316,7 +335,9 @@ public class RagfairOfferHelper( var lockedOffers = GetLoyaltyLockedOffers(possibleOffers, pmcData); // Exclude locked offers + above loyalty locked offers if at least 1 was found - offersToSort = possibleOffers.Where(offer => !(offer.Locked.GetValueOrDefault(false) || lockedOffers.Contains(offer.Id)) + offersToSort = possibleOffers + .Where(offer => + !(offer.Locked.GetValueOrDefault(false) || lockedOffers.Contains(offer.Id)) ) .ToList(); @@ -342,9 +363,14 @@ public class RagfairOfferHelper( /// Player profile /// Player cannot view flea yet/ever /// True = should be shown to player - private bool IsDisplayableOffer(SearchRequestData searchRequest, List itemsToAdd, - Dictionary traderAssorts, RagfairOffer offer, PmcData pmcProfile, - bool playerIsFleaBanned = false) + private bool IsDisplayableOffer( + SearchRequestData searchRequest, + List itemsToAdd, + Dictionary traderAssorts, + RagfairOffer offer, + PmcData pmcProfile, + bool playerIsFleaBanned = false + ) { var offerRootItem = offer.Items.FirstOrDefault(); @@ -359,15 +385,17 @@ public class RagfairOfferHelper( // Offer root items tpl not in searched for array if (!itemsToAdd.Contains(offerRootItem.Template)) - // skip items we shouldn't include + // skip items we shouldn't include { return false; } // Performing a required search and offer doesn't have requirement for item if ( - !string.IsNullOrEmpty(searchRequest.NeededSearchId) && - !offer.Requirements.Any(requirement => requirement.Template == searchRequest.NeededSearchId) + !string.IsNullOrEmpty(searchRequest.NeededSearchId) + && !offer.Requirements.Any(requirement => + requirement.Template == searchRequest.NeededSearchId + ) ) { return false; @@ -375,23 +403,28 @@ public class RagfairOfferHelper( // Weapon/equipment search + offer is preset if ( - searchRequest.BuildItems.Count == 0 && // Prevent equipment loadout searches filtering out presets - searchRequest.BuildCount.GetValueOrDefault(0) > 0 && - _presetHelper.HasPreset(offerRootItem.Template)) + searchRequest.BuildItems.Count == 0 + && // Prevent equipment loadout searches filtering out presets + searchRequest.BuildCount.GetValueOrDefault(0) > 0 + && _presetHelper.HasPreset(offerRootItem.Template) + ) { return false; } // commented out as required search "which is for checking offers that are barters" // has info.removeBartering as true, this if statement removed barter items. - if (searchRequest.RemoveBartering.GetValueOrDefault(false) && !_paymentHelper.IsMoneyTpl(moneyTypeTpl)) - // Don't include barter offers + if ( + searchRequest.RemoveBartering.GetValueOrDefault(false) + && !_paymentHelper.IsMoneyTpl(moneyTypeTpl) + ) + // Don't include barter offers { return false; } if (offer.RequirementsCost is null) - // Don't include offers with undefined or NaN in it + // Don't include offers with undefined or NaN in it { return false; } @@ -402,20 +435,19 @@ public class RagfairOfferHelper( if (isTraderOffer) { if (!traderAssorts.ContainsKey(offer.User.Id)) - // trader not visible on flea market + // trader not visible on flea market { return false; } if ( - !traderAssorts[offer.User.Id] - .Items.Any(item => - { - return item.Id == offer.Root; - } - ) - ) - // skip (quest) locked items + !traderAssorts[offer.User.Id] + .Items.Any(item => + { + return item.Id == offer.Root; + }) + ) + // skip (quest) locked items { return false; } @@ -429,27 +461,29 @@ public class RagfairOfferHelper( /// /// offers to process /// Offers - protected List GetOffersInsideBuyRestrictionLimits(List possibleOffers) + protected List GetOffersInsideBuyRestrictionLimits( + List possibleOffers + ) { // Check offer has buy limit + is from trader + current buy count is at or over max - return possibleOffers.Where(offer => + return possibleOffers + .Where(offer => + { + if ( + offer.BuyRestrictionMax is null + && OfferIsFromTrader(offer) + && offer.BuyRestrictionCurrent >= offer.BuyRestrictionMax + ) { - if ( - offer.BuyRestrictionMax is null && - OfferIsFromTrader(offer) && - offer.BuyRestrictionCurrent >= offer.BuyRestrictionMax - ) + if (offer.BuyRestrictionCurrent >= offer.BuyRestrictionMax) { - if (offer.BuyRestrictionCurrent >= offer.BuyRestrictionMax) - { - return false; - } + return false; } - - // Doesnt have buy limits, retrun offer - return true; } - ) + + // Doesnt have buy limits, retrun offer + return true; + }) .ToList(); } @@ -479,7 +513,10 @@ public class RagfairOfferHelper( /// Offer to check is quest locked /// all trader assorts for player /// true if quest locked - public bool TraderOfferItemQuestLocked(RagfairOffer offer, Dictionary traderAssorts) + public bool TraderOfferItemQuestLocked( + RagfairOffer offer, + Dictionary traderAssorts + ) { var itemIds = offer.Items.Select(x => x.Id).ToHashSet(); //foreach (var item in offer.Items) @@ -500,13 +537,17 @@ public class RagfairOfferHelper( foreach (var _ in offer.Items) { traderAssorts.TryGetValue(offer.User.Id, out var assorts); - if (assorts.BarterScheme - .Where(x => itemIds.Contains(x.Key)) - .Any(barterKvP => barterKvP.Value - .Any(subBarter => subBarter - .Any(subBarter => subBarter.SptQuestLocked.GetValueOrDefault(false)) + if ( + assorts + .BarterScheme.Where(x => itemIds.Contains(x.Key)) + .Any(barterKvP => + barterKvP.Value.Any(subBarter => + subBarter.Any(subBarter => + subBarter.SptQuestLocked.GetValueOrDefault(false) + ) + ) ) - )) + ) { return true; } @@ -546,23 +587,26 @@ public class RagfairOfferHelper( { // No trader assort data _logger.Warning( - $"Unable to find trader: " + - $"${offer.User.Nickname}assort for item: {_itemHelper.GetItemName(offer.Items[0].Template)} " + - $"{offer.Items[0].Template}, cannot check if buy restriction reached" + $"Unable to find trader: " + + $"${offer.User.Nickname}assort for item: {_itemHelper.GetItemName(offer.Items[0].Template)} " + + $"{offer.Items[0].Template}, cannot check if buy restriction reached" ); return false; } if (assortData.Upd is null) - // No Upd = no chance of limits + // No Upd = no chance of limits { return false; } // No restriction values // Can't use !assortData.upd.BuyRestrictionX as value could be 0 - if (assortData.Upd.BuyRestrictionMax is null || assortData.Upd.BuyRestrictionCurrent is null) + if ( + assortData.Upd.BuyRestrictionMax is null + || assortData.Upd.BuyRestrictionCurrent is null + ) { return false; } @@ -581,8 +625,10 @@ public class RagfairOfferHelper( var loyaltyLockedOffers = new HashSet(); foreach (var offer in offers.Where(offer => OfferIsFromTrader(offer))) { - if (pmcProfile.TradersInfo.TryGetValue(offer.User.Id, out var traderDetails) && - traderDetails.LoyaltyLevel < offer.LoyaltyLevel) + if ( + pmcProfile.TradersInfo.TryGetValue(offer.User.Id, out var traderDetails) + && traderDetails.LoyaltyLevel < offer.LoyaltyLevel + ) { loyaltyLockedOffers.Add(offer.Id); } @@ -611,7 +657,11 @@ public class RagfairOfferHelper( for (var index = profileOffers.Count - 1; index >= 0; index--) { var offer = profileOffers[index]; - if (offer.SellResults is null || offer.SellResults.Count == 0 || currentTimestamp < offer.SellResults.FirstOrDefault()?.SellTime) + if ( + offer.SellResults is null + || offer.SellResults.Count == 0 + || currentTimestamp < offer.SellResults.FirstOrDefault()?.SellTime + ) { // Not sold / too early to check continue; @@ -637,10 +687,13 @@ public class RagfairOfferHelper( } var ratingToAdd = offer.SummaryCost / totalItemsCount * boughtAmount; - IncreaseProfileRagfairRating(_profileHelper.GetFullProfile(sessionId), ratingToAdd.Value); + IncreaseProfileRagfairRating( + _profileHelper.GetFullProfile(sessionId), + ratingToAdd.Value + ); // Remove the sell result object now it has been processed - offer.SellResults.Remove(firstSellResult); + offer.SellResults.Remove(firstSellResult); // Can delete offer object, must run last CompleteOffer(sessionId, offer, boughtAmount); @@ -656,7 +709,9 @@ public class RagfairOfferHelper( /// Total stack count public double GetTotalStackCountSize(List> itemsInInventoryToSumStackCount) { - return itemsInInventoryToSumStackCount.Sum(itemAndChildren => itemAndChildren.FirstOrDefault()?.Upd?.StackObjectsCount.GetValueOrDefault(1) ?? 1); + return itemsInInventoryToSumStackCount.Sum(itemAndChildren => + itemAndChildren.FirstOrDefault()?.Upd?.StackObjectsCount.GetValueOrDefault(1) ?? 1 + ); } /// @@ -671,15 +726,17 @@ public class RagfairOfferHelper( profile.CharacterData.PmcData.RagfairInfo.IsRatingGrowing = true; if (amountToIncrementBy is null) { - _logger.Warning($"Unable to increment ragfair rating, value was not a number: {amountToIncrementBy}"); + _logger.Warning( + $"Unable to increment ragfair rating, value was not a number: {amountToIncrementBy}" + ); return; } profile.CharacterData.PmcData.RagfairInfo.Rating += - ragfairGlobalsConfig.RatingIncreaseCount / - ragfairGlobalsConfig.RatingSumForIncrease * - amountToIncrementBy; + ragfairGlobalsConfig.RatingIncreaseCount + / ragfairGlobalsConfig.RatingSumForIncrease + * amountToIncrementBy; } /// @@ -710,7 +767,9 @@ public class RagfairOfferHelper( var offerIndex = profileRagfairInfo.Offers.FindIndex(o => o.Id == offerId); if (offerIndex == -1) { - _logger.Warning($"Unable to find offer: {offerId} in profile: {sessionId}, unable to delete"); + _logger.Warning( + $"Unable to find offer: {offerId} in profile: {sessionId}, unable to delete" + ); } if (offerIndex >= 0) @@ -718,7 +777,6 @@ public class RagfairOfferHelper( profileRagfairInfo.Offers.Splice(offerIndex, 1); } - // Also delete from ragfair _ragfairOfferService.RemoveOfferById(offerId); } @@ -730,7 +788,11 @@ public class RagfairOfferHelper( /// Sold offer details /// Amount item was purchased for /// ItemEventRouterResponse - public ItemEventRouterResponse CompleteOffer(string offerOwnerSessionId, RagfairOffer offer, int boughtAmount) + public ItemEventRouterResponse CompleteOffer( + string offerOwnerSessionId, + RagfairOffer offer, + int boughtAmount + ) { // Pack or ALL items of a multi-offer were bought - remove entire offer if (offer.SellInOnePiece.GetValueOrDefault(false) || boughtAmount == offer.Quantity) @@ -756,19 +818,13 @@ public class RagfairOfferHelper( { Id = _hashUtil.Generate(), Template = requirement.Template, - Upd = new Upd - { - StackObjectsCount = requirement.Count * boughtAmount - } + Upd = new Upd { StackObjectsCount = requirement.Count * boughtAmount }, }; var stacks = _itemHelper.SplitStack(requestedItem); foreach (var item in stacks) { - var outItems = new List - { - item - }; + var outItems = new List { item }; // TODO - is this code used?, may have been when adding barters to flea was still possible for player if (requirement.OnlyFunctional.GetValueOrDefault(false)) @@ -789,11 +845,15 @@ public class RagfairOfferHelper( OfferId = offer.Id, // pack-offers NEED to be the full item count, // otherwise it only removes 1 from the pack, leaving phantom offer on client ui - Count = offer.SellInOnePiece.GetValueOrDefault(false) ? offerStackCount.Value : boughtAmount, - HandbookId = itemTpl + Count = offer.SellInOnePiece.GetValueOrDefault(false) + ? offerStackCount.Value + : boughtAmount, + HandbookId = itemTpl, }; - var storageTimeSeconds = _timeUtil.GetHoursAsSeconds((int) _questHelper.GetMailItemRedeemTimeHoursForProfile(sellerProfile)); + var storageTimeSeconds = _timeUtil.GetHoursAsSeconds( + (int)_questHelper.GetMailItemRedeemTimeHoursForProfile(sellerProfile) + ); _mailSendService.SendDirectNpcMessageToPlayer( offerOwnerSessionId, Traders.RAGMAN, @@ -825,7 +885,10 @@ public class RagfairOfferHelper( if (!globalLocales.TryGetValue(_goodSoldTemplate, out var soldMessageLocaleGuid)) { _logger.Error( - _localisationService.GetText("ragfair-unable_to_find_locale_by_key", _goodSoldTemplate) + _localisationService.GetText( + "ragfair-unable_to_find_locale_by_key", + _goodSoldTemplate + ) ); } @@ -837,7 +900,7 @@ public class RagfairOfferHelper( { SoldItem = hasKey ? value : itemTpl, BuyerNickname = _botHelper.GetPmcNicknameOfMaxLength(_botConfig.BotNameLengthLimit), - ItemCount = boughtAmount + ItemCount = boughtAmount, }; // Node searches for anything inside {property}: e.g.: "Your {soldItem} {itemCount} items were bought by {buyerNickname}." @@ -847,8 +910,14 @@ public class RagfairOfferHelper( // Seems to be much simpler just replacing each key like this. soldMessageLocaleGuid = soldMessageLocaleGuid.Replace("{soldItem}", tplVars.SoldItem); - soldMessageLocaleGuid = soldMessageLocaleGuid.Replace("{itemCount}", tplVars.ItemCount.ToString()); - soldMessageLocaleGuid = soldMessageLocaleGuid.Replace("{buyerNickname}", tplVars.BuyerNickname); + soldMessageLocaleGuid = soldMessageLocaleGuid.Replace( + "{itemCount}", + tplVars.ItemCount.ToString() + ); + soldMessageLocaleGuid = soldMessageLocaleGuid.Replace( + "{buyerNickname}", + tplVars.BuyerNickname + ); return soldMessageLocaleGuid; } @@ -859,54 +928,70 @@ public class RagfairOfferHelper( * @param pmcData Player profile * @returns True if offer passes criteria */ - protected bool PassesSearchFilterCriteria(SearchRequestData searchRequest, RagfairOffer offer, PmcData pmcData) + protected bool PassesSearchFilterCriteria( + SearchRequestData searchRequest, + RagfairOffer offer, + PmcData pmcData + ) { var isDefaultUserOffer = offer.User.MemberType == MemberCategory.Default; var offerRootItem = offer.Items[0]; var offerMoneyTypeTpl = offer.Requirements[0].Template; var isTraderOffer = OfferIsFromTrader(offer); - if (pmcData.Info.Level < _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel && isDefaultUserOffer) - // Skip item if player is < global unlock level (default is 15) and item is from a dynamically generated source + if ( + pmcData.Info.Level < _databaseService.GetGlobals().Configuration.RagFair.MinUserLevel + && isDefaultUserOffer + ) + // Skip item if player is < global unlock level (default is 15) and item is from a dynamically generated source { return false; } if (searchRequest.OfferOwnerType == OfferOwnerType.TRADEROWNERTYPE && !isTraderOffer) - // don't include player offers + // don't include player offers { return false; } if (searchRequest.OfferOwnerType == OfferOwnerType.PLAYEROWNERTYPE && isTraderOffer) - // don't include trader offers + // don't include trader offers { return false; } if ( - searchRequest.OneHourExpiration.GetValueOrDefault(false) && - offer.EndTime - _timeUtil.GetTimeStamp() > TimeUtil.OneHourAsSeconds - ) - // offer expires within an hour + searchRequest.OneHourExpiration.GetValueOrDefault(false) + && offer.EndTime - _timeUtil.GetTimeStamp() > TimeUtil.OneHourAsSeconds + ) + // offer expires within an hour { return false; } - if (searchRequest.QuantityFrom > 0 && offerRootItem.Upd.StackObjectsCount < searchRequest.QuantityFrom) - // too little items to offer + if ( + searchRequest.QuantityFrom > 0 + && offerRootItem.Upd.StackObjectsCount < searchRequest.QuantityFrom + ) + // too little items to offer { return false; } - if (searchRequest.QuantityTo > 0 && offerRootItem.Upd.StackObjectsCount > searchRequest.QuantityTo) - // Too many items to offer + if ( + searchRequest.QuantityTo > 0 + && offerRootItem.Upd.StackObjectsCount > searchRequest.QuantityTo + ) + // Too many items to offer { return false; } - if (searchRequest.OnlyFunctional.GetValueOrDefault(false) && !IsItemFunctional(offerRootItem, offer)) - // Don't include non-functional items + if ( + searchRequest.OnlyFunctional.GetValueOrDefault(false) + && !IsItemFunctional(offerRootItem, offer) + ) + // Don't include non-functional items { return false; } @@ -916,8 +1001,12 @@ public class RagfairOfferHelper( // Counts quality % using the offer items current durability compared to its possible max, not current max // Single item if ( - IsConditionItem(offerRootItem) && - !ItemQualityInRange(offerRootItem, searchRequest.ConditionFrom.Value, searchRequest.ConditionTo.Value) + IsConditionItem(offerRootItem) + && !ItemQualityInRange( + offerRootItem, + searchRequest.ConditionFrom.Value, + searchRequest.ConditionTo.Value + ) ) { return false; @@ -941,20 +1030,20 @@ public class RagfairOfferHelper( { // Use 'currencies' as mapping for the money choice dropdown, e.g. 0 = all, 2 = "USD; if (!_currencies.Contains(_ragfairHelper.GetCurrencyTag(offerMoneyTypeTpl))) - // Don't include item paid in wrong currency + // Don't include item paid in wrong currency { return false; } } if (searchRequest.PriceFrom > 0 && searchRequest.PriceFrom >= offer.RequirementsCost) - // price is too low + // price is too low { return false; } if (searchRequest.PriceTo > 0 && searchRequest.PriceTo <= offer.RequirementsCost) - // price is too high + // price is too high { return false; } @@ -981,8 +1070,8 @@ public class RagfairOfferHelper( if (_itemHelper.ArmorItemCanHoldMods(offerRootItem.Template)) { var offerRootTemplate = _itemHelper.GetItem(offerRootItem.Template).Value; - var requiredPlateCount = offerRootTemplate.Properties.Slots - ?.Where(item => item.Required.GetValueOrDefault(false)) + var requiredPlateCount = offerRootTemplate + .Properties.Slots?.Where(item => item.Required.GetValueOrDefault(false)) ?.Count(); return offer.Items.Count > requiredPlateCount; @@ -1006,12 +1095,12 @@ public class RagfairOfferHelper( return false; } - return item.Upd.MedKit is not null || - item.Upd.Repairable is not null || - item.Upd.Resource is not null || - item.Upd.FoodDrink is not null || - item.Upd.Key is not null || - item.Upd.RepairKit is not null; + return item.Upd.MedKit is not null + || item.Upd.Repairable is not null + || item.Upd.Resource is not null + || item.Upd.FoodDrink is not null + || item.Upd.Key is not null + || item.Upd.RepairKit is not null; } /// @@ -1025,13 +1114,13 @@ public class RagfairOfferHelper( { var itemQualityPercentage = 100 * _itemHelper.GetItemQualityModifier(item); if (min > 0 && min > itemQualityPercentage) - // Item condition too low + // Item condition too low { return false; } if (max < 100 && max <= itemQualityPercentage) - // Item condition too high + // Item condition too high { return false; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs index 59e1da89..11bf2bf9 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs @@ -15,7 +15,8 @@ public class RagfairSellHelper( TimeUtil _timeUtil, RandomUtil _randomUtil, DatabaseService _databaseService, - ConfigServer _configServer) + ConfigServer _configServer +) { protected RagfairConfig _ragfairConfig = _configServer.GetConfig(); @@ -29,7 +30,8 @@ public class RagfairSellHelper( public double CalculateSellChance( double averageOfferPriceRub, double playerListedPriceRub, - double qualityMultiplier) + double qualityMultiplier + ) { var sellConfig = _ragfairConfig.Sell.Chance; @@ -38,7 +40,9 @@ public class RagfairSellHelper( // Modifier gets applied twice to either penalize or incentivize over/under pricing (Probably a cleaner way to do this) var sellModifier = averageOfferPriceRub / playerListedPriceRub * sellConfig.SellMultiplier; - var sellChance = Math.Round(baseSellChancePercent * sellModifier * Math.Pow(sellModifier, 3) + 10); // Power of 3 + var sellChance = Math.Round( + baseSellChancePercent * sellModifier * Math.Pow(sellModifier, 3) + 10 + ); // Power of 3 // Adjust sell chance if below config value if (sellChance < sellConfig.MinSellChancePercent) @@ -62,14 +66,23 @@ public class RagfairSellHelper( /// count of items to sell /// All items listed get sold at once /// List of purchases of item(s) listed - public List RollForSale(double? sellChancePercent, int itemSellCount, bool sellInOneGo = false) + public List RollForSale( + double? sellChancePercent, + int itemSellCount, + bool sellInOneGo = false + ) { var startTimestamp = _timeUtil.GetTimeStamp(); // Get a time in future to stop simulating sell chances at var endTime = - startTimestamp + - _timeUtil.GetHoursAsSeconds((int) _databaseService.GetGlobals().Configuration.RagFair.OfferDurationTimeInHour.Value); + startTimestamp + + _timeUtil.GetHoursAsSeconds( + (int) + _databaseService + .GetGlobals() + .Configuration.RagFair.OfferDurationTimeInHour.Value + ); var sellTimestamp = startTimestamp; var remainingCount = itemSellCount; @@ -80,12 +93,16 @@ public class RagfairSellHelper( if (sellChancePercent is null) { effectiveSellChance = _ragfairConfig.Sell.Chance.Base; - _logger.Warning($"Sell chance was not a number: {sellChancePercent}, defaulting to {_ragfairConfig.Sell.Chance.Base}%"); + _logger.Warning( + $"Sell chance was not a number: {sellChancePercent}, defaulting to {_ragfairConfig.Sell.Chance.Base}%" + ); } if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Rolling to sell: {itemSellCount} item(s) - (chance: {effectiveSellChance}%)"); + _logger.Debug( + $"Rolling to sell: {itemSellCount} item(s) - (chance: {effectiveSellChance}%)" + ); } // No point rolling for a sale on a 0% chance item, exit early @@ -111,25 +128,23 @@ public class RagfairSellHelper( // Sell time will be random between min/max var random = new Random(); - var newSellTime = Math.Floor(random.NextDouble() * (maximumTime.Value - minimumTime) + minimumTime); + var newSellTime = Math.Floor( + random.NextDouble() * (maximumTime.Value - minimumTime) + minimumTime + ); if (newSellTime == 0) - // Ensure all sales don't occur the same exact time + // Ensure all sales don't occur the same exact time { newSellTime += 1; } - sellTimestamp += (long) newSellTime; - result.Add( - new SellResult - { - SellTime = sellTimestamp, - Amount = boughtAmount - } - ); + sellTimestamp += (long)newSellTime; + result.Add(new SellResult { SellTime = sellTimestamp, Amount = boughtAmount }); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Offer will sell at: {_timeUtil.GetDateTimeFromTimeStamp(sellTimestamp).ToLocalTime().ToString()}, bought: {boughtAmount}"); + _logger.Debug( + $"Offer will sell at: {_timeUtil.GetDateTimeFromTimeStamp(sellTimestamp).ToLocalTime().ToString()}, bought: {boughtAmount}" + ); } } else diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs index b46fe977..962b6304 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs @@ -49,7 +49,10 @@ public class RagfairServerHelper( } // Skip bsg blacklisted items - if (blacklistConfig.EnableBsgList && !(itemDetails.Value?.Properties?.CanSellOnRagfair ?? false)) + if ( + blacklistConfig.EnableBsgList + && !(itemDetails.Value?.Properties?.CanSellOnRagfair ?? false) + ) { return false; } @@ -64,8 +67,8 @@ public class RagfairServerHelper( // Skip custom category blacklisted items if ( - blacklistConfig.EnableCustomItemCategoryList && - IsItemCategoryOnCustomFleaBlacklist(itemDetails.Value.Parent) + blacklistConfig.EnableCustomItemCategoryList + && IsItemCategoryOnCustomFleaBlacklist(itemDetails.Value.Parent) ) { return false; @@ -79,9 +82,9 @@ public class RagfairServerHelper( // Don't include damaged ammo packs if ( - ragfairConfig.Dynamic.Blacklist.DamagedAmmoPacks && - itemDetails.Value.Parent == BaseClasses.AMMO_BOX && - itemDetails.Value.Name.Contains("_damaged") + ragfairConfig.Dynamic.Blacklist.DamagedAmmoPacks + && itemDetails.Value.Parent == BaseClasses.AMMO_BOX + && itemDetails.Value.Name.Contains("_damaged") ) { return false; @@ -133,7 +136,12 @@ public class RagfairServerHelper( MessageType.MessageWithItems, goodsReturnedTemplate, returnedItems, - timeUtil.GetHoursAsSeconds((int) databaseService.GetGlobals().Configuration.RagFair.YourOfferDidNotSellMaxStorageTimeInHour) + timeUtil.GetHoursAsSeconds( + (int) + databaseService + .GetGlobals() + .Configuration.RagFair.YourOfferDidNotSellMaxStorageTimeInHour + ) ); } @@ -154,9 +162,13 @@ public class RagfairServerHelper( } // Item Types to return one of - if (isWeaponPreset || - itemHelper.IsOfBaseclasses(itemDetails.Value.Id, ragfairConfig.Dynamic.ShowAsSingleStack) - ) + if ( + isWeaponPreset + || itemHelper.IsOfBaseclasses( + itemDetails.Value.Id, + ragfairConfig.Dynamic.ShowAsSingleStack + ) + ) { return 1; } @@ -171,10 +183,13 @@ public class RagfairServerHelper( } // Get a % to get of stack size - var stackPercent = randomUtil.GetDouble(config.StackablePercent.Min, config.StackablePercent.Max); + var stackPercent = randomUtil.GetDouble( + config.StackablePercent.Min, + config.StackablePercent.Max + ); // Min value to return should be no less than 1 - return Math.Max((int) randomUtil.GetPercentOfValue(stackPercent, maxStackSize, 0), 1); + return Math.Max((int)randomUtil.GetPercentOfValue(stackPercent, maxStackSize, 0), 1); } /** @@ -212,11 +227,15 @@ public class RagfairServerHelper( var presets = new List(); foreach (var itemId in databaseService.GetGlobals().ItemPresets.Keys) { - if (databaseService.GetGlobals().ItemPresets.TryGetValue(itemId, out var presetsOfItem) - && presetsOfItem.Items?.FirstOrDefault()?.Template == item.Template) + if ( + databaseService.GetGlobals().ItemPresets.TryGetValue(itemId, out var presetsOfItem) + && presetsOfItem.Items?.FirstOrDefault()?.Template == item.Template + ) { // Add a clone of the found preset into list above - presets.AddRange(itemHelper.ReparentItemAndChildren(item, cloner.Clone(presetsOfItem.Items))); + presets.AddRange( + itemHelper.ReparentItemAndChildren(item, cloner.Clone(presetsOfItem.Items)) + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSortHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSortHelper.cs index 94b0875f..76c2aeef 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSortHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSortHelper.cs @@ -6,8 +6,7 @@ using SPTarkov.Server.Core.Services; namespace SPTarkov.Server.Core.Helpers; [Injectable] -public class RagfairSortHelper( - LocaleService _localeService) +public class RagfairSortHelper(LocaleService _localeService) { /** * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time) @@ -16,7 +15,11 @@ public class RagfairSortHelper( * @param direction Ascending/descending * @returns Sorted offers */ - public List SortOffers(List offers, RagfairSort type, int direction = 0) + public List SortOffers( + List offers, + RagfairSort type, + int direction = 0 + ) { // Sort results switch (type) @@ -62,15 +65,21 @@ public class RagfairSortHelper( protected int SortOffersByBarter(RagfairOffer a, RagfairOffer b) { - var aIsOnlyMoney = a.Requirements.Count == 1 && Money.GetMoneyTpls().Contains(a.Requirements[0].Template) ? 1 : 0; - var bIsOnlyMoney = b.Requirements.Count == 1 && Money.GetMoneyTpls().Contains(b.Requirements[0].Template) ? 1 : 0; + var aIsOnlyMoney = + a.Requirements.Count == 1 && Money.GetMoneyTpls().Contains(a.Requirements[0].Template) + ? 1 + : 0; + var bIsOnlyMoney = + b.Requirements.Count == 1 && Money.GetMoneyTpls().Contains(b.Requirements[0].Template) + ? 1 + : 0; return aIsOnlyMoney - bIsOnlyMoney; } protected int SortOffersByRating(RagfairOffer a, RagfairOffer b) { - return (int) (a.User.Rating.Value - b.User.Rating.Value); + return (int)(a.User.Rating.Value - b.User.Rating.Value); } protected int SortOffersByName(RagfairOffer a, RagfairOffer b) @@ -93,11 +102,11 @@ public class RagfairSortHelper( */ protected int SortOffersByPrice(RagfairOffer a, RagfairOffer b) { - return (int) (a.RequirementsCost.Value - b.RequirementsCost.Value); + return (int)(a.RequirementsCost.Value - b.RequirementsCost.Value); } protected int SortOffersByExpiry(RagfairOffer a, RagfairOffer b) { - return (int) (a.EndTime - b.EndTime); + return (int)(a.EndTime - b.EndTime); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RepairHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RepairHelper.cs index f03002ba..62fdde6c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RepairHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RepairHelper.cs @@ -44,7 +44,9 @@ public class RepairHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Adding {amountToRepair} to {itemToRepairDetails.Name} using kit: {useRepairKit}"); + _logger.Debug( + $"Adding {amountToRepair} to {itemToRepairDetails.Name} using kit: {useRepairKit}" + ); } var itemMaxDurability = _cloner.Clone(itemToRepair.Upd.Repairable.MaxDurability); @@ -70,7 +72,7 @@ public class RepairHelper( itemToRepair.Upd.Repairable = new UpdRepairable { Durability = newCurrentDurability, - MaxDurability = newCurrentMaxDurability + MaxDurability = newCurrentMaxDurability, }; // when modders set the repair coefficient to 0 it means that they dont want to lose durability on items @@ -124,7 +126,11 @@ public class RepairHelper( ) { // Degradation value is based on the armor material - if (!_databaseService.GetGlobals().Configuration.ArmorMaterials.TryGetValue(material, out var armorMaterialSettings)) + if ( + !_databaseService + .GetGlobals() + .Configuration.ArmorMaterials.TryGetValue(material, out var armorMaterialSettings) + ) { _logger.Error($"Unable to find armor with a type of: {material}"); } @@ -137,8 +143,9 @@ public class RepairHelper( ? armorMaterialSettings.MaxRepairKitDegradation : armorMaterialSettings.MaxRepairDegradation; - var duraLossPercent = _randomUtil.GetDouble((double) minMultiplier, (double) maxMultiplier); - var duraLossMultipliedByTraderMultiplier = duraLossPercent * armorMax * traderQualityMultiplier; + var duraLossPercent = _randomUtil.GetDouble((double)minMultiplier, (double)maxMultiplier); + var duraLossMultipliedByTraderMultiplier = + duraLossPercent * armorMax * traderQualityMultiplier; return Math.Round(duraLossMultipliedByTraderMultiplier, 2); } @@ -158,8 +165,12 @@ public class RepairHelper( double traderQualityMultipler ) { - var minRepairDeg = isRepairKit ? itemProps.MinRepairKitDegradation : itemProps.MinRepairDegradation; - var maxRepairDeg = isRepairKit ? itemProps.MaxRepairKitDegradation : itemProps.MaxRepairDegradation; + var minRepairDeg = isRepairKit + ? itemProps.MinRepairKitDegradation + : itemProps.MinRepairDegradation; + var maxRepairDeg = isRepairKit + ? itemProps.MaxRepairKitDegradation + : itemProps.MaxRepairDegradation; // WORKAROUND: Some items are always 0 when repairkit is true if (maxRepairDeg == 0) @@ -167,8 +178,9 @@ public class RepairHelper( maxRepairDeg = itemProps.MaxRepairDegradation; } - var duraLossPercent = _randomUtil.GetDouble((double) minRepairDeg, (double) maxRepairDeg); - var duraLossMultipliedByTraderMultiplier = duraLossPercent * weaponMax * traderQualityMultipler; + var duraLossPercent = _randomUtil.GetDouble((double)minRepairDeg, (double)maxRepairDeg); + var duraLossMultipliedByTraderMultiplier = + duraLossPercent * weaponMax * traderQualityMultipler; return Math.Round(duraLossMultipliedByTraderMultiplier, 2); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RepeatableQuestHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RepeatableQuestHelper.cs index a2e7fbbf..7e451921 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RepeatableQuestHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RepeatableQuestHelper.cs @@ -5,9 +5,7 @@ using SPTarkov.Server.Core.Models.Utils; namespace SPTarkov.Server.Core.Helpers; [Injectable] -public class RepeatableQuestHelper( - ISptLogger _logger -) +public class RepeatableQuestHelper(ISptLogger _logger) { /// /// Get the relevant elimination config based on the current players PMC level @@ -15,9 +13,13 @@ public class RepeatableQuestHelper( /// Level of PMC character /// Main repeatable config /// EliminationConfig - public EliminationConfig? GetEliminationConfigByPmcLevel(int pmcLevel, RepeatableQuestConfig repeatableConfig) + public EliminationConfig? GetEliminationConfigByPmcLevel( + int pmcLevel, + RepeatableQuestConfig repeatableConfig + ) { - return repeatableConfig.QuestConfig.Elimination.FirstOrDefault(x => pmcLevel >= x.LevelRange.Min && pmcLevel <= x.LevelRange.Max + return repeatableConfig.QuestConfig.Elimination.FirstOrDefault(x => + pmcLevel >= x.LevelRange.Min && pmcLevel <= x.LevelRange.Max ); } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RewardHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RewardHelper.cs index e84eda80..37535025 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RewardHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RewardHelper.cs @@ -84,11 +84,7 @@ public class RewardHelper( pmcProfile.Info.Level = _playerService.CalculateLevel(pmcProfile); break; case RewardType.TraderStanding: - _traderHelper.AddStandingToTrader( - sessionId, - reward.Target, - reward.Value.Value - ); + _traderHelper.AddStandingToTrader(sessionId, reward.Target, reward.Value.Value); break; case RewardType.TraderUnlock: _traderHelper.SetTraderUnlockedState(reward.Target, true, sessionId); @@ -260,10 +256,7 @@ public class RewardHelper( /// Array of rewards to get the items from. /// The game version of the profile. /// Array of items with the correct maxStack. - protected List GetRewardItems( - List rewards, - string gameVersion - ) + protected List GetRewardItems(List rewards, string gameVersion) { // Iterate over all rewards with the desired status, flatten out items that have a type of Item var rewardItems = rewards.SelectMany(reward => diff --git a/Libraries/SPTarkov.Server.Core/Helpers/SecureContainerHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/SecureContainerHelper.cs index ab6b39d7..f9012fa8 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/SecureContainerHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/SecureContainerHelper.cs @@ -21,7 +21,10 @@ public class SecureContainerHelper(ItemHelper _itemHelper) return []; } - var itemsInSecureContainer = _itemHelper.FindAndReturnChildrenByItems(items, secureContainer.Id); + var itemsInSecureContainer = _itemHelper.FindAndReturnChildrenByItems( + items, + secureContainer.Id + ); // Return all items returned and exclude the secure container item itself return itemsInSecureContainer.Where(x => x != secureContainer.Id).ToList(); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/TradeHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/TradeHelper.cs index 429615c6..542fe3c2 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/TradeHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/TradeHelper.cs @@ -56,7 +56,13 @@ public class TradeHelper( List offerItems = []; Action? buyCallback; - if (string.Equals(buyRequestData.TransactionId, "ragfair", StringComparison.OrdinalIgnoreCase)) + if ( + string.Equals( + buyRequestData.TransactionId, + "ragfair", + StringComparison.OrdinalIgnoreCase + ) + ) { // Called when player purchases PMC offer from ragfair buyCallback = buyCount => @@ -64,7 +70,9 @@ public class TradeHelper( var allOffers = _ragfairServer.GetOffers(); // We store ragfair offerId in buyRequestData.item_id - var offerWithItem = allOffers.FirstOrDefault(x => x.Id == buyRequestData.ItemId); + var offerWithItem = allOffers.FirstOrDefault(x => + x.Id == buyRequestData.ItemId + ); var itemPurchased = offerWithItem.Items.FirstOrDefault(); // Ensure purchase does not exceed trader item limit @@ -88,19 +96,25 @@ public class TradeHelper( new PurchaseItems { ItemId = buyRequestData.ItemId, - Count = buyCount - } + Count = buyCount, + }, ], - TraderId = buyRequestData.TransactionId + TraderId = buyRequestData.TransactionId, }; - _traderHelper.AddTraderPurchasesToPlayerProfile(sessionID, itemPurchaseDetails, itemPurchased); + _traderHelper.AddTraderPurchasesToPlayerProfile( + sessionID, + itemPurchaseDetails, + itemPurchased + ); } }; // buyCallback = BuyCallback1; // Get raw offer from ragfair, clone to prevent altering offer itself var allOffers = _ragfairServer.GetOffers(); - var offerWithItemCloned = _cloner.Clone(allOffers.FirstOrDefault(x => x.Id == buyRequestData.ItemId)); + var offerWithItemCloned = _cloner.Clone( + allOffers.FirstOrDefault(x => x.Id == buyRequestData.ItemId) + ); offerItems = offerWithItemCloned.Items; } else if (buyRequestData.TransactionId == Traders.FENCE) @@ -108,8 +122,12 @@ public class TradeHelper( buyCallback = buyCount => { // Update assort/flea item values - var traderAssorts = _traderHelper.GetTraderAssortsByTraderId(buyRequestData.TransactionId).Items; - var itemPurchased = traderAssorts.FirstOrDefault(assort => assort.Id == buyRequestData.ItemId); + var traderAssorts = _traderHelper + .GetTraderAssortsByTraderId(buyRequestData.TransactionId) + .Items; + var itemPurchased = traderAssorts.FirstOrDefault(assort => + assort.Id == buyRequestData.ItemId + ); // Decrement trader item count itemPurchased.Upd.StackObjectsCount -= buyCount; @@ -123,7 +141,9 @@ public class TradeHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Tried to buy item {buyRequestData.ItemId} from fence that no longer exists"); + _logger.Debug( + $"Tried to buy item {buyRequestData.ItemId} from fence that no longer exists" + ); } var message = _localisationService.GetText("ragfair-offer_no_longer_exists"); @@ -132,20 +152,27 @@ public class TradeHelper( return; } - offerItems = _itemHelper.FindAndReturnChildrenAsItems(fenceItems, buyRequestData.ItemId); + offerItems = _itemHelper.FindAndReturnChildrenAsItems( + fenceItems, + buyRequestData.ItemId + ); } else { buyCallback = buyCount => { // Update assort/flea item values - var traderAssorts = _traderHelper.GetTraderAssortsByTraderId(buyRequestData.TransactionId).Items; - var itemPurchased = traderAssorts.FirstOrDefault(item => item.Id == buyRequestData.ItemId); + var traderAssorts = _traderHelper + .GetTraderAssortsByTraderId(buyRequestData.TransactionId) + .Items; + var itemPurchased = traderAssorts.FirstOrDefault(item => + item.Id == buyRequestData.ItemId + ); // Ensure purchase does not exceed trader item limit var assortHasBuyRestrictions = _itemHelper.HasBuyRestrictions(itemPurchased); if (assortHasBuyRestrictions) - // Will throw error if check fails + // Will throw error if check fails { CheckPurchaseIsWithinTraderItemLimit( sessionID, @@ -177,25 +204,35 @@ public class TradeHelper( new PurchaseItems { ItemId = buyRequestData.ItemId, - Count = buyCount - } + Count = buyCount, + }, ], - TraderId = buyRequestData.TransactionId + TraderId = buyRequestData.TransactionId, }; - _traderHelper.AddTraderPurchasesToPlayerProfile(sessionID, itemPurchaseDat, itemPurchased); + _traderHelper.AddTraderPurchasesToPlayerProfile( + sessionID, + itemPurchaseDat, + itemPurchased + ); } }; // Get all trader assort items - var traderItems = _traderAssortHelper.GetAssort(sessionID, buyRequestData.TransactionId).Items; + var traderItems = _traderAssortHelper + .GetAssort(sessionID, buyRequestData.TransactionId) + .Items; // Get item + children for purchase - var relevantItems = _itemHelper.FindAndReturnChildrenAsItems(traderItems, buyRequestData.ItemId); + var relevantItems = _itemHelper.FindAndReturnChildrenAsItems( + traderItems, + buyRequestData.ItemId + ); if (relevantItems.Count == 0) { _logger.Error( - $"Purchased trader: {buyRequestData.TransactionId} offer: {buyRequestData.ItemId} has no items"); + $"Purchased trader: {buyRequestData.TransactionId} offer: {buyRequestData.ItemId} has no items" + ); } offerItems.AddRange(relevantItems); @@ -235,7 +272,7 @@ public class TradeHelper( ItemsWithModsToAdd = itemsToSendToPlayer, FoundInRaid = foundInRaid, Callback = buyCallback, - UseSortingTable = false + UseSortingTable = false, }; // Add items + their children to stash @@ -249,8 +286,13 @@ public class TradeHelper( _paymentService.PayMoney(pmcData, buyRequestData, sessionID, output); if (output.Warnings?.Count > 0) { - var errorMessage = $"Transaction failed: {output.Warnings.FirstOrDefault().ErrorMessage}"; - _httpResponseUtil.AppendErrorToOutput(output, errorMessage, BackendErrorCodes.UnknownTradingError); + var errorMessage = + $"Transaction failed: {output.Warnings.FirstOrDefault().ErrorMessage}"; + _httpResponseUtil.AppendErrorToOutput( + output, + errorMessage, + BackendErrorCodes.UnknownTradingError + ); } } } @@ -272,7 +314,11 @@ public class TradeHelper( ) { // Check for and increment SoldToTrader condition counters - _questHelper.IncrementSoldToTraderCounters(profileWithItemsToSell, profileToReceiveMoney, sellRequest); + _questHelper.IncrementSoldToTraderCounters( + profileWithItemsToSell, + profileToReceiveMoney, + sellRequest + ); const string pattern = @"\s+"; @@ -281,10 +327,13 @@ public class TradeHelper( { var itemIdToFind = Regex.Replace(itemToBeRemoved.Id, pattern, ""); // Strip out whitespace // Find item in player inventory, or show error to player if not found - var matchingItemInInventory = profileWithItemsToSell.Inventory.Items.FirstOrDefault(x => x.Id == itemIdToFind); + var matchingItemInInventory = profileWithItemsToSell.Inventory.Items.FirstOrDefault(x => + x.Id == itemIdToFind + ); if (matchingItemInInventory is null) { - var errorMessage = $"Unable to sell item {itemToBeRemoved.Id}, cannot be found in player inventory"; + var errorMessage = + $"Unable to sell item {itemToBeRemoved.Id}, cannot be found in player inventory"; _logger.Error(errorMessage); _httpResponseUtil.AppendErrorToOutput(output, errorMessage); @@ -294,7 +343,9 @@ public class TradeHelper( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Selling: id: {matchingItemInInventory.Id} tpl: {matchingItemInInventory.Template}"); + _logger.Debug( + $"Selling: id: {matchingItemInInventory.Id} tpl: {matchingItemInInventory.Template}" + ); } if (sellRequest.TransactionId == Traders.FENCE) @@ -306,11 +357,22 @@ public class TradeHelper( } // Remove item from inventory + any child items it has - _inventoryHelper.RemoveItem(profileWithItemsToSell, itemToBeRemoved.Id, sessionID, output); + _inventoryHelper.RemoveItem( + profileWithItemsToSell, + itemToBeRemoved.Id, + sessionID, + output + ); } // Give player money for sold item(s) - _paymentService.GiveProfileMoney(profileToReceiveMoney, sellRequest.Price, sellRequest, output, sessionID); + _paymentService.GiveProfileMoney( + profileToReceiveMoney, + sellRequest.Price, + sellRequest, + output, + sessionID + ); } /// @@ -337,7 +399,7 @@ public class TradeHelper( assortBeingPurchased.Id ); var traderItemPurchaseLimit = _traderHelper.GetAccountTypeAdjustedTraderPurchaseLimit( - (double) assortBeingPurchased.Upd?.BuyRestrictionMax, + (double)assortBeingPurchased.Upd?.BuyRestrictionMax, pmcData.Info.GameVersion ); if ((traderPurchaseData?.PurchaseCount ?? 0) + count > traderItemPurchaseLimit) @@ -351,30 +413,14 @@ public class TradeHelper( public record PurchaseDetails { - public List Items - { - get; - set; - } + public List Items { get; set; } - public string TraderId - { - get; - set; - } + public string TraderId { get; set; } } public record PurchaseItems { - public string ItemId - { - get; - set; - } + public string ItemId { get; set; } - public double Count - { - get; - set; - } + public double Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/TraderAssortHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/TraderAssortHelper.cs index 3dd5d8ee..558adbd7 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/TraderAssortHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/TraderAssortHelper.cs @@ -58,7 +58,11 @@ public class TraderAssortHelper( // Strip assorts player should not see yet if (!showLockedAssorts) { - traderClone.Assort = _assortHelper.StripLockedLoyaltyAssort(pmcProfile, traderId, traderClone.Assort); + traderClone.Assort = _assortHelper.StripLockedLoyaltyAssort( + pmcProfile, + traderId, + traderClone.Assort + ); } ResetBuyRestrictionCurrentValue(traderClone.Assort.Items); @@ -80,7 +84,9 @@ public class TraderAssortHelper( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Cannot find trader: {traderClone.Base.Nickname} assort: {assortId} to adjust BuyRestrictionCurrent value, skipping"); + _logger.Debug( + $"Cannot find trader: {traderClone.Base.Nickname} assort: {assortId} to adjust BuyRestrictionCurrent value, skipping" + ); } continue; @@ -98,7 +104,9 @@ public class TraderAssortHelper( continue; } - assortToAdjust.Upd.BuyRestrictionCurrent = (int) (assortPurchasesfromTrader[assortId.Key].PurchaseCount ?? 0); + assortToAdjust.Upd.BuyRestrictionCurrent = (int)( + assortPurchasesfromTrader[assortId.Key].PurchaseCount ?? 0 + ); } // Get rid of quest locked assorts @@ -130,9 +138,13 @@ public class TraderAssortHelper( /// /// Trader assort to modify /// Item TPLs the assort should not have - protected void RemoveItemsFromAssort(TraderAssort assortToFilter, HashSet itemsTplsToRemove) + protected void RemoveItemsFromAssort( + TraderAssort assortToFilter, + HashSet itemsTplsToRemove + ) { - assortToFilter.Items = assortToFilter.Items.Where(item => + assortToFilter.Items = assortToFilter + .Items.Where(item => item.ParentId == "hideout" && itemsTplsToRemove.Contains(item.Template) ) .ToList(); @@ -169,19 +181,24 @@ public class TraderAssortHelper( // Trader has quest assort data var trader = traders[traderId.Key]; if (trader.QuestAssort is not null) - // Started/Success/fail + // Started/Success/fail { foreach (var questStatus in trader.QuestAssort) - // Each assort to quest id record + // Each assort to quest id record foreach (var assortId in trader.QuestAssort[questStatus.Key]) { // Null guard if (!_mergedQuestAssorts.TryGetValue(questStatus.Key, out _)) { - _mergedQuestAssorts.TryAdd(questStatus.Key, new Dictionary()); + _mergedQuestAssorts.TryAdd( + questStatus.Key, + new Dictionary() + ); } - _mergedQuestAssorts[questStatus.Key][assortId.Key] = trader.QuestAssort[questStatus.Key][assortId.Key]; + _mergedQuestAssorts[questStatus.Key][assortId.Key] = trader.QuestAssort[ + questStatus.Key + ][assortId.Key]; } } } @@ -197,7 +214,7 @@ public class TraderAssortHelper( trader.Assort.Items = GetPristineTraderAssorts(trader.Base.Id); // Update resupply value to next timestamp - trader.Base.NextResupply = (int) _traderHelper.GetNextUpdateTimestamp(trader.Base.Id); + trader.Base.NextResupply = (int)_traderHelper.GetNextUpdateTimestamp(trader.Base.Id); // Flag a refresh is needed so ragfair update() will pick it up trader.Base.RefreshTraderRagfairOffers = true; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs index f376f3bf..7a77505c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs @@ -11,7 +11,6 @@ using SPTarkov.Server.Core.Services; using SPTarkov.Server.Core.Utils; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; - namespace SPTarkov.Server.Core.Helpers; [Injectable] @@ -36,11 +35,15 @@ public class TraderHelper( public TraderBase? GetTraderByNickName(string traderName) { - return _databaseService.GetTraders().Select(dict => dict.Value.Base) - .FirstOrDefault(t => t?.Nickname != null && string.Equals(t.Nickname, traderName, StringComparison.CurrentCultureIgnoreCase)); + return _databaseService + .GetTraders() + .Select(dict => dict.Value.Base) + .FirstOrDefault(t => + t?.Nickname != null + && string.Equals(t.Nickname, traderName, StringComparison.CurrentCultureIgnoreCase) + ); } - /// /// Get a trader base object, update profile to reflect players current standing in profile /// when trader not found in profile @@ -52,16 +55,15 @@ public class TraderHelper( { if (traderID == "ragfair") { - return new TraderBase - { - Currency = CurrencyType.RUB - }; + return new TraderBase { Currency = CurrencyType.RUB }; } var pmcData = _profileHelper.GetPmcProfile(sessionID); if (pmcData == null) { - throw new Exception(_localisationService.GetText("trader-unable_to_find_profile_with_id", sessionID)); + throw new Exception( + _localisationService.GetText("trader-unable_to_find_profile_with_id", sessionID) + ); } // Profile has traderInfo dict (profile beyond creation stage) but no requested trader in profile @@ -75,7 +77,9 @@ public class TraderHelper( var traderBase = _databaseService.GetTrader(traderID).Base; if (traderBase == null) { - _logger.Error(_localisationService.GetText("trader-unable_to_find_trader_by_id", traderID)); + _logger.Error( + _localisationService.GetText("trader-unable_to_find_trader_by_id", traderID) + ); } return traderBase; @@ -141,12 +145,17 @@ public class TraderHelper( var fullProfile = _profileHelper.GetFullProfile(sessionID); if (fullProfile is null) { - throw new Exception(_localisationService.GetText("trader-unable_to_find_profile_by_id", sessionID)); + throw new Exception( + _localisationService.GetText("trader-unable_to_find_profile_by_id", sessionID) + ); } // Get matching profile 'type' e.g. 'standard' var pmcData = fullProfile.CharacterData.PmcData; - var matchingSide = _profileHelper.GetProfileTemplateForSide(fullProfile.ProfileInfo.Edition, pmcData.Info.Side); + var matchingSide = _profileHelper.GetProfileTemplateForSide( + fullProfile.ProfileInfo.Edition, + pmcData.Info.Side + ); // Profiles trader settings var profileTemplateTraderData = matchingSide.Trader; @@ -154,11 +163,14 @@ public class TraderHelper( var newTraderData = new TraderInfo { Disabled = false, - LoyaltyLevel = profileTemplateTraderData.InitialLoyaltyLevel.GetValueOrDefault(traderID, 1), + LoyaltyLevel = profileTemplateTraderData.InitialLoyaltyLevel.GetValueOrDefault( + traderID, + 1 + ), SalesSum = profileTemplateTraderData.InitialSalesSum, Standing = GetStartingStanding(traderID, profileTemplateTraderData), NextResupply = trader.Base.NextResupply, - Unlocked = trader.Base.UnlockedByDefault + Unlocked = trader.Base.UnlockedByDefault, }; // Add trader to profile if it doesn't already @@ -170,25 +182,29 @@ public class TraderHelper( pmcData.TradersInfo[traderID].Unlocked = true; } - if (profileTemplateTraderData.PurchaseAllClothingByDefaultForTrader?.Contains(traderID) ?? false) + if ( + profileTemplateTraderData.PurchaseAllClothingByDefaultForTrader?.Contains(traderID) + ?? false + ) { // Get traders clothing var clothing = _databaseService.GetTrader(traderID).Suits; if (clothing?.Count > 0) - // Force suit ids into profile + // Force suit ids into profile { - AddSuitsToProfile( - fullProfile, - clothing.Select(suit => suit.SuiteId).ToList() - ); + AddSuitsToProfile(fullProfile, clothing.Select(suit => suit.SuiteId).ToList()); } } // Template has flea block if ((profileTemplateTraderData.FleaBlockedDays ?? 0) > 0) { - var newBanDateTime = _timeUtil.GetTimeStampFromNowDays(profileTemplateTraderData.FleaBlockedDays ?? 0); - var existingBan = pmcData.Info.Bans?.FirstOrDefault(ban => ban.BanType == BanType.RagFair); + var newBanDateTime = _timeUtil.GetTimeStampFromNowDays( + profileTemplateTraderData.FleaBlockedDays ?? 0 + ); + var existingBan = pmcData.Info.Bans?.FirstOrDefault(ban => + ban.BanType == BanType.RagFair + ); if (existingBan is not null) { existingBan.DateTime = newBanDateTime; @@ -197,11 +213,7 @@ public class TraderHelper( { pmcData.Info.Bans ??= []; pmcData.Info.Bans.Add( - new Ban - { - BanType = BanType.RagFair, - DateTime = newBanDateTime - } + new Ban { BanType = BanType.RagFair, DateTime = newBanDateTime } ); } } @@ -245,15 +257,21 @@ public class TraderHelper( foreach (var suitId in clothingIds) { - if (!fullProfile.CustomisationUnlocks.Exists(customisation => customisation.Id == suitId)) + if ( + !fullProfile.CustomisationUnlocks.Exists(customisation => + customisation.Id == suitId + ) + ) { // Clothing item doesn't exist in profile, add it - fullProfile.CustomisationUnlocks.Add(new CustomisationStorage - { - Id = suitId, - Source = CustomisationSource.UNLOCKED_IN_GAME, - Type = CustomisationType.SUITE - }); + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = suitId, + Source = CustomisationSource.UNLOCKED_IN_GAME, + Type = CustomisationType.SUITE, + } + ); } } } @@ -270,7 +288,9 @@ public class TraderHelper( var profileTraderData = pmcData.TradersInfo[traderId]; if (profileTraderData is null) { - _logger.Error($"Unable to set trader {traderId} unlocked state to: {status} as trader cannot be found in profile"); + _logger.Error( + $"Unable to set trader {traderId} unlocked state to: {status} as trader cannot be found in profile" + ); return; } @@ -293,9 +313,10 @@ public class TraderHelper( pmcTraderInfo.Standing = AddStandingValuesTogether(pmcTraderInfo.Standing, standingToAdd); if (traderId == Traders.FENCE) - // Must add rep to scav profile to ensure consistency + // Must add rep to scav profile to ensure consistency { - fullProfile.CharacterData.ScavData.TradersInfo[traderId].Standing = pmcTraderInfo.Standing; + fullProfile.CharacterData.ScavData.TradersInfo[traderId].Standing = + pmcTraderInfo.Standing; } LevelUp(traderId, fullProfile.CharacterData.PmcData); @@ -346,16 +367,18 @@ public class TraderHelper( var targetLevel = 0; // Round standing to 2 decimal places to address floating point inaccuracies - pmcData.TradersInfo[traderID].Standing = Math.Round(pmcData.TradersInfo[traderID].Standing * 100 ?? 0, 2) / 100; + pmcData.TradersInfo[traderID].Standing = + Math.Round(pmcData.TradersInfo[traderID].Standing * 100 ?? 0, 2) / 100; foreach (var loyaltyLevel in loyaltyLevels) { - if (loyaltyLevel.MinLevel <= pmcData.Info.Level && - loyaltyLevel.MinSalesSum <= pmcData.TradersInfo[traderID].SalesSum && - loyaltyLevel.MinStanding <= pmcData.TradersInfo[traderID].Standing && - targetLevel < 4 - ) - // level reached + if ( + loyaltyLevel.MinLevel <= pmcData.Info.Level + && loyaltyLevel.MinSalesSum <= pmcData.TradersInfo[traderID].SalesSum + && loyaltyLevel.MinStanding <= pmcData.TradersInfo[traderID].Standing + && targetLevel < 4 + ) + // level reached { targetLevel++; } @@ -390,21 +413,20 @@ public class TraderHelper( _logger.Warning( _localisationService.GetText( "trader-missing_trader_details_using_default_refresh_time", - new - { - traderId, - updateTime = _traderConfig.UpdateTimeDefault - } + new { traderId, updateTime = _traderConfig.UpdateTimeDefault } ) ); _traderConfig.UpdateTime.Add( new UpdateTime - // create temporary entry to prevent logger spam - { - TraderId = traderId, - Seconds = new MinMax(_traderConfig.UpdateTimeDefault, _traderConfig.UpdateTimeDefault) - } + // create temporary entry to prevent logger spam + { + TraderId = traderId, + Seconds = new MinMax( + _traderConfig.UpdateTimeDefault, + _traderConfig.UpdateTimeDefault + ), + } ); return null; @@ -444,7 +466,8 @@ public class TraderHelper( public void AddTraderPurchasesToPlayerProfile( string sessionID, PurchaseDetails newPurchaseDetails, - Item itemPurchased) + Item itemPurchased + ) { var profile = _profileHelper.GetFullProfile(sessionID); var traderId = newPurchaseDetails.TraderId; @@ -455,44 +478,46 @@ public class TraderHelper( var currentTime = _timeUtil.GetTimeStamp(); // Nullguard traderPurchases - profile.TraderPurchases ??= new Dictionary?>(); + profile.TraderPurchases ??= + new Dictionary?>(); // Nullguard traderPurchases for this trader profile.TraderPurchases[traderId] ??= new Dictionary(); // Null guard when dict doesnt exist - if (profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount is null || - profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseTimestamp is null) + if ( + profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount is null + || profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseTimestamp is null + ) { profile.TraderPurchases[traderId][purchasedItem.ItemId] = new TraderPurchaseData { PurchaseCount = purchasedItem.Count, - PurchaseTimestamp = currentTime + PurchaseTimestamp = currentTime, }; continue; } - if (profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount + purchasedItem.Count > - GetAccountTypeAdjustedTraderPurchaseLimit( - (double) itemPurchased.Upd.BuyRestrictionMax, + if ( + profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount + + purchasedItem.Count + > GetAccountTypeAdjustedTraderPurchaseLimit( + (double)itemPurchased.Upd.BuyRestrictionMax, profile.CharacterData.PmcData.Info.GameVersion ) - ) + ) { throw new Exception( _localisationService.GetText( "trader-unable_to_purchase_item_limit_reached", - new - { - traderId, - limit = itemPurchased.Upd.BuyRestrictionMax - } + new { traderId, limit = itemPurchased.Upd.BuyRestrictionMax } ) ); } - profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount += purchasedItem.Count; + profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseCount += + purchasedItem.Count; profile.TraderPurchases[traderId][purchasedItem.ItemId].PurchaseTimestamp = currentTime; } } @@ -503,7 +528,10 @@ public class TraderHelper( /// Existing value from trader item /// Profiles game version /// buyRestrictionMax value - public double GetAccountTypeAdjustedTraderPurchaseLimit(double buyRestrictionMax, string gameVersion) + public double GetAccountTypeAdjustedTraderPurchaseLimit( + double buyRestrictionMax, + string gameVersion + ) { if (_gameVersions.Contains(gameVersion)) { @@ -546,12 +574,16 @@ public class TraderHelper( foreach (var item in traderAssorts.Items.Where(x => x.ParentId == "hideout")) { // Get barter scheme (contains cost of item) - var barterScheme = traderAssorts.BarterScheme[item.Id].FirstOrDefault().FirstOrDefault(); + var barterScheme = traderAssorts + .BarterScheme[item.Id] + .FirstOrDefault() + .FirstOrDefault(); // Convert into roubles - var roubleAmount = barterScheme.Template == Money.ROUBLES - ? barterScheme.Count - : _handbookHelper.InRUB(barterScheme.Count ?? 1, barterScheme.Template); + var roubleAmount = + barterScheme.Template == Money.ROUBLES + ? barterScheme.Count + : _handbookHelper.InRUB(barterScheme.Count ?? 1, barterScheme.Template); // Existing price smaller in dict than current iteration, overwrite if (_highestTraderPriceItems[item.Template] < roubleAmount) @@ -579,7 +611,10 @@ public class TraderHelper( var traderBase = _databaseService.GetTrader(trader.Id).Base; // Skip traders that don't sell this category of item - if (traderBase is null || !_itemHelper.IsOfBaseclasses(tpl, traderBase.ItemsBuy.Category)) + if ( + traderBase is null + || !_itemHelper.IsOfBaseclasses(tpl, traderBase.ItemsBuy.Category) + ) { continue; } @@ -587,10 +622,15 @@ public class TraderHelper( // Get loyalty level details player has achieved with this trader // Uses lowest loyalty level as this function is used before a player has logged into server // We have no idea what player loyalty is with traders - var traderBuyBackPricePercent = 100 - traderBase.LoyaltyLevels.FirstOrDefault().BuyPriceCoefficient; + var traderBuyBackPricePercent = + 100 - traderBase.LoyaltyLevels.FirstOrDefault().BuyPriceCoefficient; var itemHandbookPrice = _handbookHelper.GetTemplatePrice(tpl); - var priceTraderBuysItemAt = _randomUtil.GetPercentOfValue(traderBuyBackPricePercent ?? 0, itemHandbookPrice, 0); + var priceTraderBuysItemAt = _randomUtil.GetPercentOfValue( + traderBuyBackPricePercent ?? 0, + itemHandbookPrice, + 0 + ); // Price from this trader is higher than highest found, update if (priceTraderBuysItemAt > highestPrice) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs index 629feff9..92b29eec 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs @@ -39,9 +39,8 @@ public class WeatherHelper( var currentTimestampSeconds = timestamp; var tarkovTime = _timeUtil.GetDateTimeFromTimeStamp( - (long) - (russiaOffsetSeconds + currentTimestampSeconds * _weatherConfig.Acceleration) % - twentyFourHoursSeconds + (long)(russiaOffsetSeconds + currentTimestampSeconds * _weatherConfig.Acceleration) + % twentyFourHoursSeconds ); return tarkovTime; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/WeightedRandomHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/WeightedRandomHelper.cs index be84fe16..1be11604 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/WeightedRandomHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/WeightedRandomHelper.cs @@ -18,7 +18,8 @@ public class WeightedRandomHelper( /// /// Items and weights to use /// Chosen item from array - public T GetWeightedValue(Dictionary values) where T : notnull + public T GetWeightedValue(Dictionary values) + where T : notnull { if (values.Count == 1) { @@ -54,12 +55,19 @@ public class WeightedRandomHelper( if (weights.Count == 0) { - _logger.Error(localisationService.GetText("weightedrandomhelper-supplied_weights_empty")); + _logger.Error( + localisationService.GetText("weightedrandomhelper-supplied_weights_empty") + ); } if (items.Count != weights.Count) { - _logger.Error(localisationService.GetText("weightedrandomhelper-supplied_data_doesnt_match", new { itemCount = items .Count, weightCount = weights.Count})); + _logger.Error( + localisationService.GetText( + "weightedrandomhelper-supplied_data_doesnt_match", + new { itemCount = items.Count, weightCount = weights.Count } + ) + ); } // Preparing the cumulative weights list. @@ -81,11 +89,7 @@ public class WeightedRandomHelper( { // Weights are all the same, early exit var randomIndex = _randomUtil.GetInt(0, items.Count - 1); - return new WeightedRandomResult - { - Item = items[randomIndex], - Index = randomIndex - }; + return new WeightedRandomResult { Item = items[randomIndex], Index = randomIndex }; } // Getting the random number in a range of [0...sum(weights)] @@ -96,11 +100,7 @@ public class WeightedRandomHelper( { if (cumulativeWeights[itemIndex] >= randomNumber) { - return new WeightedRandomResult - { - Item = items[itemIndex], - Index = itemIndex - }; + return new WeightedRandomResult { Item = items[itemIndex], Index = itemIndex }; } } diff --git a/Libraries/SPTarkov.Server.Core/Loaders/BundleLoader.cs b/Libraries/SPTarkov.Server.Core/Loaders/BundleLoader.cs index e68aece8..d90ee68c 100644 --- a/Libraries/SPTarkov.Server.Core/Loaders/BundleLoader.cs +++ b/Libraries/SPTarkov.Server.Core/Loaders/BundleLoader.cs @@ -20,14 +20,9 @@ namespace SPTarkov.Server.Core.Loaders; } */ public class BundleInfo { - public BundleInfo() - { - } + public BundleInfo() { } - public BundleInfo( - string modPath, - BundleManifestEntry bundle, - uint bundleHash) + public BundleInfo(string modPath, BundleManifestEntry bundle, uint bundleHash) { ModPath = modPath; FileName = bundle.Key; @@ -36,35 +31,15 @@ public class BundleInfo Dependencies = bundle?.DependencyKeys ?? []; } - public string? ModPath - { - get; - set; - } + public string? ModPath { get; set; } - public string FileName - { - get; - set; - } + public string FileName { get; set; } - public BundleManifestEntry Bundle - { - get; - set; - } + public BundleManifestEntry Bundle { get; set; } - public uint Crc - { - get; - set; - } + public uint Crc { get; set; } - public List Dependencies - { - get; - set; - } + public List Dependencies { get; set; } } [Injectable(InjectionType.Singleton)] @@ -86,7 +61,8 @@ public class BundleLoader FileUtil fileUtil, BundleHashCacheService bundleHashCacheService, InMemoryCacheService inMemoryCacheService, - ICloner cloner) + ICloner cloner + ) { _logger = logger; _hashUtil = hashUtil; @@ -123,7 +99,9 @@ public class BundleLoader // modPath should be relative to the server exe - ./user/mods/Mod3 // TODO: make sure the mod is passing a path that is relative from the server exe - var modBundlesJson = _fileUtil.ReadFile(Path.Join(Directory.GetCurrentDirectory(), modPath, "bundles.json")); + var modBundlesJson = _fileUtil.ReadFile( + Path.Join(Directory.GetCurrentDirectory(), modPath, "bundles.json") + ); var modBundles = _jsonUtil.Deserialize(modBundlesJson); var bundleManifestArr = modBundles?.Manifest; @@ -131,7 +109,8 @@ public class BundleLoader { var relativeModPath = modPath.Replace('\\', '/'); - var bundleLocalPath = Path.Join(relativeModPath, "bundles", bundleManifest.Key).Replace('\\', '/'); + var bundleLocalPath = Path.Join(relativeModPath, "bundles", bundleManifest.Key) + .Replace('\\', '/'); if (!_bundleHashCacheService.CalculateAndMatchHash(bundleLocalPath)) { @@ -140,7 +119,10 @@ public class BundleLoader var bundleHash = _bundleHashCacheService.GetStoredValue(bundleLocalPath); - AddBundle(bundleManifest.Key, new BundleInfo(relativeModPath, bundleManifest, bundleHash)); + AddBundle( + bundleManifest.Key, + new BundleInfo(relativeModPath, bundleManifest, bundleHash) + ); } } @@ -157,26 +139,14 @@ public class BundleLoader public record BundleManifest { [JsonPropertyName("manifest")] - public List Manifest - { - get; - set; - } + public List Manifest { get; set; } } public record BundleManifestEntry { [JsonPropertyName("key")] - public string Key - { - get; - set; - } + public string Key { get; set; } [JsonPropertyName("dependencyKeys")] - public List? DependencyKeys - { - get; - set; - } + public List? DependencyKeys { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Loaders/PostDBModLoader.cs b/Libraries/SPTarkov.Server.Core/Loaders/PostDBModLoader.cs index e790ad52..6168f8b4 100644 --- a/Libraries/SPTarkov.Server.Core/Loaders/PostDBModLoader.cs +++ b/Libraries/SPTarkov.Server.Core/Loaders/PostDBModLoader.cs @@ -6,7 +6,9 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Loaders; -[Obsolete("This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPostDBLoadModAsync for more information.")] +[Obsolete( + "This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPostDBLoadModAsync for more information." +)] [Injectable(TypePriority = OnLoadOrder.PostDBModLoader)] public class PostDBModLoader( ISptLogger _logger, diff --git a/Libraries/SPTarkov.Server.Core/Loaders/PostSptModLoader.cs b/Libraries/SPTarkov.Server.Core/Loaders/PostSptModLoader.cs index 9465c69b..2370daef 100644 --- a/Libraries/SPTarkov.Server.Core/Loaders/PostSptModLoader.cs +++ b/Libraries/SPTarkov.Server.Core/Loaders/PostSptModLoader.cs @@ -6,7 +6,9 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Loaders; -[Obsolete("This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPostSptLoadModAsync for more information.")] +[Obsolete( + "This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPostSptLoadModAsync for more information." +)] [Injectable(TypePriority = OnLoadOrder.PostSptModLoader)] public class PostSptModLoader( ISptLogger _logger, diff --git a/Libraries/SPTarkov.Server.Core/Loaders/PreSptModLoader.cs b/Libraries/SPTarkov.Server.Core/Loaders/PreSptModLoader.cs index cae27d10..2fda877f 100644 --- a/Libraries/SPTarkov.Server.Core/Loaders/PreSptModLoader.cs +++ b/Libraries/SPTarkov.Server.Core/Loaders/PreSptModLoader.cs @@ -7,7 +7,8 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Loaders; [Obsolete( - "This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPreSptLoadModAsync for more information.")] + "This mod loader is obsolete and will be removed in 4.1.0. See documentation in IPreSptLoadModAsync for more information." +)] [Injectable(InjectionType.Singleton, TypePriority = OnLoadOrder.PreSptModLoader)] public class PreSptModLoader( ISptLogger _logger, diff --git a/Libraries/SPTarkov.Server.Core/Models/Common/IdWithCount.cs b/Libraries/SPTarkov.Server.Core/Models/Common/IdWithCount.cs index 04c2ecb1..88eb91f0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Common/IdWithCount.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Common/IdWithCount.cs @@ -11,19 +11,11 @@ public record IdWithCount /// ID of stack to take money from /// [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } /// /// Amount of money to take off player for treatment /// [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Common/MinMax.cs b/Libraries/SPTarkov.Server.Core/Models/Common/MinMax.cs index 6a7b2170..1bab7ba4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Common/MinMax.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Common/MinMax.cs @@ -3,7 +3,8 @@ using System.Text.Json.Serialization; namespace SPTarkov.Server.Core.Models.Common; -public record MinMax where T : IMinMaxValue +public record MinMax + where T : IMinMaxValue { [JsonExtensionData] public Dictionary ExtensionData { get; set; } @@ -14,28 +15,14 @@ public record MinMax where T : IMinMaxValue Max = max; } - public MinMax() - { - } + public MinMax() { } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("max")] - public T Max - { - get; - set; - } + public T Max { get; set; } [JsonPropertyName("min")] - public T Min - { - get; - set; - } + public T Min { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/GenerateBotsRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/GenerateBotsRequestData.cs index c701b100..0b443dc2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/GenerateBotsRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/GenerateBotsRequestData.cs @@ -9,11 +9,7 @@ public record GenerateBotsRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("conditions")] - public List? Conditions - { - get; - set; - } + public List? Conditions { get; set; } } public record GenerateCondition @@ -25,23 +21,11 @@ public record GenerateCondition /// e.g. assault/pmcBot/bossKilla /// [JsonPropertyName("Role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } [JsonPropertyName("Limit")] - public int Limit - { - get; - set; - } + public int Limit { get; set; } [JsonPropertyName("Difficulty")] - public string? Difficulty - { - get; - set; - } + public string? Difficulty { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/RandomisedBotLevelResult.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/RandomisedBotLevelResult.cs index d73fafde..a7fd418b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/RandomisedBotLevelResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Bot/RandomisedBotLevelResult.cs @@ -8,16 +8,8 @@ public record RandomisedBotLevelResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("exp")] - public int? Exp - { - get; - set; - } + public int? Exp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Builds/SetMagazineRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Builds/SetMagazineRequest.cs index 18c02ad6..a5d0709e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Builds/SetMagazineRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Builds/SetMagazineRequest.cs @@ -10,44 +10,20 @@ public record SetMagazineRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("Caliber")] - public string? Caliber - { - get; - set; - } + public string? Caliber { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("TopCount")] - public int? TopCount - { - get; - set; - } + public int? TopCount { get; set; } [JsonPropertyName("BottomCount")] - public int? BottomCount - { - get; - set; - } + public int? BottomCount { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/EmptyRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/EmptyRequestData.cs index 1061bd54..ba9c39f4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/EmptyRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/EmptyRequestData.cs @@ -7,5 +7,4 @@ public record EmptyRequestData : IRequestData { [JsonExtensionData] public Dictionary ExtensionData { get; set; } - } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs index d8c8fbdc..2d7d5a1a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs @@ -11,39 +11,19 @@ public record Globals public Dictionary ExtensionData { get; set; } [JsonPropertyName("config")] - public Config? Configuration - { - get; - set; - } + public Config? Configuration { get; set; } [JsonPropertyName("LocationInfection")] - public LocationInfection? LocationInfection - { - get; - set; - } + public LocationInfection? LocationInfection { get; set; } [JsonPropertyName("bot_presets")] - public List? BotPresets - { - get; - set; - } + public List? BotPresets { get; set; } [JsonPropertyName("BotWeaponScatterings")] - public List? BotWeaponScatterings - { - get; - set; - } + public List? BotWeaponScatterings { get; set; } [JsonPropertyName("ItemPresets")] - public Dictionary? ItemPresets - { - get; - set; - } + public Dictionary? ItemPresets { get; set; } } public record PlayerSettings @@ -52,60 +32,28 @@ public record PlayerSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("BaseMaxMovementRolloff")] - public double? BaseMaxMovementRolloff - { - get; - set; - } + public double? BaseMaxMovementRolloff { get; set; } [JsonPropertyName("EnabledOcclusionDynamicRolloff")] - public bool? IsEnabledOcclusionDynamicRolloff - { - get; - set; - } + public bool? IsEnabledOcclusionDynamicRolloff { get; set; } [JsonPropertyName("IndoorRolloffMult")] - public double? IndoorRolloffMultiplier - { - get; - set; - } + public double? IndoorRolloffMultiplier { get; set; } [JsonPropertyName("MinStepSoundRolloffMult")] - public double? MinStepSoundRolloffMultiplier - { - get; - set; - } + public double? MinStepSoundRolloffMultiplier { get; set; } [JsonPropertyName("MinStepSoundVolumeMult")] - public double? MinStepSoundVolumeMultiplier - { - get; - set; - } + public double? MinStepSoundVolumeMultiplier { get; set; } [JsonPropertyName("MovementRolloffMultipliers")] - public List? MovementRolloffMultipliers - { - get; - set; - } + public List? MovementRolloffMultipliers { get; set; } [JsonPropertyName("OutdoorRolloffMult")] - public double? OutdoorRolloffMultiplier - { - get; - set; - } + public double? OutdoorRolloffMultiplier { get; set; } [JsonPropertyName("SearchSoundVolume")] - public SearchSoundVolumeSettings? SearchSoundVolume - { - get; - set; - } + public SearchSoundVolumeSettings? SearchSoundVolume { get; set; } } public record SearchSoundVolumeSettings @@ -113,17 +61,9 @@ public record SearchSoundVolumeSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double FpVolume - { - get; - set; - } + public double FpVolume { get; set; } - public double TpVolume - { - get; - set; - } + public double TpVolume { get; set; } } public record MovementRolloffMultiplier @@ -132,18 +72,10 @@ public record MovementRolloffMultiplier public Dictionary ExtensionData { get; set; } [JsonPropertyName("MovementState")] - public string? MovementState - { - get; - set; - } + public string? MovementState { get; set; } [JsonPropertyName("RolloffMultiplier")] - public double? RolloffMultiplier - { - get; - set; - } + public double? RolloffMultiplier { get; set; } } public record RadioBroadcastSettings @@ -152,18 +84,10 @@ public record RadioBroadcastSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("EnabledBroadcast")] - public bool? EnabledBroadcast - { - get; - set; - } + public bool? EnabledBroadcast { get; set; } [JsonPropertyName("RadioStations")] - public List? RadioStations - { - get; - set; - } + public List? RadioStations { get; set; } } public record RadioStation @@ -172,18 +96,10 @@ public record RadioStation public Dictionary ExtensionData { get; set; } [JsonPropertyName("Enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("Station")] - public RadioStationType? Station - { - get; - set; - } + public RadioStationType? Station { get; set; } } public record LocationInfection @@ -192,74 +108,34 @@ public record LocationInfection public Dictionary ExtensionData { get; set; } [JsonPropertyName("Interchange")] - public double? Interchange - { - get; - set; - } + public double? Interchange { get; set; } [JsonPropertyName("Lighthouse")] - public double? Lighthouse - { - get; - set; - } + public double? Lighthouse { get; set; } [JsonPropertyName("RezervBase")] - public double? RezervBase - { - get; - set; - } + public double? RezervBase { get; set; } [JsonPropertyName("Sandbox")] - public double? Sandbox - { - get; - set; - } + public double? Sandbox { get; set; } [JsonPropertyName("Shoreline")] - public double? Shoreline - { - get; - set; - } + public double? Shoreline { get; set; } [JsonPropertyName("TarkovStreets")] - public double? TarkovStreets - { - get; - set; - } + public double? TarkovStreets { get; set; } [JsonPropertyName("Woods")] - public double? Woods - { - get; - set; - } + public double? Woods { get; set; } [JsonPropertyName("bigmap")] - public double? BigMap - { - get; - set; - } + public double? BigMap { get; set; } [JsonPropertyName("factory4")] - public double? Factory4 - { - get; - set; - } + public double? Factory4 { get; set; } [JsonPropertyName("laboratory")] - public double? Laboratory - { - get; - set; - } + public double? Laboratory { get; set; } } public record ArtilleryShelling @@ -268,25 +144,13 @@ public record ArtilleryShelling public Dictionary ExtensionData { get; set; } [JsonPropertyName("ArtilleryMapsConfigs")] - public Dictionary? ArtilleryMapsConfigs - { - get; - set; - } + public Dictionary? ArtilleryMapsConfigs { get; set; } [JsonPropertyName("ProjectileExplosionParams")] - public ProjectileExplosionParams? ProjectileExplosionParams - { - get; - set; - } + public ProjectileExplosionParams? ProjectileExplosionParams { get; set; } [JsonPropertyName("MaxCalledShellingCount")] - public double? MaxCalledShellingCount - { - get; - set; - } + public double? MaxCalledShellingCount { get; set; } } public record ArtilleryMapSettings @@ -295,81 +159,37 @@ public record ArtilleryMapSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("PlanedShellingOn")] - public bool? PlanedShellingOn - { - get; - set; - } + public bool? PlanedShellingOn { get; set; } [JsonPropertyName("InitShellingTimer")] - public double? InitShellingTimer - { - get; - set; - } + public double? InitShellingTimer { get; set; } [JsonPropertyName("BeforeShellingSignalTime")] - public double? BeforeShellingSignalTime - { - get; - set; - } + public double? BeforeShellingSignalTime { get; set; } [JsonPropertyName("ShellingCount")] - public double? ShellingCount - { - get; - set; - } + public double? ShellingCount { get; set; } [JsonPropertyName("ZonesInShelling")] - public double? ZonesInShelling - { - get; - set; - } + public double? ZonesInShelling { get; set; } [JsonPropertyName("NewZonesForEachShelling")] - public bool? NewZonesForEachShelling - { - get; - set; - } + public bool? NewZonesForEachShelling { get; set; } [JsonPropertyName("InitCalledShellingTime")] - public double? InitCalledShellingTime - { - get; - set; - } + public double? InitCalledShellingTime { get; set; } [JsonPropertyName("ShellingZones")] - public List? ShellingZones - { - get; - set; - } + public List? ShellingZones { get; set; } [JsonPropertyName("Brigades")] - public List? Brigades - { - get; - set; - } + public List? Brigades { get; set; } [JsonPropertyName("ArtilleryShellingAirDropSettings")] - public ArtilleryShellingAirDropSettings? ArtilleryShellingAirDropSettings - { - get; - set; - } + public ArtilleryShellingAirDropSettings? ArtilleryShellingAirDropSettings { get; set; } [JsonPropertyName("PauseBetweenShellings")] - public XYZ? PauseBetweenShellings - { - get; - set; - } + public XYZ? PauseBetweenShellings { get; set; } } public record ShellingZone @@ -378,123 +198,55 @@ public record ShellingZone public Dictionary ExtensionData { get; set; } [JsonPropertyName("ID")] - public double? ID - { - get; - set; - } + public double? ID { get; set; } [JsonPropertyName("PointsInShellings")] - public XYZ? PointsInShellings - { - get; - set; - } + public XYZ? PointsInShellings { get; set; } [JsonPropertyName("ShellingRounds")] - public double? ShellingRounds - { - get; - set; - } + public double? ShellingRounds { get; set; } [JsonPropertyName("ShotCount")] - public double? ShotCount - { - get; - set; - } + public double? ShotCount { get; set; } [JsonPropertyName("PauseBetweenRounds")] - public XYZ? PauseBetweenRounds - { - get; - set; - } + public XYZ? PauseBetweenRounds { get; set; } [JsonPropertyName("PauseBetweenShots")] - public XYZ? PauseBetweenShots - { - get; - set; - } + public XYZ? PauseBetweenShots { get; set; } [JsonPropertyName("Center")] - public XYZ? Center - { - get; - set; - } + public XYZ? Center { get; set; } [JsonPropertyName("Rotate")] - public double? Rotate - { - get; - set; - } + public double? Rotate { get; set; } [JsonPropertyName("GridStep")] - public XYZ? GridStep - { - get; - set; - } + public XYZ? GridStep { get; set; } [JsonPropertyName("Points")] - public XYZ? Points - { - get; - set; - } + public XYZ? Points { get; set; } [JsonPropertyName("PointRadius")] - public double? PointRadius - { - get; - set; - } + public double? PointRadius { get; set; } [JsonPropertyName("ExplosionDistanceRange")] - public XYZ? ExplosionDistanceRange - { - get; - set; - } + public XYZ? ExplosionDistanceRange { get; set; } [JsonPropertyName("AlarmStages")] - public List? AlarmStages - { - get; - set; - } + public List? AlarmStages { get; set; } [JsonPropertyName("BeforeShellingSignalTime")] - public double? BeforeShellingSignalTime - { - get; - set; - } + public double? BeforeShellingSignalTime { get; set; } [JsonPropertyName("UsedInPlanedShelling")] - public bool? UsedInPlanedShelling - { - get; - set; - } + public bool? UsedInPlanedShelling { get; set; } [JsonPropertyName("UseInCalledShelling")] - public bool? UseInCalledShelling - { - get; - set; - } + public bool? UseInCalledShelling { get; set; } [JsonPropertyName("IsActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } } public record AlarmStage @@ -503,11 +255,7 @@ public record AlarmStage public Dictionary ExtensionData { get; set; } [JsonPropertyName("Value")] - public Position? Value - { - get; - set; - } + public Position? Value { get; set; } } public record Brigade @@ -516,18 +264,10 @@ public record Brigade public Dictionary ExtensionData { get; set; } [JsonPropertyName("ID")] - public double? Id - { - get; - set; - } + public double? Id { get; set; } [JsonPropertyName("ArtilleryGuns")] - public List? ArtilleryGuns - { - get; - set; - } + public List? ArtilleryGuns { get; set; } } public record ArtilleryGun @@ -536,11 +276,7 @@ public record ArtilleryGun public Dictionary ExtensionData { get; set; } [JsonPropertyName("Position")] - public XYZ? Position - { - get; - set; - } + public XYZ? Position { get; set; } } public record ArtilleryShellingAirDropSettings @@ -549,32 +285,16 @@ public record ArtilleryShellingAirDropSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("UseAirDrop")] - public bool? UseAirDrop - { - get; - set; - } + public bool? UseAirDrop { get; set; } [JsonPropertyName("AirDropTime")] - public double? AirDropTime - { - get; - set; - } + public double? AirDropTime { get; set; } [JsonPropertyName("AirDropPosition")] - public XYZ? AirDropPosition - { - get; - set; - } + public XYZ? AirDropPosition { get; set; } [JsonPropertyName("LootTemplateId")] - public string? LootTemplateId - { - get; - set; - } + public string? LootTemplateId { get; set; } } public record ProjectileExplosionParams @@ -583,107 +303,51 @@ public record ProjectileExplosionParams public Dictionary ExtensionData { get; set; } [JsonPropertyName("Blindness")] - public XYZ? Blindness - { - get; - set; - } + public XYZ? Blindness { get; set; } [JsonPropertyName("Contusion")] - public XYZ? Contusion - { - get; - set; - } + public XYZ? Contusion { get; set; } [JsonPropertyName("ArmorDistanceDistanceDamage")] - public XYZ? ArmorDistanceDistanceDamage - { - get; - set; - } + public XYZ? ArmorDistanceDistanceDamage { get; set; } // Checked in client [JsonPropertyName("MinExplosionDistance")] - public double? MinExplosionDistance - { - get; - set; - } + public double? MinExplosionDistance { get; set; } [JsonPropertyName("MaxExplosionDistance")] - public float? MaxExplosionDistance - { - get; - set; - } + public float? MaxExplosionDistance { get; set; } // Checked in client [JsonPropertyName("FragmentsCount")] - public int? FragmentsCount - { - get; - set; - } + public int? FragmentsCount { get; set; } [JsonPropertyName("Strength")] - public double? Strength - { - get; - set; - } + public double? Strength { get; set; } // Checked in client [JsonPropertyName("ArmorDamage")] - public double? ArmorDamage - { - get; - set; - } + public double? ArmorDamage { get; set; } // Checked in client [JsonPropertyName("StaminaBurnRate")] - public double? StaminaBurnRate - { - get; - set; - } + public double? StaminaBurnRate { get; set; } // Checked in client [JsonPropertyName("PenetrationPower")] - public double? PenetrationPower - { - get; - set; - } + public double? PenetrationPower { get; set; } [JsonPropertyName("DirectionalDamageAngle")] - public double? DirectionalDamageAngle - { - get; - set; - } + public double? DirectionalDamageAngle { get; set; } [JsonPropertyName("DirectionalDamageMultiplier")] - public double? DirectionalDamageMultiplier - { - get; - set; - } + public double? DirectionalDamageMultiplier { get; set; } [JsonPropertyName("FragmentType")] - public string? FragmentType - { - get; - set; - } + public string? FragmentType { get; set; } [JsonPropertyName("DeadlyDistance")] - public double? DeadlyDistance - { - get; - set; - } + public double? DeadlyDistance { get; set; } } public record Config @@ -692,752 +356,324 @@ public record Config public Dictionary ExtensionData { get; set; } [JsonPropertyName("ArtilleryShelling")] - public ArtilleryShelling? ArtilleryShelling - { - get; - set; - } + public ArtilleryShelling? ArtilleryShelling { get; set; } [JsonPropertyName("AudioSettings")] - public GlobalAudioSettings? AudioSettings - { - get; - set; - } + public GlobalAudioSettings? AudioSettings { get; set; } [JsonPropertyName("content")] - public Content? Content - { - get; - set; - } + public Content? Content { get; set; } [JsonPropertyName("AimPunchMagnitude")] - public double? AimPunchMagnitude - { - get; - set; - } + public double? AimPunchMagnitude { get; set; } [JsonPropertyName("WeaponSkillProgressRate")] - public double? WeaponSkillProgressRate - { - get; - set; - } + public double? WeaponSkillProgressRate { get; set; } [JsonPropertyName("SkillAtrophy")] - public bool? SkillAtrophy - { - get; - set; - } + public bool? SkillAtrophy { get; set; } [JsonPropertyName("exp")] - public Exp? Exp - { - get; - set; - } + public Exp? Exp { get; set; } [JsonPropertyName("t_base_looting")] - public double? TBaseLooting - { - get; - set; - } + public double? TBaseLooting { get; set; } [JsonPropertyName("t_base_lockpicking")] - public double? TBaseLockpicking - { - get; - set; - } + public double? TBaseLockpicking { get; set; } [JsonPropertyName("armor")] - public Armor? Armor - { - get; - set; - } + public Armor? Armor { get; set; } [JsonPropertyName("SessionsToShowHotKeys")] - public double? SessionsToShowHotKeys - { - get; - set; - } + public double? SessionsToShowHotKeys { get; set; } [JsonPropertyName("MaxBotsAliveOnMap")] - public double? MaxBotsAliveOnMap - { - get; - set; - } + public double? MaxBotsAliveOnMap { get; set; } [JsonPropertyName("MaxBotsAliveOnMapPvE")] - public double? MaxBotsAliveOnMapPvE - { - get; - set; - } + public double? MaxBotsAliveOnMapPvE { get; set; } [JsonPropertyName("RunddansSettings")] - public RunddansSettings? RunddansSettings - { - get; - set; - } + public RunddansSettings? RunddansSettings { get; set; } // Checked in client [JsonPropertyName("SavagePlayCooldown")] - public int? SavagePlayCooldown - { - get; - set; - } + public int? SavagePlayCooldown { get; set; } [JsonPropertyName("SavagePlayCooldownNdaFree")] - public double? SavagePlayCooldownNdaFree - { - get; - set; - } + public double? SavagePlayCooldownNdaFree { get; set; } [JsonPropertyName("SeasonActivity")] - public SeasonActivity? SeasonActivity - { - get; - set; - } + public SeasonActivity? SeasonActivity { get; set; } [JsonPropertyName("MarksmanAccuracy")] - public double? MarksmanAccuracy - { - get; - set; - } + public double? MarksmanAccuracy { get; set; } [JsonPropertyName("SavagePlayCooldownDevelop")] - public double? SavagePlayCooldownDevelop - { - get; - set; - } + public double? SavagePlayCooldownDevelop { get; set; } [JsonPropertyName("TODSkyDate")] - public string? TODSkyDate - { - get; - set; - } + public string? TODSkyDate { get; set; } [JsonPropertyName("Mastering")] - public Mastering[] Mastering - { - get; - set; - } + public Mastering[] Mastering { get; set; } [JsonPropertyName("GlobalItemPriceModifier")] - public double? GlobalItemPriceModifier - { - get; - set; - } + public double? GlobalItemPriceModifier { get; set; } [JsonPropertyName("TradingUnlimitedItems")] - public bool? TradingUnlimitedItems - { - get; - set; - } + public bool? TradingUnlimitedItems { get; set; } [JsonPropertyName("TradingUnsetPersonalLimitItems")] - public bool? TradingUnsetPersonalLimitItems - { - get; - set; - } + public bool? TradingUnsetPersonalLimitItems { get; set; } [JsonPropertyName("TransitSettings")] - public TransitSettings? TransitSettings - { - get; - set; - } + public TransitSettings? TransitSettings { get; set; } [JsonPropertyName("Triggers")] - public Triggers? Triggers - { - get; - set; - } + public Triggers? Triggers { get; set; } [JsonPropertyName("TripwiresSettings")] - public TripwiresSettings? TripwiresSettings - { - get; - set; - } + public TripwiresSettings? TripwiresSettings { get; set; } [JsonPropertyName("MaxLoyaltyLevelForAll")] - public bool? MaxLoyaltyLevelForAll - { - get; - set; - } + public bool? MaxLoyaltyLevelForAll { get; set; } [JsonPropertyName("MountingSettings")] - public MountingSettings? MountingSettings - { - get; - set; - } + public MountingSettings? MountingSettings { get; set; } [JsonPropertyName("GlobalLootChanceModifier")] - public double? GlobalLootChanceModifier - { - get; - set; - } + public double? GlobalLootChanceModifier { get; set; } [JsonPropertyName("GlobalLootChanceModifierPvE")] - public double? GlobalLootChanceModifierPvE - { - get; - set; - } + public double? GlobalLootChanceModifierPvE { get; set; } [JsonPropertyName("GraphicSettings")] - public GraphicSettings? GraphicSettings - { - get; - set; - } + public GraphicSettings? GraphicSettings { get; set; } [JsonPropertyName("TimeBeforeDeploy")] - public double? TimeBeforeDeploy - { - get; - set; - } + public double? TimeBeforeDeploy { get; set; } [JsonPropertyName("TimeBeforeDeployLocal")] - public double? TimeBeforeDeployLocal - { - get; - set; - } + public double? TimeBeforeDeployLocal { get; set; } [JsonPropertyName("TradingSetting")] - public double? TradingSetting - { - get; - set; - } + public double? TradingSetting { get; set; } [JsonPropertyName("TradingSettings")] - public TradingSettings? TradingSettings - { - get; - set; - } + public TradingSettings? TradingSettings { get; set; } [JsonPropertyName("ItemsCommonSettings")] - public ItemsCommonSettings? ItemsCommonSettings - { - get; - set; - } + public ItemsCommonSettings? ItemsCommonSettings { get; set; } [JsonPropertyName("LoadTimeSpeedProgress")] - public double? LoadTimeSpeedProgress - { - get; - set; - } + public double? LoadTimeSpeedProgress { get; set; } + [JsonPropertyName("MailItemsExpirationTimeLimitWarning")] - public double? MailItemsExpirationTimeLimitWarning - { - get; - set; - } + public double? MailItemsExpirationTimeLimitWarning { get; set; } [JsonPropertyName("BaseLoadTime")] - public double? BaseLoadTime - { - get; - set; - } + public double? BaseLoadTime { get; set; } [JsonPropertyName("BaseUnloadTime")] - public double? BaseUnloadTime - { - get; - set; - } + public double? BaseUnloadTime { get; set; } [JsonPropertyName("BaseCheckTime")] - public double? BaseCheckTime - { - get; - set; - } + public double? BaseCheckTime { get; set; } [JsonPropertyName("BluntDamageReduceFromSoftArmorMod")] - public double? BluntDamageReduceFromSoftArmorMod - { - get; - set; - } + public double? BluntDamageReduceFromSoftArmorMod { get; set; } [JsonPropertyName("BodyPartColliderSettings")] - public BodyPartColliderSettings? BodyPartColliderSettings - { - get; - set; - } + public BodyPartColliderSettings? BodyPartColliderSettings { get; set; } [JsonPropertyName("Customization")] - public Customization? Customization - { - get; - set; - } + public Customization? Customization { get; set; } [JsonPropertyName("UncheckOnShot")] - public bool? UncheckOnShot - { - get; - set; - } + public bool? UncheckOnShot { get; set; } [JsonPropertyName("BotsEnabled")] - public bool? BotsEnabled - { - get; - set; - } + public bool? BotsEnabled { get; set; } [JsonPropertyName("BufferZone")] - public BufferZone? BufferZone - { - get; - set; - } + public BufferZone? BufferZone { get; set; } [JsonPropertyName("Airdrop")] - public AirdropGlobalSettings? Airdrop - { - get; - set; - } + public AirdropGlobalSettings? Airdrop { get; set; } [JsonPropertyName("ArmorMaterials")] - public Dictionary? ArmorMaterials - { - get; - set; - } + public Dictionary? ArmorMaterials { get; set; } [JsonPropertyName("ArenaEftTransferSettings")] - public ArenaEftTransferSettings - ArenaEftTransferSettings - { - get; - set; - } // TODO: this needs to be looked into, there are two types further down commented out with the same name + public ArenaEftTransferSettings ArenaEftTransferSettings { get; set; } // TODO: this needs to be looked into, there are two types further down commented out with the same name [JsonPropertyName("KarmaCalculationSettings")] - public KarmaCalculationSettings? KarmaCalculationSettings - { - get; - set; - } + public KarmaCalculationSettings? KarmaCalculationSettings { get; set; } [JsonPropertyName("LegsOverdamage")] - public double? LegsOverdamage - { - get; - set; - } + public double? LegsOverdamage { get; set; } [JsonPropertyName("HandsOverdamage")] - public double? HandsOverdamage - { - get; - set; - } + public double? HandsOverdamage { get; set; } [JsonPropertyName("StomachOverdamage")] - public double? StomachOverdamage - { - get; - set; - } + public double? StomachOverdamage { get; set; } [JsonPropertyName("Health")] - public Health? Health - { - get; - set; - } + public Health? Health { get; set; } [JsonPropertyName("rating")] - public Rating? Rating - { - get; - set; - } + public Rating? Rating { get; set; } [JsonPropertyName("tournament")] - public Tournament? Tournament - { - get; - set; - } + public Tournament? Tournament { get; set; } [JsonPropertyName("QuestSettings")] - public QuestSettings? QuestSettings - { - get; - set; - } + public QuestSettings? QuestSettings { get; set; } [JsonPropertyName("RagFair")] - public RagFair? RagFair - { - get; - set; - } + public RagFair? RagFair { get; set; } [JsonPropertyName("handbook")] - public Handbook? Handbook - { - get; - set; - } + public Handbook? Handbook { get; set; } [JsonPropertyName("FractureCausedByFalling")] - public Probability? FractureCausedByFalling - { - get; - set; - } + public Probability? FractureCausedByFalling { get; set; } [JsonPropertyName("FractureCausedByBulletHit")] - public Probability? FractureCausedByBulletHit - { - get; - set; - } + public Probability? FractureCausedByBulletHit { get; set; } [JsonPropertyName("WAVE_COEF_LOW")] - public double? WaveCoefficientLow - { - get; - set; - } + public double? WaveCoefficientLow { get; set; } [JsonPropertyName("WAVE_COEF_MID")] - public double? WaveCoefficientMid - { - get; - set; - } + public double? WaveCoefficientMid { get; set; } [JsonPropertyName("WAVE_COEF_HIGH")] - public double? WaveCoefficientHigh - { - get; - set; - } + public double? WaveCoefficientHigh { get; set; } [JsonPropertyName("WAVE_COEF_HORDE")] - public double? WaveCoefficientHorde - { - get; - set; - } + public double? WaveCoefficientHorde { get; set; } [JsonPropertyName("Stamina")] - public Stamina? Stamina - { - get; - set; - } + public Stamina? Stamina { get; set; } [JsonPropertyName("StaminaRestoration")] - public StaminaRestoration? StaminaRestoration - { - get; - set; - } + public StaminaRestoration? StaminaRestoration { get; set; } [JsonPropertyName("StaminaDrain")] - public StaminaDrain? StaminaDrain - { - get; - set; - } + public StaminaDrain? StaminaDrain { get; set; } [JsonPropertyName("RequirementReferences")] - public RequirementReferences? RequirementReferences - { - get; - set; - } + public RequirementReferences? RequirementReferences { get; set; } [JsonPropertyName("RestrictionsInRaid")] - public RestrictionsInRaid[] RestrictionsInRaid - { - get; - set; - } + public RestrictionsInRaid[] RestrictionsInRaid { get; set; } [JsonPropertyName("SkillMinEffectiveness")] - public double? SkillMinEffectiveness - { - get; - set; - } + public double? SkillMinEffectiveness { get; set; } [JsonPropertyName("SkillFatiguePerPoint")] - public double? SkillFatiguePerPoint - { - get; - set; - } + public double? SkillFatiguePerPoint { get; set; } [JsonPropertyName("SkillFreshEffectiveness")] - public double? SkillFreshEffectiveness - { - get; - set; - } + public double? SkillFreshEffectiveness { get; set; } [JsonPropertyName("SkillFreshPoints")] - public double? SkillFreshPoints - { - get; - set; - } + public double? SkillFreshPoints { get; set; } [JsonPropertyName("SkillPointsBeforeFatigue")] - public double? SkillPointsBeforeFatigue - { - get; - set; - } + public double? SkillPointsBeforeFatigue { get; set; } [JsonPropertyName("SkillFatigueReset")] - public double? SkillFatigueReset - { - get; - set; - } + public double? SkillFatigueReset { get; set; } [JsonPropertyName("DiscardLimitsEnabled")] - public bool? DiscardLimitsEnabled - { - get; - set; - } + public bool? DiscardLimitsEnabled { get; set; } [JsonPropertyName("EnvironmentSettings")] - public EnvironmentUISettings? EnvironmentSettings - { - get; - set; - } + public EnvironmentUISettings? EnvironmentSettings { get; set; } [JsonPropertyName("EventSettings")] - public EventSettings? EventSettings - { - get; - set; - } + public EventSettings? EventSettings { get; set; } [JsonPropertyName("FavoriteItemsSettings")] - public FavoriteItemsSettings? FavoriteItemsSettings - { - get; - set; - } + public FavoriteItemsSettings? FavoriteItemsSettings { get; set; } [JsonPropertyName("VaultingSettings")] - public VaultingSettings? VaultingSettings - { - get; - set; - } + public VaultingSettings? VaultingSettings { get; set; } [JsonPropertyName("BTRSettings")] - public BTRSettings? BTRSettings - { - get; - set; - } + public BTRSettings? BTRSettings { get; set; } [JsonPropertyName("EventType")] - public List EventType - { - get; - set; - } + public List EventType { get; set; } [JsonPropertyName("WalkSpeed")] - public XYZ? WalkSpeed - { - get; - set; - } + public XYZ? WalkSpeed { get; set; } [JsonPropertyName("SprintSpeed")] - public XYZ? SprintSpeed - { - get; - set; - } + public XYZ? SprintSpeed { get; set; } [JsonPropertyName("SquadSettings")] - public SquadSettings? SquadSettings - { - get; - set; - } + public SquadSettings? SquadSettings { get; set; } [JsonPropertyName("SkillEnduranceWeightThreshold")] - public double? SkillEnduranceWeightThreshold - { - get; - set; - } + public double? SkillEnduranceWeightThreshold { get; set; } [JsonPropertyName("TeamSearchingTimeout")] - public double? TeamSearchingTimeout - { - get; - set; - } + public double? TeamSearchingTimeout { get; set; } [JsonPropertyName("Insurance")] - public Insurance? Insurance - { - get; - set; - } + public Insurance? Insurance { get; set; } [JsonPropertyName("SkillExpPerLevel")] - public double? SkillExpPerLevel - { - get; - set; - } + public double? SkillExpPerLevel { get; set; } [JsonPropertyName("GameSearchingTimeout")] - public double? GameSearchingTimeout - { - get; - set; - } + public double? GameSearchingTimeout { get; set; } [JsonPropertyName("WallContusionAbsorption")] - public XYZ? WallContusionAbsorption - { - get; - set; - } + public XYZ? WallContusionAbsorption { get; set; } [JsonPropertyName("WeaponFastDrawSettings")] - public WeaponFastDrawSettings? WeaponFastDrawSettings - { - get; - set; - } + public WeaponFastDrawSettings? WeaponFastDrawSettings { get; set; } [JsonPropertyName("SkillsSettings")] - public SkillsSettings? SkillsSettings - { - get; - set; - } + public SkillsSettings? SkillsSettings { get; set; } [JsonPropertyName("AzimuthPanelShowsPlayerOrientation")] - public bool? AzimuthPanelShowsPlayerOrientation - { - get; - set; - } + public bool? AzimuthPanelShowsPlayerOrientation { get; set; } [JsonPropertyName("Aiming")] - public Aiming? Aiming - { - get; - set; - } + public Aiming? Aiming { get; set; } [JsonPropertyName("Malfunction")] - public Malfunction? Malfunction - { - get; - set; - } + public Malfunction? Malfunction { get; set; } [JsonPropertyName("Overheat")] - public Overheat? Overheat - { - get; - set; - } + public Overheat? Overheat { get; set; } [JsonPropertyName("FenceSettings")] - public FenceSettings? FenceSettings - { - get; - set; - } + public FenceSettings? FenceSettings { get; set; } [JsonPropertyName("TestValue")] - public double? TestValue - { - get; - set; - } + public double? TestValue { get; set; } [JsonPropertyName("Inertia")] - public Inertia? Inertia - { - get; - set; - } + public Inertia? Inertia { get; set; } [JsonPropertyName("Ballistic")] - public Ballistic? Ballistic - { - get; - set; - } + public Ballistic? Ballistic { get; set; } [JsonPropertyName("RepairSettings")] - public RepairSettings? RepairSettings - { - get; - set; - } + public RepairSettings? RepairSettings { get; set; } - public CoopSettings? CoopSettings - { - get; - set; - } + public CoopSettings? CoopSettings { get; set; } - public PveSettings? PveSettings - { - get; - set; - } + public PveSettings? PveSettings { get; set; } } public record GlobalAudioSettings @@ -1446,11 +682,7 @@ public record GlobalAudioSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("RadioBroadcastSettings")] - public RadioBroadcastSettings? RadioBroadcastSettings - { - get; - set; - } + public RadioBroadcastSettings? RadioBroadcastSettings { get; set; } } public record Triggers @@ -1458,11 +690,7 @@ public record Triggers [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary>? HandlerDamage - { - get; - set; - } + public Dictionary>? HandlerDamage { get; set; } } public record DamageData @@ -1470,18 +698,10 @@ public record DamageData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public int? Amount - { - get; - set; - } + public int? Amount { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] - public BodyPartColliderType BodyPartColliderType - { - get; - set; - } + public BodyPartColliderType BodyPartColliderType { get; set; } } public record HandlerDamageObject @@ -1489,17 +709,9 @@ public record HandlerDamageObject [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public int? Amount - { - get; - set; - } + public int? Amount { get; set; } - public string? BodyPartColliderType - { - get; - set; - } + public string? BodyPartColliderType { get; set; } } public record PveSettings @@ -1507,17 +719,9 @@ public record PveSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? AvailableVersions - { - get; - set; - } + public List? AvailableVersions { get; set; } - public bool? ModeEnabled - { - get; - set; - } + public bool? ModeEnabled { get; set; } } public record CoopSettings @@ -1525,11 +729,7 @@ public record CoopSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? AvailableVersions - { - get; - set; - } + public List? AvailableVersions { get; set; } } public record RunddansSettings @@ -1538,130 +738,58 @@ public record RunddansSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("accessKeys")] - public List? AccessKeys - { - get; - set; - } + public List? AccessKeys { get; set; } [JsonPropertyName("active")] - public bool? Active - { - get; - set; - } + public bool? Active { get; set; } [JsonPropertyName("activePVE")] - public bool? ActivePVE - { - get; - set; - } + public bool? ActivePVE { get; set; } [JsonPropertyName("applyFrozenEverySec")] - public double? ApplyFrozenEverySec - { - get; - set; - } + public double? ApplyFrozenEverySec { get; set; } [JsonPropertyName("consumables")] - public List? Consumables - { - get; - set; - } + public List? Consumables { get; set; } [JsonPropertyName("drunkImmunitySec")] - public double? DrunkImmunitySec - { - get; - set; - } + public double? DrunkImmunitySec { get; set; } [JsonPropertyName("durability")] - public XY? Durability - { - get; - set; - } + public XY? Durability { get; set; } [JsonPropertyName("fireDistanceToHeat")] - public double? FireDistanceToHeat - { - get; - set; - } + public double? FireDistanceToHeat { get; set; } [JsonPropertyName("grenadeDistanceToBreak")] - public double? GrenadeDistanceToBreak - { - get; - set; - } + public double? GrenadeDistanceToBreak { get; set; } [JsonPropertyName("interactionDistance")] - public double? InteractionDistance - { - get; - set; - } + public double? InteractionDistance { get; set; } [JsonPropertyName("knifeCritChanceToBreak")] - public double? KnifeCritChanceToBreak - { - get; - set; - } + public double? KnifeCritChanceToBreak { get; set; } [JsonPropertyName("locations")] - public List? Locations - { - get; - set; - } + public List? Locations { get; set; } [JsonPropertyName("multitoolRepairSec")] - public double? MultitoolRepairSec - { - get; - set; - } + public double? MultitoolRepairSec { get; set; } [JsonPropertyName("nonExitsLocations")] - public List? NonExitsLocations - { - get; - set; - } + public List? NonExitsLocations { get; set; } [JsonPropertyName("rainForFrozen")] - public double? RainForFrozen - { - get; - set; - } + public double? RainForFrozen { get; set; } [JsonPropertyName("repairSec")] - public double? RepairSec - { - get; - set; - } + public double? RepairSec { get; set; } [JsonPropertyName("secToBreak")] - public XY? SecToBreak - { - get; - set; - } + public XY? SecToBreak { get; set; } [JsonPropertyName("sleighLocations")] - public List? SleighLocations - { - get; - set; - } + public List? SleighLocations { get; set; } } public record SeasonActivity @@ -1670,11 +798,7 @@ public record SeasonActivity public Dictionary ExtensionData { get; set; } [JsonPropertyName("InfectionHalloween")] - public SeasonActivityHalloween? InfectionHalloween - { - get; - set; - } + public SeasonActivityHalloween? InfectionHalloween { get; set; } } public record SeasonActivityHalloween @@ -1683,25 +807,13 @@ public record SeasonActivityHalloween public Dictionary ExtensionData { get; set; } [JsonPropertyName("DisplayUIEnabled")] - public bool? DisplayUIEnabled - { - get; - set; - } + public bool? DisplayUIEnabled { get; set; } [JsonPropertyName("Enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("ZombieBleedMul")] - public double? ZombieBleedMul - { - get; - set; - } + public double? ZombieBleedMul { get; set; } } public record EnvironmentUISettings @@ -1709,11 +821,7 @@ public record EnvironmentUISettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public EnvironmentUIData? EnvironmentUIData - { - get; - set; - } + public EnvironmentUIData? EnvironmentUIData { get; set; } } public record EnvironmentUIData @@ -1721,11 +829,7 @@ public record EnvironmentUIData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string[] TheUnheardEditionEnvironmentUiType - { - get; - set; - } + public string[] TheUnheardEditionEnvironmentUiType { get; set; } } public record BodyPartColliderSettings @@ -1733,161 +837,57 @@ public record BodyPartColliderSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public BodyPartColliderPart? BackHead - { - get; - set; - } + public BodyPartColliderPart? BackHead { get; set; } - public BodyPartColliderPart? Ears - { - get; - set; - } + public BodyPartColliderPart? Ears { get; set; } - public BodyPartColliderPart? Eyes - { - get; - set; - } + public BodyPartColliderPart? Eyes { get; set; } - public BodyPartColliderPart? HeadCommon - { - get; - set; - } + public BodyPartColliderPart? HeadCommon { get; set; } - public BodyPartColliderPart? Jaw - { - get; - set; - } + public BodyPartColliderPart? Jaw { get; set; } - public BodyPartColliderPart? LeftCalf - { - get; - set; - } + public BodyPartColliderPart? LeftCalf { get; set; } - public BodyPartColliderPart? LeftForearm - { - get; - set; - } + public BodyPartColliderPart? LeftForearm { get; set; } - public BodyPartColliderPart? LeftSideChestDown - { - get; - set; - } + public BodyPartColliderPart? LeftSideChestDown { get; set; } - public BodyPartColliderPart? LeftSideChestUp - { - get; - set; - } + public BodyPartColliderPart? LeftSideChestUp { get; set; } - public BodyPartColliderPart? LeftThigh - { - get; - set; - } + public BodyPartColliderPart? LeftThigh { get; set; } - public BodyPartColliderPart? LeftUpperArm - { - get; - set; - } + public BodyPartColliderPart? LeftUpperArm { get; set; } - public BodyPartColliderPart? NeckBack - { - get; - set; - } + public BodyPartColliderPart? NeckBack { get; set; } - public BodyPartColliderPart? NeckFront - { - get; - set; - } + public BodyPartColliderPart? NeckFront { get; set; } - public BodyPartColliderPart? ParietalHead - { - get; - set; - } + public BodyPartColliderPart? ParietalHead { get; set; } - public BodyPartColliderPart? Pelvis - { - get; - set; - } + public BodyPartColliderPart? Pelvis { get; set; } - public BodyPartColliderPart? PelvisBack - { - get; - set; - } + public BodyPartColliderPart? PelvisBack { get; set; } - public BodyPartColliderPart? RibcageLow - { - get; - set; - } + public BodyPartColliderPart? RibcageLow { get; set; } - public BodyPartColliderPart? RibcageUp - { - get; - set; - } + public BodyPartColliderPart? RibcageUp { get; set; } - public BodyPartColliderPart? RightCalf - { - get; - set; - } + public BodyPartColliderPart? RightCalf { get; set; } - public BodyPartColliderPart? RightForearm - { - get; - set; - } + public BodyPartColliderPart? RightForearm { get; set; } - public BodyPartColliderPart? RightSideChestDown - { - get; - set; - } + public BodyPartColliderPart? RightSideChestDown { get; set; } - public BodyPartColliderPart? RightSideChestUp - { - get; - set; - } + public BodyPartColliderPart? RightSideChestUp { get; set; } - public BodyPartColliderPart? RightThigh - { - get; - set; - } + public BodyPartColliderPart? RightThigh { get; set; } - public BodyPartColliderPart? RightUpperArm - { - get; - set; - } + public BodyPartColliderPart? RightUpperArm { get; set; } - public BodyPartColliderPart? SpineDown - { - get; - set; - } + public BodyPartColliderPart? SpineDown { get; set; } - public BodyPartColliderPart? SpineTop - { - get; - set; - } + public BodyPartColliderPart? SpineTop { get; set; } } public record BodyPartColliderPart @@ -1896,25 +896,13 @@ public record BodyPartColliderPart public Dictionary ExtensionData { get; set; } [JsonPropertyName("PenetrationChance")] - public double? PenetrationChance - { - get; - set; - } + public double? PenetrationChance { get; set; } [JsonPropertyName("PenetrationDamageMod")] - public double? PenetrationDamageMod - { - get; - set; - } + public double? PenetrationDamageMod { get; set; } [JsonPropertyName("PenetrationLevel")] - public double? PenetrationLevel - { - get; - set; - } + public double? PenetrationLevel { get; set; } } public record WeaponFastDrawSettings @@ -1923,60 +911,28 @@ public record WeaponFastDrawSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("HandShakeCurveFrequency")] - public double? HandShakeCurveFrequency - { - get; - set; - } + public double? HandShakeCurveFrequency { get; set; } [JsonPropertyName("HandShakeCurveIntensity")] - public double? HandShakeCurveIntensity - { - get; - set; - } + public double? HandShakeCurveIntensity { get; set; } [JsonPropertyName("HandShakeMaxDuration")] - public double? HandShakeMaxDuration - { - get; - set; - } + public double? HandShakeMaxDuration { get; set; } [JsonPropertyName("HandShakeTremorIntensity")] - public double? HandShakeTremorIntensity - { - get; - set; - } + public double? HandShakeTremorIntensity { get; set; } [JsonPropertyName("WeaponFastSwitchMaxSpeedMult")] - public double? WeaponFastSwitchMaxSpeedMult - { - get; - set; - } + public double? WeaponFastSwitchMaxSpeedMult { get; set; } [JsonPropertyName("WeaponFastSwitchMinSpeedMult")] - public double? WeaponFastSwitchMinSpeedMult - { - get; - set; - } + public double? WeaponFastSwitchMinSpeedMult { get; set; } [JsonPropertyName("WeaponPistolFastSwitchMaxSpeedMult")] - public double? WeaponPistolFastSwitchMaxSpeedMult - { - get; - set; - } + public double? WeaponPistolFastSwitchMaxSpeedMult { get; set; } [JsonPropertyName("WeaponPistolFastSwitchMinSpeedMult")] - public double? WeaponPistolFastSwitchMinSpeedMult - { - get; - set; - } + public double? WeaponPistolFastSwitchMinSpeedMult { get; set; } } public record EventSettings @@ -1985,60 +941,28 @@ public record EventSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("EventActive")] - public bool? EventActive - { - get; - set; - } + public bool? EventActive { get; set; } [JsonPropertyName("EventTime")] - public double? EventTime - { - get; - set; - } + public double? EventTime { get; set; } [JsonPropertyName("EventWeather")] - public EventWeather? EventWeather - { - get; - set; - } + public EventWeather? EventWeather { get; set; } [JsonPropertyName("ExitTimeMultiplier")] - public double? ExitTimeMultiplier - { - get; - set; - } + public double? ExitTimeMultiplier { get; set; } [JsonPropertyName("StaminaMultiplier")] - public double? StaminaMultiplier - { - get; - set; - } + public double? StaminaMultiplier { get; set; } [JsonPropertyName("SummonFailedWeather")] - public EventWeather? SummonFailedWeather - { - get; - set; - } + public EventWeather? SummonFailedWeather { get; set; } [JsonPropertyName("SummonSuccessWeather")] - public EventWeather? SummonSuccessWeather - { - get; - set; - } + public EventWeather? SummonSuccessWeather { get; set; } [JsonPropertyName("WeatherChangeTime")] - public double? WeatherChangeTime - { - get; - set; - } + public double? WeatherChangeTime { get; set; } } public record EventWeather @@ -2047,67 +971,31 @@ public record EventWeather public Dictionary ExtensionData { get; set; } [JsonPropertyName("Cloudness")] - public double? Cloudness - { - get; - set; - } + public double? Cloudness { get; set; } [JsonPropertyName("Hour")] - public double? Hour - { - get; - set; - } + public double? Hour { get; set; } [JsonPropertyName("Minute")] - public double? Minute - { - get; - set; - } + public double? Minute { get; set; } [JsonPropertyName("Rain")] - public double? Rain - { - get; - set; - } + public double? Rain { get; set; } [JsonPropertyName("RainRandomness")] - public double? RainRandomness - { - get; - set; - } + public double? RainRandomness { get; set; } [JsonPropertyName("ScaterringFogDensity")] - public double? ScaterringFogDensity - { - get; - set; - } + public double? ScaterringFogDensity { get; set; } [JsonPropertyName("TopWindDirection")] - public XYZ? TopWindDirection - { - get; - set; - } + public XYZ? TopWindDirection { get; set; } [JsonPropertyName("Wind")] - public double? Wind - { - get; - set; - } + public double? Wind { get; set; } [JsonPropertyName("WindDirection")] - public double? WindDirection - { - get; - set; - } + public double? WindDirection { get; set; } } public record TransitSettings @@ -2116,95 +1004,43 @@ public record TransitSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("BearPriceMod")] - public double? BearPriceMod - { - get; - set; - } + public double? BearPriceMod { get; set; } [JsonPropertyName("ClearAllPlayerEffectsOnTransit")] - public bool? ClearAllPlayerEffectsOnTransit - { - get; - set; - } + public bool? ClearAllPlayerEffectsOnTransit { get; set; } [JsonPropertyName("CoefficientDiscountCharisma")] - public double? CoefficientDiscountCharisma - { - get; - set; - } + public double? CoefficientDiscountCharisma { get; set; } [JsonPropertyName("DeliveryMinPrice")] - public double? DeliveryMinPrice - { - get; - set; - } + public double? DeliveryMinPrice { get; set; } [JsonPropertyName("DeliveryPrice")] - public double? DeliveryPrice - { - get; - set; - } + public double? DeliveryPrice { get; set; } [JsonPropertyName("ModDeliveryCost")] - public double? ModDeliveryCost - { - get; - set; - } + public double? ModDeliveryCost { get; set; } [JsonPropertyName("PercentageOfMissingEnergyRestore")] - public double? PercentageOfMissingEnergyRestore - { - get; - set; - } + public double? PercentageOfMissingEnergyRestore { get; set; } [JsonPropertyName("PercentageOfMissingHealthRestore")] - public double? PercentageOfMissingHealthRestore - { - get; - set; - } + public double? PercentageOfMissingHealthRestore { get; set; } [JsonPropertyName("PercentageOfMissingWaterRestore")] - public double? PercentageOfMissingWaterRestore - { - get; - set; - } + public double? PercentageOfMissingWaterRestore { get; set; } [JsonPropertyName("RestoreHealthOnDestroyedParts")] - public bool? RestoreHealthOnDestroyedParts - { - get; - set; - } + public bool? RestoreHealthOnDestroyedParts { get; set; } [JsonPropertyName("ScavPriceMod")] - public double? ScavPriceMod - { - get; - set; - } + public double? ScavPriceMod { get; set; } [JsonPropertyName("UsecPriceMod")] - public double? UsecPriceMod - { - get; - set; - } + public double? UsecPriceMod { get; set; } [JsonPropertyName("active")] - public bool? Active - { - get; - set; - } + public bool? Active { get; set; } } public record TripwiresSettings @@ -2213,102 +1049,46 @@ public record TripwiresSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("CollisionCapsuleCheckCoef")] - public double? CollisionCapsuleCheckCoef - { - get; - set; - } + public double? CollisionCapsuleCheckCoef { get; set; } [JsonPropertyName("CollisionCapsuleRadius")] - public double? CollisionCapsuleRadius - { - get; - set; - } + public double? CollisionCapsuleRadius { get; set; } [JsonPropertyName("DefuseTimeSeconds")] - public double? DefuseTimeSeconds - { - get; - set; - } + public double? DefuseTimeSeconds { get; set; } [JsonPropertyName("DestroyedSeconds")] - public double? DestroyedSeconds - { - get; - set; - } + public double? DestroyedSeconds { get; set; } [JsonPropertyName("GroundDotProductTolerance")] - public double? GroundDotProductTolerance - { - get; - set; - } + public double? GroundDotProductTolerance { get; set; } [JsonPropertyName("InertSeconds")] - public double? InertSeconds - { - get; - set; - } + public double? InertSeconds { get; set; } [JsonPropertyName("InteractionSqrDistance")] - public double? InteractionSqrDistance - { - get; - set; - } + public double? InteractionSqrDistance { get; set; } [JsonPropertyName("MaxHeightDifference")] - public double? MaxHeightDifference - { - get; - set; - } + public double? MaxHeightDifference { get; set; } [JsonPropertyName("MaxLength")] - public double? MaxLength - { - get; - set; - } + public double? MaxLength { get; set; } [JsonPropertyName("MaxPreviewLength")] - public double? MaxPreviewLength - { - get; - set; - } + public double? MaxPreviewLength { get; set; } [JsonPropertyName("MaxTripwireToPlayerDistance")] - public double? MaxTripwireToPlayerDistance - { - get; - set; - } + public double? MaxTripwireToPlayerDistance { get; set; } [JsonPropertyName("MinLength")] - public double? MinLength - { - get; - set; - } + public double? MinLength { get; set; } [JsonPropertyName("MultitoolDefuseTimeSeconds")] - public double? MultitoolDefuseTimeSeconds - { - get; - set; - } + public double? MultitoolDefuseTimeSeconds { get; set; } [JsonPropertyName("ShotSqrDistance")] - public double? ShotSqrDistance - { - get; - set; - } + public double? ShotSqrDistance { get; set; } } public record MountingSettings @@ -2317,18 +1097,10 @@ public record MountingSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("MovementSettings")] - public MountingMovementSettings? MovementSettings - { - get; - set; - } + public MountingMovementSettings? MovementSettings { get; set; } [JsonPropertyName("PointDetectionSettings")] - public MountingPointDetectionSettings? PointDetectionSettings - { - get; - set; - } + public MountingPointDetectionSettings? PointDetectionSettings { get; set; } } public record MountingMovementSettings @@ -2337,109 +1109,49 @@ public record MountingMovementSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("ApproachTime")] - public double? ApproachTime - { - get; - set; - } + public double? ApproachTime { get; set; } [JsonPropertyName("ApproachTimeDeltaAngleModifier")] - public double? ApproachTimeDeltaAngleModifier - { - get; - set; - } + public double? ApproachTimeDeltaAngleModifier { get; set; } [JsonPropertyName("ExitTime")] - public double? ExitTime - { - get; - set; - } + public double? ExitTime { get; set; } [JsonPropertyName("MaxApproachTime")] - public double? MaxApproachTime - { - get; - set; - } + public double? MaxApproachTime { get; set; } [JsonPropertyName("MaxPitchLimitExcess")] - public double? MaxPitchLimitExcess - { - get; - set; - } + public double? MaxPitchLimitExcess { get; set; } [JsonPropertyName("MaxVerticalMountAngle")] - public double? MaxVerticalMountAngle - { - get; - set; - } + public double? MaxVerticalMountAngle { get; set; } [JsonPropertyName("MaxYawLimitExcess")] - public double? MaxYawLimitExcess - { - get; - set; - } + public double? MaxYawLimitExcess { get; set; } [JsonPropertyName("MinApproachTime")] - public double? MinApproachTime - { - get; - set; - } + public double? MinApproachTime { get; set; } [JsonPropertyName("MountingCameraSpeed")] - public double? MountingCameraSpeed - { - get; - set; - } + public double? MountingCameraSpeed { get; set; } [JsonPropertyName("MountingSwayFactorModifier")] - public double? MountingSwayFactorModifier - { - get; - set; - } + public double? MountingSwayFactorModifier { get; set; } [JsonPropertyName("PitchLimitHorizontal")] - public XYZ? PitchLimitHorizontal - { - get; - set; - } + public XYZ? PitchLimitHorizontal { get; set; } [JsonPropertyName("PitchLimitHorizontalBipod")] - public XYZ? PitchLimitHorizontalBipod - { - get; - set; - } + public XYZ? PitchLimitHorizontalBipod { get; set; } [JsonPropertyName("PitchLimitVertical")] - public XYZ? PitchLimitVertical - { - get; - set; - } + public XYZ? PitchLimitVertical { get; set; } [JsonPropertyName("RotationSpeedClamp")] - public double? RotationSpeedClamp - { - get; - set; - } + public double? RotationSpeedClamp { get; set; } [JsonPropertyName("SensitivityMultiplier")] - public double? SensitivityMultiplier - { - get; - set; - } + public double? SensitivityMultiplier { get; set; } } public record MountingPointDetectionSettings @@ -2448,151 +1160,67 @@ public record MountingPointDetectionSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("CheckHorizontalSecondaryOffset")] - public double? CheckHorizontalSecondaryOffset - { - get; - set; - } + public double? CheckHorizontalSecondaryOffset { get; set; } [JsonPropertyName("CheckWallOffset")] - public double? CheckWallOffset - { - get; - set; - } + public double? CheckWallOffset { get; set; } [JsonPropertyName("EdgeDetectionDistance")] - public double? EdgeDetectionDistance - { - get; - set; - } + public double? EdgeDetectionDistance { get; set; } [JsonPropertyName("GridMaxHeight")] - public double? GridMaxHeight - { - get; - set; - } + public double? GridMaxHeight { get; set; } [JsonPropertyName("GridMinHeight")] - public double? GridMinHeight - { - get; - set; - } + public double? GridMinHeight { get; set; } [JsonPropertyName("HorizontalGridFromTopOffset")] - public double? HorizontalGridFromTopOffset - { - get; - set; - } + public double? HorizontalGridFromTopOffset { get; set; } [JsonPropertyName("HorizontalGridSize")] - public double? HorizontalGridSize - { - get; - set; - } + public double? HorizontalGridSize { get; set; } [JsonPropertyName("HorizontalGridStepsAmount")] - public double? HorizontalGridStepsAmount - { - get; - set; - } + public double? HorizontalGridStepsAmount { get; set; } [JsonPropertyName("MaxFramesForRaycast")] - public double? MaxFramesForRaycast - { - get; - set; - } + public double? MaxFramesForRaycast { get; set; } [JsonPropertyName("MaxHorizontalMountAngleDotDelta")] - public double? MaxHorizontalMountAngleDotDelta - { - get; - set; - } + public double? MaxHorizontalMountAngleDotDelta { get; set; } [JsonPropertyName("MaxProneMountAngleDotDelta")] - public double? MaxProneMountAngleDotDelta - { - get; - set; - } + public double? MaxProneMountAngleDotDelta { get; set; } [JsonPropertyName("MaxVerticalMountAngleDotDelta")] - public double? MaxVerticalMountAngleDotDelta - { - get; - set; - } + public double? MaxVerticalMountAngleDotDelta { get; set; } [JsonPropertyName("PointHorizontalMountOffset")] - public double? PointHorizontalMountOffset - { - get; - set; - } + public double? PointHorizontalMountOffset { get; set; } [JsonPropertyName("PointVerticalMountOffset")] - public double? PointVerticalMountOffset - { - get; - set; - } + public double? PointVerticalMountOffset { get; set; } [JsonPropertyName("RaycastDistance")] - public double? RaycastDistance - { - get; - set; - } + public double? RaycastDistance { get; set; } [JsonPropertyName("SecondCheckVerticalDistance")] - public double? SecondCheckVerticalDistance - { - get; - set; - } + public double? SecondCheckVerticalDistance { get; set; } [JsonPropertyName("SecondCheckVerticalGridOffset")] - public double? SecondCheckVerticalGridOffset - { - get; - set; - } + public double? SecondCheckVerticalGridOffset { get; set; } [JsonPropertyName("SecondCheckVerticalGridSize")] - public double? SecondCheckVerticalGridSize - { - get; - set; - } + public double? SecondCheckVerticalGridSize { get; set; } [JsonPropertyName("SecondCheckVerticalGridSizeStepsAmount")] - public double? SecondCheckVerticalGridSizeStepsAmount - { - get; - set; - } + public double? SecondCheckVerticalGridSizeStepsAmount { get; set; } [JsonPropertyName("VerticalGridSize")] - public double? VerticalGridSize - { - get; - set; - } + public double? VerticalGridSize { get; set; } [JsonPropertyName("VerticalGridStepsAmount")] - public double? VerticalGridStepsAmount - { - get; - set; - } + public double? VerticalGridStepsAmount { get; set; } } public record GraphicSettings @@ -2601,11 +1229,7 @@ public record GraphicSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("ExperimentalFogInCity")] - public bool? ExperimentalFogInCity - { - get; - set; - } + public bool? ExperimentalFogInCity { get; set; } } public record BufferZone @@ -2614,25 +1238,13 @@ public record BufferZone public Dictionary ExtensionData { get; set; } [JsonPropertyName("CustomerAccessTime")] - public double? CustomerAccessTime - { - get; - set; - } + public double? CustomerAccessTime { get; set; } [JsonPropertyName("CustomerCriticalTimeStart")] - public double? CustomerCriticalTimeStart - { - get; - set; - } + public double? CustomerCriticalTimeStart { get; set; } [JsonPropertyName("CustomerKickNotifTime")] - public double? CustomerKickNotifTime - { - get; - set; - } + public double? CustomerKickNotifTime { get; set; } } public record ItemsCommonSettings @@ -2641,11 +1253,7 @@ public record ItemsCommonSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("ItemRemoveAfterInterruptionTime")] - public double? ItemRemoveAfterInterruptionTime - { - get; - set; - } + public double? ItemRemoveAfterInterruptionTime { get; set; } } public record TradingSettings @@ -2654,18 +1262,10 @@ public record TradingSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("BuyRestrictionMaxBonus")] - public Dictionary? BuyRestrictionMaxBonus - { - get; - set; - } + public Dictionary? BuyRestrictionMaxBonus { get; set; } [JsonPropertyName("BuyoutRestrictions")] - public BuyoutRestrictions? BuyoutRestrictions - { - get; - set; - } + public BuyoutRestrictions? BuyoutRestrictions { get; set; } } public record BuyRestrictionMaxBonus @@ -2674,11 +1274,7 @@ public record BuyRestrictionMaxBonus public Dictionary ExtensionData { get; set; } [JsonPropertyName("multiplier")] - public double? Multiplier - { - get; - set; - } + public double? Multiplier { get; set; } } public record BuyoutRestrictions @@ -2687,25 +1283,13 @@ public record BuyoutRestrictions public Dictionary ExtensionData { get; set; } [JsonPropertyName("MinDurability")] - public double? MinDurability - { - get; - set; - } + public double? MinDurability { get; set; } [JsonPropertyName("MinFoodDrinkResource")] - public double? MinFoodDrinkResource - { - get; - set; - } + public double? MinFoodDrinkResource { get; set; } [JsonPropertyName("MinMedsResource")] - public double? MinMedsResource - { - get; - set; - } + public double? MinMedsResource { get; set; } } public record Content @@ -2714,25 +1298,13 @@ public record Content public Dictionary ExtensionData { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public double? Port - { - get; - set; - } + public double? Port { get; set; } [JsonPropertyName("root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } } public record Exp @@ -2741,70 +1313,34 @@ public record Exp public Dictionary ExtensionData { get; set; } [JsonPropertyName("heal")] - public Heal? Heal - { - get; - set; - } + public Heal? Heal { get; set; } [JsonPropertyName("match_end")] - public MatchEnd? MatchEnd - { - get; - set; - } + public MatchEnd? MatchEnd { get; set; } [JsonPropertyName("kill")] - public Kill? Kill - { - get; - set; - } + public Kill? Kill { get; set; } [JsonPropertyName("level")] - public Level? Level - { - get; - set; - } + public Level? Level { get; set; } [JsonPropertyName("loot_attempts")] - public List? LootAttempts - { - get; - set; - } + public List? LootAttempts { get; set; } // Confirmed in client [JsonPropertyName("expForLevelOneDogtag")] - public double? ExpForLevelOneDogtag - { - get; - set; - } + public double? ExpForLevelOneDogtag { get; set; } // Confirmed in client [JsonPropertyName("expForLockedDoorOpen")] - public int? ExpForLockedDoorOpen - { - get; - set; - } + public int? ExpForLockedDoorOpen { get; set; } // Confirmed in client [JsonPropertyName("expForLockedDoorBreach")] - public int? ExpForLockedDoorBreach - { - get; - set; - } + public int? ExpForLockedDoorBreach { get; set; } [JsonPropertyName("triggerMult")] - public double? TriggerMult - { - get; - set; - } + public double? TriggerMult { get; set; } } public record Heal @@ -2813,25 +1349,13 @@ public record Heal public Dictionary ExtensionData { get; set; } [JsonPropertyName("expForHeal")] - public double? ExpForHeal - { - get; - set; - } + public double? ExpForHeal { get; set; } [JsonPropertyName("expForHydration")] - public double? ExpForHydration - { - get; - set; - } + public double? ExpForHydration { get; set; } [JsonPropertyName("expForEnergy")] - public double? ExpForEnergy - { - get; - set; - } + public double? ExpForEnergy { get; set; } } public record MatchEnd @@ -2840,99 +1364,47 @@ public record MatchEnd public Dictionary ExtensionData { get; set; } [JsonPropertyName("README")] - public string? ReadMe - { - get; - set; - } + public string? ReadMe { get; set; } // Confirmed in client [JsonPropertyName("survived_exp_requirement")] - public int? SurvivedExperienceRequirement - { - get; - set; - } + public int? SurvivedExperienceRequirement { get; set; } // Confirmed in client [JsonPropertyName("survived_seconds_requirement")] - public int? SurvivedSecondsRequirement - { - get; - set; - } + public int? SurvivedSecondsRequirement { get; set; } // Confirmed in client [JsonPropertyName("survived_exp_reward")] - public int? SurvivedExperienceReward - { - get; - set; - } + public int? SurvivedExperienceReward { get; set; } // Confirmed in client [JsonPropertyName("mia_exp_reward")] - public int? MiaExperienceReward - { - get; - set; - } + public int? MiaExperienceReward { get; set; } [JsonPropertyName("runner_exp_reward")] - public int? RunnerExperienceReward - { - get; - set; - } + public int? RunnerExperienceReward { get; set; } [JsonPropertyName("leftMult")] - public double? LeftMultiplier - { - get; - set; - } + public double? LeftMultiplier { get; set; } [JsonPropertyName("miaMult")] - public double? MiaMultiplier - { - get; - set; - } + public double? MiaMultiplier { get; set; } [JsonPropertyName("survivedMult")] - public double? SurvivedMultiplier - { - get; - set; - } + public double? SurvivedMultiplier { get; set; } [JsonPropertyName("runnerMult")] - public double? RunnerMultiplier - { - get; - set; - } + public double? RunnerMultiplier { get; set; } [JsonPropertyName("killedMult")] - public double? KilledMultiplier - { - get; - set; - } + public double? KilledMultiplier { get; set; } [JsonPropertyName("transit_exp_reward")] - public double? TransitExperienceReward - { - get; - set; - } + public double? TransitExperienceReward { get; set; } [JsonPropertyName("transit_mult")] - public List>? TransitMultiplier - { - get; - set; - } + public List>? TransitMultiplier { get; set; } } public record Kill @@ -2941,81 +1413,37 @@ public record Kill public Dictionary ExtensionData { get; set; } [JsonPropertyName("combo")] - public Combo[] Combos - { - get; - set; - } + public Combo[] Combos { get; set; } [JsonPropertyName("victimLevelExp")] - public double? VictimLevelExperience - { - get; - set; - } + public double? VictimLevelExperience { get; set; } [JsonPropertyName("headShotMult")] - public double? HeadShotMultiplier - { - get; - set; - } + public double? HeadShotMultiplier { get; set; } [JsonPropertyName("expOnDamageAllHealth")] - public double? ExperienceOnDamageAllHealth - { - get; - set; - } + public double? ExperienceOnDamageAllHealth { get; set; } [JsonPropertyName("longShotDistance")] - public double? LongShotDistance - { - get; - set; - } + public double? LongShotDistance { get; set; } [JsonPropertyName("bloodLossToLitre")] - public double? BloodLossToLitre - { - get; - set; - } + public double? BloodLossToLitre { get; set; } [JsonPropertyName("botExpOnDamageAllHealth")] - public double? BotExperienceOnDamageAllHealth - { - get; - set; - } + public double? BotExperienceOnDamageAllHealth { get; set; } [JsonPropertyName("botHeadShotMult")] - public double? BotHeadShotMultiplier - { - get; - set; - } + public double? BotHeadShotMultiplier { get; set; } [JsonPropertyName("victimBotLevelExp")] - public double? VictimBotLevelExperience - { - get; - set; - } + public double? VictimBotLevelExperience { get; set; } [JsonPropertyName("pmcExpOnDamageAllHealth")] - public double? PmcExperienceOnDamageAllHealth - { - get; - set; - } + public double? PmcExperienceOnDamageAllHealth { get; set; } [JsonPropertyName("pmcHeadShotMult")] - public double? PmcHeadShotMultiplier - { - get; - set; - } + public double? PmcHeadShotMultiplier { get; set; } } public record Combo @@ -3024,11 +1452,7 @@ public record Combo public Dictionary ExtensionData { get; set; } [JsonPropertyName("percent")] - public double? Percentage - { - get; - set; - } + public double? Percentage { get; set; } } public record Level @@ -3037,46 +1461,22 @@ public record Level public Dictionary ExtensionData { get; set; } [JsonPropertyName("exp_table")] - public ExpTable[] ExperienceTable - { - get; - set; - } + public ExpTable[] ExperienceTable { get; set; } [JsonPropertyName("trade_level")] - public double? TradeLevel - { - get; - set; - } + public double? TradeLevel { get; set; } [JsonPropertyName("savage_level")] - public double? SavageLevel - { - get; - set; - } + public double? SavageLevel { get; set; } [JsonPropertyName("clan_level")] - public double? ClanLevel - { - get; - set; - } + public double? ClanLevel { get; set; } [JsonPropertyName("mastering1")] - public double? Mastering1 - { - get; - set; - } + public double? Mastering1 { get; set; } [JsonPropertyName("mastering2")] - public double? Mastering2 - { - get; - set; - } + public double? Mastering2 { get; set; } } public record ExpTable @@ -3085,11 +1485,7 @@ public record ExpTable public Dictionary ExtensionData { get; set; } [JsonPropertyName("exp")] - public int? Experience - { - get; - set; - } + public int? Experience { get; set; } } public record LootAttempt @@ -3098,11 +1494,7 @@ public record LootAttempt public Dictionary ExtensionData { get; set; } [JsonPropertyName("k_exp")] - public double? ExperiencePoints - { - get; - set; - } + public double? ExperiencePoints { get; set; } } public record Armor @@ -3111,11 +1503,7 @@ public record Armor public Dictionary ExtensionData { get; set; } [JsonPropertyName("class")] - public List? Classes - { - get; - set; - } + public List? Classes { get; set; } } public record Class @@ -3125,11 +1513,7 @@ public record Class // Checked in client [JsonPropertyName("resistance")] - public int? Resistance - { - get; - set; - } + public int? Resistance { get; set; } } public record Mastering @@ -3138,48 +1522,24 @@ public record Mastering public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("Templates")] - public List? Templates - { - get; - set; - } + public List? Templates { get; set; } [JsonPropertyName("Progress")] - public double? Progress - { - get; - set; - } + public double? Progress { get; set; } // Checked in client [JsonPropertyName("Level2")] - public int? Level2 - { - get; - set; - } + public int? Level2 { get; set; } // Checked in client [JsonPropertyName("Level3")] - public int? Level3 - { - get; - set; - } + public int? Level3 { get; set; } } public record Customization @@ -3188,39 +1548,19 @@ public record Customization public Dictionary ExtensionData { get; set; } [JsonPropertyName("SavageHead")] - public Dictionary? Head - { - get; - set; - } + public Dictionary? Head { get; set; } [JsonPropertyName("SavageBody")] - public Dictionary? Body - { - get; - set; - } + public Dictionary? Body { get; set; } [JsonPropertyName("SavageFeet")] - public Dictionary? Feet - { - get; - set; - } + public Dictionary? Feet { get; set; } [JsonPropertyName("CustomizationVoice")] - public List? VoiceOptions - { - get; - set; - } + public List? VoiceOptions { get; set; } [JsonPropertyName("BodyParts")] - public BodyParts? BodyParts - { - get; - set; - } + public BodyParts? BodyParts { get; set; } } public record WildHead @@ -3229,25 +1569,13 @@ public record WildHead public Dictionary ExtensionData { get; set; } [JsonPropertyName("head")] - public string? Head - { - get; - set; - } + public string? Head { get; set; } [JsonPropertyName("isNotRandom")] - public bool? IsNotRandom - { - get; - set; - } + public bool? IsNotRandom { get; set; } [JsonPropertyName("NotRandom")] - public bool? NotRandom - { - get; - set; - } + public bool? NotRandom { get; set; } } public record WildBody @@ -3256,25 +1584,13 @@ public record WildBody public Dictionary ExtensionData { get; set; } [JsonPropertyName("body")] - public string? Body - { - get; - set; - } + public string? Body { get; set; } [JsonPropertyName("hands")] - public string? Hands - { - get; - set; - } + public string? Hands { get; set; } [JsonPropertyName("isNotRandom")] - public bool? IsNotRandom - { - get; - set; - } + public bool? IsNotRandom { get; set; } } public record WildFeet @@ -3283,25 +1599,13 @@ public record WildFeet public Dictionary ExtensionData { get; set; } [JsonPropertyName("feet")] - public string? Feet - { - get; - set; - } + public string? Feet { get; set; } [JsonPropertyName("isNotRandom")] - public bool? IsNotRandom - { - get; - set; - } + public bool? IsNotRandom { get; set; } [JsonPropertyName("NotRandom")] - public bool? NotRandom - { - get; - set; - } + public bool? NotRandom { get; set; } } public record CustomizationVoice @@ -3310,25 +1614,13 @@ public record CustomizationVoice public Dictionary ExtensionData { get; set; } [JsonPropertyName("voice")] - public string? Voice - { - get; - set; - } + public string? Voice { get; set; } [JsonPropertyName("side")] - public List? Side - { - get; - set; - } + public List? Side { get; set; } [JsonPropertyName("isNotRandom")] - public bool? IsNotRandom - { - get; - set; - } + public bool? IsNotRandom { get; set; } } public record BodyParts @@ -3336,29 +1628,13 @@ public record BodyParts [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? Head - { - get; - set; - } + public string? Head { get; set; } - public string? Body - { - get; - set; - } + public string? Body { get; set; } - public string? Feet - { - get; - set; - } + public string? Feet { get; set; } - public string? Hands - { - get; - set; - } + public string? Hands { get; set; } } public record AirdropGlobalSettings @@ -3366,71 +1642,27 @@ public record AirdropGlobalSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? AirdropViewType - { - get; - set; - } + public string? AirdropViewType { get; set; } - public double? ParachuteEndOpenHeight - { - get; - set; - } + public double? ParachuteEndOpenHeight { get; set; } - public double? ParachuteStartOpenHeight - { - get; - set; - } + public double? ParachuteStartOpenHeight { get; set; } - public double? PlaneAdditionalDistance - { - get; - set; - } + public double? PlaneAdditionalDistance { get; set; } - public double? PlaneAirdropDuration - { - get; - set; - } + public double? PlaneAirdropDuration { get; set; } - public double? PlaneAirdropFlareWait - { - get; - set; - } + public double? PlaneAirdropFlareWait { get; set; } - public double? PlaneAirdropSmoke - { - get; - set; - } + public double? PlaneAirdropSmoke { get; set; } - public double? PlaneMaxFlightHeight - { - get; - set; - } + public double? PlaneMaxFlightHeight { get; set; } - public double? PlaneMinFlightHeight - { - get; - set; - } + public double? PlaneMinFlightHeight { get; set; } - public double? PlaneSpeed - { - get; - set; - } + public double? PlaneSpeed { get; set; } - public double? SmokeActivateHeight - { - get; - set; - } + public double? SmokeActivateHeight { get; set; } } public record KarmaCalculationSettings @@ -3439,46 +1671,22 @@ public record KarmaCalculationSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("defaultPveKarmaValue")] - public double? DefaultPveKarmaValue - { - get; - set; - } + public double? DefaultPveKarmaValue { get; set; } [JsonPropertyName("enable")] - public bool? Enable - { - get; - set; - } + public bool? Enable { get; set; } [JsonPropertyName("expireDaysAfterLastRaid")] - public double? ExpireDaysAfterLastRaid - { - get; - set; - } + public double? ExpireDaysAfterLastRaid { get; set; } [JsonPropertyName("maxKarmaThresholdPercentile")] - public double? MaxKarmaThresholdPercentile - { - get; - set; - } + public double? MaxKarmaThresholdPercentile { get; set; } [JsonPropertyName("minKarmaThresholdPercentile")] - public double? MinKarmaThresholdPercentile - { - get; - set; - } + public double? MinKarmaThresholdPercentile { get; set; } [JsonPropertyName("minSurvivedRaidCount")] - public double? MinSurvivedRaidCount - { - get; - set; - } + public double? MinSurvivedRaidCount { get; set; } } public record ArenaEftTransferSettings @@ -3486,41 +1694,17 @@ public record ArenaEftTransferSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? ArenaManagerReputationTaxMultiplier - { - get; - set; - } + public double? ArenaManagerReputationTaxMultiplier { get; set; } - public double? CharismaTaxMultiplier - { - get; - set; - } + public double? CharismaTaxMultiplier { get; set; } - public double? CreditPriceTaxMultiplier - { - get; - set; - } + public double? CreditPriceTaxMultiplier { get; set; } - public double? RubTaxMultiplier - { - get; - set; - } + public double? RubTaxMultiplier { get; set; } - public Dictionary? TransferLimitsByGameEdition - { - get; - set; - } + public Dictionary? TransferLimitsByGameEdition { get; set; } - public Dictionary? TransferLimitsSettings - { - get; - set; - } + public Dictionary? TransferLimitsSettings { get; set; } } public record ArmorType @@ -3529,46 +1713,22 @@ public record ArmorType public Dictionary ExtensionData { get; set; } [JsonPropertyName("Destructibility")] - public double? Destructibility - { - get; - set; - } + public double? Destructibility { get; set; } [JsonPropertyName("MinRepairDegradation")] - public double? MinRepairDegradation - { - get; - set; - } + public double? MinRepairDegradation { get; set; } [JsonPropertyName("MaxRepairDegradation")] - public double? MaxRepairDegradation - { - get; - set; - } + public double? MaxRepairDegradation { get; set; } [JsonPropertyName("ExplosionDestructibility")] - public double? ExplosionDestructibility - { - get; - set; - } + public double? ExplosionDestructibility { get; set; } [JsonPropertyName("MinRepairKitDegradation")] - public double? MinRepairKitDegradation - { - get; - set; - } + public double? MinRepairKitDegradation { get; set; } [JsonPropertyName("MaxRepairKitDegradation")] - public double? MaxRepairKitDegradation - { - get; - set; - } + public double? MaxRepairKitDegradation { get; set; } } public record Health @@ -3577,32 +1737,16 @@ public record Health public Dictionary ExtensionData { get; set; } [JsonPropertyName("Falling")] - public Falling? Falling - { - get; - set; - } + public Falling? Falling { get; set; } [JsonPropertyName("Effects")] - public Effects? Effects - { - get; - set; - } + public Effects? Effects { get; set; } [JsonPropertyName("HealPrice")] - public HealPrice? HealPrice - { - get; - set; - } + public HealPrice? HealPrice { get; set; } [JsonPropertyName("ProfileHealthSettings")] - public ProfileHealthSettings? ProfileHealthSettings - { - get; - set; - } + public ProfileHealthSettings? ProfileHealthSettings { get; set; } } public record Falling @@ -3611,18 +1755,10 @@ public record Falling public Dictionary ExtensionData { get; set; } [JsonPropertyName("DamagePerMeter")] - public double? DamagePerMeter - { - get; - set; - } + public double? DamagePerMeter { get; set; } [JsonPropertyName("SafeHeight")] - public double? SafeHeight - { - get; - set; - } + public double? SafeHeight { get; set; } } public record Effects @@ -3631,200 +1767,88 @@ public record Effects public Dictionary ExtensionData { get; set; } [JsonPropertyName("Existence")] - public Existence? Existence - { - get; - set; - } + public Existence? Existence { get; set; } [JsonPropertyName("Dehydration")] - public Dehydration? Dehydration - { - get; - set; - } + public Dehydration? Dehydration { get; set; } [JsonPropertyName("BreakPart")] - public BreakPart? BreakPart - { - get; - set; - } + public BreakPart? BreakPart { get; set; } [JsonPropertyName("Contusion")] - public Contusion? Contusion - { - get; - set; - } + public Contusion? Contusion { get; set; } [JsonPropertyName("Disorientation")] - public Disorientation? Disorientation - { - get; - set; - } + public Disorientation? Disorientation { get; set; } [JsonPropertyName("Exhaustion")] - public Exhaustion? Exhaustion - { - get; - set; - } + public Exhaustion? Exhaustion { get; set; } [JsonPropertyName("LowEdgeHealth")] - public LowEdgeHealth? LowEdgeHealth - { - get; - set; - } + public LowEdgeHealth? LowEdgeHealth { get; set; } [JsonPropertyName("RadExposure")] - public RadExposure? RadExposure - { - get; - set; - } + public RadExposure? RadExposure { get; set; } [JsonPropertyName("Stun")] - public Stun? Stun - { - get; - set; - } + public Stun? Stun { get; set; } [JsonPropertyName("Intoxication")] - public Intoxication? Intoxication - { - get; - set; - } + public Intoxication? Intoxication { get; set; } [JsonPropertyName("Regeneration")] - public Regeneration? Regeneration - { - get; - set; - } + public Regeneration? Regeneration { get; set; } [JsonPropertyName("Wound")] - public Wound? Wound - { - get; - set; - } + public Wound? Wound { get; set; } [JsonPropertyName("Berserk")] - public Berserk? Berserk - { - get; - set; - } + public Berserk? Berserk { get; set; } [JsonPropertyName("Flash")] - public Flash? Flash - { - get; - set; - } + public Flash? Flash { get; set; } [JsonPropertyName("MedEffect")] - public MedEffect? MedEffect - { - get; - set; - } + public MedEffect? MedEffect { get; set; } [JsonPropertyName("Pain")] - public Pain? Pain - { - get; - set; - } + public Pain? Pain { get; set; } [JsonPropertyName("PainKiller")] - public PainKiller? PainKiller - { - get; - set; - } + public PainKiller? PainKiller { get; set; } [JsonPropertyName("SandingScreen")] - public SandingScreen? SandingScreen - { - get; - set; - } + public SandingScreen? SandingScreen { get; set; } [JsonPropertyName("MildMusclePain")] - public MusclePainEffect? MildMusclePain - { - get; - set; - } + public MusclePainEffect? MildMusclePain { get; set; } [JsonPropertyName("SevereMusclePain")] - public MusclePainEffect? SevereMusclePain - { - get; - set; - } + public MusclePainEffect? SevereMusclePain { get; set; } [JsonPropertyName("Stimulator")] - public Stimulator? Stimulator - { - get; - set; - } + public Stimulator? Stimulator { get; set; } [JsonPropertyName("Tremor")] - public Tremor? Tremor - { - get; - set; - } + public Tremor? Tremor { get; set; } [JsonPropertyName("ChronicStaminaFatigue")] - public ChronicStaminaFatigue? ChronicStaminaFatigue - { - get; - set; - } + public ChronicStaminaFatigue? ChronicStaminaFatigue { get; set; } [JsonPropertyName("Fracture")] - public Fracture? Fracture - { - get; - set; - } + public Fracture? Fracture { get; set; } [JsonPropertyName("HeavyBleeding")] - public HeavyBleeding? HeavyBleeding - { - get; - set; - } + public HeavyBleeding? HeavyBleeding { get; set; } [JsonPropertyName("LightBleeding")] - public LightBleeding? LightBleeding - { - get; - set; - } + public LightBleeding? LightBleeding { get; set; } [JsonPropertyName("BodyTemperature")] - public BodyTemperature? BodyTemperature - { - get; - set; - } + public BodyTemperature? BodyTemperature { get; set; } [JsonPropertyName("ZombieInfection")] - public ZombieInfection? ZombieInfection - { - get; - set; - } + public ZombieInfection? ZombieInfection { get; set; } } public record ZombieInfection @@ -3833,27 +1857,15 @@ public record ZombieInfection public Dictionary ExtensionData { get; set; } [JsonPropertyName("Dehydration")] - public double? Dehydration - { - get; - set; - } + public double? Dehydration { get; set; } [JsonPropertyName("HearingDebuffPercentage")] - public double? HearingDebuffPercentage - { - get; - set; - } + public double? HearingDebuffPercentage { get; set; } // The C on the Cumulatie down here is the russian C, its encoded differently, I THINK // Just in case, dont change it [JsonPropertyName("СumulativeTime")] - public double? CumulativeTime - { - get; - set; - } + public double? CumulativeTime { get; set; } } public record Existence @@ -3862,46 +1874,22 @@ public record Existence public Dictionary ExtensionData { get; set; } [JsonPropertyName("EnergyLoopTime")] - public double? EnergyLoopTime - { - get; - set; - } + public double? EnergyLoopTime { get; set; } [JsonPropertyName("HydrationLoopTime")] - public double? HydrationLoopTime - { - get; - set; - } + public double? HydrationLoopTime { get; set; } [JsonPropertyName("EnergyDamage")] - public double? EnergyDamage - { - get; - set; - } + public double? EnergyDamage { get; set; } [JsonPropertyName("HydrationDamage")] - public double? HydrationDamage - { - get; - set; - } + public double? HydrationDamage { get; set; } [JsonPropertyName("DestroyedStomachEnergyTimeFactor")] - public double? DestroyedStomachEnergyTimeFactor - { - get; - set; - } + public double? DestroyedStomachEnergyTimeFactor { get; set; } [JsonPropertyName("DestroyedStomachHydrationTimeFactor")] - public double? DestroyedStomachHydrationTimeFactor - { - get; - set; - } + public double? DestroyedStomachHydrationTimeFactor { get; set; } } public record Dehydration @@ -3910,53 +1898,25 @@ public record Dehydration public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("BleedingHealth")] - public double? BleedingHealth - { - get; - set; - } + public double? BleedingHealth { get; set; } [JsonPropertyName("BleedingLoopTime")] - public double? BleedingLoopTime - { - get; - set; - } + public double? BleedingLoopTime { get; set; } [JsonPropertyName("BleedingLifeTime")] - public double? BleedingLifeTime - { - get; - set; - } + public double? BleedingLifeTime { get; set; } [JsonPropertyName("DamageOnStrongDehydration")] - public double? DamageOnStrongDehydration - { - get; - set; - } + public double? DamageOnStrongDehydration { get; set; } [JsonPropertyName("StrongDehydrationLoopTime")] - public double? StrongDehydrationLoopTime - { - get; - set; - } + public double? StrongDehydrationLoopTime { get; set; } } public record BreakPart @@ -3965,67 +1925,31 @@ public record BreakPart public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } [JsonPropertyName("OfflineDurationMin")] - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } [JsonPropertyName("OfflineDurationMax")] - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } [JsonPropertyName("RemovePrice")] - public double? RemovePrice - { - get; - set; - } + public double? RemovePrice { get; set; } [JsonPropertyName("RemovedAfterDeath")] - public bool? RemovedAfterDeath - { - get; - set; - } + public bool? RemovedAfterDeath { get; set; } [JsonPropertyName("BulletHitProbability")] - public Probability? BulletHitProbability - { - get; - set; - } + public Probability? BulletHitProbability { get; set; } [JsonPropertyName("FallingProbability")] - public Probability? FallingProbability - { - get; - set; - } + public Probability? FallingProbability { get; set; } } public record Contusion @@ -4034,11 +1958,7 @@ public record Contusion public Dictionary ExtensionData { get; set; } [JsonPropertyName("Dummy")] - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record Disorientation @@ -4047,11 +1967,7 @@ public record Disorientation public Dictionary ExtensionData { get; set; } [JsonPropertyName("Dummy")] - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record Exhaustion @@ -4060,32 +1976,16 @@ public record Exhaustion public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("Damage")] - public double? Damage - { - get; - set; - } + public double? Damage { get; set; } [JsonPropertyName("DamageLoopTime")] - public double? DamageLoopTime - { - get; - set; - } + public double? DamageLoopTime { get; set; } } public record LowEdgeHealth @@ -4094,25 +1994,13 @@ public record LowEdgeHealth public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("StartCommonHealth")] - public double? StartCommonHealth - { - get; - set; - } + public double? StartCommonHealth { get; set; } } public record RadExposure @@ -4121,18 +2009,10 @@ public record RadExposure public Dictionary ExtensionData { get; set; } [JsonPropertyName("Damage")] - public double? Damage - { - get; - set; - } + public double? Damage { get; set; } [JsonPropertyName("DamageLoopTime")] - public double? DamageLoopTime - { - get; - set; - } + public double? DamageLoopTime { get; set; } } public record Stun @@ -4141,11 +2021,7 @@ public record Stun public Dictionary ExtensionData { get; set; } [JsonPropertyName("Dummy")] - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record Intoxication @@ -4154,67 +2030,31 @@ public record Intoxication public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("DamageHealth")] - public double? DamageHealth - { - get; - set; - } + public double? DamageHealth { get; set; } [JsonPropertyName("HealthLoopTime")] - public double? HealthLoopTime - { - get; - set; - } + public double? HealthLoopTime { get; set; } [JsonPropertyName("OfflineDurationMin")] - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } [JsonPropertyName("OfflineDurationMax")] - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } [JsonPropertyName("RemovedAfterDeath")] - public bool? RemovedAfterDeath - { - get; - set; - } + public bool? RemovedAfterDeath { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } [JsonPropertyName("RemovePrice")] - public double? RemovePrice - { - get; - set; - } + public double? RemovePrice { get; set; } } public record Regeneration @@ -4223,46 +2063,22 @@ public record Regeneration public Dictionary ExtensionData { get; set; } [JsonPropertyName("LoopTime")] - public double? LoopTime - { - get; - set; - } + public double? LoopTime { get; set; } [JsonPropertyName("MinimumHealthPercentage")] - public double? MinimumHealthPercentage - { - get; - set; - } + public double? MinimumHealthPercentage { get; set; } [JsonPropertyName("Energy")] - public double? Energy - { - get; - set; - } + public double? Energy { get; set; } [JsonPropertyName("Hydration")] - public double? Hydration - { - get; - set; - } + public double? Hydration { get; set; } [JsonPropertyName("BodyHealth")] - public BodyHealth? BodyHealth - { - get; - set; - } + public BodyHealth? BodyHealth { get; set; } [JsonPropertyName("Influences")] - public Influences? Influences - { - get; - set; - } + public Influences? Influences { get; set; } } public record BodyHealth @@ -4271,53 +2087,25 @@ public record BodyHealth public Dictionary ExtensionData { get; set; } [JsonPropertyName("Head")] - public BodyHealthValue? Head - { - get; - set; - } + public BodyHealthValue? Head { get; set; } [JsonPropertyName("Chest")] - public BodyHealthValue? Chest - { - get; - set; - } + public BodyHealthValue? Chest { get; set; } [JsonPropertyName("Stomach")] - public BodyHealthValue? Stomach - { - get; - set; - } + public BodyHealthValue? Stomach { get; set; } [JsonPropertyName("LeftArm")] - public BodyHealthValue? LeftArm - { - get; - set; - } + public BodyHealthValue? LeftArm { get; set; } [JsonPropertyName("RightArm")] - public BodyHealthValue? RightArm - { - get; - set; - } + public BodyHealthValue? RightArm { get; set; } [JsonPropertyName("LeftLeg")] - public BodyHealthValue? LeftLeg - { - get; - set; - } + public BodyHealthValue? LeftLeg { get; set; } [JsonPropertyName("RightLeg")] - public BodyHealthValue? RightLeg - { - get; - set; - } + public BodyHealthValue? RightLeg { get; set; } } public record BodyHealthValue @@ -4326,11 +2114,7 @@ public record BodyHealthValue public Dictionary ExtensionData { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record Influences @@ -4339,39 +2123,19 @@ public record Influences public Dictionary ExtensionData { get; set; } [JsonPropertyName("LightBleeding")] - public Influence? LightBleeding - { - get; - set; - } + public Influence? LightBleeding { get; set; } [JsonPropertyName("HeavyBleeding")] - public Influence? HeavyBleeding - { - get; - set; - } + public Influence? HeavyBleeding { get; set; } [JsonPropertyName("Fracture")] - public Influence? Fracture - { - get; - set; - } + public Influence? Fracture { get; set; } [JsonPropertyName("RadExposure")] - public Influence? RadExposure - { - get; - set; - } + public Influence? RadExposure { get; set; } [JsonPropertyName("Intoxication")] - public Influence? Intoxication - { - get; - set; - } + public Influence? Intoxication { get; set; } } public record Influence @@ -4380,25 +2144,13 @@ public record Influence public Dictionary ExtensionData { get; set; } [JsonPropertyName("HealthSlowDownPercentage")] - public double? HealthSlowDownPercentage - { - get; - set; - } + public double? HealthSlowDownPercentage { get; set; } [JsonPropertyName("EnergySlowDownPercentage")] - public double? EnergySlowDownPercentage - { - get; - set; - } + public double? EnergySlowDownPercentage { get; set; } [JsonPropertyName("HydrationSlowDownPercentage")] - public double? HydrationSlowDownPercentage - { - get; - set; - } + public double? HydrationSlowDownPercentage { get; set; } } public record Wound @@ -4407,25 +2159,13 @@ public record Wound public Dictionary ExtensionData { get; set; } [JsonPropertyName("WorkingTime")] - public double? WorkingTime - { - get; - set; - } + public double? WorkingTime { get; set; } [JsonPropertyName("ThresholdMin")] - public double? ThresholdMin - { - get; - set; - } + public double? ThresholdMin { get; set; } [JsonPropertyName("ThresholdMax")] - public double? ThresholdMax - { - get; - set; - } + public double? ThresholdMax { get; set; } } public record Berserk @@ -4434,25 +2174,13 @@ public record Berserk public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("WorkingTime")] - public double? WorkingTime - { - get; - set; - } + public double? WorkingTime { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } } public record Flash @@ -4461,11 +2189,7 @@ public record Flash public Dictionary ExtensionData { get; set; } [JsonPropertyName("Dummy")] - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record MedEffect @@ -4474,60 +2198,28 @@ public record MedEffect public Dictionary ExtensionData { get; set; } [JsonPropertyName("LoopTime")] - public double? LoopTime - { - get; - set; - } + public double? LoopTime { get; set; } [JsonPropertyName("StartDelay")] - public double? StartDelay - { - get; - set; - } + public double? StartDelay { get; set; } [JsonPropertyName("DrinkStartDelay")] - public double? DrinkStartDelay - { - get; - set; - } + public double? DrinkStartDelay { get; set; } [JsonPropertyName("FoodStartDelay")] - public double? FoodStartDelay - { - get; - set; - } + public double? FoodStartDelay { get; set; } [JsonPropertyName("DrugsStartDelay")] - public double? DrugsStartDelay - { - get; - set; - } + public double? DrugsStartDelay { get; set; } [JsonPropertyName("MedKitStartDelay")] - public double? MedKitStartDelay - { - get; - set; - } + public double? MedKitStartDelay { get; set; } [JsonPropertyName("MedicalStartDelay")] - public double? MedicalStartDelay - { - get; - set; - } + public double? MedicalStartDelay { get; set; } [JsonPropertyName("StimulatorStartDelay")] - public double? StimulatorStartDelay - { - get; - set; - } + public double? StimulatorStartDelay { get; set; } } public record Pain @@ -4536,18 +2228,10 @@ public record Pain public Dictionary ExtensionData { get; set; } [JsonPropertyName("TremorDelay")] - public double? TremorDelay - { - get; - set; - } + public double? TremorDelay { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } } public record PainKiller @@ -4555,11 +2239,7 @@ public record PainKiller [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record SandingScreen @@ -4567,11 +2247,7 @@ public record SandingScreen [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Dummy - { - get; - set; - } + public double? Dummy { get; set; } } public record MusclePainEffect @@ -4579,29 +2255,13 @@ public record MusclePainEffect [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? GymEffectivity - { - get; - set; - } + public double? GymEffectivity { get; set; } - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } - public double? TraumaChance - { - get; - set; - } + public double? TraumaChance { get; set; } } public record Stimulator @@ -4609,17 +2269,9 @@ public record Stimulator [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? BuffLoopTime - { - get; - set; - } + public double? BuffLoopTime { get; set; } - public Dictionary>? Buffs - { - get; - set; - } + public Dictionary>? Buffs { get; set; } } public record Buff @@ -4628,59 +2280,27 @@ public record Buff public Dictionary ExtensionData { get; set; } [JsonPropertyName("BuffType")] - public string? BuffType - { - get; - set; - } + public string? BuffType { get; set; } [JsonPropertyName("Chance")] - public double? Chance - { - get; - set; - } + public double? Chance { get; set; } [JsonPropertyName("Delay")] - public double? Delay - { - get; - set; - } + public double? Delay { get; set; } [JsonPropertyName("Duration")] - public double? Duration - { - get; - set; - } + public double? Duration { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("AbsoluteValue")] - public bool? AbsoluteValue - { - get; - set; - } + public bool? AbsoluteValue { get; set; } [JsonPropertyName("SkillName")] - public string? SkillName - { - get; - set; - } + public string? SkillName { get; set; } - public List? AppliesTo - { - get; - set; - } + public List? AppliesTo { get; set; } } public record Tremor @@ -4689,18 +2309,10 @@ public record Tremor public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } } public record ChronicStaminaFatigue @@ -4709,32 +2321,16 @@ public record ChronicStaminaFatigue public Dictionary ExtensionData { get; set; } [JsonPropertyName("EnergyRate")] - public double? EnergyRate - { - get; - set; - } + public double? EnergyRate { get; set; } [JsonPropertyName("WorkingTime")] - public double? WorkingTime - { - get; - set; - } + public double? WorkingTime { get; set; } [JsonPropertyName("TicksEvery")] - public double? TicksEvery - { - get; - set; - } + public double? TicksEvery { get; set; } [JsonPropertyName("EnergyRatePerStack")] - public double? EnergyRatePerStack - { - get; - set; - } + public double? EnergyRatePerStack { get; set; } } public record Fracture @@ -4743,67 +2339,31 @@ public record Fracture public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } [JsonPropertyName("OfflineDurationMin")] - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } [JsonPropertyName("OfflineDurationMax")] - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } [JsonPropertyName("RemovePrice")] - public double? RemovePrice - { - get; - set; - } + public double? RemovePrice { get; set; } [JsonPropertyName("RemovedAfterDeath")] - public bool? RemovedAfterDeath - { - get; - set; - } + public bool? RemovedAfterDeath { get; set; } [JsonPropertyName("BulletHitProbability")] - public Probability? BulletHitProbability - { - get; - set; - } + public Probability? BulletHitProbability { get; set; } [JsonPropertyName("FallingProbability")] - public Probability? FallingProbability - { - get; - set; - } + public Probability? FallingProbability { get; set; } } public record HeavyBleeding @@ -4812,116 +2372,52 @@ public record HeavyBleeding public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("DamageEnergy")] - public double? DamageEnergy - { - get; - set; - } + public double? DamageEnergy { get; set; } [JsonPropertyName("DamageHealth")] - public double? DamageHealth - { - get; - set; - } + public double? DamageHealth { get; set; } [JsonPropertyName("EnergyLoopTime")] - public double? EnergyLoopTime - { - get; - set; - } + public double? EnergyLoopTime { get; set; } [JsonPropertyName("HealthLoopTime")] - public double? HealthLoopTime - { - get; - set; - } + public double? HealthLoopTime { get; set; } [JsonPropertyName("DamageHealthDehydrated")] - public double? DamageHealthDehydrated - { - get; - set; - } + public double? DamageHealthDehydrated { get; set; } [JsonPropertyName("HealthLoopTimeDehydrated")] - public double? HealthLoopTimeDehydrated - { - get; - set; - } + public double? HealthLoopTimeDehydrated { get; set; } [JsonPropertyName("LifeTimeDehydrated")] - public double? LifeTimeDehydrated - { - get; - set; - } + public double? LifeTimeDehydrated { get; set; } [JsonPropertyName("EliteVitalityDuration")] - public double? EliteVitalityDuration - { - get; - set; - } + public double? EliteVitalityDuration { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } [JsonPropertyName("OfflineDurationMin")] - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } [JsonPropertyName("OfflineDurationMax")] - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } [JsonPropertyName("RemovePrice")] - public double? RemovePrice - { - get; - set; - } + public double? RemovePrice { get; set; } [JsonPropertyName("RemovedAfterDeath")] - public bool? RemovedAfterDeath - { - get; - set; - } + public bool? RemovedAfterDeath { get; set; } [JsonPropertyName("Probability")] - public Probability? Probability - { - get; - set; - } + public Probability? Probability { get; set; } } public record Probability @@ -4930,32 +2426,16 @@ public record Probability public Dictionary ExtensionData { get; set; } [JsonPropertyName("FunctionType")] - public string? FunctionType - { - get; - set; - } + public string? FunctionType { get; set; } [JsonPropertyName("K")] - public double? K - { - get; - set; - } + public double? K { get; set; } [JsonPropertyName("B")] - public double? B - { - get; - set; - } + public double? B { get; set; } [JsonPropertyName("Threshold")] - public double? Threshold - { - get; - set; - } + public double? Threshold { get; set; } } public record LightBleeding @@ -4964,116 +2444,52 @@ public record LightBleeding public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultDelay")] - public double? DefaultDelay - { - get; - set; - } + public double? DefaultDelay { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("DamageEnergy")] - public double? DamageEnergy - { - get; - set; - } + public double? DamageEnergy { get; set; } [JsonPropertyName("DamageHealth")] - public double? DamageHealth - { - get; - set; - } + public double? DamageHealth { get; set; } [JsonPropertyName("EnergyLoopTime")] - public double? EnergyLoopTime - { - get; - set; - } + public double? EnergyLoopTime { get; set; } [JsonPropertyName("HealthLoopTime")] - public double? HealthLoopTime - { - get; - set; - } + public double? HealthLoopTime { get; set; } [JsonPropertyName("DamageHealthDehydrated")] - public double? DamageHealthDehydrated - { - get; - set; - } + public double? DamageHealthDehydrated { get; set; } [JsonPropertyName("HealthLoopTimeDehydrated")] - public double? HealthLoopTimeDehydrated - { - get; - set; - } + public double? HealthLoopTimeDehydrated { get; set; } [JsonPropertyName("LifeTimeDehydrated")] - public double? LifeTimeDehydrated - { - get; - set; - } + public double? LifeTimeDehydrated { get; set; } [JsonPropertyName("EliteVitalityDuration")] - public double? EliteVitalityDuration - { - get; - set; - } + public double? EliteVitalityDuration { get; set; } [JsonPropertyName("HealExperience")] - public double? HealExperience - { - get; - set; - } + public double? HealExperience { get; set; } [JsonPropertyName("OfflineDurationMin")] - public double? OfflineDurationMin - { - get; - set; - } + public double? OfflineDurationMin { get; set; } [JsonPropertyName("OfflineDurationMax")] - public double? OfflineDurationMax - { - get; - set; - } + public double? OfflineDurationMax { get; set; } [JsonPropertyName("RemovePrice")] - public double? RemovePrice - { - get; - set; - } + public double? RemovePrice { get; set; } [JsonPropertyName("RemovedAfterDeath")] - public bool? RemovedAfterDeath - { - get; - set; - } + public bool? RemovedAfterDeath { get; set; } [JsonPropertyName("Probability")] - public Probability? Probability - { - get; - set; - } + public Probability? Probability { get; set; } } public record BodyTemperature @@ -5082,25 +2498,13 @@ public record BodyTemperature public Dictionary ExtensionData { get; set; } [JsonPropertyName("DefaultBuildUpTime")] - public double? DefaultBuildUpTime - { - get; - set; - } + public double? DefaultBuildUpTime { get; set; } [JsonPropertyName("DefaultResidueTime")] - public double? DefaultResidueTime - { - get; - set; - } + public double? DefaultResidueTime { get; set; } [JsonPropertyName("LoopTime")] - public double? LoopTime - { - get; - set; - } + public double? LoopTime { get; set; } } public record HealPrice @@ -5109,39 +2513,19 @@ public record HealPrice public Dictionary ExtensionData { get; set; } [JsonPropertyName("HealthPointPrice")] - public double? HealthPointPrice - { - get; - set; - } + public double? HealthPointPrice { get; set; } [JsonPropertyName("HydrationPointPrice")] - public double? HydrationPointPrice - { - get; - set; - } + public double? HydrationPointPrice { get; set; } [JsonPropertyName("EnergyPointPrice")] - public double? EnergyPointPrice - { - get; - set; - } + public double? EnergyPointPrice { get; set; } [JsonPropertyName("TrialLevels")] - public double? TrialLevels - { - get; - set; - } + public double? TrialLevels { get; set; } [JsonPropertyName("TrialRaids")] - public double? TrialRaids - { - get; - set; - } + public double? TrialRaids { get; set; } } public record ProfileHealthSettings @@ -5150,25 +2534,13 @@ public record ProfileHealthSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("BodyPartsSettings")] - public BodyPartsSettings? BodyPartsSettings - { - get; - set; - } + public BodyPartsSettings? BodyPartsSettings { get; set; } [JsonPropertyName("HealthFactorsSettings")] - public HealthFactorsSettings? HealthFactorsSettings - { - get; - set; - } + public HealthFactorsSettings? HealthFactorsSettings { get; set; } [JsonPropertyName("DefaultStimulatorBuff")] - public string? DefaultStimulatorBuff - { - get; - set; - } + public string? DefaultStimulatorBuff { get; set; } } public record BodyPartsSettings @@ -5177,53 +2549,25 @@ public record BodyPartsSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("Head")] - public BodyPartsSetting? Head - { - get; - set; - } + public BodyPartsSetting? Head { get; set; } [JsonPropertyName("Chest")] - public BodyPartsSetting? Chest - { - get; - set; - } + public BodyPartsSetting? Chest { get; set; } [JsonPropertyName("Stomach")] - public BodyPartsSetting? Stomach - { - get; - set; - } + public BodyPartsSetting? Stomach { get; set; } [JsonPropertyName("LeftArm")] - public BodyPartsSetting? LeftArm - { - get; - set; - } + public BodyPartsSetting? LeftArm { get; set; } [JsonPropertyName("RightArm")] - public BodyPartsSetting? RightArm - { - get; - set; - } + public BodyPartsSetting? RightArm { get; set; } [JsonPropertyName("LeftLeg")] - public BodyPartsSetting? LeftLeg - { - get; - set; - } + public BodyPartsSetting? LeftLeg { get; set; } [JsonPropertyName("RightLeg")] - public BodyPartsSetting? RightLeg - { - get; - set; - } + public BodyPartsSetting? RightLeg { get; set; } } public record BodyPartsSetting @@ -5232,39 +2576,19 @@ public record BodyPartsSetting public Dictionary ExtensionData { get; set; } [JsonPropertyName("Minimum")] - public double? Minimum - { - get; - set; - } + public double? Minimum { get; set; } [JsonPropertyName("Maximum")] - public double? Maximum - { - get; - set; - } + public double? Maximum { get; set; } [JsonPropertyName("Default")] - public double? Default - { - get; - set; - } + public double? Default { get; set; } [JsonPropertyName("EnvironmentDamageMultiplier")] - public float? EnvironmentDamageMultiplier - { - get; - set; - } + public float? EnvironmentDamageMultiplier { get; set; } [JsonPropertyName("OverDamageReceivedMultiplier")] - public float? OverDamageReceivedMultiplier - { - get; - set; - } + public float? OverDamageReceivedMultiplier { get; set; } } public record HealthFactorsSettings @@ -5273,39 +2597,19 @@ public record HealthFactorsSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("Energy")] - public HealthFactorSetting? Energy - { - get; - set; - } + public HealthFactorSetting? Energy { get; set; } [JsonPropertyName("Hydration")] - public HealthFactorSetting? Hydration - { - get; - set; - } + public HealthFactorSetting? Hydration { get; set; } [JsonPropertyName("Temperature")] - public HealthFactorSetting? Temperature - { - get; - set; - } + public HealthFactorSetting? Temperature { get; set; } [JsonPropertyName("Poisoning")] - public HealthFactorSetting? Poisoning - { - get; - set; - } + public HealthFactorSetting? Poisoning { get; set; } [JsonPropertyName("Radiation")] - public HealthFactorSetting? Radiation - { - get; - set; - } + public HealthFactorSetting? Radiation { get; set; } } public record HealthFactorSetting @@ -5314,25 +2618,13 @@ public record HealthFactorSetting public Dictionary ExtensionData { get; set; } [JsonPropertyName("Minimum")] - public double? Minimum - { - get; - set; - } + public double? Minimum { get; set; } [JsonPropertyName("Maximum")] - public double? Maximum - { - get; - set; - } + public double? Maximum { get; set; } [JsonPropertyName("Default")] - public double? Default - { - get; - set; - } + public double? Default { get; set; } } public record Rating @@ -5341,25 +2633,13 @@ public record Rating public Dictionary ExtensionData { get; set; } [JsonPropertyName("levelRequired")] - public double? LevelRequired - { - get; - set; - } + public double? LevelRequired { get; set; } [JsonPropertyName("limit")] - public double? Limit - { - get; - set; - } + public double? Limit { get; set; } [JsonPropertyName("categories")] - public Categories? Categories - { - get; - set; - } + public Categories? Categories { get; set; } } public record Categories @@ -5368,74 +2648,34 @@ public record Categories public Dictionary ExtensionData { get; set; } [JsonPropertyName("experience")] - public bool? Experience - { - get; - set; - } + public bool? Experience { get; set; } [JsonPropertyName("kd")] - public bool? Kd - { - get; - set; - } + public bool? Kd { get; set; } [JsonPropertyName("surviveRatio")] - public bool? SurviveRatio - { - get; - set; - } + public bool? SurviveRatio { get; set; } [JsonPropertyName("avgEarnings")] - public bool? AvgEarnings - { - get; - set; - } + public bool? AvgEarnings { get; set; } [JsonPropertyName("pmcKills")] - public bool? PmcKills - { - get; - set; - } + public bool? PmcKills { get; set; } [JsonPropertyName("raidCount")] - public bool? RaidCount - { - get; - set; - } + public bool? RaidCount { get; set; } [JsonPropertyName("longestShot")] - public bool? LongestShot - { - get; - set; - } + public bool? LongestShot { get; set; } [JsonPropertyName("timeOnline")] - public bool? TimeOnline - { - get; - set; - } + public bool? TimeOnline { get; set; } [JsonPropertyName("inventoryFullCost")] - public bool? InventoryFullCost - { - get; - set; - } + public bool? InventoryFullCost { get; set; } [JsonPropertyName("ragFairStanding")] - public bool? RagFairStanding - { - get; - set; - } + public bool? RagFairStanding { get; set; } } public record Tournament @@ -5444,25 +2684,13 @@ public record Tournament public Dictionary ExtensionData { get; set; } [JsonPropertyName("categories")] - public TournamentCategories? Categories - { - get; - set; - } + public TournamentCategories? Categories { get; set; } [JsonPropertyName("limit")] - public double? Limit - { - get; - set; - } + public double? Limit { get; set; } [JsonPropertyName("levelRequired")] - public double? LevelRequired - { - get; - set; - } + public double? LevelRequired { get; set; } } public record TournamentCategories @@ -5471,11 +2699,7 @@ public record TournamentCategories public Dictionary ExtensionData { get; set; } [JsonPropertyName("dogtags")] - public bool? Dogtags - { - get; - set; - } + public bool? Dogtags { get; set; } } public record RagFair @@ -5484,265 +2708,117 @@ public record RagFair public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("priceStabilizerEnabled")] - public bool? PriceStabilizerEnabled - { - get; - set; - } + public bool? PriceStabilizerEnabled { get; set; } [JsonPropertyName("includePveTraderSales")] - public bool? IncludePveTraderSales - { - get; - set; - } + public bool? IncludePveTraderSales { get; set; } [JsonPropertyName("priceStabilizerStartIntervalInHours")] - public double? PriceStabilizerStartIntervalInHours - { - get; - set; - } + public double? PriceStabilizerStartIntervalInHours { get; set; } // Checked in client [JsonPropertyName("minUserLevel")] - public int? MinUserLevel - { - get; - set; - } + public int? MinUserLevel { get; set; } [JsonPropertyName("communityTax")] - public float? CommunityTax - { - get; - set; - } + public float? CommunityTax { get; set; } [JsonPropertyName("communityItemTax")] - public float? CommunityItemTax - { - get; - set; - } + public float? CommunityItemTax { get; set; } // Checked in client [JsonPropertyName("communityRequirementTax")] - public double? CommunityRequirementTax - { - get; - set; - } + public double? CommunityRequirementTax { get; set; } [JsonPropertyName("offerPriorityCost")] - public float? OfferPriorityCost - { - get; - set; - } + public float? OfferPriorityCost { get; set; } [JsonPropertyName("offerDurationTimeInHour")] - public double? OfferDurationTimeInHour - { - get; - set; - } + public double? OfferDurationTimeInHour { get; set; } [JsonPropertyName("offerDurationTimeInHourAfterRemove")] - public double? OfferDurationTimeInHourAfterRemove - { - get; - set; - } + public double? OfferDurationTimeInHourAfterRemove { get; set; } [JsonPropertyName("priorityTimeModifier")] - public float? PriorityTimeModifier - { - get; - set; - } + public float? PriorityTimeModifier { get; set; } [JsonPropertyName("maxRenewOfferTimeInHour")] - public double? MaxRenewOfferTimeInHour - { - get; - set; - } + public double? MaxRenewOfferTimeInHour { get; set; } [JsonPropertyName("renewPricePerHour")] - public float? RenewPricePerHour - { - get; - set; - } + public float? RenewPricePerHour { get; set; } [JsonPropertyName("maxActiveOfferCount")] - public List? MaxActiveOfferCount - { - get; - set; - } + public List? MaxActiveOfferCount { get; set; } [JsonPropertyName("balancerRemovePriceCoefficient")] - public float? BalancerRemovePriceCoefficient - { - get; - set; - } + public float? BalancerRemovePriceCoefficient { get; set; } [JsonPropertyName("balancerMinPriceCount")] - public float? BalancerMinPriceCount - { - get; - set; - } + public float? BalancerMinPriceCount { get; set; } [JsonPropertyName("balancerAveragePriceCoefficient")] - public float? BalancerAveragePriceCoefficient - { - get; - set; - } + public float? BalancerAveragePriceCoefficient { get; set; } [JsonPropertyName("delaySinceOfferAdd")] - public int? DelaySinceOfferAdd - { - get; - set; - } + public int? DelaySinceOfferAdd { get; set; } [JsonPropertyName("uniqueBuyerTimeoutInDays")] - public double? UniqueBuyerTimeoutInDays - { - get; - set; - } + public double? UniqueBuyerTimeoutInDays { get; set; } [JsonPropertyName("userRatingChangeFrequencyMultiplayer")] - public float? UserRatingChangeFrequencyMultiplayer - { - get; - set; - } + public float? UserRatingChangeFrequencyMultiplayer { get; set; } [JsonPropertyName("RagfairTurnOnTimestamp")] - public long? RagfairTurnOnTimestamp - { - get; - set; - } + public long? RagfairTurnOnTimestamp { get; set; } [JsonPropertyName("ratingSumForIncrease")] - public double? RatingSumForIncrease - { - get; - set; - } + public double? RatingSumForIncrease { get; set; } [JsonPropertyName("ratingIncreaseCount")] - public double? RatingIncreaseCount - { - get; - set; - } + public double? RatingIncreaseCount { get; set; } [JsonPropertyName("ratingSumForDecrease")] - public double? RatingSumForDecrease - { - get; - set; - } + public double? RatingSumForDecrease { get; set; } [JsonPropertyName("ratingDecreaseCount")] - public double? RatingDecreaseCount - { - get; - set; - } + public double? RatingDecreaseCount { get; set; } [JsonPropertyName("maxSumForIncreaseRatingPerOneSale")] - public double? MaxSumForIncreaseRatingPerOneSale - { - get; - set; - } + public double? MaxSumForIncreaseRatingPerOneSale { get; set; } [JsonPropertyName("maxSumForDecreaseRatingPerOneSale")] - public double? MaxSumForDecreaseRatingPerOneSale - { - get; - set; - } + public double? MaxSumForDecreaseRatingPerOneSale { get; set; } [JsonPropertyName("maxSumForRarity")] - public MaxSumForRarity? MaxSumForRarity - { - get; - set; - } + public MaxSumForRarity? MaxSumForRarity { get; set; } [JsonPropertyName("ChangePriceCoef")] - public double? ChangePriceCoef - { - get; - set; - } + public double? ChangePriceCoef { get; set; } [JsonPropertyName("ItemRestrictions")] - public List? ItemRestrictions - { - get; - set; - } + public List? ItemRestrictions { get; set; } [JsonPropertyName("balancerUserItemSaleCooldownEnabled")] - public bool? BalancerUserItemSaleCooldownEnabled - { - get; - set; - } + public bool? BalancerUserItemSaleCooldownEnabled { get; set; } [JsonPropertyName("balancerUserItemSaleCooldown")] - public float? BalancerUserItemSaleCooldown - { - get; - set; - } + public float? BalancerUserItemSaleCooldown { get; set; } [JsonPropertyName("youSellOfferMaxStorageTimeInHour")] - public double? YouSellOfferMaxStorageTimeInHour - { - get; - set; - } + public double? YouSellOfferMaxStorageTimeInHour { get; set; } [JsonPropertyName("yourOfferDidNotSellMaxStorageTimeInHour")] - public double? YourOfferDidNotSellMaxStorageTimeInHour - { - get; - set; - } + public double? YourOfferDidNotSellMaxStorageTimeInHour { get; set; } [JsonPropertyName("isOnlyFoundInRaidAllowed")] - public bool? IsOnlyFoundInRaidAllowed - { - get; - set; - } + public bool? IsOnlyFoundInRaidAllowed { get; set; } [JsonPropertyName("sellInOnePiece")] - public double? SellInOnePiece - { - get; - set; - } + public double? SellInOnePiece { get; set; } } public record ItemGlobalRestrictions @@ -5751,25 +2827,13 @@ public record ItemGlobalRestrictions public Dictionary ExtensionData { get; set; } [JsonPropertyName("MaxFlea")] - public double? MaxFlea - { - get; - set; - } + public double? MaxFlea { get; set; } [JsonPropertyName("MaxFleaStacked")] - public double? MaxFleaStacked - { - get; - set; - } + public double? MaxFleaStacked { get; set; } [JsonPropertyName("TemplateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } } public record MaxActiveOfferCount @@ -5778,32 +2842,16 @@ public record MaxActiveOfferCount public Dictionary ExtensionData { get; set; } [JsonPropertyName("from")] - public double? From - { - get; - set; - } + public double? From { get; set; } [JsonPropertyName("to")] - public double? To - { - get; - set; - } + public double? To { get; set; } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("countForSpecialEditions")] - public double? CountForSpecialEditions - { - get; - set; - } + public double? CountForSpecialEditions { get; set; } } public record MaxSumForRarity @@ -5812,32 +2860,16 @@ public record MaxSumForRarity public Dictionary ExtensionData { get; set; } [JsonPropertyName("Common")] - public RarityMaxSum? Common - { - get; - set; - } + public RarityMaxSum? Common { get; set; } [JsonPropertyName("Rare")] - public RarityMaxSum? Rare - { - get; - set; - } + public RarityMaxSum? Rare { get; set; } [JsonPropertyName("Superrare")] - public RarityMaxSum? Superrare - { - get; - set; - } + public RarityMaxSum? Superrare { get; set; } [JsonPropertyName("Not_exist")] - public RarityMaxSum? NotExist - { - get; - set; - } + public RarityMaxSum? NotExist { get; set; } } public record RarityMaxSum @@ -5846,11 +2878,7 @@ public record RarityMaxSum public Dictionary ExtensionData { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record Handbook @@ -5859,11 +2887,7 @@ public record Handbook public Dictionary ExtensionData { get; set; } [JsonPropertyName("defaultCategory")] - public string? DefaultCategory - { - get; - set; - } + public string? DefaultCategory { get; set; } } public record Stamina @@ -5872,377 +2896,161 @@ public record Stamina public Dictionary ExtensionData { get; set; } [JsonPropertyName("Capacity")] - public double? Capacity - { - get; - set; - } + public double? Capacity { get; set; } [JsonPropertyName("SprintDrainRate")] - public double? SprintDrainRate - { - get; - set; - } + public double? SprintDrainRate { get; set; } [JsonPropertyName("BaseRestorationRate")] - public double? BaseRestorationRate - { - get; - set; - } + public double? BaseRestorationRate { get; set; } [JsonPropertyName("BipodAimDrainRateMultiplier")] - public double? BipodAimDrainRateMultiplier - { - get; - set; - } + public double? BipodAimDrainRateMultiplier { get; set; } [JsonPropertyName("JumpConsumption")] - public double? JumpConsumption - { - get; - set; - } + public double? JumpConsumption { get; set; } [JsonPropertyName("MountingHorizontalAimDrainRateMultiplier")] - public double? MountingHorizontalAimDrainRateMultiplier - { - get; - set; - } + public double? MountingHorizontalAimDrainRateMultiplier { get; set; } [JsonPropertyName("MountingVerticalAimDrainRateMultiplier")] - public double? MountingVerticalAimDrainRateMultiplier - { - get; - set; - } + public double? MountingVerticalAimDrainRateMultiplier { get; set; } [JsonPropertyName("GrenadeHighThrow")] - public double? GrenadeHighThrow - { - get; - set; - } + public double? GrenadeHighThrow { get; set; } [JsonPropertyName("GrenadeLowThrow")] - public double? GrenadeLowThrow - { - get; - set; - } + public double? GrenadeLowThrow { get; set; } [JsonPropertyName("AimDrainRate")] - public double? AimDrainRate - { - get; - set; - } + public double? AimDrainRate { get; set; } [JsonPropertyName("AimRangeFinderDrainRate")] - public double? AimRangeFinderDrainRate - { - get; - set; - } + public double? AimRangeFinderDrainRate { get; set; } [JsonPropertyName("OxygenCapacity")] - public double? OxygenCapacity - { - get; - set; - } + public double? OxygenCapacity { get; set; } [JsonPropertyName("OxygenRestoration")] - public double? OxygenRestoration - { - get; - set; - } + public double? OxygenRestoration { get; set; } [JsonPropertyName("WalkOverweightLimits")] - public XYZ? WalkOverweightLimits - { - get; - set; - } + public XYZ? WalkOverweightLimits { get; set; } [JsonPropertyName("BaseOverweightLimits")] - public XYZ? BaseOverweightLimits - { - get; - set; - } + public XYZ? BaseOverweightLimits { get; set; } [JsonPropertyName("SprintOverweightLimits")] - public XYZ? SprintOverweightLimits - { - get; - set; - } + public XYZ? SprintOverweightLimits { get; set; } [JsonPropertyName("WalkSpeedOverweightLimits")] - public XYZ? WalkSpeedOverweightLimits - { - get; - set; - } + public XYZ? WalkSpeedOverweightLimits { get; set; } [JsonPropertyName("CrouchConsumption")] - public XYZ? CrouchConsumption - { - get; - set; - } + public XYZ? CrouchConsumption { get; set; } [JsonPropertyName("WalkConsumption")] - public XYZ? WalkConsumption - { - get; - set; - } + public XYZ? WalkConsumption { get; set; } [JsonPropertyName("StandupConsumption")] - public XYZ? StandupConsumption - { - get; - set; - } + public XYZ? StandupConsumption { get; set; } [JsonPropertyName("TransitionSpeed")] - public XYZ? TransitionSpeed - { - get; - set; - } + public XYZ? TransitionSpeed { get; set; } [JsonPropertyName("SprintAccelerationLowerLimit")] - public double? SprintAccelerationLowerLimit - { - get; - set; - } + public double? SprintAccelerationLowerLimit { get; set; } [JsonPropertyName("SprintSpeedLowerLimit")] - public double? SprintSpeedLowerLimit - { - get; - set; - } + public double? SprintSpeedLowerLimit { get; set; } [JsonPropertyName("SprintSensitivityLowerLimit")] - public double? SprintSensitivityLowerLimit - { - get; - set; - } + public double? SprintSensitivityLowerLimit { get; set; } [JsonPropertyName("AimConsumptionByPose")] - public XYZ? AimConsumptionByPose - { - get; - set; - } + public XYZ? AimConsumptionByPose { get; set; } [JsonPropertyName("RestorationMultiplierByPose")] - public XYZ? RestorationMultiplierByPose - { - get; - set; - } + public XYZ? RestorationMultiplierByPose { get; set; } [JsonPropertyName("OverweightConsumptionByPose")] - public XYZ? OverweightConsumptionByPose - { - get; - set; - } + public XYZ? OverweightConsumptionByPose { get; set; } [JsonPropertyName("AimingSpeedMultiplier")] - public double? AimingSpeedMultiplier - { - get; - set; - } + public double? AimingSpeedMultiplier { get; set; } [JsonPropertyName("WalkVisualEffectMultiplier")] - public double? WalkVisualEffectMultiplier - { - get; - set; - } + public double? WalkVisualEffectMultiplier { get; set; } [JsonPropertyName("WeaponFastSwitchConsumption")] - public double? WeaponFastSwitchConsumption - { - get; - set; - } + public double? WeaponFastSwitchConsumption { get; set; } [JsonPropertyName("HandsCapacity")] - public double? HandsCapacity - { - get; - set; - } + public double? HandsCapacity { get; set; } [JsonPropertyName("HandsRestoration")] - public double? HandsRestoration - { - get; - set; - } + public double? HandsRestoration { get; set; } [JsonPropertyName("ProneConsumption")] - public double? ProneConsumption - { - get; - set; - } + public double? ProneConsumption { get; set; } [JsonPropertyName("BaseHoldBreathConsumption")] - public double? BaseHoldBreathConsumption - { - get; - set; - } + public double? BaseHoldBreathConsumption { get; set; } [JsonPropertyName("SoundRadius")] - public XYZ? SoundRadius - { - get; - set; - } + public XYZ? SoundRadius { get; set; } [JsonPropertyName("ExhaustedMeleeSpeed")] - public double? ExhaustedMeleeSpeed - { - get; - set; - } + public double? ExhaustedMeleeSpeed { get; set; } [JsonPropertyName("FatigueRestorationRate")] - public double? FatigueRestorationRate - { - get; - set; - } + public double? FatigueRestorationRate { get; set; } [JsonPropertyName("FatigueAmountToCreateEffect")] - public double? FatigueAmountToCreateEffect - { - get; - set; - } + public double? FatigueAmountToCreateEffect { get; set; } [JsonPropertyName("ExhaustedMeleeDamageMultiplier")] - public double? ExhaustedMeleeDamageMultiplier - { - get; - set; - } + public double? ExhaustedMeleeDamageMultiplier { get; set; } [JsonPropertyName("FallDamageMultiplier")] - public double? FallDamageMultiplier - { - get; - set; - } + public double? FallDamageMultiplier { get; set; } [JsonPropertyName("SafeHeightOverweight")] - public double? SafeHeightOverweight - { - get; - set; - } + public double? SafeHeightOverweight { get; set; } [JsonPropertyName("SitToStandConsumption")] - public double? SitToStandConsumption - { - get; - set; - } + public double? SitToStandConsumption { get; set; } [JsonPropertyName("StaminaExhaustionCausesJiggle")] - public bool? StaminaExhaustionCausesJiggle - { - get; - set; - } + public bool? StaminaExhaustionCausesJiggle { get; set; } [JsonPropertyName("StaminaExhaustionStartsBreathSound")] - public bool? StaminaExhaustionStartsBreathSound - { - get; - set; - } + public bool? StaminaExhaustionStartsBreathSound { get; set; } [JsonPropertyName("StaminaExhaustionRocksCamera")] - public bool? StaminaExhaustionRocksCamera - { - get; - set; - } + public bool? StaminaExhaustionRocksCamera { get; set; } [JsonPropertyName("HoldBreathStaminaMultiplier")] - public XYZ? HoldBreathStaminaMultiplier - { - get; - set; - } + public XYZ? HoldBreathStaminaMultiplier { get; set; } [JsonPropertyName("PoseLevelIncreaseSpeed")] - public XYZ? PoseLevelIncreaseSpeed - { - get; - set; - } + public XYZ? PoseLevelIncreaseSpeed { get; set; } [JsonPropertyName("PoseLevelDecreaseSpeed")] - public XYZ? PoseLevelDecreaseSpeed - { - get; - set; - } + public XYZ? PoseLevelDecreaseSpeed { get; set; } [JsonPropertyName("PoseLevelConsumptionPerNotch")] - public XYZ? PoseLevelConsumptionPerNotch - { - get; - set; - } + public XYZ? PoseLevelConsumptionPerNotch { get; set; } - public XYZ? ClimbLegsConsumption - { - get; - set; - } + public XYZ? ClimbLegsConsumption { get; set; } - public XYZ? ClimbOneHandConsumption - { - get; - set; - } + public XYZ? ClimbOneHandConsumption { get; set; } - public XYZ? ClimbTwoHandsConsumption - { - get; - set; - } + public XYZ? ClimbTwoHandsConsumption { get; set; } - public XYZ? VaultLegsConsumption - { - get; - set; - } + public XYZ? VaultLegsConsumption { get; set; } - public XYZ? VaultOneHandConsumption - { - get; - set; - } + public XYZ? VaultOneHandConsumption { get; set; } } public record StaminaRestoration @@ -6251,46 +3059,22 @@ public record StaminaRestoration public Dictionary ExtensionData { get; set; } [JsonPropertyName("LowerLeftPoint")] - public double? LowerLeftPoint - { - get; - set; - } + public double? LowerLeftPoint { get; set; } [JsonPropertyName("LowerRightPoint")] - public double? LowerRightPoint - { - get; - set; - } + public double? LowerRightPoint { get; set; } [JsonPropertyName("LeftPlatoPoint")] - public double? LeftPlatoPoint - { - get; - set; - } + public double? LeftPlatoPoint { get; set; } [JsonPropertyName("RightPlatoPoint")] - public double? RightPlatoPoint - { - get; - set; - } + public double? RightPlatoPoint { get; set; } [JsonPropertyName("RightLimit")] - public double? RightLimit - { - get; - set; - } + public double? RightLimit { get; set; } [JsonPropertyName("ZeroValue")] - public double? ZeroValue - { - get; - set; - } + public double? ZeroValue { get; set; } } public record StaminaDrain @@ -6299,46 +3083,22 @@ public record StaminaDrain public Dictionary ExtensionData { get; set; } [JsonPropertyName("LowerLeftPoint")] - public double? LowerLeftPoint - { - get; - set; - } + public double? LowerLeftPoint { get; set; } [JsonPropertyName("LowerRightPoint")] - public double? LowerRightPoint - { - get; - set; - } + public double? LowerRightPoint { get; set; } [JsonPropertyName("LeftPlatoPoint")] - public double? LeftPlatoPoint - { - get; - set; - } + public double? LeftPlatoPoint { get; set; } [JsonPropertyName("RightPlatoPoint")] - public double? RightPlatoPoint - { - get; - set; - } + public double? RightPlatoPoint { get; set; } [JsonPropertyName("RightLimit")] - public double? RightLimit - { - get; - set; - } + public double? RightLimit { get; set; } [JsonPropertyName("ZeroValue")] - public double? ZeroValue - { - get; - set; - } + public double? ZeroValue { get; set; } } public record RequirementReferences @@ -6347,11 +3107,7 @@ public record RequirementReferences public Dictionary ExtensionData { get; set; } [JsonPropertyName("Alpinist")] - public List? Alpinists - { - get; - set; - } + public List? Alpinists { get; set; } } public record Alpinist @@ -6360,39 +3116,19 @@ public record Alpinist public Dictionary ExtensionData { get; set; } [JsonPropertyName("Requirement")] - public string? Requirement - { - get; - set; - } + public string? Requirement { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("RequiredSlot")] - public string? RequiredSlot - { - get; - set; - } + public string? RequiredSlot { get; set; } [JsonPropertyName("RequirementTip")] - public string? RequirementTip - { - get; - set; - } + public string? RequirementTip { get; set; } } public record RestrictionsInRaid @@ -6401,25 +3137,13 @@ public record RestrictionsInRaid public Dictionary ExtensionData { get; set; } [JsonPropertyName("MaxInLobby")] - public double? MaxInLobby - { - get; - set; - } + public double? MaxInLobby { get; set; } [JsonPropertyName("MaxInRaid")] - public double? MaxInRaid - { - get; - set; - } + public double? MaxInRaid { get; set; } [JsonPropertyName("TemplateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } } public record FavoriteItemsSettings @@ -6428,18 +3152,10 @@ public record FavoriteItemsSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("WeaponStandMaxItemsCount")] - public double? WeaponStandMaxItemsCount - { - get; - set; - } + public double? WeaponStandMaxItemsCount { get; set; } [JsonPropertyName("PlaceOfFameMaxItemsCount")] - public double? PlaceOfFameMaxItemsCount - { - get; - set; - } + public double? PlaceOfFameMaxItemsCount { get; set; } } public record VaultingSettings @@ -6448,32 +3164,16 @@ public record VaultingSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("IsActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("VaultingInputTime")] - public double? VaultingInputTime - { - get; - set; - } + public double? VaultingInputTime { get; set; } [JsonPropertyName("GridSettings")] - public VaultingGridSettings? GridSettings - { - get; - set; - } + public VaultingGridSettings? GridSettings { get; set; } [JsonPropertyName("MovesSettings")] - public VaultingMovesSettings? MovesSettings - { - get; - set; - } + public VaultingMovesSettings? MovesSettings { get; set; } } public record VaultingGridSettings @@ -6482,74 +3182,34 @@ public record VaultingGridSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("GridSizeX")] - public double? GridSizeX - { - get; - set; - } + public double? GridSizeX { get; set; } [JsonPropertyName("GridSizeY")] - public double? GridSizeY - { - get; - set; - } + public double? GridSizeY { get; set; } [JsonPropertyName("GridSizeZ")] - public double? GridSizeZ - { - get; - set; - } + public double? GridSizeZ { get; set; } [JsonPropertyName("SteppingLengthX")] - public double? SteppingLengthX - { - get; - set; - } + public double? SteppingLengthX { get; set; } [JsonPropertyName("SteppingLengthY")] - public double? SteppingLengthY - { - get; - set; - } + public double? SteppingLengthY { get; set; } [JsonPropertyName("SteppingLengthZ")] - public double? SteppingLengthZ - { - get; - set; - } + public double? SteppingLengthZ { get; set; } [JsonPropertyName("GridOffsetX")] - public double? GridOffsetX - { - get; - set; - } + public double? GridOffsetX { get; set; } [JsonPropertyName("GridOffsetY")] - public double? GridOffsetY - { - get; - set; - } + public double? GridOffsetY { get; set; } [JsonPropertyName("GridOffsetZ")] - public double? GridOffsetZ - { - get; - set; - } + public double? GridOffsetZ { get; set; } [JsonPropertyName("OffsetFactor")] - public double? OffsetFactor - { - get; - set; - } + public double? OffsetFactor { get; set; } } public record VaultingMovesSettings @@ -6558,18 +3218,10 @@ public record VaultingMovesSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("VaultSettings")] - public VaultingSubMoveSettings? VaultSettings - { - get; - set; - } + public VaultingSubMoveSettings? VaultSettings { get; set; } [JsonPropertyName("ClimbSettings")] - public VaultingSubMoveSettings? ClimbSettings - { - get; - set; - } + public VaultingSubMoveSettings? ClimbSettings { get; set; } } public record VaultingSubMoveSettings @@ -6578,45 +3230,21 @@ public record VaultingSubMoveSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("IsActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("MaxWithoutHandHeight")] - public double? MaxWithoutHandHeight - { - get; - set; - } + public double? MaxWithoutHandHeight { get; set; } - public double? MaxOneHandHeight - { - get; - set; - } + public double? MaxOneHandHeight { get; set; } [JsonPropertyName("SpeedRange")] - public XYZ? SpeedRange - { - get; - set; - } + public XYZ? SpeedRange { get; set; } [JsonPropertyName("MoveRestrictions")] - public MoveRestrictions? MoveRestrictions - { - get; - set; - } + public MoveRestrictions? MoveRestrictions { get; set; } [JsonPropertyName("AutoMoveRestrictions")] - public MoveRestrictions? AutoMoveRestrictions - { - get; - set; - } + public MoveRestrictions? AutoMoveRestrictions { get; set; } } public record MoveRestrictions @@ -6625,46 +3253,22 @@ public record MoveRestrictions public Dictionary ExtensionData { get; set; } [JsonPropertyName("IsActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("MinDistantToInteract")] - public double? MinDistantToInteract - { - get; - set; - } + public double? MinDistantToInteract { get; set; } [JsonPropertyName("MinHeight")] - public double? MinHeight - { - get; - set; - } + public double? MinHeight { get; set; } [JsonPropertyName("MaxHeight")] - public double? MaxHeight - { - get; - set; - } + public double? MaxHeight { get; set; } [JsonPropertyName("MinLength")] - public double? MinLength - { - get; - set; - } + public double? MinLength { get; set; } [JsonPropertyName("MaxLength")] - public double? MaxLength - { - get; - set; - } + public double? MaxLength { get; set; } } public record BTRSettings @@ -6673,151 +3277,67 @@ public record BTRSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("LocationsWithBTR")] - public List? LocationsWithBTR - { - get; - set; - } + public List? LocationsWithBTR { get; set; } [JsonPropertyName("BasePriceTaxi")] - public double? BasePriceTaxi - { - get; - set; - } + public double? BasePriceTaxi { get; set; } [JsonPropertyName("AddPriceTaxi")] - public double? AddPriceTaxi - { - get; - set; - } + public double? AddPriceTaxi { get; set; } [JsonPropertyName("CleanUpPrice")] - public double? CleanUpPrice - { - get; - set; - } + public double? CleanUpPrice { get; set; } [JsonPropertyName("DeliveryPrice")] - public double? DeliveryPrice - { - get; - set; - } + public double? DeliveryPrice { get; set; } [JsonPropertyName("ModDeliveryCost")] - public double? ModDeliveryCost - { - get; - set; - } + public double? ModDeliveryCost { get; set; } [JsonPropertyName("BearPriceMod")] - public double? BearPriceMod - { - get; - set; - } + public double? BearPriceMod { get; set; } [JsonPropertyName("UsecPriceMod")] - public double? UsecPriceMod - { - get; - set; - } + public double? UsecPriceMod { get; set; } [JsonPropertyName("ScavPriceMod")] - public double? ScavPriceMod - { - get; - set; - } + public double? ScavPriceMod { get; set; } [JsonPropertyName("CoefficientDiscountCharisma")] - public double? CoefficientDiscountCharisma - { - get; - set; - } + public double? CoefficientDiscountCharisma { get; set; } [JsonPropertyName("DeliveryMinPrice")] - public double? DeliveryMinPrice - { - get; - set; - } + public double? DeliveryMinPrice { get; set; } [JsonPropertyName("TaxiMinPrice")] - public double? TaxiMinPrice - { - get; - set; - } + public double? TaxiMinPrice { get; set; } [JsonPropertyName("BotCoverMinPrice")] - public double? BotCoverMinPrice - { - get; - set; - } + public double? BotCoverMinPrice { get; set; } [JsonPropertyName("MapsConfigs")] - public Dictionary? MapsConfigs - { - get; - set; - } + public Dictionary? MapsConfigs { get; set; } [JsonPropertyName("DiameterWheel")] - public double? DiameterWheel - { - get; - set; - } + public double? DiameterWheel { get; set; } [JsonPropertyName("HeightWheel")] - public double? HeightWheel - { - get; - set; - } + public double? HeightWheel { get; set; } [JsonPropertyName("HeightWheelMaxPosLimit")] - public double? HeightWheelMaxPosLimit - { - get; - set; - } + public double? HeightWheelMaxPosLimit { get; set; } [JsonPropertyName("HeightWheelMinPosLimit")] - public double? HeightWheelMinPosLimit - { - get; - set; - } + public double? HeightWheelMinPosLimit { get; set; } [JsonPropertyName("SnapToSurfaceWheelsSpeed")] - public double? SnapToSurfaceWheelsSpeed - { - get; - set; - } + public double? SnapToSurfaceWheelsSpeed { get; set; } [JsonPropertyName("CheckSurfaceForWheelsTimer")] - public double? CheckSurfaceForWheelsTimer - { - get; - set; - } + public double? CheckSurfaceForWheelsTimer { get; set; } [JsonPropertyName("HeightWheelOffset")] - public double? HeightWheelOffset - { - get; - set; - } + public double? HeightWheelOffset { get; set; } } public record BtrMapConfig @@ -6826,109 +3346,49 @@ public record BtrMapConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("BtrSkin")] - public string? BtrSkin - { - get; - set; - } + public string? BtrSkin { get; set; } [JsonPropertyName("CheckSurfaceForWheelsTimer")] - public double? CheckSurfaceForWheelsTimer - { - get; - set; - } + public double? CheckSurfaceForWheelsTimer { get; set; } [JsonPropertyName("DiameterWheel")] - public double? DiameterWheel - { - get; - set; - } + public double? DiameterWheel { get; set; } [JsonPropertyName("HeightWheel")] - public double? HeightWheel - { - get; - set; - } + public double? HeightWheel { get; set; } [JsonPropertyName("HeightWheelMaxPosLimit")] - public double? HeightWheelMaxPosLimit - { - get; - set; - } + public double? HeightWheelMaxPosLimit { get; set; } [JsonPropertyName("HeightWheelMinPosLimit")] - public double? HeightWheelMinPosLimit - { - get; - set; - } + public double? HeightWheelMinPosLimit { get; set; } [JsonPropertyName("HeightWheelOffset")] - public double? HeightWheelOffset - { - get; - set; - } + public double? HeightWheelOffset { get; set; } [JsonPropertyName("SnapToSurfaceWheelsSpeed")] - public double? SnapToSurfaceWheelsSpeed - { - get; - set; - } + public double? SnapToSurfaceWheelsSpeed { get; set; } [JsonPropertyName("SuspensionDamperStiffness")] - public double? SuspensionDamperStiffness - { - get; - set; - } + public double? SuspensionDamperStiffness { get; set; } [JsonPropertyName("SuspensionRestLength")] - public double? SuspensionRestLength - { - get; - set; - } + public double? SuspensionRestLength { get; set; } [JsonPropertyName("SuspensionSpringStiffness")] - public double? SuspensionSpringStiffness - { - get; - set; - } + public double? SuspensionSpringStiffness { get; set; } [JsonPropertyName("SuspensionTravel")] - public double? SuspensionTravel - { - get; - set; - } + public double? SuspensionTravel { get; set; } [JsonPropertyName("SuspensionWheelRadius")] - public double? SuspensionWheelRadius - { - get; - set; - } + public double? SuspensionWheelRadius { get; set; } [JsonPropertyName("mapID")] - public string? MapID - { - get; - set; - } + public string? MapID { get; set; } [JsonPropertyName("pathsConfigurations")] - public List? PathsConfigurations - { - get; - set; - } + public List? PathsConfigurations { get; set; } } public record PathConfig @@ -6937,67 +3397,31 @@ public record PathConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("active")] - public bool? Active - { - get; - set; - } + public bool? Active { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("enterPoint")] - public string? EnterPoint - { - get; - set; - } + public string? EnterPoint { get; set; } [JsonPropertyName("exitPoint")] - public string? ExitPoint - { - get; - set; - } + public string? ExitPoint { get; set; } [JsonPropertyName("pathPoints")] - public List? PathPoints - { - get; - set; - } + public List? PathPoints { get; set; } [JsonPropertyName("once")] - public bool? Once - { - get; - set; - } + public bool? Once { get; set; } [JsonPropertyName("circle")] - public bool? Circle - { - get; - set; - } + public bool? Circle { get; set; } [JsonPropertyName("circleCount")] - public double? CircleCount - { - get; - set; - } + public double? CircleCount { get; set; } [JsonPropertyName("skinType")] - public List? SkinType - { - get; - set; - } + public List? SkinType { get; set; } } public record SquadSettings @@ -7006,25 +3430,13 @@ public record SquadSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("CountOfRequestsToOnePlayer")] - public double? CountOfRequestsToOnePlayer - { - get; - set; - } + public double? CountOfRequestsToOnePlayer { get; set; } [JsonPropertyName("SecondsForExpiredRequest")] - public double? SecondsForExpiredRequest - { - get; - set; - } + public double? SecondsForExpiredRequest { get; set; } [JsonPropertyName("SendRequestDelaySeconds")] - public double? SendRequestDelaySeconds - { - get; - set; - } + public double? SendRequestDelaySeconds { get; set; } } public record Insurance @@ -7033,46 +3445,22 @@ public record Insurance public Dictionary ExtensionData { get; set; } [JsonPropertyName("ChangeForReturnItemsInOfflineRaid")] - public double? ChangeForReturnItemsInOfflineRaid - { - get; - set; - } + public double? ChangeForReturnItemsInOfflineRaid { get; set; } [JsonPropertyName("MaxStorageTimeInHour")] - public double? MaxStorageTimeInHour - { - get; - set; - } + public double? MaxStorageTimeInHour { get; set; } [JsonPropertyName("CoefOfSendingMessageTime")] - public double? CoefOfSendingMessageTime - { - get; - set; - } + public double? CoefOfSendingMessageTime { get; set; } [JsonPropertyName("CoefOfHavingMarkOfUnknown")] - public double? CoefOfHavingMarkOfUnknown - { - get; - set; - } + public double? CoefOfHavingMarkOfUnknown { get; set; } [JsonPropertyName("EditionSendingMessageTime")] - public Dictionary? EditionSendingMessageTime - { - get; - set; - } + public Dictionary? EditionSendingMessageTime { get; set; } [JsonPropertyName("OnlyInDeathCase")] - public bool? OnlyInDeathCase - { - get; - set; - } + public bool? OnlyInDeathCase { get; set; } } public record MessageSendTimeMultiplier @@ -7081,11 +3469,7 @@ public record MessageSendTimeMultiplier public Dictionary ExtensionData { get; set; } [JsonPropertyName("multiplier")] - public double? Multiplier - { - get; - set; - } + public double? Multiplier { get; set; } } public record SkillsSettings @@ -7094,487 +3478,211 @@ public record SkillsSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("SkillProgressRate")] - public double? SkillProgressRate - { - get; - set; - } + public double? SkillProgressRate { get; set; } [JsonPropertyName("WeaponSkillProgressRate")] - public double? WeaponSkillProgressRate - { - get; - set; - } + public double? WeaponSkillProgressRate { get; set; } [JsonPropertyName("WeaponSkillRecoilBonusPerLevel")] - public double? WeaponSkillRecoilBonusPerLevel - { - get; - set; - } + public double? WeaponSkillRecoilBonusPerLevel { get; set; } [JsonPropertyName("HideoutManagement")] - public HideoutManagement? HideoutManagement - { - get; - set; - } + public HideoutManagement? HideoutManagement { get; set; } [JsonPropertyName("Crafting")] - public Crafting? Crafting - { - get; - set; - } + public Crafting? Crafting { get; set; } [JsonPropertyName("Metabolism")] - public Metabolism? Metabolism - { - get; - set; - } + public Metabolism? Metabolism { get; set; } [JsonPropertyName("MountingErgonomicsBonusPerLevel")] - public double? MountingErgonomicsBonusPerLevel - { - get; - set; - } + public double? MountingErgonomicsBonusPerLevel { get; set; } [JsonPropertyName("Immunity")] - public Immunity? Immunity - { - get; - set; - } + public Immunity? Immunity { get; set; } [JsonPropertyName("Endurance")] - public Endurance? Endurance - { - get; - set; - } + public Endurance? Endurance { get; set; } [JsonPropertyName("Strength")] - public Strength? Strength - { - get; - set; - } + public Strength? Strength { get; set; } [JsonPropertyName("Vitality")] - public Vitality? Vitality - { - get; - set; - } + public Vitality? Vitality { get; set; } [JsonPropertyName("Health")] - public HealthSkillProgress? Health - { - get; - set; - } + public HealthSkillProgress? Health { get; set; } [JsonPropertyName("StressResistance")] - public StressResistance? StressResistance - { - get; - set; - } + public StressResistance? StressResistance { get; set; } [JsonPropertyName("Throwing")] - public Throwing? Throwing - { - get; - set; - } + public Throwing? Throwing { get; set; } [JsonPropertyName("RecoilControl")] - public RecoilControl? RecoilControl - { - get; - set; - } + public RecoilControl? RecoilControl { get; set; } [JsonPropertyName("Pistol")] - public WeaponSkills? Pistol - { - get; - set; - } + public WeaponSkills? Pistol { get; set; } [JsonPropertyName("Revolver")] - public WeaponSkills? Revolver - { - get; - set; - } + public WeaponSkills? Revolver { get; set; } [JsonPropertyName("SMG")] - public List? SMG - { - get; - set; - } + public List? SMG { get; set; } [JsonPropertyName("Assault")] - public WeaponSkills? Assault - { - get; - set; - } + public WeaponSkills? Assault { get; set; } [JsonPropertyName("Shotgun")] - public WeaponSkills? Shotgun - { - get; - set; - } + public WeaponSkills? Shotgun { get; set; } [JsonPropertyName("Sniper")] - public WeaponSkills? Sniper - { - get; - set; - } + public WeaponSkills? Sniper { get; set; } [JsonPropertyName("LMG")] - public List? LMG - { - get; - set; - } + public List? LMG { get; set; } [JsonPropertyName("HMG")] - public List? HMG - { - get; - set; - } + public List? HMG { get; set; } [JsonPropertyName("Launcher")] - public List? Launcher - { - get; - set; - } + public List? Launcher { get; set; } [JsonPropertyName("AttachedLauncher")] - public List? AttachedLauncher - { - get; - set; - } + public List? AttachedLauncher { get; set; } [JsonPropertyName("Melee")] - public MeleeSkill? Melee - { - get; - set; - } + public MeleeSkill? Melee { get; set; } [JsonPropertyName("DMR")] - public WeaponSkills? DMR - { - get; - set; - } + public WeaponSkills? DMR { get; set; } [JsonPropertyName("BearAssaultoperations")] - public List? BearAssaultoperations - { - get; - set; - } + public List? BearAssaultoperations { get; set; } [JsonPropertyName("BearAuthority")] - public List? BearAuthority - { - get; - set; - } + public List? BearAuthority { get; set; } [JsonPropertyName("BearAksystems")] - public List? BearAksystems - { - get; - set; - } + public List? BearAksystems { get; set; } [JsonPropertyName("BearHeavycaliber")] - public List? BearHeavycaliber - { - get; - set; - } + public List? BearHeavycaliber { get; set; } [JsonPropertyName("BearRawpower")] - public List? BearRawpower - { - get; - set; - } + public List? BearRawpower { get; set; } [JsonPropertyName("BipodErgonomicsBonusPerLevel")] - public double? BipodErgonomicsBonusPerLevel - { - get; - set; - } + public double? BipodErgonomicsBonusPerLevel { get; set; } [JsonPropertyName("UsecArsystems")] - public List? UsecArsystems - { - get; - set; - } + public List? UsecArsystems { get; set; } [JsonPropertyName("UsecDeepweaponmodding_Settings")] - public List? UsecDeepweaponmodding_Settings - { - get; - set; - } + public List? UsecDeepweaponmodding_Settings { get; set; } [JsonPropertyName("UsecLongrangeoptics_Settings")] - public List? UsecLongrangeoptics_Settings - { - get; - set; - } + public List? UsecLongrangeoptics_Settings { get; set; } [JsonPropertyName("UsecNegotiations")] - public List? UsecNegotiations - { - get; - set; - } + public List? UsecNegotiations { get; set; } [JsonPropertyName("UsecTactics")] - public List? UsecTactics - { - get; - set; - } + public List? UsecTactics { get; set; } [JsonPropertyName("BotReload")] - public List? BotReload - { - get; - set; - } + public List? BotReload { get; set; } [JsonPropertyName("CovertMovement")] - public CovertMovement? CovertMovement - { - get; - set; - } + public CovertMovement? CovertMovement { get; set; } [JsonPropertyName("FieldMedicine")] - public List? FieldMedicine - { - get; - set; - } + public List? FieldMedicine { get; set; } [JsonPropertyName("Search")] - public Search? Search - { - get; - set; - } + public Search? Search { get; set; } [JsonPropertyName("Sniping")] - public List? Sniping - { - get; - set; - } + public List? Sniping { get; set; } [JsonPropertyName("ProneMovement")] - public List? ProneMovement - { - get; - set; - } + public List? ProneMovement { get; set; } [JsonPropertyName("FirstAid")] - public List? FirstAid - { - get; - set; - } + public List? FirstAid { get; set; } [JsonPropertyName("LightVests")] - public ArmorSkills? LightVests - { - get; - set; - } + public ArmorSkills? LightVests { get; set; } [JsonPropertyName("HeavyVests")] - public ArmorSkills? HeavyVests - { - get; - set; - } + public ArmorSkills? HeavyVests { get; set; } [JsonPropertyName("WeaponModding")] - public List? WeaponModding - { - get; - set; - } + public List? WeaponModding { get; set; } [JsonPropertyName("AdvancedModding")] - public List? AdvancedModding - { - get; - set; - } + public List? AdvancedModding { get; set; } [JsonPropertyName("NightOps")] - public List? NightOps - { - get; - set; - } + public List? NightOps { get; set; } [JsonPropertyName("SilentOps")] - public List? SilentOps - { - get; - set; - } + public List? SilentOps { get; set; } [JsonPropertyName("Lockpicking")] - public List? Lockpicking - { - get; - set; - } + public List? Lockpicking { get; set; } [JsonPropertyName("WeaponTreatment")] - public WeaponTreatment? WeaponTreatment - { - get; - set; - } + public WeaponTreatment? WeaponTreatment { get; set; } [JsonPropertyName("MagDrills")] - public MagDrills? MagDrills - { - get; - set; - } + public MagDrills? MagDrills { get; set; } [JsonPropertyName("Freetrading")] - public List? Freetrading - { - get; - set; - } + public List? Freetrading { get; set; } [JsonPropertyName("Auctions")] - public List? Auctions - { - get; - set; - } + public List? Auctions { get; set; } [JsonPropertyName("Cleanoperations")] - public List? Cleanoperations - { - get; - set; - } + public List? Cleanoperations { get; set; } [JsonPropertyName("Barter")] - public List? Barter - { - get; - set; - } + public List? Barter { get; set; } [JsonPropertyName("Shadowconnections")] - public List? Shadowconnections - { - get; - set; - } + public List? Shadowconnections { get; set; } [JsonPropertyName("Taskperformance")] - public List? Taskperformance - { - get; - set; - } + public List? Taskperformance { get; set; } [JsonPropertyName("Perception")] - public Perception? Perception - { - get; - set; - } + public Perception? Perception { get; set; } [JsonPropertyName("Intellect")] - public Intellect? Intellect - { - get; - set; - } + public Intellect? Intellect { get; set; } [JsonPropertyName("Attention")] - public Attention? Attention - { - get; - set; - } + public Attention? Attention { get; set; } [JsonPropertyName("Charisma")] - public Charisma? Charisma - { - get; - set; - } + public Charisma? Charisma { get; set; } [JsonPropertyName("Memory")] - public Memory? Memory - { - get; - set; - } + public Memory? Memory { get; set; } [JsonPropertyName("Surgery")] - public Surgery? Surgery - { - get; - set; - } + public Surgery? Surgery { get; set; } [JsonPropertyName("AimDrills")] - public AimDrills? AimDrills - { - get; - set; - } + public AimDrills? AimDrills { get; set; } [JsonPropertyName("BotSound")] - public List? BotSound - { - get; - set; - } + public List? BotSound { get; set; } [JsonPropertyName("TroubleShooting")] - public TroubleShooting? TroubleShooting - { - get; - set; - } + public TroubleShooting? TroubleShooting { get; set; } } public record MeleeSkill @@ -7582,11 +3690,7 @@ public record MeleeSkill [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public BuffSettings? BuffSettings - { - get; - set; - } + public BuffSettings? BuffSettings { get; set; } } public record ArmorSkills @@ -7594,89 +3698,33 @@ public record ArmorSkills [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? BluntThroughputDamageHVestsReducePerLevel - { - get; - set; - } + public double? BluntThroughputDamageHVestsReducePerLevel { get; set; } - public double? WearAmountRepairHVestsReducePerLevel - { - get; - set; - } + public double? WearAmountRepairHVestsReducePerLevel { get; set; } - public double? WearChanceRepairHVestsReduceEliteLevel - { - get; - set; - } + public double? WearChanceRepairHVestsReduceEliteLevel { get; set; } - public double? BuffMaxCount - { - get; - set; - } + public double? BuffMaxCount { get; set; } - public BuffSettings? BuffSettings - { - get; - set; - } + public BuffSettings? BuffSettings { get; set; } - public ArmorCounters? Counters - { - get; - set; - } + public ArmorCounters? Counters { get; set; } - public double? MoveSpeedPenaltyReductionHVestsReducePerLevel - { - get; - set; - } + public double? MoveSpeedPenaltyReductionHVestsReducePerLevel { get; set; } - public double? RicochetChanceHVestsCurrentDurabilityThreshold - { - get; - set; - } + public double? RicochetChanceHVestsCurrentDurabilityThreshold { get; set; } - public double? RicochetChanceHVestsEliteLevel - { - get; - set; - } + public double? RicochetChanceHVestsEliteLevel { get; set; } - public double? RicochetChanceHVestsMaxDurabilityThreshold - { - get; - set; - } + public double? RicochetChanceHVestsMaxDurabilityThreshold { get; set; } - public double? MeleeDamageLVestsReducePerLevel - { - get; - set; - } + public double? MeleeDamageLVestsReducePerLevel { get; set; } - public double? MoveSpeedPenaltyReductionLVestsReducePerLevel - { - get; - set; - } + public double? MoveSpeedPenaltyReductionLVestsReducePerLevel { get; set; } - public double? WearAmountRepairLVestsReducePerLevel - { - get; - set; - } + public double? WearAmountRepairLVestsReducePerLevel { get; set; } - public double? WearChanceRepairLVestsReduceEliteLevel - { - get; - set; - } + public double? WearChanceRepairLVestsReduceEliteLevel { get; set; } } public record ArmorCounters @@ -7685,11 +3733,7 @@ public record ArmorCounters public Dictionary ExtensionData { get; set; } [JsonPropertyName("armorDurability")] - public SkillCounter? ArmorDurability - { - get; - set; - } + public SkillCounter? ArmorDurability { get; set; } } public record HideoutManagement @@ -7697,47 +3741,19 @@ public record HideoutManagement [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? SkillPointsPerAreaUpgrade - { - get; - set; - } + public double? SkillPointsPerAreaUpgrade { get; set; } - public double? SkillPointsPerCraft - { - get; - set; - } + public double? SkillPointsPerCraft { get; set; } - public double? CircleOfCultistsBonusPercent - { - get; - set; - } + public double? CircleOfCultistsBonusPercent { get; set; } - public double? ConsumptionReductionPerLevel - { - get; - set; - } + public double? ConsumptionReductionPerLevel { get; set; } - public double? SkillBoostPercent - { - get; - set; - } + public double? SkillBoostPercent { get; set; } - public SkillPointsRate? SkillPointsRate - { - get; - set; - } + public SkillPointsRate? SkillPointsRate { get; set; } - public EliteSlots? EliteSlots - { - get; - set; - } + public EliteSlots? EliteSlots { get; set; } } public record SkillPointsRate @@ -7745,29 +3761,13 @@ public record SkillPointsRate [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public SkillPointRate? Generator - { - get; - set; - } + public SkillPointRate? Generator { get; set; } - public SkillPointRate? AirFilteringUnit - { - get; - set; - } + public SkillPointRate? AirFilteringUnit { get; set; } - public SkillPointRate? WaterCollector - { - get; - set; - } + public SkillPointRate? WaterCollector { get; set; } - public SkillPointRate? SolarPower - { - get; - set; - } + public SkillPointRate? SolarPower { get; set; } } public record SkillPointRate @@ -7775,17 +3775,9 @@ public record SkillPointRate [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? ResourceSpent - { - get; - set; - } + public double? ResourceSpent { get; set; } - public double? PointsGained - { - get; - set; - } + public double? PointsGained { get; set; } } public record EliteSlots @@ -7793,29 +3785,13 @@ public record EliteSlots [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public EliteSlot? Generator - { - get; - set; - } + public EliteSlot? Generator { get; set; } - public EliteSlot? AirFilteringUnit - { - get; - set; - } + public EliteSlot? AirFilteringUnit { get; set; } - public EliteSlot? WaterCollector - { - get; - set; - } + public EliteSlot? WaterCollector { get; set; } - public EliteSlot? BitcoinFarm - { - get; - set; - } + public EliteSlot? BitcoinFarm { get; set; } } public record EliteSlot @@ -7823,17 +3799,9 @@ public record EliteSlot [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Slots - { - get; - set; - } + public double? Slots { get; set; } - public double? Container - { - get; - set; - } + public double? Container { get; set; } } public record Crafting @@ -7842,68 +3810,32 @@ public record Crafting public Dictionary ExtensionData { get; set; } [JsonPropertyName("DependentSkillRatios")] - public List? DependentSkillRatios - { - get; - set; - } + public List? DependentSkillRatios { get; set; } [JsonPropertyName("PointsPerCraftingCycle")] - public double? PointsPerCraftingCycle - { - get; - set; - } + public double? PointsPerCraftingCycle { get; set; } [JsonPropertyName("CraftingCycleHours")] - public double? CraftingCycleHours - { - get; - set; - } + public double? CraftingCycleHours { get; set; } [JsonPropertyName("PointsPerUniqueCraftCycle")] - public double? PointsPerUniqueCraftCycle - { - get; - set; - } + public double? PointsPerUniqueCraftCycle { get; set; } [JsonPropertyName("UniqueCraftsPerCycle")] - public double? UniqueCraftsPerCycle - { - get; - set; - } + public double? UniqueCraftsPerCycle { get; set; } [JsonPropertyName("CraftTimeReductionPerLevel")] - public double? CraftTimeReductionPerLevel - { - get; - set; - } + public double? CraftTimeReductionPerLevel { get; set; } [JsonPropertyName("ProductionTimeReductionPerLevel")] - public double? ProductionTimeReductionPerLevel - { - get; - set; - } + public double? ProductionTimeReductionPerLevel { get; set; } [JsonPropertyName("EliteExtraProductions")] - public double? EliteExtraProductions - { - get; - set; - } + public double? EliteExtraProductions { get; set; } // Yes, there is a typo [JsonPropertyName("CraftingPointsToInteligence")] - public double? CraftingPointsToIntelligence - { - get; - set; - } + public double? CraftingPointsToIntelligence { get; set; } } public record Metabolism @@ -7912,39 +3844,19 @@ public record Metabolism public Dictionary ExtensionData { get; set; } [JsonPropertyName("HydrationRecoveryRate")] - public double? HydrationRecoveryRate - { - get; - set; - } + public double? HydrationRecoveryRate { get; set; } [JsonPropertyName("EnergyRecoveryRate")] - public double? EnergyRecoveryRate - { - get; - set; - } + public double? EnergyRecoveryRate { get; set; } [JsonPropertyName("IncreasePositiveEffectDurationRate")] - public double? IncreasePositiveEffectDurationRate - { - get; - set; - } + public double? IncreasePositiveEffectDurationRate { get; set; } [JsonPropertyName("DecreaseNegativeEffectDurationRate")] - public double? DecreaseNegativeEffectDurationRate - { - get; - set; - } + public double? DecreaseNegativeEffectDurationRate { get; set; } [JsonPropertyName("DecreasePoisonDurationRate")] - public double? DecreasePoisonDurationRate - { - get; - set; - } + public double? DecreasePoisonDurationRate { get; set; } } public record Immunity @@ -7953,39 +3865,19 @@ public record Immunity public Dictionary ExtensionData { get; set; } [JsonPropertyName("ImmunityMiscEffects")] - public double? ImmunityMiscEffects - { - get; - set; - } + public double? ImmunityMiscEffects { get; set; } [JsonPropertyName("ImmunityPoisonBuff")] - public double? ImmunityPoisonBuff - { - get; - set; - } + public double? ImmunityPoisonBuff { get; set; } [JsonPropertyName("ImmunityPainKiller")] - public double? ImmunityPainKiller - { - get; - set; - } + public double? ImmunityPainKiller { get; set; } [JsonPropertyName("HealthNegativeEffect")] - public double? HealthNegativeEffect - { - get; - set; - } + public double? HealthNegativeEffect { get; set; } [JsonPropertyName("StimulatorNegativeBuff")] - public double? StimulatorNegativeBuff - { - get; - set; - } + public double? StimulatorNegativeBuff { get; set; } } public record Endurance @@ -7994,39 +3886,19 @@ public record Endurance public Dictionary ExtensionData { get; set; } [JsonPropertyName("MovementAction")] - public double? MovementAction - { - get; - set; - } + public double? MovementAction { get; set; } [JsonPropertyName("SprintAction")] - public double? SprintAction - { - get; - set; - } + public double? SprintAction { get; set; } [JsonPropertyName("GainPerFatigueStack")] - public double? GainPerFatigueStack - { - get; - set; - } + public double? GainPerFatigueStack { get; set; } [JsonPropertyName("DependentSkillRatios")] - public List? DependentSkillRatios - { - get; - set; - } + public List? DependentSkillRatios { get; set; } [JsonPropertyName("QTELevelMultipliers")] - public Dictionary>? QTELevelMultipliers - { - get; - set; - } + public Dictionary>? QTELevelMultipliers { get; set; } } public record Strength @@ -8035,74 +3907,34 @@ public record Strength public Dictionary ExtensionData { get; set; } [JsonPropertyName("DependentSkillRatios")] - public List? DependentSkillRatios - { - get; - set; - } + public List? DependentSkillRatios { get; set; } [JsonPropertyName("SprintActionMin")] - public double? SprintActionMin - { - get; - set; - } + public double? SprintActionMin { get; set; } [JsonPropertyName("SprintActionMax")] - public double? SprintActionMax - { - get; - set; - } + public double? SprintActionMax { get; set; } [JsonPropertyName("MovementActionMin")] - public double? MovementActionMin - { - get; - set; - } + public double? MovementActionMin { get; set; } [JsonPropertyName("MovementActionMax")] - public double? MovementActionMax - { - get; - set; - } + public double? MovementActionMax { get; set; } [JsonPropertyName("PushUpMin")] - public double? PushUpMin - { - get; - set; - } + public double? PushUpMin { get; set; } [JsonPropertyName("PushUpMax")] - public double? PushUpMax - { - get; - set; - } + public double? PushUpMax { get; set; } [JsonPropertyName("QTELevelMultipliers")] - public List? QTELevelMultipliers - { - get; - set; - } + public List? QTELevelMultipliers { get; set; } [JsonPropertyName("FistfightAction")] - public double? FistfightAction - { - get; - set; - } + public double? FistfightAction { get; set; } [JsonPropertyName("ThrowAction")] - public double? ThrowAction - { - get; - set; - } + public double? ThrowAction { get; set; } } public record DependentSkillRatio @@ -8111,18 +3943,10 @@ public record DependentSkillRatio public Dictionary ExtensionData { get; set; } [JsonPropertyName("Ratio")] - public double? Ratio - { - get; - set; - } + public double? Ratio { get; set; } [JsonPropertyName("SkillId")] - public string? SkillId - { - get; - set; - } + public string? SkillId { get; set; } } public record QTELevelMultiplier @@ -8131,18 +3955,10 @@ public record QTELevelMultiplier public Dictionary ExtensionData { get; set; } [JsonPropertyName("Level")] - public double? Level - { - get; - set; - } + public double? Level { get; set; } [JsonPropertyName("Multiplier")] - public double? Multiplier - { - get; - set; - } + public double? Multiplier { get; set; } } public record Vitality @@ -8151,18 +3967,10 @@ public record Vitality public Dictionary ExtensionData { get; set; } [JsonPropertyName("DamageTakenAction")] - public double? DamageTakenAction - { - get; - set; - } + public double? DamageTakenAction { get; set; } [JsonPropertyName("HealthNegativeEffect")] - public double? HealthNegativeEffect - { - get; - set; - } + public double? HealthNegativeEffect { get; set; } } public record HealthSkillProgress @@ -8171,11 +3979,7 @@ public record HealthSkillProgress public Dictionary ExtensionData { get; set; } [JsonPropertyName("SkillProgress")] - public double? SkillProgress - { - get; - set; - } + public double? SkillProgress { get; set; } } public record StressResistance @@ -8184,18 +3988,10 @@ public record StressResistance public Dictionary ExtensionData { get; set; } [JsonPropertyName("HealthNegativeEffect")] - public double? HealthNegativeEffect - { - get; - set; - } + public double? HealthNegativeEffect { get; set; } [JsonPropertyName("LowHPDuration")] - public double? LowHPDuration - { - get; - set; - } + public double? LowHPDuration { get; set; } } public record Throwing @@ -8204,11 +4000,7 @@ public record Throwing public Dictionary ExtensionData { get; set; } [JsonPropertyName("ThrowAction")] - public double? ThrowAction - { - get; - set; - } + public double? ThrowAction { get; set; } } public record RecoilControl @@ -8217,18 +4009,10 @@ public record RecoilControl public Dictionary ExtensionData { get; set; } [JsonPropertyName("RecoilAction")] - public double? RecoilAction - { - get; - set; - } + public double? RecoilAction { get; set; } [JsonPropertyName("RecoilBonusPerLevel")] - public double? RecoilBonusPerLevel - { - get; - set; - } + public double? RecoilBonusPerLevel { get; set; } } public record WeaponSkills @@ -8237,32 +4021,16 @@ public record WeaponSkills public Dictionary ExtensionData { get; set; } [JsonPropertyName("WeaponReloadAction")] - public double? WeaponReloadAction - { - get; - set; - } + public double? WeaponReloadAction { get; set; } [JsonPropertyName("WeaponShotAction")] - public double? WeaponShotAction - { - get; - set; - } + public double? WeaponShotAction { get; set; } [JsonPropertyName("WeaponFixAction")] - public double? WeaponFixAction - { - get; - set; - } + public double? WeaponFixAction { get; set; } [JsonPropertyName("WeaponChamberAction")] - public double? WeaponChamberAction - { - get; - set; - } + public double? WeaponChamberAction { get; set; } } public record CovertMovement @@ -8271,11 +4039,7 @@ public record CovertMovement public Dictionary ExtensionData { get; set; } [JsonPropertyName("MovementAction")] - public double? MovementAction - { - get; - set; - } + public double? MovementAction { get; set; } } public record Search @@ -8284,18 +4048,10 @@ public record Search public Dictionary ExtensionData { get; set; } [JsonPropertyName("SearchAction")] - public double? SearchAction - { - get; - set; - } + public double? SearchAction { get; set; } [JsonPropertyName("FindAction")] - public double? FindAction - { - get; - set; - } + public double? FindAction { get; set; } } public record WeaponTreatment @@ -8304,60 +4060,28 @@ public record WeaponTreatment public Dictionary ExtensionData { get; set; } [JsonPropertyName("BuffMaxCount")] - public double? BuffMaxCount - { - get; - set; - } + public double? BuffMaxCount { get; set; } [JsonPropertyName("BuffSettings")] - public BuffSettings? BuffSettings - { - get; - set; - } + public BuffSettings? BuffSettings { get; set; } [JsonPropertyName("Counters")] - public WeaponTreatmentCounters? Counters - { - get; - set; - } + public WeaponTreatmentCounters? Counters { get; set; } [JsonPropertyName("DurLossReducePerLevel")] - public double? DurLossReducePerLevel - { - get; - set; - } + public double? DurLossReducePerLevel { get; set; } [JsonPropertyName("SkillPointsPerRepair")] - public double? SkillPointsPerRepair - { - get; - set; - } + public double? SkillPointsPerRepair { get; set; } [JsonPropertyName("Filter")] - public List? Filter - { - get; - set; - } + public List? Filter { get; set; } [JsonPropertyName("WearAmountRepairGunsReducePerLevel")] - public double? WearAmountRepairGunsReducePerLevel - { - get; - set; - } + public double? WearAmountRepairGunsReducePerLevel { get; set; } [JsonPropertyName("WearChanceRepairGunsReduceEliteLevel")] - public double? WearChanceRepairGunsReduceEliteLevel - { - get; - set; - } + public double? WearChanceRepairGunsReduceEliteLevel { get; set; } } public record WeaponTreatmentCounters @@ -8366,11 +4090,7 @@ public record WeaponTreatmentCounters public Dictionary ExtensionData { get; set; } [JsonPropertyName("firearmsDurability")] - public SkillCounter? FirearmsDurability - { - get; - set; - } + public SkillCounter? FirearmsDurability { get; set; } } public record BuffSettings @@ -8379,46 +4099,22 @@ public record BuffSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("CommonBuffChanceLevelBonus")] - public double? CommonBuffChanceLevelBonus - { - get; - set; - } + public double? CommonBuffChanceLevelBonus { get; set; } [JsonPropertyName("CommonBuffMinChanceValue")] - public double? CommonBuffMinChanceValue - { - get; - set; - } + public double? CommonBuffMinChanceValue { get; set; } [JsonPropertyName("CurrentDurabilityLossToRemoveBuff")] - public double? CurrentDurabilityLossToRemoveBuff - { - get; - set; - } + public double? CurrentDurabilityLossToRemoveBuff { get; set; } [JsonPropertyName("MaxDurabilityLossToRemoveBuff")] - public double? MaxDurabilityLossToRemoveBuff - { - get; - set; - } + public double? MaxDurabilityLossToRemoveBuff { get; set; } [JsonPropertyName("RareBuffChanceCoff")] - public double? RareBuffChanceCoff - { - get; - set; - } + public double? RareBuffChanceCoff { get; set; } [JsonPropertyName("ReceivedDurabilityMaxPercent")] - public double? ReceivedDurabilityMaxPercent - { - get; - set; - } + public double? ReceivedDurabilityMaxPercent { get; set; } } public record MagDrills @@ -8427,25 +4123,13 @@ public record MagDrills public Dictionary ExtensionData { get; set; } [JsonPropertyName("RaidLoadedAmmoAction")] - public double? RaidLoadedAmmoAction - { - get; - set; - } + public double? RaidLoadedAmmoAction { get; set; } [JsonPropertyName("RaidUnloadedAmmoAction")] - public double? RaidUnloadedAmmoAction - { - get; - set; - } + public double? RaidUnloadedAmmoAction { get; set; } [JsonPropertyName("MagazineCheckAction")] - public double? MagazineCheckAction - { - get; - set; - } + public double? MagazineCheckAction { get; set; } } public record Perception @@ -8454,25 +4138,13 @@ public record Perception public Dictionary ExtensionData { get; set; } [JsonPropertyName("DependentSkillRatios")] - public List? DependentSkillRatios - { - get; - set; - } + public List? DependentSkillRatios { get; set; } [JsonPropertyName("OnlineAction")] - public double? OnlineAction - { - get; - set; - } + public double? OnlineAction { get; set; } [JsonPropertyName("UniqueLoot")] - public double? UniqueLoot - { - get; - set; - } + public double? UniqueLoot { get; set; } } public record SkillRatio @@ -8481,18 +4153,10 @@ public record SkillRatio public Dictionary ExtensionData { get; set; } [JsonPropertyName("Ratio")] - public double? Ratio - { - get; - set; - } + public double? Ratio { get; set; } [JsonPropertyName("SkillId")] - public string? SkillId - { - get; - set; - } + public string? SkillId { get; set; } } public record Intellect @@ -8500,60 +4164,28 @@ public record Intellect [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public SkillRatio[] DependentSkillRatios - { - get; - set; - } + public SkillRatio[] DependentSkillRatios { get; set; } [JsonPropertyName("Counters")] - public IntellectCounters? Counters - { - get; - set; - } + public IntellectCounters? Counters { get; set; } [JsonPropertyName("ExamineAction")] - public double? ExamineAction - { - get; - set; - } + public double? ExamineAction { get; set; } [JsonPropertyName("SkillProgress")] - public double? SkillProgress - { - get; - set; - } + public double? SkillProgress { get; set; } [JsonPropertyName("RepairAction")] - public double? RepairAction - { - get; - set; - } + public double? RepairAction { get; set; } [JsonPropertyName("WearAmountReducePerLevel")] - public double? WearAmountReducePerLevel - { - get; - set; - } + public double? WearAmountReducePerLevel { get; set; } [JsonPropertyName("WearChanceReduceEliteLevel")] - public double? WearChanceReduceEliteLevel - { - get; - set; - } + public double? WearChanceReduceEliteLevel { get; set; } [JsonPropertyName("RepairPointsCostReduction")] - public double? RepairPointsCostReduction - { - get; - set; - } + public double? RepairPointsCostReduction { get; set; } } public record IntellectCounters @@ -8562,25 +4194,13 @@ public record IntellectCounters public Dictionary ExtensionData { get; set; } [JsonPropertyName("armorDurability")] - public SkillCounter? ArmorDurability - { - get; - set; - } + public SkillCounter? ArmorDurability { get; set; } [JsonPropertyName("firearmsDurability")] - public SkillCounter? FirearmsDurability - { - get; - set; - } + public SkillCounter? FirearmsDurability { get; set; } [JsonPropertyName("meleeWeaponDurability")] - public SkillCounter? MeleeWeaponDurability - { - get; - set; - } + public SkillCounter? MeleeWeaponDurability { get; set; } } public record SkillCounter @@ -8589,18 +4209,10 @@ public record SkillCounter public Dictionary ExtensionData { get; set; } [JsonPropertyName("divisor")] - public double? Divisor - { - get; - set; - } + public double? Divisor { get; set; } [JsonPropertyName("points")] - public double? Points - { - get; - set; - } + public double? Points { get; set; } } public record Attention @@ -8609,32 +4221,16 @@ public record Attention public Dictionary ExtensionData { get; set; } [JsonPropertyName("DependentSkillRatios")] - public SkillRatio[] DependentSkillRatios - { - get; - set; - } + public SkillRatio[] DependentSkillRatios { get; set; } [JsonPropertyName("ExamineWithInstruction")] - public double? ExamineWithInstruction - { - get; - set; - } + public double? ExamineWithInstruction { get; set; } [JsonPropertyName("FindActionFalse")] - public double? FindActionFalse - { - get; - set; - } + public double? FindActionFalse { get; set; } [JsonPropertyName("FindActionTrue")] - public double? FindActionTrue - { - get; - set; - } + public double? FindActionTrue { get; set; } } public record Charisma @@ -8643,39 +4239,19 @@ public record Charisma public Dictionary ExtensionData { get; set; } [JsonPropertyName("BonusSettings")] - public BonusSettings? BonusSettings - { - get; - set; - } + public BonusSettings? BonusSettings { get; set; } [JsonPropertyName("Counters")] - public CharismaSkillCounters? Counters - { - get; - set; - } + public CharismaSkillCounters? Counters { get; set; } [JsonPropertyName("SkillProgressInt")] - public double? SkillProgressInt - { - get; - set; - } + public double? SkillProgressInt { get; set; } [JsonPropertyName("SkillProgressAtn")] - public double? SkillProgressAtn - { - get; - set; - } + public double? SkillProgressAtn { get; set; } [JsonPropertyName("SkillProgressPer")] - public double? SkillProgressPer - { - get; - set; - } + public double? SkillProgressPer { get; set; } } public record CharismaSkillCounters @@ -8684,39 +4260,19 @@ public record CharismaSkillCounters public Dictionary ExtensionData { get; set; } [JsonPropertyName("insuranceCost")] - public SkillCounter? InsuranceCost - { - get; - set; - } + public SkillCounter? InsuranceCost { get; set; } [JsonPropertyName("repairCost")] - public SkillCounter? RepairCost - { - get; - set; - } + public SkillCounter? RepairCost { get; set; } [JsonPropertyName("repeatableQuestCompleteCount")] - public SkillCounter? RepeatableQuestCompleteCount - { - get; - set; - } + public SkillCounter? RepeatableQuestCompleteCount { get; set; } [JsonPropertyName("restoredHealthCost")] - public SkillCounter? RestoredHealthCost - { - get; - set; - } + public SkillCounter? RestoredHealthCost { get; set; } [JsonPropertyName("scavCaseCost")] - public SkillCounter? ScavCaseCost - { - get; - set; - } + public SkillCounter? ScavCaseCost { get; set; } } public record BonusSettings @@ -8725,18 +4281,10 @@ public record BonusSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("EliteBonusSettings")] - public EliteBonusSettings? EliteBonusSettings - { - get; - set; - } + public EliteBonusSettings? EliteBonusSettings { get; set; } [JsonPropertyName("LevelBonusSettings")] - public LevelBonusSettings? LevelBonusSettings - { - get; - set; - } + public LevelBonusSettings? LevelBonusSettings { get; set; } } public record EliteBonusSettings @@ -8745,25 +4293,13 @@ public record EliteBonusSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("FenceStandingLossDiscount")] - public double? FenceStandingLossDiscount - { - get; - set; - } + public double? FenceStandingLossDiscount { get; set; } [JsonPropertyName("RepeatableQuestExtraCount")] - public int? RepeatableQuestExtraCount - { - get; - set; - } + public int? RepeatableQuestExtraCount { get; set; } [JsonPropertyName("ScavCaseDiscount")] - public double? ScavCaseDiscount - { - get; - set; - } + public double? ScavCaseDiscount { get; set; } } public record LevelBonusSettings @@ -8772,46 +4308,22 @@ public record LevelBonusSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("HealthRestoreDiscount")] - public double? HealthRestoreDiscount - { - get; - set; - } + public double? HealthRestoreDiscount { get; set; } [JsonPropertyName("HealthRestoreTraderDiscount")] - public double? HealthRestoreTraderDiscount - { - get; - set; - } + public double? HealthRestoreTraderDiscount { get; set; } [JsonPropertyName("InsuranceDiscount")] - public double? InsuranceDiscount - { - get; - set; - } + public double? InsuranceDiscount { get; set; } [JsonPropertyName("InsuranceTraderDiscount")] - public double? InsuranceTraderDiscount - { - get; - set; - } + public double? InsuranceTraderDiscount { get; set; } [JsonPropertyName("PaidExitDiscount")] - public double? PaidExitDiscount - { - get; - set; - } + public double? PaidExitDiscount { get; set; } [JsonPropertyName("RepeatableQuestChangeDiscount")] - public double? RepeatableQuestChangeDiscount - { - get; - set; - } + public double? RepeatableQuestChangeDiscount { get; set; } } public record Memory @@ -8820,18 +4332,10 @@ public record Memory public Dictionary ExtensionData { get; set; } [JsonPropertyName("AnySkillUp")] - public double? AnySkillUp - { - get; - set; - } + public double? AnySkillUp { get; set; } [JsonPropertyName("SkillProgress")] - public double? SkillProgress - { - get; - set; - } + public double? SkillProgress { get; set; } } public record Surgery @@ -8840,18 +4344,10 @@ public record Surgery public Dictionary ExtensionData { get; set; } [JsonPropertyName("SurgeryAction")] - public double? SurgeryAction - { - get; - set; - } + public double? SurgeryAction { get; set; } [JsonPropertyName("SkillProgress")] - public double? SkillProgress - { - get; - set; - } + public double? SkillProgress { get; set; } } public record AimDrills @@ -8860,11 +4356,7 @@ public record AimDrills public Dictionary ExtensionData { get; set; } [JsonPropertyName("WeaponShotAction")] - public double? WeaponShotAction - { - get; - set; - } + public double? WeaponShotAction { get; set; } } public record TroubleShooting @@ -8873,39 +4365,19 @@ public record TroubleShooting public Dictionary ExtensionData { get; set; } [JsonPropertyName("MalfRepairSpeedBonusPerLevel")] - public double? MalfRepairSpeedBonusPerLevel - { - get; - set; - } + public double? MalfRepairSpeedBonusPerLevel { get; set; } [JsonPropertyName("SkillPointsPerMalfFix")] - public double? SkillPointsPerMalfFix - { - get; - set; - } + public double? SkillPointsPerMalfFix { get; set; } [JsonPropertyName("EliteDurabilityChanceReduceMult")] - public double? EliteDurabilityChanceReduceMult - { - get; - set; - } + public double? EliteDurabilityChanceReduceMult { get; set; } [JsonPropertyName("EliteAmmoChanceReduceMult")] - public double? EliteAmmoChanceReduceMult - { - get; - set; - } + public double? EliteAmmoChanceReduceMult { get; set; } [JsonPropertyName("EliteMagChanceReduceMult")] - public double? EliteMagChanceReduceMult - { - get; - set; - } + public double? EliteMagChanceReduceMult { get; set; } } public record Aiming @@ -8914,137 +4386,61 @@ public record Aiming public Dictionary ExtensionData { get; set; } [JsonPropertyName("ProceduralIntensityByPose")] - public XYZ? ProceduralIntensityByPose - { - get; - set; - } + public XYZ? ProceduralIntensityByPose { get; set; } [JsonPropertyName("AimProceduralIntensity")] - public double? AimProceduralIntensity - { - get; - set; - } + public double? AimProceduralIntensity { get; set; } [JsonPropertyName("HeavyWeight")] - public double? HeavyWeight - { - get; - set; - } + public double? HeavyWeight { get; set; } [JsonPropertyName("LightWeight")] - public double? LightWeight - { - get; - set; - } + public double? LightWeight { get; set; } [JsonPropertyName("MaxTimeHeavy")] - public double? MaxTimeHeavy - { - get; - set; - } + public double? MaxTimeHeavy { get; set; } [JsonPropertyName("MinTimeHeavy")] - public double? MinTimeHeavy - { - get; - set; - } + public double? MinTimeHeavy { get; set; } [JsonPropertyName("MaxTimeLight")] - public double? MaxTimeLight - { - get; - set; - } + public double? MaxTimeLight { get; set; } [JsonPropertyName("MinTimeLight")] - public double? MinTimeLight - { - get; - set; - } + public double? MinTimeLight { get; set; } [JsonPropertyName("RecoilScaling")] - public double? RecoilScaling - { - get; - set; - } + public double? RecoilScaling { get; set; } [JsonPropertyName("RecoilDamping")] - public double? RecoilDamping - { - get; - set; - } + public double? RecoilDamping { get; set; } [JsonPropertyName("CameraSnapGlobalMult")] - public double? CameraSnapGlobalMult - { - get; - set; - } + public double? CameraSnapGlobalMult { get; set; } [JsonPropertyName("RecoilXIntensityByPose")] - public XYZ? RecoilXIntensityByPose - { - get; - set; - } + public XYZ? RecoilXIntensityByPose { get; set; } [JsonPropertyName("RecoilYIntensityByPose")] - public XYZ? RecoilYIntensityByPose - { - get; - set; - } + public XYZ? RecoilYIntensityByPose { get; set; } [JsonPropertyName("RecoilZIntensityByPose")] - public XYZ? RecoilZIntensityByPose - { - get; - set; - } + public XYZ? RecoilZIntensityByPose { get; set; } [JsonPropertyName("RecoilCrank")] - public bool? RecoilCrank - { - get; - set; - } + public bool? RecoilCrank { get; set; } [JsonPropertyName("RecoilHandDamping")] - public double? RecoilHandDamping - { - get; - set; - } + public double? RecoilHandDamping { get; set; } [JsonPropertyName("RecoilConvergenceMult")] - public double? RecoilConvergenceMult - { - get; - set; - } + public double? RecoilConvergenceMult { get; set; } [JsonPropertyName("RecoilVertBonus")] - public double? RecoilVertBonus - { - get; - set; - } + public double? RecoilVertBonus { get; set; } [JsonPropertyName("RecoilBackBonus")] - public double? RecoilBackBonus - { - get; - set; - } + public double? RecoilBackBonus { get; set; } } public record Malfunction @@ -9053,179 +4449,79 @@ public record Malfunction public Dictionary ExtensionData { get; set; } [JsonPropertyName("AmmoMalfChanceMult")] - public double? AmmoMalfChanceMult - { - get; - set; - } + public double? AmmoMalfChanceMult { get; set; } [JsonPropertyName("MagazineMalfChanceMult")] - public double? MagazineMalfChanceMult - { - get; - set; - } + public double? MagazineMalfChanceMult { get; set; } [JsonPropertyName("MalfRepairHardSlideMult")] - public double? MalfRepairHardSlideMult - { - get; - set; - } + public double? MalfRepairHardSlideMult { get; set; } [JsonPropertyName("MalfRepairOneHandBrokenMult")] - public double? MalfRepairOneHandBrokenMult - { - get; - set; - } + public double? MalfRepairOneHandBrokenMult { get; set; } [JsonPropertyName("MalfRepairTwoHandsBrokenMult")] - public double? MalfRepairTwoHandsBrokenMult - { - get; - set; - } + public double? MalfRepairTwoHandsBrokenMult { get; set; } [JsonPropertyName("AllowMalfForBots")] - public bool? AllowMalfForBots - { - get; - set; - } + public bool? AllowMalfForBots { get; set; } [JsonPropertyName("ShowGlowAttemptsCount")] - public double? ShowGlowAttemptsCount - { - get; - set; - } + public double? ShowGlowAttemptsCount { get; set; } [JsonPropertyName("OutToIdleSpeedMultForPistol")] - public double? OutToIdleSpeedMultForPistol - { - get; - set; - } + public double? OutToIdleSpeedMultForPistol { get; set; } [JsonPropertyName("IdleToOutSpeedMultOnMalf")] - public double? IdleToOutSpeedMultOnMalf - { - get; - set; - } + public double? IdleToOutSpeedMultOnMalf { get; set; } [JsonPropertyName("TimeToQuickdrawPistol")] - public double? TimeToQuickdrawPistol - { - get; - set; - } + public double? TimeToQuickdrawPistol { get; set; } [JsonPropertyName("DurRangeToIgnoreMalfs")] - public XYZ? DurRangeToIgnoreMalfs - { - get; - set; - } + public XYZ? DurRangeToIgnoreMalfs { get; set; } [JsonPropertyName("DurFeedWt")] - public double? DurFeedWt - { - get; - set; - } + public double? DurFeedWt { get; set; } [JsonPropertyName("DurMisfireWt")] - public double? DurMisfireWt - { - get; - set; - } + public double? DurMisfireWt { get; set; } [JsonPropertyName("DurJamWt")] - public double? DurJamWt - { - get; - set; - } + public double? DurJamWt { get; set; } [JsonPropertyName("DurSoftSlideWt")] - public double? DurSoftSlideWt - { - get; - set; - } + public double? DurSoftSlideWt { get; set; } [JsonPropertyName("DurHardSlideMinWt")] - public double? DurHardSlideMinWt - { - get; - set; - } + public double? DurHardSlideMinWt { get; set; } [JsonPropertyName("DurHardSlideMaxWt")] - public double? DurHardSlideMaxWt - { - get; - set; - } + public double? DurHardSlideMaxWt { get; set; } [JsonPropertyName("AmmoMisfireWt")] - public double? AmmoMisfireWt - { - get; - set; - } + public double? AmmoMisfireWt { get; set; } [JsonPropertyName("AmmoFeedWt")] - public double? AmmoFeedWt - { - get; - set; - } + public double? AmmoFeedWt { get; set; } [JsonPropertyName("AmmoJamWt")] - public double? AmmoJamWt - { - get; - set; - } + public double? AmmoJamWt { get; set; } [JsonPropertyName("OverheatFeedWt")] - public double? OverheatFeedWt - { - get; - set; - } + public double? OverheatFeedWt { get; set; } [JsonPropertyName("OverheatJamWt")] - public double? OverheatJamWt - { - get; - set; - } + public double? OverheatJamWt { get; set; } [JsonPropertyName("OverheatSoftSlideWt")] - public double? OverheatSoftSlideWt - { - get; - set; - } + public double? OverheatSoftSlideWt { get; set; } [JsonPropertyName("OverheatHardSlideMinWt")] - public double? OverheatHardSlideMinWt - { - get; - set; - } + public double? OverheatHardSlideMinWt { get; set; } [JsonPropertyName("OverheatHardSlideMaxWt")] - public double? OverheatHardSlideMaxWt - { - get; - set; - } + public double? OverheatHardSlideMaxWt { get; set; } } public record Overheat @@ -9234,200 +4530,88 @@ public record Overheat public Dictionary ExtensionData { get; set; } [JsonPropertyName("MinOverheat")] - public double? MinimumOverheat - { - get; - set; - } + public double? MinimumOverheat { get; set; } [JsonPropertyName("MaxOverheat")] - public double? MaximumOverheat - { - get; - set; - } + public double? MaximumOverheat { get; set; } [JsonPropertyName("OverheatProblemsStart")] - public double? OverheatProblemsStart - { - get; - set; - } + public double? OverheatProblemsStart { get; set; } [JsonPropertyName("ModHeatFactor")] - public double? ModificationHeatFactor - { - get; - set; - } + public double? ModificationHeatFactor { get; set; } [JsonPropertyName("ModCoolFactor")] - public double? ModificationCoolFactor - { - get; - set; - } + public double? ModificationCoolFactor { get; set; } [JsonPropertyName("MinWearOnOverheat")] - public double? MinimumWearOnOverheat - { - get; - set; - } + public double? MinimumWearOnOverheat { get; set; } [JsonPropertyName("MaxWearOnOverheat")] - public double? MaximumWearOnOverheat - { - get; - set; - } + public double? MaximumWearOnOverheat { get; set; } [JsonPropertyName("MinWearOnMaxOverheat")] - public double? MinimumWearOnMaximumOverheat - { - get; - set; - } + public double? MinimumWearOnMaximumOverheat { get; set; } [JsonPropertyName("MaxWearOnMaxOverheat")] - public double? MaximumWearOnMaximumOverheat - { - get; - set; - } + public double? MaximumWearOnMaximumOverheat { get; set; } [JsonPropertyName("OverheatWearLimit")] - public double? OverheatWearLimit - { - get; - set; - } + public double? OverheatWearLimit { get; set; } [JsonPropertyName("MaxCOIIncreaseMult")] - public double? MaximumCOIIncreaseMultiplier - { - get; - set; - } + public double? MaximumCOIIncreaseMultiplier { get; set; } [JsonPropertyName("MinMalfChance")] - public double? MinimumMalfunctionChance - { - get; - set; - } + public double? MinimumMalfunctionChance { get; set; } [JsonPropertyName("MaxMalfChance")] - public double? MaximumMalfunctionChance - { - get; - set; - } + public double? MaximumMalfunctionChance { get; set; } [JsonPropertyName("DurReduceMinMult")] - public double? DurabilityReductionMinimumMultiplier - { - get; - set; - } + public double? DurabilityReductionMinimumMultiplier { get; set; } [JsonPropertyName("DurReduceMaxMult")] - public double? DurabilityReductionMaximumMultiplier - { - get; - set; - } + public double? DurabilityReductionMaximumMultiplier { get; set; } [JsonPropertyName("BarrelMoveRndDuration")] - public double? BarrelMovementRandomDuration - { - get; - set; - } + public double? BarrelMovementRandomDuration { get; set; } [JsonPropertyName("BarrelMoveMaxMult")] - public double? BarrelMovementMaximumMultiplier - { - get; - set; - } + public double? BarrelMovementMaximumMultiplier { get; set; } [JsonPropertyName("FireratePitchMult")] - public double? FireRatePitchMultiplier - { - get; - set; - } + public double? FireRatePitchMultiplier { get; set; } [JsonPropertyName("FirerateReduceMinMult")] - public double? FireRateReductionMinimumMultiplier - { - get; - set; - } + public double? FireRateReductionMinimumMultiplier { get; set; } [JsonPropertyName("FirerateReduceMaxMult")] - public double? FireRateReductionMaximumMultiplier - { - get; - set; - } + public double? FireRateReductionMaximumMultiplier { get; set; } [JsonPropertyName("FirerateOverheatBorder")] - public double? FireRateOverheatBorder - { - get; - set; - } + public double? FireRateOverheatBorder { get; set; } [JsonPropertyName("EnableSlideOnMaxOverheat")] - public bool? IsSlideEnabledOnMaximumOverheat - { - get; - set; - } + public bool? IsSlideEnabledOnMaximumOverheat { get; set; } [JsonPropertyName("StartSlideOverheat")] - public double? StartSlideOverheat - { - get; - set; - } + public double? StartSlideOverheat { get; set; } [JsonPropertyName("FixSlideOverheat")] - public double? FixSlideOverheat - { - get; - set; - } + public double? FixSlideOverheat { get; set; } [JsonPropertyName("AutoshotMinOverheat")] - public double? AutoshotMinimumOverheat - { - get; - set; - } + public double? AutoshotMinimumOverheat { get; set; } [JsonPropertyName("AutoshotChance")] - public double? AutoshotChance - { - get; - set; - } + public double? AutoshotChance { get; set; } [JsonPropertyName("AutoshotPossibilityDuration")] - public double? AutoshotPossibilityDuration - { - get; - set; - } + public double? AutoshotPossibilityDuration { get; set; } [JsonPropertyName("MaxOverheatCoolCoef")] - public double? MaximumOverheatCoolCoefficient - { - get; - set; - } + public double? MaximumOverheatCoolCoefficient { get; set; } } public record FenceSettings @@ -9437,36 +4621,16 @@ public record FenceSettings // MongoId [JsonPropertyName("FenceId")] - public string? FenceIdentifier - { - get; - set; - } + public string? FenceIdentifier { get; set; } [JsonPropertyName("Levels")] - public Dictionary? Levels - { - get; - set; - } + public Dictionary? Levels { get; set; } [JsonPropertyName("paidExitStandingNumerator")] - public double? PaidExitStandingNumerator - { - get; - set; - } + public double? PaidExitStandingNumerator { get; set; } - public double? PmcBotKillStandingMultiplier - { - get; - set; - } - public double? ScavEquipmentChancePercentThreshold - { - get; - set; - } + public double? PmcBotKillStandingMultiplier { get; set; } + public double? ScavEquipmentChancePercentThreshold { get; set; } } public record FenceLevel @@ -9475,186 +4639,82 @@ public record FenceLevel public Dictionary ExtensionData { get; set; } [JsonPropertyName("ReachOnMarkOnUnknowns")] - public bool? CanReachOnMarkOnUnknowns - { - get; - set; - } + public bool? CanReachOnMarkOnUnknowns { get; set; } [JsonPropertyName("SavageCooldownModifier")] - public double? SavageCooldownModifier - { - get; - set; - } + public double? SavageCooldownModifier { get; set; } [JsonPropertyName("ScavCaseTimeModifier")] - public double? ScavCaseTimeModifier - { - get; - set; - } + public double? ScavCaseTimeModifier { get; set; } [JsonPropertyName("PaidExitCostModifier")] - public double? PaidExitCostModifier - { - get; - set; - } + public double? PaidExitCostModifier { get; set; } [JsonPropertyName("BotFollowChance")] - public double? BotFollowChance - { - get; - set; - } + public double? BotFollowChance { get; set; } [JsonPropertyName("ScavEquipmentSpawnChanceModifier")] - public double? ScavEquipmentSpawnChanceModifier - { - get; - set; - } + public double? ScavEquipmentSpawnChanceModifier { get; set; } [JsonPropertyName("TransitGridSize")] - public XYZ? TransitGridSize - { - get; - set; - } + public XYZ? TransitGridSize { get; set; } [JsonPropertyName("PriceModifier")] - public double? PriceModifier - { - get; - set; - } + public double? PriceModifier { get; set; } [JsonPropertyName("HostileBosses")] - public bool? AreHostileBossesPresent - { - get; - set; - } + public bool? AreHostileBossesPresent { get; set; } [JsonPropertyName("HostileScavs")] - public bool? AreHostileScavsPresent - { - get; - set; - } + public bool? AreHostileScavsPresent { get; set; } [JsonPropertyName("ScavAttackSupport")] - public bool? IsScavAttackSupported - { - get; - set; - } + public bool? IsScavAttackSupported { get; set; } [JsonPropertyName("ExfiltrationPriceModifier")] - public double? ExfiltrationPriceModifier - { - get; - set; - } + public double? ExfiltrationPriceModifier { get; set; } [JsonPropertyName("AvailableExits")] - public double? AvailableExits - { - get; - set; - } + public double? AvailableExits { get; set; } [JsonPropertyName("BotApplySilenceChance")] - public double? BotApplySilenceChance - { - get; - set; - } + public double? BotApplySilenceChance { get; set; } [JsonPropertyName("BotGetInCoverChance")] - public double? BotGetInCoverChance - { - get; - set; - } + public double? BotGetInCoverChance { get; set; } [JsonPropertyName("BotHelpChance")] - public double? BotHelpChance - { - get; - set; - } + public double? BotHelpChance { get; set; } [JsonPropertyName("BotSpreadoutChance")] - public double? BotSpreadoutChance - { - get; - set; - } + public double? BotSpreadoutChance { get; set; } [JsonPropertyName("BotStopChance")] - public double? BotStopChance - { - get; - set; - } + public double? BotStopChance { get; set; } [JsonPropertyName("PriceModTaxi")] - public double? PriceModifierTaxi - { - get; - set; - } + public double? PriceModifierTaxi { get; set; } [JsonPropertyName("PriceModDelivery")] - public double? PriceModifierDelivery - { - get; - set; - } + public double? PriceModifierDelivery { get; set; } [JsonPropertyName("PriceModCleanUp")] - public double? PriceModifierCleanUp - { - get; - set; - } + public double? PriceModifierCleanUp { get; set; } [JsonPropertyName("ReactOnMarkOnUnknowns")] - public bool? ReactOnMarkOnUnknowns - { - get; - set; - } + public bool? ReactOnMarkOnUnknowns { get; set; } [JsonPropertyName("ReactOnMarkOnUnknownsPVE")] - public bool? ReactOnMarkOnUnknownsPVE - { - get; - set; - } + public bool? ReactOnMarkOnUnknownsPVE { get; set; } [JsonPropertyName("DeliveryGridSize")] - public XYZ? DeliveryGridSize - { - get; - set; - } + public XYZ? DeliveryGridSize { get; set; } [JsonPropertyName("CanInteractWithBtr")] - public bool? CanInteractWithBtr - { - get; - set; - } + public bool? CanInteractWithBtr { get; set; } [JsonPropertyName("CircleOfCultistsBonusPercent")] - public double? CircleOfCultistsBonusPercentage - { - get; - set; - } + public double? CircleOfCultistsBonusPercentage { get; set; } } public record Inertia @@ -9663,276 +4723,120 @@ public record Inertia public Dictionary ExtensionData { get; set; } [JsonPropertyName("InertiaLimits")] - public XYZ? InertiaLimits - { - get; - set; - } + public XYZ? InertiaLimits { get; set; } [JsonPropertyName("InertiaLimitsStep")] - public double? InertiaLimitsStep - { - get; - set; - } + public double? InertiaLimitsStep { get; set; } [JsonPropertyName("ExitMovementStateSpeedThreshold")] - public XYZ? ExitMovementStateSpeedThreshold - { - get; - set; - } + public XYZ? ExitMovementStateSpeedThreshold { get; set; } [JsonPropertyName("WalkInertia")] - public XYZ? WalkInertia - { - get; - set; - } + public XYZ? WalkInertia { get; set; } [JsonPropertyName("FallThreshold")] - public double? FallThreshold - { - get; - set; - } + public double? FallThreshold { get; set; } [JsonPropertyName("SpeedLimitAfterFallMin")] - public XYZ? SpeedLimitAfterFallMin - { - get; - set; - } + public XYZ? SpeedLimitAfterFallMin { get; set; } [JsonPropertyName("SpeedLimitAfterFallMax")] - public XYZ? SpeedLimitAfterFallMax - { - get; - set; - } + public XYZ? SpeedLimitAfterFallMax { get; set; } [JsonPropertyName("SpeedLimitDurationMin")] - public XYZ? SpeedLimitDurationMin - { - get; - set; - } + public XYZ? SpeedLimitDurationMin { get; set; } [JsonPropertyName("SpeedLimitDurationMax")] - public XYZ? SpeedLimitDurationMax - { - get; - set; - } + public XYZ? SpeedLimitDurationMax { get; set; } [JsonPropertyName("SpeedInertiaAfterJump")] - public XYZ? SpeedInertiaAfterJump - { - get; - set; - } + public XYZ? SpeedInertiaAfterJump { get; set; } [JsonPropertyName("BaseJumpPenaltyDuration")] - public double? BaseJumpPenaltyDuration - { - get; - set; - } + public double? BaseJumpPenaltyDuration { get; set; } [JsonPropertyName("DurationPower")] - public double? DurationPower - { - get; - set; - } + public double? DurationPower { get; set; } [JsonPropertyName("BaseJumpPenalty")] - public double? BaseJumpPenalty - { - get; - set; - } + public double? BaseJumpPenalty { get; set; } [JsonPropertyName("PenaltyPower")] - public double? PenaltyPower - { - get; - set; - } + public double? PenaltyPower { get; set; } [JsonPropertyName("InertiaTiltCurveMin")] - public XYZ? InertiaTiltCurveMin - { - get; - set; - } + public XYZ? InertiaTiltCurveMin { get; set; } [JsonPropertyName("InertiaTiltCurveMax")] - public XYZ? InertiaTiltCurveMax - { - get; - set; - } + public XYZ? InertiaTiltCurveMax { get; set; } [JsonPropertyName("InertiaBackwardCoef")] - public XYZ? InertiaBackwardCoef - { - get; - set; - } + public XYZ? InertiaBackwardCoef { get; set; } [JsonPropertyName("TiltInertiaMaxSpeed")] - public XYZ? TiltInertiaMaxSpeed - { - get; - set; - } + public XYZ? TiltInertiaMaxSpeed { get; set; } [JsonPropertyName("TiltStartSideBackSpeed")] - public XYZ? TiltStartSideBackSpeed - { - get; - set; - } + public XYZ? TiltStartSideBackSpeed { get; set; } [JsonPropertyName("TiltMaxSideBackSpeed")] - public XYZ? TiltMaxSideBackSpeed - { - get; - set; - } + public XYZ? TiltMaxSideBackSpeed { get; set; } [JsonPropertyName("TiltAcceleration")] - public XYZ? TiltAcceleration - { - get; - set; - } + public XYZ? TiltAcceleration { get; set; } [JsonPropertyName("AverageRotationFrameSpan")] - public double? AverageRotationFrameSpan - { - get; - set; - } + public double? AverageRotationFrameSpan { get; set; } [JsonPropertyName("SprintSpeedInertiaCurveMin")] - public XYZ? SprintSpeedInertiaCurveMin - { - get; - set; - } + public XYZ? SprintSpeedInertiaCurveMin { get; set; } [JsonPropertyName("SprintSpeedInertiaCurveMax")] - public XYZ? SprintSpeedInertiaCurveMax - { - get; - set; - } + public XYZ? SprintSpeedInertiaCurveMax { get; set; } [JsonPropertyName("SprintBrakeInertia")] - public XYZ? SprintBrakeInertia - { - get; - set; - } + public XYZ? SprintBrakeInertia { get; set; } [JsonPropertyName("SprintTransitionMotionPreservation")] - public XYZ? SprintTransitionMotionPreservation - { - get; - set; - } + public XYZ? SprintTransitionMotionPreservation { get; set; } [JsonPropertyName("WeaponFlipSpeed")] - public XYZ? WeaponFlipSpeed - { - get; - set; - } + public XYZ? WeaponFlipSpeed { get; set; } [JsonPropertyName("PreSprintAccelerationLimits")] - public XYZ? PreSprintAccelerationLimits - { - get; - set; - } + public XYZ? PreSprintAccelerationLimits { get; set; } [JsonPropertyName("SprintAccelerationLimits")] - public XYZ? SprintAccelerationLimits - { - get; - set; - } + public XYZ? SprintAccelerationLimits { get; set; } [JsonPropertyName("SideTime")] - public XYZ? SideTime - { - get; - set; - } + public XYZ? SideTime { get; set; } [JsonPropertyName("DiagonalTime")] - public XYZ? DiagonalTime - { - get; - set; - } + public XYZ? DiagonalTime { get; set; } [JsonPropertyName("MaxTimeWithoutInput")] - public XYZ? MaxTimeWithoutInput - { - get; - set; - } + public XYZ? MaxTimeWithoutInput { get; set; } [JsonPropertyName("MinDirectionBlendTime")] - public double? MinDirectionBlendTime - { - get; - set; - } + public double? MinDirectionBlendTime { get; set; } [JsonPropertyName("MoveTimeRange")] - public XYZ? MoveTimeRange - { - get; - set; - } + public XYZ? MoveTimeRange { get; set; } [JsonPropertyName("ProneDirectionAccelerationRange")] - public XYZ? ProneDirectionAccelerationRange - { - get; - set; - } + public XYZ? ProneDirectionAccelerationRange { get; set; } [JsonPropertyName("ProneSpeedAccelerationRange")] - public XYZ? ProneSpeedAccelerationRange - { - get; - set; - } + public XYZ? ProneSpeedAccelerationRange { get; set; } [JsonPropertyName("MinMovementAccelerationRangeRight")] - public XYZ? MinMovementAccelerationRangeRight - { - get; - set; - } + public XYZ? MinMovementAccelerationRangeRight { get; set; } [JsonPropertyName("MaxMovementAccelerationRangeRight")] - public XYZ? MaxMovementAccelerationRangeRight - { - get; - set; - } + public XYZ? MaxMovementAccelerationRangeRight { get; set; } - public XYZ? CrouchSpeedAccelerationRange - { - get; - set; - } + public XYZ? CrouchSpeedAccelerationRange { get; set; } } public record Ballistic @@ -9941,11 +4845,7 @@ public record Ballistic public Dictionary ExtensionData { get; set; } [JsonPropertyName("GlobalDamageDegradationCoefficient")] - public double? GlobalDamageDegradationCoefficient - { - get; - set; - } + public double? GlobalDamageDegradationCoefficient { get; set; } } public record RepairSettings @@ -9954,46 +4854,22 @@ public record RepairSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("ItemEnhancementSettings")] - public ItemEnhancementSettings? ItemEnhancementSettings - { - get; - set; - } + public ItemEnhancementSettings? ItemEnhancementSettings { get; set; } [JsonPropertyName("MinimumLevelToApplyBuff")] - public double? MinimumLevelToApplyBuff - { - get; - set; - } + public double? MinimumLevelToApplyBuff { get; set; } [JsonPropertyName("RepairStrategies")] - public RepairStrategies? RepairStrategies - { - get; - set; - } + public RepairStrategies? RepairStrategies { get; set; } [JsonPropertyName("armorClassDivisor")] - public double? ArmorClassDivisor - { - get; - set; - } + public double? ArmorClassDivisor { get; set; } [JsonPropertyName("durabilityPointCostArmor")] - public double? DurabilityPointCostArmor - { - get; - set; - } + public double? DurabilityPointCostArmor { get; set; } [JsonPropertyName("durabilityPointCostGuns")] - public double? DurabilityPointCostGuns - { - get; - set; - } + public double? DurabilityPointCostGuns { get; set; } } public record ItemEnhancementSettings @@ -10002,25 +4878,13 @@ public record ItemEnhancementSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("DamageReduction")] - public PriceModifier? DamageReduction - { - get; - set; - } + public PriceModifier? DamageReduction { get; set; } [JsonPropertyName("MalfunctionProtections")] - public PriceModifier? MalfunctionProtections - { - get; - set; - } + public PriceModifier? MalfunctionProtections { get; set; } [JsonPropertyName("WeaponSpread")] - public PriceModifier? WeaponSpread - { - get; - set; - } + public PriceModifier? WeaponSpread { get; set; } } public record PriceModifier @@ -10029,11 +4893,7 @@ public record PriceModifier public Dictionary ExtensionData { get; set; } [JsonPropertyName("PriceModifier")] - public double? PriceModifierValue - { - get; - set; - } + public double? PriceModifierValue { get; set; } } public record RepairStrategies @@ -10042,18 +4902,10 @@ public record RepairStrategies public Dictionary ExtensionData { get; set; } [JsonPropertyName("Armor")] - public RepairStrategy? Armor - { - get; - set; - } + public RepairStrategy? Armor { get; set; } [JsonPropertyName("Firearms")] - public RepairStrategy? Firearms - { - get; - set; - } + public RepairStrategy? Firearms { get; set; } } public record RepairStrategy @@ -10062,18 +4914,10 @@ public record RepairStrategy public Dictionary ExtensionData { get; set; } [JsonPropertyName("BuffTypes")] - public List? BuffTypes - { - get; - set; - } + public List? BuffTypes { get; set; } [JsonPropertyName("Filter")] - public List? Filter - { - get; - set; - } + public List? Filter { get; set; } } public record BotPreset @@ -10082,81 +4926,37 @@ public record BotPreset public Dictionary ExtensionData { get; set; } [JsonPropertyName("UseThis")] - public bool? UseThis - { - get; - set; - } + public bool? UseThis { get; set; } [JsonPropertyName("Role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } [JsonPropertyName("BotDifficulty")] - public string? BotDifficulty - { - get; - set; - } + public string? BotDifficulty { get; set; } [JsonPropertyName("VisibleAngle")] - public double? VisibleAngle - { - get; - set; - } + public double? VisibleAngle { get; set; } [JsonPropertyName("VisibleDistance")] - public double? VisibleDistance - { - get; - set; - } + public double? VisibleDistance { get; set; } [JsonPropertyName("ScatteringPerMeter")] - public double? ScatteringPerMeter - { - get; - set; - } + public double? ScatteringPerMeter { get; set; } [JsonPropertyName("HearingSense")] - public double? HearingSense - { - get; - set; - } + public double? HearingSense { get; set; } [JsonPropertyName("SCATTERING_DIST_MODIF")] - public double? ScatteringDistModif - { - get; - set; - } + public double? ScatteringDistModif { get; set; } [JsonPropertyName("MAX_AIMING_UPGRADE_BY_TIME")] - public double? MaxAimingUpgradeByTime - { - get; - set; - } + public double? MaxAimingUpgradeByTime { get; set; } [JsonPropertyName("FIRST_CONTACT_ADD_SEC")] - public double? FirstContactAddSec - { - get; - set; - } + public double? FirstContactAddSec { get; set; } [JsonPropertyName("COEF_IF_MOVE")] - public double? CoefIfMove - { - get; - set; - } + public double? CoefIfMove { get; set; } } public record BotWeaponScattering @@ -10165,32 +4965,16 @@ public record BotWeaponScattering public Dictionary ExtensionData { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("PriorityScatter1meter")] - public double? PriorityScatter1Meter - { - get; - set; - } + public double? PriorityScatter1Meter { get; set; } [JsonPropertyName("PriorityScatter10meter")] - public double? PriorityScatter10Meter - { - get; - set; - } + public double? PriorityScatter10Meter { get; set; } [JsonPropertyName("PriorityScatter100meter")] - public double? PriorityScatter100Meter - { - get; - set; - } + public double? PriorityScatter100Meter { get; set; } } public record Preset @@ -10199,56 +4983,28 @@ public record Preset public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("_changeWeaponName")] - public bool? ChangeWeaponName - { - get; - set; - } + public bool? ChangeWeaponName { get; set; } [JsonPropertyName("_name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("_parent")] - public string? Parent - { - get; - set; - } + public string? Parent { get; set; } [JsonPropertyName("_items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } /// /// Default presets have this property /// [JsonPropertyName("_encyclopedia")] - public string? Encyclopedia - { - get; - set; - } + public string? Encyclopedia { get; set; } } public record QuestSettings @@ -10257,16 +5013,8 @@ public record QuestSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("GlobalRewardRepModifierDailyQuestPvE")] - public double? GlobalRewardRepModifierDailyQuestPvE - { - get; - set; - } + public double? GlobalRewardRepModifierDailyQuestPvE { get; set; } [JsonPropertyName("GlobalRewardRepModifierQuestPvE")] - public double? GlobalRewardRepModifierQuestPvE - { - get; - set; - } + public double? GlobalRewardRepModifierQuestPvE { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs index e8ee871a..97cd9a57 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs @@ -12,68 +12,40 @@ public record Location /// Map meta-data /// [JsonPropertyName("base")] - public LocationBase? Base - { - get; - set; - } + public LocationBase? Base { get; set; } /// /// Loose loot positions and item weights /// [JsonPropertyName("looseLoot")] - public LazyLoad? LooseLoot - { - get; - set; - } + public LazyLoad? LooseLoot { get; set; } /// /// Static loot item weights /// [JsonPropertyName("staticLoot")] - public LazyLoad>? StaticLoot - { - get; - set; - } + public LazyLoad>? StaticLoot { get; set; } /// /// Static container positions and item weights /// [JsonPropertyName("staticContainers")] - public LazyLoad? StaticContainers - { - get; - set; - } + public LazyLoad? StaticContainers { get; set; } [JsonPropertyName("staticAmmo")] - public Dictionary> StaticAmmo - { - get; - set; - } + public Dictionary> StaticAmmo { get; set; } /// /// All possible static containers on map + their assign groupings /// [JsonPropertyName("statics")] - public StaticContainer? Statics - { - get; - set; - } + public StaticContainer? Statics { get; set; } /// /// All possible map extracts /// [JsonPropertyName("allExtracts")] - public Exit[] AllExtracts - { - get; - set; - } + public Exit[] AllExtracts { get; set; } } public record StaticContainer @@ -82,18 +54,10 @@ public record StaticContainer public Dictionary ExtensionData { get; set; } [JsonPropertyName("containersGroups")] - public Dictionary? ContainersGroups - { - get; - set; - } + public Dictionary? ContainersGroups { get; set; } [JsonPropertyName("containers")] - public Dictionary? Containers - { - get; - set; - } + public Dictionary? Containers { get; set; } } public record ContainerMinMax @@ -102,32 +66,16 @@ public record ContainerMinMax public Dictionary ExtensionData { get; set; } [JsonPropertyName("minContainers")] - public int? MinContainers - { - get; - set; - } + public int? MinContainers { get; set; } [JsonPropertyName("maxContainers")] - public int? MaxContainers - { - get; - set; - } + public int? MaxContainers { get; set; } [JsonPropertyName("current")] - public int? Current - { - get; - set; - } + public int? Current { get; set; } [JsonPropertyName("chosenCount")] - public int? ChosenCount - { - get; - set; - } + public int? ChosenCount { get; set; } } public record ContainerData @@ -136,11 +84,7 @@ public record ContainerData public Dictionary ExtensionData { get; set; } [JsonPropertyName("groupId")] - public string? GroupId - { - get; - set; - } + public string? GroupId { get; set; } } public record StaticLootDetails @@ -149,18 +93,10 @@ public record StaticLootDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("itemcountDistribution")] - public ItemCountDistribution[] ItemCountDistribution - { - get; - set; - } + public ItemCountDistribution[] ItemCountDistribution { get; set; } [JsonPropertyName("itemDistribution")] - public ItemDistribution[] ItemDistribution - { - get; - set; - } + public ItemDistribution[] ItemDistribution { get; set; } } public record ItemCountDistribution @@ -169,18 +105,10 @@ public record ItemCountDistribution public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("relativeProbability")] - public float? RelativeProbability - { - get; - set; - } + public float? RelativeProbability { get; set; } } public record ItemDistribution @@ -189,18 +117,10 @@ public record ItemDistribution public Dictionary ExtensionData { get; set; } [JsonPropertyName("tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } [JsonPropertyName("relativeProbability")] - public float? RelativeProbability - { - get; - set; - } + public float? RelativeProbability { get; set; } } public record StaticContainerDetails @@ -209,25 +129,13 @@ public record StaticContainerDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("staticWeapons")] - public List StaticWeapons - { - get; - set; - } + public List StaticWeapons { get; set; } [JsonPropertyName("staticContainers")] - public List StaticContainers - { - get; - set; - } + public List StaticContainers { get; set; } [JsonPropertyName("staticForced")] - public List StaticForced - { - get; - set; - } + public List StaticForced { get; set; } } public record StaticForced @@ -236,18 +144,10 @@ public record StaticForced public Dictionary ExtensionData { get; set; } [JsonPropertyName("containerId")] - public string ContainerId - { - get; - set; - } + public string ContainerId { get; set; } [JsonPropertyName("itemTpl")] - public string ItemTpl - { - get; - set; - } + public string ItemTpl { get; set; } } public record StaticContainerData @@ -256,18 +156,10 @@ public record StaticContainerData public Dictionary ExtensionData { get; set; } [JsonPropertyName("probability")] - public float? Probability - { - get; - set; - } + public float? Probability { get; set; } [JsonPropertyName("template")] - public SpawnpointTemplate? Template - { - get; - set; - } + public SpawnpointTemplate? Template { get; set; } } public record StaticAmmoDetails @@ -276,16 +168,8 @@ public record StaticAmmoDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } [JsonPropertyName("relativeProbability")] - public float? RelativeProbability - { - get; - set; - } + public float? RelativeProbability { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs index f8385b78..c94b713c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs @@ -12,803 +12,372 @@ public record LocationBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("AccessKeys")] - public List? AccessKeys - { - get; - set; - } + public List? AccessKeys { get; set; } [JsonPropertyName("AccessKeysPvE")] - public List? AccessKeysPvE - { - get; - set; - } + public List? AccessKeysPvE { get; set; } [JsonPropertyName("AirdropParameters")] - public List? AirdropParameters - { - get; - set; - } + public List? AirdropParameters { get; set; } [JsonPropertyName("NewSpawnForPlayers")] - public bool? NewSpawnForPlayers - { - get; - set; - } + public bool? NewSpawnForPlayers { get; set; } [JsonPropertyName("OfflineNewSpawn")] - public bool? OfflineNewSpawn - { - get; - set; - } + public bool? OfflineNewSpawn { get; set; } [JsonPropertyName("OfflineOldSpawn")] - public bool? OfflineOldSpawn - { - get; - set; - } + public bool? OfflineOldSpawn { get; set; } [JsonPropertyName("Area")] - public double? Area - { - get; - set; - } + public double? Area { get; set; } [JsonPropertyName("AveragePlayTime")] - public double? AveragePlayTime - { - get; - set; - } + public double? AveragePlayTime { get; set; } [JsonPropertyName("AveragePlayerLevel")] - public double? AveragePlayerLevel - { - get; - set; - } + public double? AveragePlayerLevel { get; set; } [JsonPropertyName("Banners")] - public List? Banners - { - get; - set; - } + public List? Banners { get; set; } [JsonPropertyName("BossLocationSpawn")] - public List BossLocationSpawn - { - get; - set; - } + public List BossLocationSpawn { get; set; } [JsonPropertyName("secretExits")] - public List? SecretExits - { - get; - set; - } + public List? SecretExits { get; set; } [JsonPropertyName("BotStartPlayer")] - public int? BotStartPlayer - { - get; - set; - } + public int? BotStartPlayer { get; set; } [JsonPropertyName("BotAssault")] - public int? BotAssault - { - get; - set; - } + public int? BotAssault { get; set; } /// /// Weighting on how likely a bot will be Easy difficulty /// [JsonPropertyName("BotEasy")] - public int? BotEasy - { - get; - set; - } + public int? BotEasy { get; set; } /// /// Weighting on how likely a bot will be Hard difficulty /// [JsonPropertyName("BotHard")] - public int? BotHard - { - get; - set; - } + public int? BotHard { get; set; } /// /// Weighting on how likely a bot will be Impossible difficulty /// [JsonPropertyName("BotImpossible")] - public int? BotImpossible - { - get; - set; - } + public int? BotImpossible { get; set; } [JsonPropertyName("BotLocationModifier")] - public BotLocationModifier? BotLocationModifier - { - get; - set; - } + public BotLocationModifier? BotLocationModifier { get; set; } [JsonPropertyName("BotMarksman")] - public int? BotMarksman - { - get; - set; - } + public int? BotMarksman { get; set; } /// /// Maximum Number of bots that are currently alive/loading/delayed /// [JsonPropertyName("BotMax")] - public int? BotMax - { - get; - set; - } + public int? BotMax { get; set; } /// /// Is not used in 33420 TODO: still needed? /// [JsonPropertyName("BotMaxPlayer")] - public int? BotMaxPlayer - { - get; - set; - } + public int? BotMaxPlayer { get; set; } /// /// Is not used in 33420 TODO: still needed? /// [JsonPropertyName("BotMaxTimePlayer")] - public int? BotMaxTimePlayer - { - get; - set; - } + public int? BotMaxTimePlayer { get; set; } /// /// Does not even exist in the client in 33420 TODO: still needed? /// [JsonPropertyName("BotMaxPvE")] - public int? BotMaxPvE - { - get; - set; - } + public int? BotMaxPvE { get; set; } /// /// Weighting on how likely a bot will be Normal difficulty /// [JsonPropertyName("BotNormal")] - public int? BotNormal - { - get; - set; - } + public int? BotNormal { get; set; } /// /// How many bot slots that need to be open before trying to spawn new bots. /// [JsonPropertyName("BotSpawnCountStep")] - public int? BotSpawnCountStep - { - get; - set; - } + public int? BotSpawnCountStep { get; set; } /// /// How often to check if bots are spawn-able. In seconds /// [JsonPropertyName("BotSpawnPeriodCheck")] - public int? BotSpawnPeriodCheck - { - get; - set; - } + public int? BotSpawnPeriodCheck { get; set; } /// /// The bot spawn will toggle on and off in intervals of Off(Min/Max) and On(Min/Max) /// [JsonPropertyName("BotSpawnTimeOffMax")] - public int? BotSpawnTimeOffMax - { - get; - set; - } + public int? BotSpawnTimeOffMax { get; set; } [JsonPropertyName("BotSpawnTimeOffMin")] - public int? BotSpawnTimeOffMin - { - get; - set; - } + public int? BotSpawnTimeOffMin { get; set; } [JsonPropertyName("BotSpawnTimeOnMax")] - public int? BotSpawnTimeOnMax - { - get; - set; - } + public int? BotSpawnTimeOnMax { get; set; } [JsonPropertyName("BotSpawnTimeOnMin")] - public int? BotSpawnTimeOnMin - { - get; - set; - } + public int? BotSpawnTimeOnMin { get; set; } /// /// How soon bots will be allowed to spawn /// [JsonPropertyName("BotStart")] - public int? BotStart - { - get; - set; - } + public int? BotStart { get; set; } /// /// After this long bots will no longer spawn /// [JsonPropertyName("BotStop")] - public int? BotStop - { - get; - set; - } + public int? BotStop { get; set; } [JsonPropertyName("Description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("DisabledForScav")] - public bool? DisabledForScav - { - get; - set; - } + public bool? DisabledForScav { get; set; } [JsonPropertyName("EventTrapsData")] - public EventTrapsData? EventTrapsData - { - get; - set; - } + public EventTrapsData? EventTrapsData { get; set; } [JsonPropertyName("DisabledScavExits")] - public string? DisabledScavExits - { - get; - set; - } + public string? DisabledScavExits { get; set; } [JsonPropertyName("Enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("EnableCoop")] - public bool? EnableCoop - { - get; - set; - } + public bool? EnableCoop { get; set; } [JsonPropertyName("GlobalLootChanceModifier")] - public double? GlobalLootChanceModifier - { - get; - set; - } + public double? GlobalLootChanceModifier { get; set; } [JsonPropertyName("GlobalLootChanceModifierPvE")] - public double? GlobalLootChanceModifierPvE - { - get; - set; - } + public double? GlobalLootChanceModifierPvE { get; set; } [JsonPropertyName("GlobalContainerChanceModifier")] - public double? GlobalContainerChanceModifier - { - get; - set; - } + public double? GlobalContainerChanceModifier { get; set; } [JsonPropertyName("HeatmapCellSize")] - public XYZ? HeatmapCellSize - { - get; - set; - } + public XYZ? HeatmapCellSize { get; set; } [JsonPropertyName("HeatmapLayers")] - public List? HeatmapLayers - { - get; - set; - } + public List? HeatmapLayers { get; set; } [JsonPropertyName("IconX")] - public double? IconX - { - get; - set; - } + public double? IconX { get; set; } [JsonPropertyName("IconY")] - public double? IconY - { - get; - set; - } + public double? IconY { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Insurance")] - public bool? Insurance - { - get; - set; - } + public bool? Insurance { get; set; } [JsonPropertyName("IsSecret")] - public bool? IsSecret - { - get; - set; - } + public bool? IsSecret { get; set; } [JsonPropertyName("Locked")] - public bool? Locked - { - get; - set; - } + public bool? Locked { get; set; } [JsonPropertyName("Loot")] - public List? Loot - { - get; - set; - } + public List? Loot { get; set; } [JsonPropertyName("MatchMakerMinPlayersByWaitTime")] - public List? MatchMakerMinPlayersByWaitTime - { - get; - set; - } + public List? MatchMakerMinPlayersByWaitTime { get; set; } [JsonPropertyName("MaxBotPerZone")] - public int? MaxBotPerZone - { - get; - set; - } + public int? MaxBotPerZone { get; set; } [JsonPropertyName("MaxDistToFreePoint")] - public int? MaxDistToFreePoint - { - get; - set; - } + public int? MaxDistToFreePoint { get; set; } [JsonPropertyName("MaxPlayers")] - public int? MaxPlayers - { - get; - set; - } + public int? MaxPlayers { get; set; } [JsonPropertyName("MinDistToExitPoint")] - public double? MinDistToExitPoint - { - get; - set; - } + public double? MinDistToExitPoint { get; set; } [JsonPropertyName("MinDistToFreePoint")] - public double? MinDistToFreePoint - { - get; - set; - } + public double? MinDistToFreePoint { get; set; } [JsonPropertyName("MinMaxBots")] - public List? MinMaxBots - { - get; - set; - } + public List? MinMaxBots { get; set; } [JsonPropertyName("MinPlayers")] - public int? MinPlayers - { - get; - set; - } + public int? MinPlayers { get; set; } [JsonPropertyName("MaxCoopGroup")] - public int? MaxCoopGroup - { - get; - set; - } + public int? MaxCoopGroup { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("NonWaveGroupScenario")] - public NonWaveGroupScenario? NonWaveGroupScenario - { - get; - set; - } + public NonWaveGroupScenario? NonWaveGroupScenario { get; set; } [JsonPropertyName("NewSpawn")] - public bool? NewSpawn - { - get; - set; - } + public bool? NewSpawn { get; set; } [JsonPropertyName("OcculsionCullingEnabled")] - public bool? OcculsionCullingEnabled - { - get; - set; - } + public bool? OcculsionCullingEnabled { get; set; } [JsonPropertyName("OldSpawn")] - public bool? OldSpawn - { - get; - set; - } + public bool? OldSpawn { get; set; } [JsonPropertyName("OpenZones")] - public string? OpenZones - { - get; - set; - } + public string? OpenZones { get; set; } [JsonPropertyName("Preview")] - public Preview? Preview - { - get; - set; - } + public Preview? Preview { get; set; } [JsonPropertyName("PlayersRequestCount")] - public int? PlayersRequestCount - { - get; - set; - } + public int? PlayersRequestCount { get; set; } [JsonPropertyName("RequiredPlayerLevel")] - public int? RequiredPlayerLevel - { - get; - set; - } + public int? RequiredPlayerLevel { get; set; } [JsonPropertyName("RequiredPlayerLevelMin")] - public int? RequiredPlayerLevelMin - { - get; - set; - } + public int? RequiredPlayerLevelMin { get; set; } [JsonPropertyName("RequiredPlayerLevelMax")] - public int? RequiredPlayerLevelMax - { - get; - set; - } + public int? RequiredPlayerLevelMax { get; set; } [JsonPropertyName("MinPlayerLvlAccessKeys")] - public int? MinPlayerLvlAccessKeys - { - get; - set; - } + public int? MinPlayerLvlAccessKeys { get; set; } [JsonPropertyName("PmcMaxPlayersInGroup")] - public int? PmcMaxPlayersInGroup - { - get; - set; - } + public int? PmcMaxPlayersInGroup { get; set; } [JsonPropertyName("ScavMaxPlayersInGroup")] - public int? ScavMaxPlayersInGroup - { - get; - set; - } + public int? ScavMaxPlayersInGroup { get; set; } [JsonPropertyName("Rules")] - public string? Rules - { - get; - set; - } + public string? Rules { get; set; } [JsonPropertyName("SafeLocation")] - public bool? SafeLocation - { - get; - set; - } + public bool? SafeLocation { get; set; } [JsonPropertyName("Scene")] - public Scene? Scene - { - get; - set; - } + public Scene? Scene { get; set; } [JsonPropertyName("NoGroupSpawn")] - public bool? NoGroupSpawn - { - get; - set; - } + public bool? NoGroupSpawn { get; set; } [JsonPropertyName("SpawnPointParams")] - public List? SpawnPointParams - { - get; - set; - } + public List? SpawnPointParams { get; set; } [JsonPropertyName("areas")] - public Dictionary? Areas - { - get; - set; - } + public Dictionary? Areas { get; set; } [JsonPropertyName("UnixDateTime")] - public long? UnixDateTime - { - get; - set; - } + public long? UnixDateTime { get; set; } [JsonPropertyName("_Id")] - public string? IdField - { - get; - set; - } + public string? IdField { get; set; } [JsonPropertyName("doors")] - public List? Doors - { - get; - set; - } + public List? Doors { get; set; } [JsonPropertyName("EscapeTimeLimit")] - public double? EscapeTimeLimit - { - get; - set; - } + public double? EscapeTimeLimit { get; set; } // BSG fucked up another property name [JsonPropertyName("escape_time_limit")] public int Escape_Time_Limit_Do_Not_Use { - set - { - EscapeTimeLimit = value; - } + set { EscapeTimeLimit = value; } } [JsonPropertyName("EscapeTimeLimitCoop")] - public int? EscapeTimeLimitCoop - { - get; - set; - } + public int? EscapeTimeLimitCoop { get; set; } [JsonPropertyName("EscapeTimeLimitPVE")] - public int? EscapeTimeLimitPVE - { - get; - set; - } + public int? EscapeTimeLimitPVE { get; set; } [JsonPropertyName("Events")] - public LocationEvents? Events - { - get; - set; - } + public LocationEvents? Events { get; set; } // Checked in client [JsonPropertyName("exit_access_time")] - public int? ExitAccessTime - { - get; - set; - } + public int? ExitAccessTime { get; set; } [JsonPropertyName("ForceOnlineRaidInPVE")] - public bool? ForceOnlineRaidInPVE - { - get; - set; - } + public bool? ForceOnlineRaidInPVE { get; set; } [JsonPropertyName("ExitZones")] - public string? ExitZones - { - get; - set; - } + public string? ExitZones { get; set; } [JsonPropertyName("exit_count")] - public int? ExitCount - { - get; - set; - } + public int? ExitCount { get; set; } [JsonPropertyName("exit_time")] - public double? ExitTime - { - get; - set; - } + public double? ExitTime { get; set; } [JsonPropertyName("SpawnSafeDistanceMeters")] - public double? SpawnSafeDistanceMeters - { - get; - set; - } + public double? SpawnSafeDistanceMeters { get; set; } [JsonPropertyName("OneTimeSpawn")] - public bool? OneTimeSpawn - { - get; - set; - } + public bool? OneTimeSpawn { get; set; } [JsonPropertyName("exits")] - public List? Exits - { - get; - set; - } + public List? Exits { get; set; } [JsonPropertyName("filter_ex")] - public List? FilterEx - { - get; - set; - } + public List? FilterEx { get; set; } [JsonPropertyName("limits")] - public List? Limits - { - get; - set; - } + public List? Limits { get; set; } [JsonPropertyName("matching_min_seconds")] - public int? MatchingMinSeconds - { - get; - set; - } + public int? MatchingMinSeconds { get; set; } [JsonPropertyName("GenerateLocalLootCache")] - public bool? GenerateLocalLootCache - { - get; - set; - } + public bool? GenerateLocalLootCache { get; set; } [JsonPropertyName("maxItemCountInLocation")] - public List? MaxItemCountInLocation - { - get; - set; - } + public List? MaxItemCountInLocation { get; set; } [JsonPropertyName("sav_summon_seconds")] - public int? SavSummonSeconds - { - get; - set; - } + public int? SavSummonSeconds { get; set; } [JsonPropertyName("tmp_location_field_remove_me")] - public int? TmpLocationFieldRemoveMe - { - get; - set; - } + public int? TmpLocationFieldRemoveMe { get; set; } [JsonPropertyName("transits")] - public List? Transits - { - get; - set; - } + public List? Transits { get; set; } [JsonPropertyName("users_gather_seconds")] - public int? UsersGatherSeconds - { - get; - set; - } + public int? UsersGatherSeconds { get; set; } [JsonPropertyName("users_spawn_seconds_n")] - public int? UsersSpawnSecondsN - { - get; - set; - } + public int? UsersSpawnSecondsN { get; set; } [JsonPropertyName("users_spawn_seconds_n2")] - public int? UsersSpawnSecondsN2 - { - get; - set; - } + public int? UsersSpawnSecondsN2 { get; set; } [JsonPropertyName("users_summon_seconds")] - public int? UsersSummonSeconds - { - get; - set; - } + public int? UsersSummonSeconds { get; set; } [JsonPropertyName("waves")] - public List Waves - { - get; - set; - } + public List Waves { get; set; } } public record EventTrapsData @@ -816,29 +385,13 @@ public record EventTrapsData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double MaxBarbedWires - { - get; - set; - } + public double MaxBarbedWires { get; set; } - public double MaxTrapDoors - { - get; - set; - } + public double MaxTrapDoors { get; set; } - public double MinBarbedWires - { - get; - set; - } + public double MinBarbedWires { get; set; } - public double MinTrapDoors - { - get; - set; - } + public double MinTrapDoors { get; set; } } public record Transit @@ -847,81 +400,37 @@ public record Transit public Dictionary ExtensionData { get; set; } [JsonPropertyName("activateAfterSec")] - public int? ActivateAfterSeconds - { - get; - set; - } + public int? ActivateAfterSeconds { get; set; } [JsonPropertyName("active")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("events")] - public bool? Events - { - get; - set; - } + public bool? Events { get; set; } [JsonPropertyName("hideIfNoKey")] - public bool? HideIfNoKey - { - get; - set; - } + public bool? HideIfNoKey { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("conditions")] - public string? Conditions - { - get; - set; - } + public string? Conditions { get; set; } [JsonPropertyName("description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("id")] - public int? Id - { - get; - set; - } + public int? Id { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("target")] - public string? Target - { - get; - set; - } + public string? Target { get; set; } [JsonPropertyName("time")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } } public record NonWaveGroupScenario @@ -930,56 +439,28 @@ public record NonWaveGroupScenario public Dictionary ExtensionData { get; set; } [JsonPropertyName("Chance")] - public double? Chance - { - get; - set; - } + public double? Chance { get; set; } [JsonPropertyName("Enabled")] - public bool? IsEnabled - { - get; - set; - } + public bool? IsEnabled { get; set; } [JsonPropertyName("MaxToBeGroup")] - public int? MaximumToBeGrouped - { - get; - set; - } + public int? MaximumToBeGrouped { get; set; } [JsonPropertyName("MinToBeGroup")] - public int? MinimumToBeGrouped - { - get; - set; - } + public int? MinimumToBeGrouped { get; set; } } public record Limit : MinMax { [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("min")] - public int? Min - { - get; - set; - } + public int? Min { get; set; } [JsonPropertyName("max")] - public int? Max - { - get; - set; - } + public int? Max { get; set; } } public record AirdropParameter @@ -988,74 +469,34 @@ public record AirdropParameter public Dictionary ExtensionData { get; set; } [JsonPropertyName("AirdropPointDeactivateDistance")] - public int? AirdropPointDeactivateDistance - { - get; - set; - } + public int? AirdropPointDeactivateDistance { get; set; } [JsonPropertyName("MinPlayersCountToSpawnAirdrop")] - public int? MinimumPlayersCountToSpawnAirdrop - { - get; - set; - } + public int? MinimumPlayersCountToSpawnAirdrop { get; set; } [JsonPropertyName("PlaneAirdropChance")] - public double? PlaneAirdropChance - { - get; - set; - } + public double? PlaneAirdropChance { get; set; } [JsonPropertyName("PlaneAirdropCooldownMax")] - public int? PlaneAirdropCooldownMax - { - get; - set; - } + public int? PlaneAirdropCooldownMax { get; set; } [JsonPropertyName("PlaneAirdropCooldownMin")] - public int? PlaneAirdropCooldownMin - { - get; - set; - } + public int? PlaneAirdropCooldownMin { get; set; } [JsonPropertyName("PlaneAirdropEnd")] - public int? PlaneAirdropEnd - { - get; - set; - } + public int? PlaneAirdropEnd { get; set; } [JsonPropertyName("PlaneAirdropMax")] - public int? PlaneAirdropMax - { - get; - set; - } + public int? PlaneAirdropMax { get; set; } [JsonPropertyName("PlaneAirdropStartMax")] - public int? PlaneAirdropStartMax - { - get; - set; - } + public int? PlaneAirdropStartMax { get; set; } [JsonPropertyName("PlaneAirdropStartMin")] - public int? PlaneAirdropStartMin - { - get; - set; - } + public int? PlaneAirdropStartMin { get; set; } [JsonPropertyName("UnsuccessfulTryPenalty")] - public int? UnsuccessfulTryPenalty - { - get; - set; - } + public int? UnsuccessfulTryPenalty { get; set; } } public record Banner @@ -1064,18 +505,10 @@ public record Banner public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("pic")] - public Pic? Picture - { - get; - set; - } + public Pic? Picture { get; set; } } public record Pic @@ -1084,18 +517,10 @@ public record Pic public Dictionary ExtensionData { get; set; } [JsonPropertyName("path")] - public string? Path - { - get; - set; - } + public string? Path { get; set; } [JsonPropertyName("rcid")] - public string? Rcid - { - get; - set; - } + public string? Rcid { get; set; } } public record BossLocationSpawn @@ -1104,146 +529,65 @@ public record BossLocationSpawn public Dictionary ExtensionData { get; set; } [JsonPropertyName("BossChance")] - public double? BossChance - { - get; - set; - } + public double? BossChance { get; set; } [JsonPropertyName("BossDifficult")] - public string? BossDifficulty - { - get; - set; - } + public string? BossDifficulty { get; set; } [JsonPropertyName("BossEscortAmount")] - public string? BossEscortAmount - { - get; - set; - } + public string? BossEscortAmount { get; set; } [JsonPropertyName("BossEscortDifficult")] - public string? BossEscortDifficulty - { - get; - set; - } + public string? BossEscortDifficulty { get; set; } [JsonPropertyName("BossEscortType")] - public string? BossEscortType - { - get; - set; - } + public string? BossEscortType { get; set; } [JsonPropertyName("BossName")] - public string? BossName - { - get; - set; - } + public string? BossName { get; set; } [JsonPropertyName("BossPlayer")] - public bool? IsBossPlayer - { - get; - set; - } + public bool? IsBossPlayer { get; set; } [JsonPropertyName("BossZone")] - public string? BossZone - { - get; - set; - } + public string? BossZone { get; set; } [JsonPropertyName("RandomTimeSpawn")] - public bool? IsRandomTimeSpawn - { - get; - set; - } + public bool? IsRandomTimeSpawn { get; set; } [JsonPropertyName("Time")] - public double? Time - { - get; - set; - } + public double? Time { get; set; } [JsonPropertyName("TriggerId")] - public string? TriggerId - { - get; - set; - } + public string? TriggerId { get; set; } [JsonPropertyName("TriggerName")] - public string? TriggerName - { - get; - set; - } + public string? TriggerName { get; set; } [JsonPropertyName("Delay")] - public double? Delay - { - get; - set; - } + public double? Delay { get; set; } [JsonPropertyName("DependKarma")] - public bool? DependKarma - { - get; - set; - } + public bool? DependKarma { get; set; } [JsonPropertyName("DependKarmaPVE")] - public bool? DependKarmaPVE - { - get; - set; - } + public bool? DependKarmaPVE { get; set; } [JsonPropertyName("ForceSpawn")] - public bool? ForceSpawn - { - get; - set; - } + public bool? ForceSpawn { get; set; } [JsonPropertyName("IgnoreMaxBots")] - public bool? IgnoreMaxBots - { - get; - set; - } - + public bool? IgnoreMaxBots { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("Supports")] - public List Supports - { - get; - set; - } + public List Supports { get; set; } [JsonPropertyName("sptId")] - public string? SptId - { - get; - set; - } + public string? SptId { get; set; } [JsonPropertyName("SpawnMode")] - public List SpawnMode - { - get; - set; - } + public List SpawnMode { get; set; } } public record BossSupport @@ -1252,26 +596,14 @@ public record BossSupport public Dictionary ExtensionData { get; set; } [JsonPropertyName("BossEscortAmount")] - public string? BossEscortAmount - { - get; - set; - } + public string? BossEscortAmount { get; set; } [JsonPropertyName("BossEscortDifficult")] [JsonConverter(typeof(ListOrTConverterFactory))] - public ListOrT BossEscortDifficulty - { - get; - set; - } + public ListOrT BossEscortDifficulty { get; set; } [JsonPropertyName("BossEscortType")] - public string? BossEscortType - { - get; - set; - } + public string? BossEscortType { get; set; } } public record BotLocationModifier @@ -1280,193 +612,85 @@ public record BotLocationModifier public Dictionary ExtensionData { get; set; } [JsonPropertyName("AccuracySpeed")] - public double? AccuracySpeed - { - get; - set; - } + public double? AccuracySpeed { get; set; } [JsonPropertyName("AdditionalHostilitySettings")] - public List AdditionalHostilitySettings - { - get; - set; - } + public List AdditionalHostilitySettings { get; set; } [JsonPropertyName("DistToActivate")] - public double? DistanceToActivate - { - get; - set; - } + public double? DistanceToActivate { get; set; } [JsonPropertyName("DistToActivatePvE")] - public double? DistanceToActivatePvE - { - get; - set; - } + public double? DistanceToActivatePvE { get; set; } [JsonPropertyName("DistToPersueAxemanCoef")] - public double? DistanceToPursueAxemanCoefficient - { - get; - set; - } + public double? DistanceToPursueAxemanCoefficient { get; set; } [JsonPropertyName("DistToSleep")] - public double? DistanceToSleep - { - get; - set; - } + public double? DistanceToSleep { get; set; } [JsonPropertyName("DistToSleepPvE")] - public double? DistanceToSleepPvE - { - get; - set; - } + public double? DistanceToSleepPvE { get; set; } [JsonPropertyName("GainSight")] - public double? GainSight - { - get; - set; - } + public double? GainSight { get; set; } [JsonPropertyName("KhorovodChance")] - public double? KhorovodChance - { - get; - set; - } + public double? KhorovodChance { get; set; } [JsonPropertyName("MagnetPower")] - public double? MagnetPower - { - get; - set; - } + public double? MagnetPower { get; set; } [JsonPropertyName("MarksmanAccuratyCoef")] - public double? MarksmanAccuracyCoefficient - { - get; - set; - } + public double? MarksmanAccuracyCoefficient { get; set; } [JsonPropertyName("Scattering")] - public double? Scattering - { - get; - set; - } + public double? Scattering { get; set; } [JsonPropertyName("VisibleDistance")] - public double? VisibleDistance - { - get; - set; - } + public double? VisibleDistance { get; set; } [JsonPropertyName("MaxExfiltrationTime")] - public double? MaxExfiltrationTime - { - get; - set; - } + public double? MaxExfiltrationTime { get; set; } [JsonPropertyName("MinExfiltrationTime")] - public double? MinExfiltrationTime - { - get; - set; - } + public double? MinExfiltrationTime { get; set; } [JsonPropertyName("FogVisibilityDistanceCoef")] - public double? FogVisibilityDistanceCoef - { - get; - set; - } + public double? FogVisibilityDistanceCoef { get; set; } [JsonPropertyName("FogVisibilitySpeedCoef")] - public double? FogVisibilitySpeedCoef - { - get; - set; - } + public double? FogVisibilitySpeedCoef { get; set; } [JsonPropertyName("LockSpawnCheckRadius")] - public double? FogVisibLockSpawnCheckRadiusilitySpeedCoef - { - get; - set; - } + public double? FogVisibLockSpawnCheckRadiusilitySpeedCoef { get; set; } [JsonPropertyName("LockSpawnCheckRadiusPvE")] - public double? LockSpawnCheckRadiusPvE - { - get; - set; - } + public double? LockSpawnCheckRadiusPvE { get; set; } [JsonPropertyName("LockSpawnStartTime")] - public double? LockSpawnStartTime - { - get; - set; - } + public double? LockSpawnStartTime { get; set; } [JsonPropertyName("LockSpawnStartTimePvE")] - public double? LockSpawnStartTimePvE - { - get; - set; - } + public double? LockSpawnStartTimePvE { get; set; } [JsonPropertyName("LockSpawnStepTime")] - public double? LockSpawnStepTime - { - get; - set; - } + public double? LockSpawnStepTime { get; set; } [JsonPropertyName("LockSpawnStepTimePvE")] - public double? LockSpawnStepTimePvE - { - get; - set; - } + public double? LockSpawnStepTimePvE { get; set; } [JsonPropertyName("NonWaveSpawnBotsLimitPerPlayer")] - public double? NonWaveSpawnBotsLimitPerPlayer - { - get; - set; - } + public double? NonWaveSpawnBotsLimitPerPlayer { get; set; } [JsonPropertyName("NonWaveSpawnBotsLimitPerPlayerPvE")] - public double? NonWaveSpawnBotsLimitPerPlayerPvE - { - get; - set; - } + public double? NonWaveSpawnBotsLimitPerPlayerPvE { get; set; } [JsonPropertyName("RainVisibilityDistanceCoef")] - public double? RainVisibilityDistanceCoef - { - get; - set; - } + public double? RainVisibilityDistanceCoef { get; set; } [JsonPropertyName("RainVisibilitySpeedCoef")] - public double? RainVisibilitySpeedCoef - { - get; - set; - } + public double? RainVisibilitySpeedCoef { get; set; } } public record AdditionalHostilitySettings @@ -1475,88 +699,40 @@ public record AdditionalHostilitySettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("AlwaysEnemies")] - public List? AlwaysEnemies - { - get; - set; - } + public List? AlwaysEnemies { get; set; } [JsonPropertyName("AlwaysFriends")] - public List? AlwaysFriends - { - get; - set; - } + public List? AlwaysFriends { get; set; } [JsonPropertyName("BearEnemyChance")] - public double? BearEnemyChance - { - get; - set; - } + public double? BearEnemyChance { get; set; } [JsonPropertyName("BearPlayerBehaviour")] - public string? BearPlayerBehaviour - { - get; - set; - } + public string? BearPlayerBehaviour { get; set; } [JsonPropertyName("BotRole")] - public string? BotRole - { - get; - set; - } + public string? BotRole { get; set; } [JsonPropertyName("ChancedEnemies")] - public List? ChancedEnemies - { - get; - set; - } + public List? ChancedEnemies { get; set; } [JsonPropertyName("Neutral")] - public List? Neutral - { - get; - set; - } + public List? Neutral { get; set; } [JsonPropertyName("SavagePlayerBehaviour")] - public string? SavagePlayerBehaviour - { - get; - set; - } + public string? SavagePlayerBehaviour { get; set; } [JsonPropertyName("SavageEnemyChance")] - public double? SavageEnemyChance - { - get; - set; - } + public double? SavageEnemyChance { get; set; } [JsonPropertyName("UsecEnemyChance")] - public double? UsecEnemyChance - { - get; - set; - } + public double? UsecEnemyChance { get; set; } [JsonPropertyName("UsecPlayerBehaviour")] - public string? UsecPlayerBehaviour - { - get; - set; - } + public string? UsecPlayerBehaviour { get; set; } [JsonPropertyName("Warn")] - public List? Warn - { - get; - set; - } + public List? Warn { get; set; } } public record ChancedEnemy @@ -1565,28 +741,16 @@ public record ChancedEnemy public Dictionary ExtensionData { get; set; } [JsonPropertyName("EnemyChance")] - public int? EnemyChance - { - get; - set; - } + public int? EnemyChance { get; set; } [JsonPropertyName("Role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } } public record MinMaxBot : MinMax { [JsonPropertyName("WildSpawnType")] - public string? WildSpawnType - { - get; - set; - } // TODO: Could be WildSpawnType or string + public string? WildSpawnType { get; set; } // TODO: Could be WildSpawnType or string } public record MinPlayerWaitTime @@ -1595,18 +759,10 @@ public record MinPlayerWaitTime public Dictionary ExtensionData { get; set; } [JsonPropertyName("minPlayers")] - public int? MinPlayers - { - get; - set; - } + public int? MinPlayers { get; set; } [JsonPropertyName("time")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } } public record Preview @@ -1615,18 +771,10 @@ public record Preview public Dictionary ExtensionData { get; set; } [JsonPropertyName("path")] - public string? Path - { - get; - set; - } + public string? Path { get; set; } [JsonPropertyName("rcid")] - public string? Rcid - { - get; - set; - } + public string? Rcid { get; set; } } public record Scene @@ -1635,18 +783,10 @@ public record Scene public Dictionary ExtensionData { get; set; } [JsonPropertyName("path")] - public string? Path - { - get; - set; - } + public string? Path { get; set; } [JsonPropertyName("rcid")] - public string? Rcid - { - get; - set; - } + public string? Rcid { get; set; } } public record SpawnPointParam @@ -1655,74 +795,34 @@ public record SpawnPointParam public Dictionary ExtensionData { get; set; } [JsonPropertyName("BotZoneName")] - public string? BotZoneName - { - get; - set; - } + public string? BotZoneName { get; set; } [JsonPropertyName("Categories")] - public List? Categories - { - get; - set; - } + public List? Categories { get; set; } [JsonPropertyName("ColliderParams")] - public ColliderParams? ColliderParams - { - get; - set; - } + public ColliderParams? ColliderParams { get; set; } [JsonPropertyName("CorePointId")] - public int? CorePointId - { - get; - set; - } + public int? CorePointId { get; set; } [JsonPropertyName("DelayToCanSpawnSec")] - public double? DelayToCanSpawnSec - { - get; - set; - } + public double? DelayToCanSpawnSec { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Infiltration")] - public string? Infiltration - { - get; - set; - } + public string? Infiltration { get; set; } [JsonPropertyName("Position")] - public XYZ? Position - { - get; - set; - } + public XYZ? Position { get; set; } [JsonPropertyName("Rotation")] - public double? Rotation - { - get; - set; - } + public double? Rotation { get; set; } [JsonPropertyName("Sides")] - public List? Sides - { - get; - set; - } + public List? Sides { get; set; } } public record ColliderParams @@ -1735,22 +835,12 @@ public record ColliderParams [JsonPropertyName("_parent")] public string? Parent { - get - { - return _parent; - } - set - { - _parent = string.Intern(value); - } + get { return _parent; } + set { _parent = string.Intern(value); } } [JsonPropertyName("_props")] - public ColliderProps? Props - { - get; - set; - } + public ColliderProps? Props { get; set; } } public record ColliderProps @@ -1759,25 +849,13 @@ public record ColliderProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("Center")] - public XYZ? Center - { - get; - set; - } + public XYZ? Center { get; set; } [JsonPropertyName("Size")] - public XYZ? Size - { - get; - set; - } + public XYZ? Size { get; set; } [JsonPropertyName("Radius")] - public double? Radius - { - get; - set; - } + public double? Radius { get; set; } } public record Exit @@ -1789,194 +867,91 @@ public record Exit /// % Chance out of 100 exit will appear in raid /// [JsonPropertyName("Chance")] - public double? Chance - { - get; - set; - } + public double? Chance { get; set; } [JsonPropertyName("ChancePVE")] - public double? ChancePVE - { - get; - set; - } + public double? ChancePVE { get; set; } [JsonPropertyName("Count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("CountPVE")] - public int? CountPVE - { - get; - set; - } + public int? CountPVE { get; set; } // Had to add this property as BSG sometimes names the properties with full PVE capitals // This property will just point the value to CountPve [JsonPropertyName("CountPve")] public int CountPve { - set - { - CountPVE = value; - } + set { CountPVE = value; } } [JsonPropertyName("EntryPoints")] - public string? EntryPoints - { - get; - set; - } + public string? EntryPoints { get; set; } [JsonPropertyName("EventAvailable")] - public bool? EventAvailable - { - get; - set; - } + public bool? EventAvailable { get; set; } [JsonPropertyName("EligibleForPMC")] - public bool? EligibleForPMC - { - get; - set; - } + public bool? EligibleForPMC { get; set; } [JsonPropertyName("EligibleForScav")] - public bool? EligibleForScav - { - get; - set; - } + public bool? EligibleForScav { get; set; } [JsonPropertyName("ExfiltrationTime")] - public double? ExfiltrationTime - { - get; - set; - } + public double? ExfiltrationTime { get; set; } [JsonPropertyName("ExfiltrationTimePVE")] - public double? ExfiltrationTimePVE - { - get; - set; - } + public double? ExfiltrationTimePVE { get; set; } [JsonPropertyName("ExfiltrationType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public ExfiltrationType? ExfiltrationType - { - get; - set; - } + public ExfiltrationType? ExfiltrationType { get; set; } [JsonPropertyName("RequiredSlot")] [JsonConverter(typeof(JsonStringEnumConverter))] - public EquipmentSlots? RequiredSlot - { - get; - set; - } + public EquipmentSlots? RequiredSlot { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("MaxTime")] - public double? MaxTime - { - get; - set; - } + public double? MaxTime { get; set; } [JsonPropertyName("MaxTimePVE")] - public double? MaxTimePVE - { - get; - set; - } + public double? MaxTimePVE { get; set; } // Checked in client [JsonPropertyName("MinTime")] - public double? MinTime - { - get; - set; - } + public double? MinTime { get; set; } [JsonPropertyName("MinTimePVE")] - public double? MinTimePVE - { - get; - set; - } + public double? MinTimePVE { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("_Name")] - public string? _Name - { - get; - set; - } + public string? _Name { get; set; } [JsonPropertyName("_name")] - public string? _NameLower - { - get; - set; - } + public string? _NameLower { get; set; } [JsonPropertyName("PassageRequirement")] [JsonConverter(typeof(JsonStringEnumConverter))] - public RequirementState? PassageRequirement - { - get; - set; - } + public RequirementState? PassageRequirement { get; set; } [JsonPropertyName("PlayersCount")] - public int? PlayersCount - { - get; - set; - } + public int? PlayersCount { get; set; } [JsonPropertyName("PlayersCountPVE")] - public int? PlayersCountPVE - { - get; - set; - } + public int? PlayersCountPVE { get; set; } [JsonPropertyName("RequirementTip")] - public string? RequirementTip - { - get; - set; - } + public string? RequirementTip { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } } public record MaxItemCountInLocation @@ -1985,18 +960,10 @@ public record MaxItemCountInLocation public Dictionary ExtensionData { get; set; } [JsonPropertyName("TemplateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("Value")] - public int? Value - { - get; - set; - } + public int? Value { get; set; } } public record Wave @@ -2005,116 +972,56 @@ public record Wave public Dictionary ExtensionData { get; set; } [JsonPropertyName("BotPreset")] - public string? BotPreset - { - get; - set; - } + public string? BotPreset { get; set; } [JsonPropertyName("BotSide")] - public string? BotSide - { - get; - set; - } + public string? BotSide { get; set; } [JsonPropertyName("KeepZoneOnSpawn")] - public bool? KeepZoneOnSpawn - { - get; - set; - } + public bool? KeepZoneOnSpawn { get; set; } [JsonPropertyName("SpawnPoints")] - public string? SpawnPoints - { - get; - set; - } + public string? SpawnPoints { get; set; } [JsonPropertyName("WildSpawnType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public WildSpawnType? WildSpawnType - { - get; - set; - } + public WildSpawnType? WildSpawnType { get; set; } [JsonPropertyName("isPlayers")] - public bool? IsPlayers - { - get; - set; - } + public bool? IsPlayers { get; set; } [JsonPropertyName("number")] - public int? Number - { - get; - set; - } + public int? Number { get; set; } [JsonPropertyName("slots_max")] - public int? SlotsMax - { - get; - set; - } + public int? SlotsMax { get; set; } [JsonPropertyName("slots_min")] - public int? SlotsMin - { - get; - set; - } + public int? SlotsMin { get; set; } [JsonPropertyName("time_max")] - public int? TimeMax - { - get; - set; - } + public int? TimeMax { get; set; } [JsonPropertyName("time_min")] - public int? TimeMin - { - get; - set; - } + public int? TimeMin { get; set; } /// /// OPTIONAL - Needs to be unique - Used by custom wave service to ensure same wave isnt added multiple times /// [JsonPropertyName("sptId")] - public string? SptId - { - get; - set; - } + public string? SptId { get; set; } [JsonPropertyName("ChanceGroup")] - public int? ChanceGroup - { - get; - set; - } + public int? ChanceGroup { get; set; } /// /// 'pve' and/or 'regular' /// [JsonPropertyName("SpawnMode")] - public List? SpawnMode - { - get; - set; - } + public List? SpawnMode { get; set; } [JsonPropertyName("OpenZones")] - public string? OpenZones - { - get; - set; - } + public string? OpenZones { get; set; } } public record LocationEvents @@ -2123,17 +1030,9 @@ public record LocationEvents public Dictionary ExtensionData { get; set; } [JsonPropertyName("Halloween2024")] - public Halloween2024? Halloween2024 - { - get; - set; - } + public Halloween2024? Halloween2024 { get; set; } - public Khorovod? Khorovod - { - get; - set; - } + public Khorovod? Khorovod { get; set; } } public record Khorovod @@ -2141,11 +1040,7 @@ public record Khorovod [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Chance - { - get; - set; - } + public double? Chance { get; set; } } public record Halloween2024 @@ -2154,108 +1049,48 @@ public record Halloween2024 public Dictionary ExtensionData { get; set; } [JsonPropertyName("CrowdAttackBlockRadius")] - public double? CrowdAttackBlockRadius - { - get; - set; - } + public double? CrowdAttackBlockRadius { get; set; } [JsonPropertyName("CrowdAttackSpawnParams")] - public List? CrowdAttackSpawnParams - { - get; - set; - } + public List? CrowdAttackSpawnParams { get; set; } [JsonPropertyName("CrowdCooldownPerPlayerSec")] - public double? CrowdCooldownPerPlayerSec - { - get; - set; - } + public double? CrowdCooldownPerPlayerSec { get; set; } [JsonPropertyName("CrowdsLimit")] - public int? CrowdsLimit - { - get; - set; - } + public int? CrowdsLimit { get; set; } [JsonPropertyName("InfectedLookCoeff")] - public double? InfectedLookCoeff - { - get; - set; - } + public double? InfectedLookCoeff { get; set; } [JsonPropertyName("MaxCrowdAttackSpawnLimit")] - public int? MaxCrowdAttackSpawnLimit - { - get; - set; - } + public int? MaxCrowdAttackSpawnLimit { get; set; } [JsonPropertyName("MinInfectionPercentage")] - public double? MinInfectionPercentage - { - get; - set; - } + public double? MinInfectionPercentage { get; set; } [JsonPropertyName("MinSpawnDistToPlayer")] - public double? MinSpawnDistToPlayer - { - get; - set; - } + public double? MinSpawnDistToPlayer { get; set; } [JsonPropertyName("TargetPointSearchRadiusLimit")] - public double? TargetPointSearchRadiusLimit - { - get; - set; - } + public double? TargetPointSearchRadiusLimit { get; set; } [JsonPropertyName("ZombieCallDeltaRadius")] - public double? ZombieCallDeltaRadius - { - get; - set; - } + public double? ZombieCallDeltaRadius { get; set; } [JsonPropertyName("ZombieCallPeriodSec")] - public double? ZombieCallPeriodSec - { - get; - set; - } + public double? ZombieCallPeriodSec { get; set; } [JsonPropertyName("ZombieCallRadiusLimit")] - public double? ZombieCallRadiusLimit - { - get; - set; - } + public double? ZombieCallRadiusLimit { get; set; } [JsonPropertyName("ZombieMultiplier")] - public double? ZombieMultiplier - { - get; - set; - } + public double? ZombieMultiplier { get; set; } [JsonPropertyName("InfectionPercentage")] - public double? InfectionPercentage - { - get; - set; - } + public double? InfectionPercentage { get; set; } - public Khorovod? Khorovod - { - get; - set; - } + public Khorovod? Khorovod { get; set; } } public record CrowdAttackSpawnParam @@ -2264,25 +1099,13 @@ public record CrowdAttackSpawnParam public Dictionary ExtensionData { get; set; } [JsonPropertyName("Difficulty")] - public string? Difficulty - { - get; - set; - } + public string? Difficulty { get; set; } [JsonPropertyName("Role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } [JsonPropertyName("Weight")] - public int? Weight - { - get; - set; - } + public int? Weight { get; set; } } public record Area @@ -2291,46 +1114,22 @@ public record Area public Dictionary ExtensionData { get; set; } [JsonPropertyName("center")] - public XYZ? Center - { - get; - set; - } + public XYZ? Center { get; set; } [JsonPropertyName("infiltrationZone")] - public string? InfiltrationZone - { - get; - set; - } + public string? InfiltrationZone { get; set; } [JsonPropertyName("orientation")] - public double? Orientation - { - get; - set; - } + public double? Orientation { get; set; } [JsonPropertyName("position")] - public XYZ? Position - { - get; - set; - } + public XYZ? Position { get; set; } [JsonPropertyName("sides")] - public List? Sides - { - get; - set; - } + public List? Sides { get; set; } [JsonPropertyName("size")] - public XYZ? Size - { - get; - set; - } + public XYZ? Size { get; set; } } public enum WildSpawnType @@ -2398,5 +1197,5 @@ public enum WildSpawnType infectedTagilla, bossTagillaAgro, bossKillaAgro, - tagillaHelperAgro + tagillaHelperAgro, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LooseLoot.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LooseLoot.cs index b73de732..5cc578f1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LooseLoot.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LooseLoot.cs @@ -9,25 +9,13 @@ public record LooseLoot public Dictionary ExtensionData { get; set; } [JsonPropertyName("spawnpointCount")] - public SpawnpointCount? SpawnpointCount - { - get; - set; - } + public SpawnpointCount? SpawnpointCount { get; set; } [JsonPropertyName("spawnpointsForced")] - public List? SpawnpointsForced - { - get; - set; - } + public List? SpawnpointsForced { get; set; } [JsonPropertyName("spawnpoints")] - public List? Spawnpoints - { - get; - set; - } + public List? Spawnpoints { get; set; } } public record SpawnpointCount @@ -36,18 +24,10 @@ public record SpawnpointCount public Dictionary ExtensionData { get; set; } [JsonPropertyName("mean")] - public double? Mean - { - get; - set; - } + public double? Mean { get; set; } [JsonPropertyName("std")] - public double? Std - { - get; - set; - } + public double? Std { get; set; } } public record SpawnpointTemplate @@ -58,87 +38,41 @@ public record SpawnpointTemplate private string? _root; [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("IsContainer")] - public bool? IsContainer - { - get; - set; - } + public bool? IsContainer { get; set; } [JsonPropertyName("useGravity")] - public bool? UseGravity - { - get; - set; - } + public bool? UseGravity { get; set; } [JsonPropertyName("randomRotation")] - public bool? RandomRotation - { - get; - set; - } + public bool? RandomRotation { get; set; } [JsonPropertyName("Position")] - public XYZ? Position - { - get; - set; - } + public XYZ? Position { get; set; } [JsonPropertyName("Rotation")] - public XYZ? Rotation - { - get; - set; - } + public XYZ? Rotation { get; set; } [JsonPropertyName("IsAlwaysSpawn")] - public bool? IsAlwaysSpawn - { - get; - set; - } + public bool? IsAlwaysSpawn { get; set; } [JsonPropertyName("IsGroupPosition")] - public bool? IsGroupPosition - { - get; - set; - } + public bool? IsGroupPosition { get; set; } [JsonPropertyName("GroupPositions")] - public List? GroupPositions - { - get; - set; - } + public List? GroupPositions { get; set; } [JsonPropertyName("Root")] public string? Root { - get - { - return _root; - } - set - { - _root = value == null ? null : string.Intern(value); - } + get { return _root; } + set { _root = value == null ? null : string.Intern(value); } } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record GroupPosition @@ -151,36 +85,18 @@ public record GroupPosition [JsonPropertyName("Name")] public string? Name { - get - { - return _name; - } - set - { - _name = value == null ? null : string.Intern(value); - } + get { return _name; } + set { _name = value == null ? null : string.Intern(value); } } [JsonPropertyName("Weight")] - public double? Weight - { - get; - set; - } + public double? Weight { get; set; } [JsonPropertyName("Position")] - public XYZ? Position - { - get; - set; - } + public XYZ? Position { get; set; } [JsonPropertyName("Rotation")] - public XYZ? Rotation - { - get; - set; - } + public XYZ? Rotation { get; set; } } public record Spawnpoint @@ -189,32 +105,16 @@ public record Spawnpoint public Dictionary ExtensionData { get; set; } [JsonPropertyName("locationId")] - public string? LocationId - { - get; - set; - } + public string? LocationId { get; set; } [JsonPropertyName("probability")] - public double? Probability - { - get; - set; - } + public double? Probability { get; set; } [JsonPropertyName("template")] - public SpawnpointTemplate? Template - { - get; - set; - } + public SpawnpointTemplate? Template { get; set; } [JsonPropertyName("itemDistribution")] - public List? ItemDistribution - { - get; - set; - } + public List? ItemDistribution { get; set; } } public record LooseLootItemDistribution @@ -223,18 +123,10 @@ public record LooseLootItemDistribution public Dictionary ExtensionData { get; set; } [JsonPropertyName("composedKey")] - public ComposedKey? ComposedKey - { - get; - set; - } + public ComposedKey? ComposedKey { get; set; } [JsonPropertyName("relativeProbability")] - public double? RelativeProbability - { - get; - set; - } + public double? RelativeProbability { get; set; } } public record ComposedKey @@ -247,13 +139,7 @@ public record ComposedKey [JsonPropertyName("key")] public string? Key { - get - { - return _key; - } - set - { - _key = string.Intern(value); - } + get { return _key; } + set { _key = string.Intern(value); } } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/MetricsTableData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/MetricsTableData.cs index 1c192c5e..1269f7c8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/MetricsTableData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/MetricsTableData.cs @@ -8,37 +8,17 @@ public record MetricsTableData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Keys")] - public List? Keys - { - get; - set; - } + public List? Keys { get; set; } [JsonPropertyName("NetProcessingBins")] - public List? NetProcessingBins - { - get; - set; - } + public List? NetProcessingBins { get; set; } [JsonPropertyName("RenderBins")] - public List? RenderBins - { - get; - set; - } + public List? RenderBins { get; set; } [JsonPropertyName("GameUpdateBins")] - public List? GameUpdateBins - { - get; - set; - } + public List? GameUpdateBins { get; set; } [JsonPropertyName("MemoryMeasureInterval")] - public int? MemoryMeasureInterval - { - get; - set; - } + public int? MemoryMeasureInterval { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/PmcData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/PmcData.cs index 90b38302..d7e59366 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/PmcData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/PmcData.cs @@ -8,31 +8,17 @@ public record PmcData : BotBase { [JsonPropertyName("Prestige")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Prestige - { - get; - set; - } + public Dictionary? Prestige { get; set; } - public Dictionary? CheckedMagazines - { - get; - set; - } + public Dictionary? CheckedMagazines { get; set; } /// /// Returns the list of IDs of the weapons, which the player has checked the chamber of in the last raid. /// - public List CheckedChambers - { - get; - set; - } + public List CheckedChambers { get; set; } } -public record PostRaidPmcData : PmcData -{ -} +public record PostRaidPmcData : PmcData { } public record PostRaidStats { @@ -40,19 +26,11 @@ public record PostRaidStats public Dictionary ExtensionData { get; set; } [JsonPropertyName("Eft")] - public EftStats? Eft - { - get; - set; - } + public EftStats? Eft { get; set; } /// /// Only found in profile we get from client post raid /// [JsonPropertyName("Arena")] - public EftStats? Arena - { - get; - set; - } + public EftStats? Arena { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/BaseInteractionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/BaseInteractionRequestData.cs index e85d5771..fe427b30 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/BaseInteractionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/BaseInteractionRequestData.cs @@ -8,25 +8,13 @@ public record BaseInteractionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Action")] - public string? Action - { - get; - set; - } + public string? Action { get; set; } [JsonPropertyName("fromOwner")] - public OwnerInfo? FromOwner - { - get; - set; - } + public OwnerInfo? FromOwner { get; set; } [JsonPropertyName("toOwner")] - public OwnerInfo? ToOwner - { - get; - set; - } + public OwnerInfo? ToOwner { get; set; } } public record OwnerInfo @@ -35,16 +23,8 @@ public record OwnerInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/UIDRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/UIDRequestData.cs index ec0d869a..c3444647 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/UIDRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Request/UIDRequestData.cs @@ -9,9 +9,5 @@ public record UIDRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Achievement.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Achievement.cs index c131392a..e13783d3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Achievement.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Achievement.cs @@ -8,109 +8,49 @@ public record Achievement public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("imageUrl")] - public string? ImageUrl - { - get; - set; - } + public string? ImageUrl { get; set; } [JsonPropertyName("assetPath")] - public string? AssetPath - { - get; - set; - } + public string? AssetPath { get; set; } [JsonPropertyName("rewards")] - public List? Rewards - { - get; - set; - } + public List? Rewards { get; set; } [JsonPropertyName("conditions")] - public AchievementQuestConditionTypes? Conditions - { - get; - set; - } + public AchievementQuestConditionTypes? Conditions { get; set; } [JsonPropertyName("instantComplete")] - public bool? InstantComplete - { - get; - set; - } + public bool? InstantComplete { get; set; } [JsonPropertyName("showNotificationsInGame")] - public bool? ShowNotificationsInGame - { - get; - set; - } + public bool? ShowNotificationsInGame { get; set; } [JsonPropertyName("showProgress")] - public bool? ShowProgress - { - get; - set; - } + public bool? ShowProgress { get; set; } [JsonPropertyName("prefab")] - public string? Prefab - { - get; - set; - } + public string? Prefab { get; set; } [JsonPropertyName("rarity")] - public string? Rarity - { - get; - set; - } + public string? Rarity { get; set; } [JsonPropertyName("hidden")] - public bool? Hidden - { - get; - set; - } + public bool? Hidden { get; set; } [JsonPropertyName("showConditions")] - public bool? ShowConditions - { - get; - set; - } + public bool? ShowConditions { get; set; } [JsonPropertyName("progressBarEnabled")] - public bool? ProgressBarEnabled - { - get; - set; - } + public bool? ProgressBarEnabled { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } } public record AchievementQuestConditionTypes @@ -119,37 +59,17 @@ public record AchievementQuestConditionTypes public Dictionary ExtensionData { get; set; } [JsonPropertyName("started")] - public List? Started - { - get; - set; - } + public List? Started { get; set; } [JsonPropertyName("availableForFinish")] - public List? AvailableForFinish - { - get; - set; - } + public List? AvailableForFinish { get; set; } [JsonPropertyName("availableForStart")] - public List? AvailableForStart - { - get; - set; - } + public List? AvailableForStart { get; set; } [JsonPropertyName("success")] - public List? Success - { - get; - set; - } + public List? Success { get; set; } [JsonPropertyName("fail")] - public List? Fail - { - get; - set; - } + public List? Fail { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs index 3548f501..c483a81d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs @@ -13,223 +13,107 @@ public record BotBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } /// /// SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) /// [JsonPropertyName("sessionId")] - public string? SessionId - { - get; - set; - } + public string? SessionId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("savage")] - public string? Savage - { - get; - set; - } + public string? Savage { get; set; } [JsonPropertyName("karmaValue")] - public double? KarmaValue - { - get; - set; - } + public double? KarmaValue { get; set; } [JsonPropertyName("Info")] - public Info? Info - { - get; - set; - } + public Info? Info { get; set; } [JsonPropertyName("Customization")] - public Customization? Customization - { - get; - set; - } + public Customization? Customization { get; set; } [JsonPropertyName("Health")] - public BotBaseHealth? Health - { - get; - set; - } + public BotBaseHealth? Health { get; set; } [JsonPropertyName("Inventory")] - public BotBaseInventory? Inventory - { - get; - set; - } + public BotBaseInventory? Inventory { get; set; } [JsonPropertyName("Skills")] - public Skills? Skills - { - get; - set; - } + public Skills? Skills { get; set; } [JsonPropertyName("Stats")] - public Stats? Stats - { - get; - set; - } + public Stats? Stats { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("Encyclopedia")] - public Dictionary? Encyclopedia - { - get; - set; - } + public Dictionary? Encyclopedia { get; set; } [JsonPropertyName("TaskConditionCounters")] - public Dictionary? TaskConditionCounters - { - get; - set; - } + public Dictionary? TaskConditionCounters { get; set; } [JsonPropertyName("InsuredItems")] - public List? InsuredItems - { - get; - set; - } + public List? InsuredItems { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("Hideout")] - public Hideout? Hideout - { - get; - set; - } + public Hideout? Hideout { get; set; } [JsonPropertyName("Quests")] - public List? Quests - { - get; - set; - } + public List? Quests { get; set; } [JsonPropertyName("TradersInfo")] - public Dictionary? TradersInfo - { - get; - set; - } + public Dictionary? TradersInfo { get; set; } [JsonPropertyName("UnlockedInfo")] - public UnlockedInfo? UnlockedInfo - { - get; - set; - } + public UnlockedInfo? UnlockedInfo { get; set; } [JsonPropertyName("RagfairInfo")] - public RagfairInfo? RagfairInfo - { - get; - set; - } + public RagfairInfo? RagfairInfo { get; set; } /// /// Achievement id and timestamp /// [JsonPropertyName("Achievements")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Achievements - { - get; - set; - } + public Dictionary? Achievements { get; set; } [JsonPropertyName("RepeatableQuests")] - public List? RepeatableQuests - { - get; - set; - } + public List? RepeatableQuests { get; set; } [JsonPropertyName("Bonuses")] - public List? Bonuses - { - get; - set; - } + public List? Bonuses { get; set; } [JsonPropertyName("Notes")] - public Notes? Notes - { - get; - set; - } + public Notes? Notes { get; set; } [JsonPropertyName("CarExtractCounts")] - public Dictionary? CarExtractCounts - { - get; - set; - } + public Dictionary? CarExtractCounts { get; set; } [JsonPropertyName("CoopExtractCounts")] - public Dictionary? CoopExtractCounts - { - get; - set; - } + public Dictionary? CoopExtractCounts { get; set; } [JsonPropertyName("SurvivorClass")] - public SurvivorClass? SurvivorClass - { - get; - set; - } + public SurvivorClass? SurvivorClass { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("WishList")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public DictionaryOrList? WishList - { - get; - set; - } + public DictionaryOrList? WishList { get; set; } [JsonPropertyName("moneyTransferLimitData")] - public MoneyTransferLimits? MoneyTransferLimitData - { - get; - set; - } + public MoneyTransferLimits? MoneyTransferLimitData { get; set; } /// /// SPT specific property used during bot generation in raid /// [JsonPropertyName("sptIsPmc")] - public bool? IsPmc - { - get; - set; - } + public bool? IsPmc { get; set; } } public record MoneyTransferLimits @@ -242,32 +126,16 @@ public record MoneyTransferLimits /// TODO: Implement /// [JsonPropertyName("nextResetTime")] - public double? NextResetTime - { - get; - set; - } + public double? NextResetTime { get; set; } [JsonPropertyName("remainingLimit")] - public double? RemainingLimit - { - get; - set; - } + public double? RemainingLimit { get; set; } [JsonPropertyName("totalLimit")] - public double? TotalLimit - { - get; - set; - } + public double? TotalLimit { get; set; } [JsonPropertyName("resetInterval")] - public double? ResetInterval - { - get; - set; - } + public double? ResetInterval { get; set; } } public record TaskConditionCounter @@ -276,35 +144,19 @@ public record TaskConditionCounter public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } /// /// Quest id /// [JsonPropertyName("sourceId")] - public string? SourceId - { - get; - set; - } + public string? SourceId { get; set; } } public record UnlockedInfo @@ -313,11 +165,7 @@ public record UnlockedInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("unlockedProductionRecipe")] - public HashSet? UnlockedProductionRecipe - { - get; - set; - } + public HashSet? UnlockedProductionRecipe { get; set; } } public record Info @@ -329,234 +177,94 @@ public record Info private string? _voice; - public string? EntryPoint - { - get; - set; - } + public string? EntryPoint { get; set; } - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } - public string? MainProfileNickname - { - get; - set; - } + public string? MainProfileNickname { get; set; } - public string? LowerNickname - { - get; - set; - } + public string? LowerNickname { get; set; } public string? Side { - get - { - return _side; - } - set - { - _side = string.Intern(value); - } + get { return _side; } + set { _side = string.Intern(value); } } - public bool? SquadInviteRestriction - { - get; - set; - } + public bool? SquadInviteRestriction { get; set; } // Confirmed in client - public int? PrestigeLevel - { - get; - set; - } + public int? PrestigeLevel { get; set; } public string? Voice { - get - { - return _voice; - } - set - { - _voice = value == null ? null : string.Intern(value); - } + get { return _voice; } + set { _voice = value == null ? null : string.Intern(value); } } - public int? Level - { - get; - set; - } + public int? Level { get; set; } //Experience the bot has gained // Confirmed in client - public int? Experience - { - get; - set; - } + public int? Experience { get; set; } - public List? Bans - { - get; - set; - } + public List? Bans { get; set; } - public bool? BannedState - { - get; - set; - } + public bool? BannedState { get; set; } - public long? BannedUntil - { - get; - set; - } + public long? BannedUntil { get; set; } - public bool? IsStreamerModeAvailable - { - get; - set; - } + public bool? IsStreamerModeAvailable { get; set; } // Confirmed in client [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? RegistrationDate - { - get; - set; - } + public int? RegistrationDate { get; set; } - public string? GameVersion - { - get; - set; - } + public string? GameVersion { get; set; } - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } - public MemberCategory? SelectedMemberCategory - { - get; - set; - } + public MemberCategory? SelectedMemberCategory { get; set; } [JsonPropertyName("lockedMoveCommands")] - public bool? LockedMoveCommands - { - get; - set; - } + public bool? LockedMoveCommands { get; set; } - public double? SavageLockTime - { - get; - set; - } + public double? SavageLockTime { get; set; } - public long? LastTimePlayedAsSavage - { - get; - set; - } + public long? LastTimePlayedAsSavage { get; set; } - public BotInfoSettings? Settings - { - get; - set; - } + public BotInfoSettings? Settings { get; set; } - public List? NeedWipeOptions - { - get; - set; - } + public List? NeedWipeOptions { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("lastCompletedWipe")] - public LastCompleted? LastCompletedWipe - { - get; - set; - } + public LastCompleted? LastCompletedWipe { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("lastWipeTimestamp")] - public LastCompleted? LastWipeTimestamp - { - get; - set; - } + public LastCompleted? LastWipeTimestamp { get; set; } - public double? AccountType - { - get; - set; - } + public double? AccountType { get; set; } - public long? NicknameChangeDate - { - get; - set; - } + public long? NicknameChangeDate { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("lastCompletedEvent")] - public LastCompleted? LastCompletedEvent - { - get; - set; - } + public LastCompleted? LastCompletedEvent { get; set; } [JsonPropertyName("isMigratedSkills")] - public bool? IsMigratedSkills - { - get; - set; - } + public bool? IsMigratedSkills { get; set; } - public string? GroupId - { - get; - set; - } + public string? GroupId { get; set; } - public string? TeamId - { - get; - set; - } + public string? TeamId { get; set; } - public bool? HasCoopExtension - { - get; - set; - } + public bool? HasCoopExtension { get; set; } - public bool? HasPveGame - { - get; - set; - } + public bool? HasPveGame { get; set; } - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record BotInfoSettings @@ -569,52 +277,24 @@ public record BotInfoSettings public string? Role { - get - { - return _role; - } - set - { - _role = value == null ? null : string.Intern(value); - } + get { return _role; } + set { _role = value == null ? null : string.Intern(value); } } public string? BotDifficulty { - get - { - return _botDifficulty; - } - set - { - _botDifficulty = value == null ? null : string.Intern(value); - } + get { return _botDifficulty; } + set { _botDifficulty = value == null ? null : string.Intern(value); } } // Experience given for being killed - public int? Experience - { - get; - set; - } + public int? Experience { get; set; } - public double? StandingForKill - { - get; - set; - } + public double? StandingForKill { get; set; } - public double? AggressorBonus - { - get; - set; - } + public double? AggressorBonus { get; set; } - public bool? UseSimpleAnimator - { - get; - set; - } + public bool? UseSimpleAnimator { get; set; } } public record Ban @@ -623,18 +303,10 @@ public record Ban public Dictionary ExtensionData { get; set; } [JsonPropertyName("banType")] - public BanType? BanType - { - get; - set; - } + public BanType? BanType { get; set; } [JsonPropertyName("dateTime")] - public long? DateTime - { - get; - set; - } + public long? DateTime { get; set; } } [EftEnumConverter] @@ -665,62 +337,32 @@ public record Customization public string? Head { - get - { - return _head; - } - set - { - _head = value == null ? null : string.Intern(value); - } + get { return _head; } + set { _head = value == null ? null : string.Intern(value); } } public string? Body { - get - { - return _body; - } - set - { - _body = value == null ? null : string.Intern(value); - } + get { return _body; } + set { _body = value == null ? null : string.Intern(value); } } public string? Feet { - get - { - return _feet; - } - set - { - _feet = value == null ? null : string.Intern(value); - } + get { return _feet; } + set { _feet = value == null ? null : string.Intern(value); } } public string? Hands { - get - { - return _hands; - } - set - { - _hands = value == null ? null : string.Intern(value); - } + get { return _hands; } + set { _hands = value == null ? null : string.Intern(value); } } public string? DogTag { - get - { - return _dogtag; - } - set - { - _dogtag = value == null ? null : string.Intern(value); - } + get { return _dogtag; } + set { _dogtag = value == null ? null : string.Intern(value); } } } @@ -729,49 +371,21 @@ public record BotBaseHealth [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public CurrentMinMax? Hydration - { - get; - set; - } + public CurrentMinMax? Hydration { get; set; } - public CurrentMinMax? Energy - { - get; - set; - } + public CurrentMinMax? Energy { get; set; } - public CurrentMinMax? Temperature - { - get; - set; - } + public CurrentMinMax? Temperature { get; set; } - public CurrentMinMax? Poison - { - get; - set; - } + public CurrentMinMax? Poison { get; set; } [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonPropertyName("BodyParts")] - public Dictionary? BodyParts - { - get; - set; - } + public Dictionary? BodyParts { get; set; } - public double? UpdateTime - { - get; - set; - } + public double? UpdateTime { get; set; } - public bool? Immortal - { - get; - set; - } + public bool? Immortal { get; set; } } public record BodyPartHealth @@ -779,17 +393,9 @@ public record BodyPartHealth [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public CurrentMinMax? Health - { - get; - set; - } + public CurrentMinMax? Health { get; set; } - public Dictionary? Effects - { - get; - set; - } // TODO: change key to DamageEffectType enum + public Dictionary? Effects { get; set; } // TODO: change key to DamageEffectType enum } public record BodyPartEffectProperties @@ -798,17 +404,9 @@ public record BodyPartEffectProperties public Dictionary ExtensionData { get; set; } // TODO: this was any, what actual type is it? - public object? ExtraData - { - get; - set; - } + public object? ExtraData { get; set; } - public double? Time - { - get; - set; - } + public double? Time { get; set; } } public record CurrentMinMax @@ -816,35 +414,15 @@ public record CurrentMinMax [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Current - { - get; - set; - } + public double? Current { get; set; } - public double? Minimum - { - get; - set; - } + public double? Minimum { get; set; } - public double? Maximum - { - get; - set; - } + public double? Maximum { get; set; } - public double? OverDamageReceivedMultiplier - { - get; - set; - } + public double? OverDamageReceivedMultiplier { get; set; } - public double? EnvironmentDamageMultiplier - { - get; - set; - } + public double? EnvironmentDamageMultiplier { get; set; } } public record BotBaseInventory @@ -853,82 +431,42 @@ public record BotBaseInventory public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("equipment")] - public string? Equipment - { - get; - set; - } + public string? Equipment { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("stash")] - public string? Stash - { - get; - set; - } + public string? Stash { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("sortingTable")] - public string? SortingTable - { - get; - set; - } + public string? SortingTable { get; set; } [JsonPropertyName("questRaidItems")] - public string? QuestRaidItems - { - get; - set; - } + public string? QuestRaidItems { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("questStashItems")] - public string? QuestStashItems - { - get; - set; - } + public string? QuestStashItems { get; set; } /// /// Key is hideout area enum numeric as string e.g. "24", value is area _id /// [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("hideoutAreaStashes")] - public Dictionary? HideoutAreaStashes - { - get; - set; - } + public Dictionary? HideoutAreaStashes { get; set; } [JsonPropertyName("fastPanel")] - public Dictionary? FastPanel - { - get; - set; - } + public Dictionary? FastPanel { get; set; } [JsonPropertyName("favoriteItems")] - public List? FavoriteItems - { - get; - set; - } + public List? FavoriteItems { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("hideoutCustomizationStashId")] - public string? HideoutCustomizationStashId - { - get; - set; - } + public string? HideoutCustomizationStashId { get; set; } } public record Skills @@ -936,38 +474,18 @@ public record Skills [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Common - { - get; - set; - } + public List? Common { get; set; } - public List? Mastering - { - get; - set; - } + public List? Mastering { get; set; } - public double? Points - { - get; - set; - } + public double? Points { get; set; } } public record MasterySkill { - public string? Id - { - get; - set; - } + public string? Id { get; set; } - public double? Progress - { - get; - set; - } + public double? Progress { get; set; } } public record CommonSkill @@ -975,43 +493,19 @@ public record CommonSkill [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? PointsEarnedDuringSession - { - get; - set; - } + public double? PointsEarnedDuringSession { get; set; } - public long? LastAccess - { - get; - set; - } + public long? LastAccess { get; set; } - public SkillTypes? Id - { - get; - set; - } + public SkillTypes? Id { get; set; } - public double? Progress - { - get; - set; - } + public double? Progress { get; set; } [JsonPropertyName("max")] - public int? Max - { - get; - set; - } + public int? Max { get; set; } [JsonPropertyName("min")] - public int? Min - { - get; - set; - } + public int? Min { get; set; } } public record Stats @@ -1019,11 +513,7 @@ public record Stats [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public EftStats? Eft - { - get; - set; - } + public EftStats? Eft { get; set; } } public record EftStats @@ -1031,111 +521,42 @@ public record EftStats [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? CarriedQuestItems - { - get; - set; - } + public List? CarriedQuestItems { get; set; } - public List? Victims - { - get; - set; - } + public List? Victims { get; set; } - public double? TotalSessionExperience - { - get; - set; - } + public double? TotalSessionExperience { get; set; } - public long? LastSessionDate - { - get; - set; - } + public long? LastSessionDate { get; set; } - public SessionCounters? SessionCounters - { - get; - set; - } + public SessionCounters? SessionCounters { get; set; } - public OverallCounters? OverallCounters - { - get; - set; - } + public OverallCounters? OverallCounters { get; set; } - public float? SessionExperienceMult - { - get; - set; - } - - public float? ExperienceBonusMult - { - get; - set; - } + public float? SessionExperienceMult { get; set; } + public float? ExperienceBonusMult { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Aggressor? Aggressor - { - get; - set; - } + public Aggressor? Aggressor { get; set; } - public List? DroppedItems - { - get; - set; - } + public List? DroppedItems { get; set; } - public List? FoundInRaidItems - { - get; - set; - } + public List? FoundInRaidItems { get; set; } - public DamageHistory? DamageHistory - { - get; - set; - } + public DamageHistory? DamageHistory { get; set; } - public DeathCause? DeathCause - { - get; - set; - } + public DeathCause? DeathCause { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public LastPlayerState? LastPlayerState - { - get; - set; - } + public LastPlayerState? LastPlayerState { get; set; } - public long? TotalInGameTime - { - get; - set; - } + public long? TotalInGameTime { get; set; } - public string? SurvivorClass - { - get; - set; - } + public string? SurvivorClass { get; set; } [JsonPropertyName("sptLastRaidFenceRepChange")] - public float? SptLastRaidFenceRepChange - { - get; - set; - } + public float? SptLastRaidFenceRepChange { get; set; } } public record DroppedItem @@ -1143,23 +564,11 @@ public record DroppedItem [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } - public string? ZoneId - { - get; - set; - } + public string? ZoneId { get; set; } } public record FoundInRaidItem @@ -1167,17 +576,9 @@ public record FoundInRaidItem [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } } public record Victim @@ -1185,83 +586,31 @@ public record Victim [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? AccountId - { - get; - set; - } + public string? AccountId { get; set; } - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } - public string? Name - { - get; - set; - } + public string? Name { get; set; } - public string? Side - { - get; - set; - } + public string? Side { get; set; } - public string? BodyPart - { - get; - set; - } + public string? BodyPart { get; set; } - public string? Time - { - get; - set; - } + public string? Time { get; set; } - public double? Distance - { - get; - set; - } + public double? Distance { get; set; } - public double? Level - { - get; - set; - } + public double? Level { get; set; } - public string? Weapon - { - get; - set; - } + public string? Weapon { get; set; } - public double? PrestigeLevel - { - get; - set; - } + public double? PrestigeLevel { get; set; } - public string? ColliderType - { - get; - set; - } + public string? ColliderType { get; set; } - public string? Role - { - get; - set; - } + public string? Role { get; set; } - public string? Location - { - get; - set; - } + public string? Location { get; set; } } public record SessionCounters @@ -1269,11 +618,7 @@ public record SessionCounters [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record OverallCounters @@ -1281,11 +626,7 @@ public record OverallCounters [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record CounterKeyValue @@ -1293,17 +634,9 @@ public record CounterKeyValue [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Key - { - get; - set; - } + public List? Key { get; set; } - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record Aggressor @@ -1311,80 +644,32 @@ public record Aggressor [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? PrestigeLevel - { - get; - set; - } + public double? PrestigeLevel { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? AccountId - { - get; - set; - } + public string? AccountId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? MainProfileNickname - { - get; - set; - } + public string? MainProfileNickname { get; set; } - public string? Name - { - get; - set; - } + public string? Name { get; set; } - public string? Side - { - get; - set; - } + public string? Side { get; set; } - public string? BodyPart - { - get; - set; - } + public string? BodyPart { get; set; } - public string? HeadSegment - { - get; - set; - } + public string? HeadSegment { get; set; } - public string? WeaponName - { - get; - set; - } + public string? WeaponName { get; set; } - public string? Category - { - get; - set; - } + public string? Category { get; set; } - public string? ColliderType - { - get; - set; - } + public string? ColliderType { get; set; } - public string? Role - { - get; - set; - } + public string? Role { get; set; } } public record DamageHistory @@ -1392,26 +677,14 @@ public record DamageHistory [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? LethalDamagePart - { - get; - set; - } + public string? LethalDamagePart { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public DamageStats? LethalDamage - { - get; - set; - } + public DamageStats? LethalDamage { get; set; } [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public BodyPartsDamageHistory? BodyParts - { - get; - set; - } + public BodyPartsDamageHistory? BodyParts { get; set; } } public record BodyPartsDamageHistory @@ -1419,53 +692,21 @@ public record BodyPartsDamageHistory [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Head - { - get; - set; - } + public List? Head { get; set; } - public List? Chest - { - get; - set; - } + public List? Chest { get; set; } - public List? Stomach - { - get; - set; - } + public List? Stomach { get; set; } - public List? LeftArm - { - get; - set; - } + public List? LeftArm { get; set; } - public List? RightArm - { - get; - set; - } + public List? RightArm { get; set; } - public List? LeftLeg - { - get; - set; - } + public List? LeftLeg { get; set; } - public List? RightLeg - { - get; - set; - } + public List? RightLeg { get; set; } - public List? Common - { - get; - set; - } + public List? Common { get; set; } } public record DamageStats @@ -1473,42 +714,18 @@ public record DamageStats [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double? Amount - { - get; - set; - } + public double? Amount { get; set; } - public string? Type - { - get; - set; - } + public string? Type { get; set; } - public string? SourceId - { - get; - set; - } + public string? SourceId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? OverDamageFrom - { - get; - set; - } + public string? OverDamageFrom { get; set; } - public bool? Blunt - { - get; - set; - } + public bool? Blunt { get; set; } - public double? ImpactsCount - { - get; - set; - } + public double? ImpactsCount { get; set; } } public record DeathCause @@ -1517,31 +734,15 @@ public record DeathCause public Dictionary ExtensionData { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] - public DamageType? DamageType - { - get; - set; - } + public DamageType? DamageType { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] - public PlayerSide? Side - { - get; - set; - } + public PlayerSide? Side { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] - public WildSpawnType? Role - { - get; - set; - } + public WildSpawnType? Role { get; set; } - public string? WeaponId - { - get; - set; - } + public string? WeaponId { get; set; } } public record LastPlayerState @@ -1549,24 +750,12 @@ public record LastPlayerState [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public LastPlayerStateInfo? Info - { - get; - set; - } + public LastPlayerStateInfo? Info { get; set; } - public Dictionary? Customization - { - get; - set; - } + public Dictionary? Customization { get; set; } // TODO: there is no definition on TS just any - public object? Equipment - { - get; - set; - } + public object? Equipment { get; set; } } public record LastPlayerStateInfo @@ -1574,29 +763,13 @@ public record LastPlayerStateInfo [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } - public string? Side - { - get; - set; - } + public string? Side { get; set; } - public double? Level - { - get; - set; - } + public double? Level { get; set; } - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } } public record BackendCounter @@ -1605,25 +778,13 @@ public record BackendCounter public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("qid")] - public string? QId - { - get; - set; - } + public string? QId { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record InsuredItem @@ -1635,18 +796,10 @@ public record InsuredItem /// Trader ID item was insured by /// [JsonPropertyName("tid")] - public string? TId - { - get; - set; - } + public string? TId { get; set; } [JsonPropertyName("itemId")] - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } } public record Hideout @@ -1654,58 +807,26 @@ public record Hideout [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary? Production - { - get; - set; - } + public Dictionary? Production { get; set; } - public List? Areas - { - get; - set; - } + public List? Areas { get; set; } - public Dictionary? Improvements - { - get; - set; - } + public Dictionary? Improvements { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public HideoutCounters? HideoutCounters - { - get; - set; - } + public HideoutCounters? HideoutCounters { get; set; } /// /// 32 char hex value /// - public string? Seed - { - get; - set; - } + public string? Seed { get; set; } - public Dictionary? MannequinPoses - { - get; - set; - } + public Dictionary? MannequinPoses { get; set; } [JsonPropertyName("sptUpdateLastRunTimestamp")] - public long? SptUpdateLastRunTimestamp - { - get; - set; - } + public long? SptUpdateLastRunTimestamp { get; set; } - public Dictionary? Customization - { - get; - set; - } + public Dictionary? Customization { get; set; } } public record HideoutCounters @@ -1714,32 +835,16 @@ public record HideoutCounters public Dictionary ExtensionData { get; set; } [JsonPropertyName("fuelCounter")] - public double? FuelCounter - { - get; - set; - } + public double? FuelCounter { get; set; } [JsonPropertyName("airFilterCounter")] - public double? AirFilterCounter - { - get; - set; - } + public double? AirFilterCounter { get; set; } [JsonPropertyName("waterFilterCounter")] - public double? WaterFilterCounter - { - get; - set; - } + public double? WaterFilterCounter { get; set; } [JsonPropertyName("craftingTimeCounter")] - public double? CraftingTimeCounter - { - get; - set; - } + public double? CraftingTimeCounter { get; set; } } public record HideoutImprovement @@ -1748,18 +853,10 @@ public record HideoutImprovement public Dictionary ExtensionData { get; set; } [JsonPropertyName("completed")] - public bool? Completed - { - get; - set; - } + public bool? Completed { get; set; } [JsonPropertyName("improveCompleteTimestamp")] - public long? ImproveCompleteTimestamp - { - get; - set; - } + public long? ImproveCompleteTimestamp { get; set; } } public record Production // use this instead of productive and scavcase @@ -1767,152 +864,76 @@ public record Production // use this instead of productive and scavcase [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? Products - { - get; - set; - } + public List? Products { get; set; } /// /// Seconds passed of production /// - public double? Progress - { - get; - set; - } + public double? Progress { get; set; } /// /// Is craft in some state of being worked on by client (crafting/ready to pick up) /// [JsonPropertyName("inProgress")] - public bool? InProgress - { - get; - set; - } + public bool? InProgress { get; set; } - public long? StartTimestamp - { - get; - set; - } + public long? StartTimestamp { get; set; } - public double? SkipTime - { - get; - set; - } + public double? SkipTime { get; set; } /// /// Seconds needed to fully craft /// - public double? ProductionTime - { - get; - set; - } + public double? ProductionTime { get; set; } - public List? GivenItemsInStart - { - get; - set; - } + public List? GivenItemsInStart { get; set; } - public bool? Interrupted - { - get; - set; - } + public bool? Interrupted { get; set; } - public string? Code - { - get; - set; - } + public string? Code { get; set; } - public bool? Decoded - { - get; - set; - } + public bool? Decoded { get; set; } - public bool? AvailableForFinish - { - get; - set; - } + public bool? AvailableForFinish { get; set; } /// /// Used in hideout production.json /// - public bool? needFuelForAllProductionTime - { - get; - set; - } + public bool? needFuelForAllProductionTime { get; set; } /// /// Used when sending data to client /// - public bool? NeedFuelForAllProductionTime - { - get; - set; - } + public bool? NeedFuelForAllProductionTime { get; set; } [JsonPropertyName("sptIsScavCase")] - public bool? SptIsScavCase - { - get; - set; - } + public bool? SptIsScavCase { get; set; } /// /// Some crafts are always inProgress, but need to be reset, e.g. water collector /// [JsonPropertyName("sptIsComplete")] - public bool? SptIsComplete - { - get; - set; - } + public bool? SptIsComplete { get; set; } /// /// Is the craft a Continuous, e.g. bitcoins/water collector /// [JsonPropertyName("sptIsContinuous")] - public bool? SptIsContinuous - { - get; - set; - } + public bool? SptIsContinuous { get; set; } /// /// Stores a list of tools used in this craft and whether they're FiR, to give back once the craft is done /// [JsonPropertyName("sptRequiredTools")] - public List? SptRequiredTools - { - get; - set; - } + public List? SptRequiredTools { get; set; } /// /// Craft is cultist circle sacrifice /// [JsonPropertyName("sptIsCultistCircle")] - public bool? SptIsCultistCircle - { - get; - set; - } + public bool? SptIsCultistCircle { get; set; } - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } } public record BotHideoutArea @@ -1921,63 +942,31 @@ public record BotHideoutArea public Dictionary ExtensionData { get; set; } [JsonPropertyName("type")] - public HideoutAreas? Type - { - get; - set; - } + public HideoutAreas? Type { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("active")] - public bool? Active - { - get; - set; - } + public bool? Active { get; set; } [JsonPropertyName("passiveBonusesEnabled")] - public bool? PassiveBonusesEnabled - { - get; - set; - } + public bool? PassiveBonusesEnabled { get; set; } /// /// Must be integer /// [JsonPropertyName("completeTime")] - public int? CompleteTime - { - get; - set; - } + public int? CompleteTime { get; set; } [JsonPropertyName("constructing")] - public bool? Constructing - { - get; - set; - } + public bool? Constructing { get; set; } [JsonPropertyName("slots")] - public List? Slots - { - get; - set; - } + public List? Slots { get; set; } [JsonPropertyName("lastRecipe")] - public string? LastRecipe - { - get; - set; - } + public string? LastRecipe { get; set; } } public record HideoutSlot @@ -1989,18 +978,10 @@ public record HideoutSlot /// SPT specific value to keep track of what index this slot is (0,1,2,3 etc.) /// [JsonPropertyName("locationIndex")] - public int? LocationIndex - { - get; - set; - } + public int? LocationIndex { get; set; } [JsonPropertyName("item")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record LastCompleted @@ -2009,11 +990,7 @@ public record LastCompleted public Dictionary ExtensionData { get; set; } [JsonPropertyName("$oid")] - public string? OId - { - get; - set; - } + public string? OId { get; set; } } public record Notes @@ -2022,11 +999,7 @@ public record Notes public Dictionary ExtensionData { get; set; } [JsonPropertyName("Notes")] - public List? DataNotes - { - get; - set; - } + public List? DataNotes { get; set; } } public enum SurvivorClass @@ -2035,7 +1008,7 @@ public enum SurvivorClass NEUTRALIZER = 1, MARAUDER = 2, PARAMEDIC = 3, - SURVIVOR = 4 + SURVIVOR = 4, } public record Quests @@ -2044,49 +1017,25 @@ public record Quests public Dictionary ExtensionData { get; set; } [JsonPropertyName("qid")] - public string? QId - { - get; - set; - } + public string? QId { get; set; } [JsonPropertyName("startTime")] - public long? StartTime - { - get; - set; - } + public long? StartTime { get; set; } [JsonPropertyName("status")] - public QuestStatusEnum? Status - { - get; - set; - } + public QuestStatusEnum? Status { get; set; } [JsonPropertyName("statusTimers")] - public Dictionary? StatusTimers - { - get; - set; - } + public Dictionary? StatusTimers { get; set; } /// /// Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client /// [JsonPropertyName("completedConditions")] - public List? CompletedConditions - { - get; - set; - } + public List? CompletedConditions { get; set; } [JsonPropertyName("availableAfter")] - public long? AvailableAfter - { - get; - set; - } + public long? AvailableAfter { get; set; } } public record TraderInfo @@ -2095,46 +1044,22 @@ public record TraderInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("loyaltyLevel")] - public int? LoyaltyLevel - { - get; - set; - } + public int? LoyaltyLevel { get; set; } [JsonPropertyName("salesSum")] - public double? SalesSum - { - get; - set; - } + public double? SalesSum { get; set; } [JsonPropertyName("standing")] - public double? Standing - { - get; - set; - } + public double? Standing { get; set; } [JsonPropertyName("nextResupply")] - public double? NextResupply - { - get; - set; - } + public double? NextResupply { get; set; } [JsonPropertyName("unlocked")] - public bool? Unlocked - { - get; - set; - } + public bool? Unlocked { get; set; } [JsonPropertyName("disabled")] - public bool? Disabled - { - get; - set; - } + public bool? Disabled { get; set; } } public record RagfairInfo @@ -2143,39 +1068,19 @@ public record RagfairInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("rating")] - public double? Rating - { - get; - set; - } + public double? Rating { get; set; } [JsonPropertyName("isRatingGrowing")] - public bool? IsRatingGrowing - { - get; - set; - } + public bool? IsRatingGrowing { get; set; } [JsonPropertyName("offers")] - public List? Offers - { - get; - set; - } + public List? Offers { get; set; } [JsonPropertyName("sellSum")] - public double? SellSum - { - get; - set; - } + public double? SellSum { get; set; } [JsonPropertyName("notSellSum")] - public double? NotSellSum - { - get; - set; - } + public double? NotSellSum { get; set; } } public record Bonus @@ -2184,73 +1089,33 @@ public record Bonus public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public BonusType? Type - { - get; - set; - } + public BonusType? Type { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("passive")] - public bool? IsPassive - { - get; - set; - } + public bool? IsPassive { get; set; } [JsonPropertyName("production")] - public bool? IsProduction - { - get; - set; - } + public bool? IsProduction { get; set; } [JsonPropertyName("visible")] - public bool? IsVisible - { - get; - set; - } + public bool? IsVisible { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("icon")] - public string? Icon - { - get; - set; - } + public string? Icon { get; set; } [JsonPropertyName("filter")] - public List? Filter - { - get; - set; - } + public List? Filter { get; set; } [JsonPropertyName("skillType")] - public BonusSkillType? SkillType - { - get; - set; - } + public BonusSkillType? SkillType { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotCore.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotCore.cs index 5b0763ab..1f7b9c11 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotCore.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotCore.cs @@ -8,919 +8,395 @@ public record BotCore public Dictionary ExtensionData { get; set; } [JsonPropertyName("SAVAGE_KILL_DIST")] - public double? SavageKillDistance - { - get; - set; - } + public double? SavageKillDistance { get; set; } [JsonPropertyName("SOUND_DOOR_BREACH_METERS")] - public double? SoundDoorBreachMeters - { - get; - set; - } + public double? SoundDoorBreachMeters { get; set; } [JsonPropertyName("SOUND_DOOR_OPEN_METERS")] - public double? SoundDoorOpenMeters - { - get; - set; - } + public double? SoundDoorOpenMeters { get; set; } [JsonPropertyName("STEP_NOISE_DELTA")] - public double? StepNoiseDelta - { - get; - set; - } + public double? StepNoiseDelta { get; set; } [JsonPropertyName("JUMP_NOISE_DELTA")] - public double? JumpNoiseDelta - { - get; - set; - } + public double? JumpNoiseDelta { get; set; } [JsonPropertyName("GUNSHOT_SPREAD")] - public double? GunshotSpread - { - get; - set; - } + public double? GunshotSpread { get; set; } [JsonPropertyName("GUNSHOT_SPREAD_SILENCE")] - public double? GunshotSpreadSilence - { - get; - set; - } + public double? GunshotSpreadSilence { get; set; } [JsonPropertyName("BASE_WALK_SPEREAD2")] - public double? BaseWalkSpread2 - { - get; - set; - } + public double? BaseWalkSpread2 { get; set; } [JsonPropertyName("MOVE_SPEED_COEF_MAX")] - public double? MoveSpeedCoefficientMax - { - get; - set; - } + public double? MoveSpeedCoefficientMax { get; set; } [JsonPropertyName("SPEED_SERV_SOUND_COEF_A")] - public double? SpeedServiceSoundCoefficientA - { - get; - set; - } + public double? SpeedServiceSoundCoefficientA { get; set; } [JsonPropertyName("SPEED_SERV_SOUND_COEF_B")] - public double? SpeedServiceSoundCoefficientB - { - get; - set; - } + public double? SpeedServiceSoundCoefficientB { get; set; } [JsonPropertyName("G")] - public double? Gravity - { - get; - set; - } + public double? Gravity { get; set; } [JsonPropertyName("STAY_COEF")] - public double? StayCoefficient - { - get; - set; - } + public double? StayCoefficient { get; set; } [JsonPropertyName("SIT_COEF")] - public double? SitCoefficient - { - get; - set; - } + public double? SitCoefficient { get; set; } [JsonPropertyName("LAY_COEF")] - public double? LayCoefficient - { - get; - set; - } + public double? LayCoefficient { get; set; } [JsonPropertyName("MAX_ITERATIONS")] - public double? MaxIterations - { - get; - set; - } + public double? MaxIterations { get; set; } [JsonPropertyName("START_DIST_TO_COV")] - public double? StartDistanceToCover - { - get; - set; - } + public double? StartDistanceToCover { get; set; } [JsonPropertyName("MAX_DIST_TO_COV")] - public double? MaxDistanceToCover - { - get; - set; - } + public double? MaxDistanceToCover { get; set; } [JsonPropertyName("STAY_HEIGHT")] - public double? StayHeight - { - get; - set; - } + public double? StayHeight { get; set; } [JsonPropertyName("CLOSE_POINTS")] - public double? ClosePoints - { - get; - set; - } + public double? ClosePoints { get; set; } [JsonPropertyName("COUNT_TURNS")] - public double? CountTurns - { - get; - set; - } + public double? CountTurns { get; set; } [JsonPropertyName("SIMPLE_POINT_LIFE_TIME_SEC")] - public double? SimplePointLifetimeSeconds - { - get; - set; - } + public double? SimplePointLifetimeSeconds { get; set; } [JsonPropertyName("DANGER_POINT_LIFE_TIME_SEC")] - public double? DangerPointLifetimeSeconds - { - get; - set; - } + public double? DangerPointLifetimeSeconds { get; set; } [JsonPropertyName("DANGER_POWER")] - public double? DangerPower - { - get; - set; - } + public double? DangerPower { get; set; } [JsonPropertyName("COVER_DIST_CLOSE")] - public double? CoverDistanceClose - { - get; - set; - } + public double? CoverDistanceClose { get; set; } [JsonPropertyName("GOOD_DIST_TO_POINT")] - public double? GoodDistanceToPoint - { - get; - set; - } + public double? GoodDistanceToPoint { get; set; } [JsonPropertyName("COVER_TOOFAR_FROM_BOSS")] - public double? CoverTooFarFromBoss - { - get; - set; - } + public double? CoverTooFarFromBoss { get; set; } [JsonPropertyName("COVER_TOOFAR_FROM_BOSS_SQRT")] - public double? CoverTooFarFromBossSqrt - { - get; - set; - } + public double? CoverTooFarFromBossSqrt { get; set; } [JsonPropertyName("MAX_Y_DIFF_TO_PROTECT")] - public double? MaxYDifferenceToProtect - { - get; - set; - } + public double? MaxYDifferenceToProtect { get; set; } [JsonPropertyName("FLARE_POWER")] - public double? FlarePower - { - get; - set; - } + public double? FlarePower { get; set; } [JsonPropertyName("MOVE_COEF")] - public double? MoveCoefficient - { - get; - set; - } + public double? MoveCoefficient { get; set; } [JsonPropertyName("PRONE_POSE")] - public double? PronePose - { - get; - set; - } + public double? PronePose { get; set; } [JsonPropertyName("LOWER_POSE")] - public double? LowerPose - { - get; - set; - } + public double? LowerPose { get; set; } [JsonPropertyName("MAX_POSE")] - public double? MaxPose - { - get; - set; - } + public double? MaxPose { get; set; } [JsonPropertyName("FLARE_TIME")] - public double? FlareTime - { - get; - set; - } + public double? FlareTime { get; set; } [JsonPropertyName("MAX_REQUESTS__PER_GROUP")] - public double? MaxRequestsPerGroup - { - get; - set; - } + public double? MaxRequestsPerGroup { get; set; } [JsonPropertyName("UPDATE_GOAL_TIMER_SEC")] - public double? UpdateGoalTimerSeconds - { - get; - set; - } + public double? UpdateGoalTimerSeconds { get; set; } [JsonPropertyName("DIST_NOT_TO_GROUP")] - public double? DistanceNotToGroup - { - get; - set; - } + public double? DistanceNotToGroup { get; set; } [JsonPropertyName("DIST_NOT_TO_GROUP_SQR")] - public double? DistanceNotToGroupSquared - { - get; - set; - } + public double? DistanceNotToGroupSquared { get; set; } [JsonPropertyName("LAST_SEEN_POS_LIFETIME")] - public double? LastSeenPositionLifetime - { - get; - set; - } + public double? LastSeenPositionLifetime { get; set; } [JsonPropertyName("DELTA_GRENADE_START_TIME")] - public double? DeltaGrenadeStartTime - { - get; - set; - } + public double? DeltaGrenadeStartTime { get; set; } [JsonPropertyName("DELTA_GRENADE_END_TIME")] - public double? DeltaGrenadeEndTime - { - get; - set; - } + public double? DeltaGrenadeEndTime { get; set; } [JsonPropertyName("DELTA_GRENADE_RUN_DIST")] - public double? DeltaGrenadeRunDistance - { - get; - set; - } + public double? DeltaGrenadeRunDistance { get; set; } [JsonPropertyName("DELTA_GRENADE_RUN_DIST_SQRT")] - public double? DeltaGrenadeRunDistanceSqrt - { - get; - set; - } + public double? DeltaGrenadeRunDistanceSqrt { get; set; } [JsonPropertyName("PATROL_MIN_LIGHT_DIST")] - public double? PatrolMinimumLightDistance - { - get; - set; - } + public double? PatrolMinimumLightDistance { get; set; } [JsonPropertyName("HOLD_MIN_LIGHT_DIST")] - public double? HoldMinimumLightDistance - { - get; - set; - } + public double? HoldMinimumLightDistance { get; set; } [JsonPropertyName("STANDART_BOT_PAUSE_DOOR")] - public double? StandardBotPauseDoor - { - get; - set; - } + public double? StandardBotPauseDoor { get; set; } [JsonPropertyName("ARMOR_CLASS_COEF")] - public double? ArmorClassCoefficient - { - get; - set; - } + public double? ArmorClassCoefficient { get; set; } [JsonPropertyName("SHOTGUN_POWER")] - public double? ShotgunPower - { - get; - set; - } + public double? ShotgunPower { get; set; } [JsonPropertyName("RIFLE_POWER")] - public double? RiflePower - { - get; - set; - } + public double? RiflePower { get; set; } [JsonPropertyName("PISTOL_POWER")] - public double? PistolPower - { - get; - set; - } + public double? PistolPower { get; set; } [JsonPropertyName("SMG_POWER")] - public double? SMGPower - { - get; - set; - } + public double? SMGPower { get; set; } [JsonPropertyName("SNIPE_POWER")] - public double? SniperPower - { - get; - set; - } + public double? SniperPower { get; set; } [JsonPropertyName("GESTUS_PERIOD_SEC")] - public double? GestusPeriodSeconds - { - get; - set; - } + public double? GestusPeriodSeconds { get; set; } [JsonPropertyName("GESTUS_AIMING_DELAY")] - public double? GestusAimingDelay - { - get; - set; - } + public double? GestusAimingDelay { get; set; } [JsonPropertyName("GESTUS_REQUEST_LIFETIME")] - public double? GestusRequestLifetime - { - get; - set; - } + public double? GestusRequestLifetime { get; set; } [JsonPropertyName("GESTUS_FIRST_STAGE_MAX_TIME")] - public double? GestusFirstStageMaxTime - { - get; - set; - } + public double? GestusFirstStageMaxTime { get; set; } [JsonPropertyName("GESTUS_SECOND_STAGE_MAX_TIME")] - public double? GestusSecondStageMaxTime - { - get; - set; - } + public double? GestusSecondStageMaxTime { get; set; } [JsonPropertyName("GESTUS_MAX_ANSWERS")] - public double? GestusMaxAnswers - { - get; - set; - } + public double? GestusMaxAnswers { get; set; } [JsonPropertyName("GESTUS_FUCK_TO_SHOOT")] - public double? GestusFuckToShoot - { - get; - set; - } + public double? GestusFuckToShoot { get; set; } [JsonPropertyName("GESTUS_DIST_ANSWERS")] - public double? GestusDistanceAnswers - { - get; - set; - } + public double? GestusDistanceAnswers { get; set; } [JsonPropertyName("GESTUS_DIST_ANSWERS_SQRT")] - public double? GestusDistanceAnswersSqrt - { - get; - set; - } + public double? GestusDistanceAnswersSqrt { get; set; } [JsonPropertyName("GESTUS_ANYWAY_CHANCE")] - public double? GestusAnywayChance - { - get; - set; - } + public double? GestusAnywayChance { get; set; } [JsonPropertyName("TALK_DELAY")] - public double? TalkDelay - { - get; - set; - } + public double? TalkDelay { get; set; } [JsonPropertyName("CAN_SHOOT_TO_HEAD")] - public bool? CanShootToHead - { - get; - set; - } + public bool? CanShootToHead { get; set; } [JsonPropertyName("CAN_TILT")] - public bool? CanTilt - { - get; - set; - } + public bool? CanTilt { get; set; } [JsonPropertyName("TILT_CHANCE")] - public double? TiltChance - { - get; - set; - } + public double? TiltChance { get; set; } [JsonPropertyName("MIN_BLOCK_DIST")] - public double? MinimumBlockDistance - { - get; - set; - } + public double? MinimumBlockDistance { get; set; } [JsonPropertyName("MIN_BLOCK_TIME")] - public double? MinimumBlockTime - { - get; - set; - } + public double? MinimumBlockTime { get; set; } [JsonPropertyName("COVER_SECONDS_AFTER_LOSE_VISION")] - public double? CoverSecondsAfterLoseVision - { - get; - set; - } + public double? CoverSecondsAfterLoseVision { get; set; } [JsonPropertyName("MIN_ARG_COEF")] - public double? MinimumArgumentCoefficient - { - get; - set; - } + public double? MinimumArgumentCoefficient { get; set; } [JsonPropertyName("MAX_ARG_COEF")] - public double? MaximumArgumentCoefficient - { - get; - set; - } + public double? MaximumArgumentCoefficient { get; set; } [JsonPropertyName("DEAD_AGR_DIST")] - public double? DeadAgrDistance - { - get; - set; - } + public double? DeadAgrDistance { get; set; } [JsonPropertyName("MAX_DANGER_CARE_DIST_SQRT")] - public double? MaxDangerCareDistanceSqrt - { - get; - set; - } + public double? MaxDangerCareDistanceSqrt { get; set; } [JsonPropertyName("MAX_DANGER_CARE_DIST")] - public double? MaxDangerCareDistance - { - get; - set; - } + public double? MaxDangerCareDistance { get; set; } [JsonPropertyName("MIN_MAX_PERSON_SEARCH")] - public double? MinimumMaximumPersonSearch - { - get; - set; - } + public double? MinimumMaximumPersonSearch { get; set; } [JsonPropertyName("PERCENT_PERSON_SEARCH")] - public double? PercentPersonSearch - { - get; - set; - } + public double? PercentPersonSearch { get; set; } [JsonPropertyName("LOOK_ANYSIDE_BY_WALL_SEC_OF_ENEMY")] - public double? LookAnySideByWallSecondsOfEnemy - { - get; - set; - } + public double? LookAnySideByWallSecondsOfEnemy { get; set; } [JsonPropertyName("CLOSE_TO_WALL_ROTATE_BY_WALL_SQRT")] - public double? CloseToWallRotateByWallSqrt - { - get; - set; - } + public double? CloseToWallRotateByWallSqrt { get; set; } [JsonPropertyName("SHOOT_TO_CHANGE_RND_PART_MIN")] - public double? ShootToChangeRandomPartMinimum - { - get; - set; - } + public double? ShootToChangeRandomPartMinimum { get; set; } [JsonPropertyName("SHOOT_TO_CHANGE_RND_PART_MAX")] - public double? ShootToChangeRandomPartMaximum - { - get; - set; - } + public double? ShootToChangeRandomPartMaximum { get; set; } [JsonPropertyName("SHOOT_TO_CHANGE_RND_PART_DELTA")] - public double? ShootToChangeRandomPartDelta - { - get; - set; - } + public double? ShootToChangeRandomPartDelta { get; set; } [JsonPropertyName("FORMUL_COEF_DELTA_DIST")] - public double? FormulaCoefficientDeltaDistance - { - get; - set; - } + public double? FormulaCoefficientDeltaDistance { get; set; } [JsonPropertyName("FORMUL_COEF_DELTA_SHOOT")] - public double? FormulaCoefficientDeltaShoot - { - get; - set; - } + public double? FormulaCoefficientDeltaShoot { get; set; } [JsonPropertyName("FORMUL_COEF_DELTA_FRIEND_COVER")] - public double? FormulaCoefficientDeltaFriendCover - { - get; - set; - } + public double? FormulaCoefficientDeltaFriendCover { get; set; } [JsonPropertyName("SUSPETION_POINT_DIST_CHECK")] - public double? SuspicionPointDistanceCheck - { - get; - set; - } + public double? SuspicionPointDistanceCheck { get; set; } [JsonPropertyName("MAX_BASE_REQUESTS_PER_PLAYER")] - public double? MaxBaseRequestsPerPlayer - { - get; - set; - } + public double? MaxBaseRequestsPerPlayer { get; set; } [JsonPropertyName("MAX_HOLD_REQUESTS_PER_PLAYER")] - public double? MaxHoldRequestsPerPlayer - { - get; - set; - } + public double? MaxHoldRequestsPerPlayer { get; set; } [JsonPropertyName("MAX_GO_TO_REQUESTS_PER_PLAYER")] - public double? MaxGoToRequestsPerPlayer - { - get; - set; - } + public double? MaxGoToRequestsPerPlayer { get; set; } [JsonPropertyName("MAX_COME_WITH_ME_REQUESTS_PER_PLAYER")] - public double? MaxComeWithMeRequestsPerPlayer - { - get; - set; - } + public double? MaxComeWithMeRequestsPerPlayer { get; set; } [JsonPropertyName("CORE_POINT_MAX_VALUE")] - public double? CorePointMaxValue - { - get; - set; - } + public double? CorePointMaxValue { get; set; } [JsonPropertyName("CORE_POINTS_MAX")] - public double? CorePointsMax - { - get; - set; - } + public double? CorePointsMax { get; set; } [JsonPropertyName("CORE_POINTS_MIN")] - public double? CorePointsMin - { - get; - set; - } + public double? CorePointsMin { get; set; } [JsonPropertyName("BORN_POISTS_FREE_ONLY_FAREST_BOT")] - public bool? BornPointsFreeOnlyFarthestBot - { - get; - set; - } + public bool? BornPointsFreeOnlyFarthestBot { get; set; } [JsonPropertyName("BORN_POINSTS_FREE_ONLY_FAREST_PLAYER")] - public bool? BornPointsFreeOnlyFarthestPlayer - { - get; - set; - } + public bool? BornPointsFreeOnlyFarthestPlayer { get; set; } [JsonPropertyName("SCAV_GROUPS_TOGETHER")] - public bool? ScavGroupsTogether - { - get; - set; - } + public bool? ScavGroupsTogether { get; set; } [JsonPropertyName("LAY_DOWN_ANG_SHOOT")] - public double? LayDownAngleShoot - { - get; - set; - } + public double? LayDownAngleShoot { get; set; } [JsonPropertyName("HOLD_REQUEST_TIME_SEC")] - public double? HoldRequestTimeSeconds - { - get; - set; - } + public double? HoldRequestTimeSeconds { get; set; } [JsonPropertyName("TRIGGERS_DOWN_TO_RUN_WHEN_MOVE")] - public double? TriggersDownToRunWhenMove - { - get; - set; - } + public double? TriggersDownToRunWhenMove { get; set; } [JsonPropertyName("MIN_DIST_TO_RUN_WHILE_ATTACK_MOVING")] - public double? MinimumDistanceToRunWhileAttackingMoving - { - get; - set; - } + public double? MinimumDistanceToRunWhileAttackingMoving { get; set; } [JsonPropertyName("MIN_DIST_TO_RUN_WHILE_ATTACK_MOVING_OTHER_ENEMIS")] - public double? MinimumDistanceToRunWhileAttackingMovingOtherEnemies - { - get; - set; - } + public double? MinimumDistanceToRunWhileAttackingMovingOtherEnemies { get; set; } [JsonPropertyName("MIN_DIST_TO_STOP_RUN")] - public double? MinimumDistanceToStopRunning - { - get; - set; - } + public double? MinimumDistanceToStopRunning { get; set; } [JsonPropertyName("JUMP_SPREAD_DIST")] - public double? JumpSpreadDistance - { - get; - set; - } + public double? JumpSpreadDistance { get; set; } [JsonPropertyName("LOOK_TIMES_TO_KILL")] - public double? LookTimesToKill - { - get; - set; - } + public double? LookTimesToKill { get; set; } [JsonPropertyName("COME_INSIDE_TIMES")] - public double? ComeInsideTimes - { - get; - set; - } + public double? ComeInsideTimes { get; set; } [JsonPropertyName("TOTAL_TIME_KILL")] - public double? TotalTimeKill - { - get; - set; - } + public double? TotalTimeKill { get; set; } [JsonPropertyName("TOTAL_TIME_KILL_AFTER_WARN")] - public double? TotalTimeKillAfterWarning - { - get; - set; - } + public double? TotalTimeKillAfterWarning { get; set; } [JsonPropertyName("MOVING_AIM_COEF")] - public double? MovingAimCoefficient - { - get; - set; - } + public double? MovingAimCoefficient { get; set; } [JsonPropertyName("VERTICAL_DIST_TO_IGNORE_SOUND")] - public double? VerticalDistanceToIgnoreSound - { - get; - set; - } + public double? VerticalDistanceToIgnoreSound { get; set; } [JsonPropertyName("DEFENCE_LEVEL_SHIFT")] - public double? DefenseLevelShift - { - get; - set; - } + public double? DefenseLevelShift { get; set; } [JsonPropertyName("MIN_DIST_CLOSE_DEF")] - public double? MinimumDistanceCloseDefense - { - get; - set; - } + public double? MinimumDistanceCloseDefense { get; set; } [JsonPropertyName("USE_ID_PRIOR_WHO_GO")] - public bool? UseIdPriorWhoGoes - { - get; - set; - } + public bool? UseIdPriorWhoGoes { get; set; } [JsonPropertyName("SMOKE_GRENADE_RADIUS_COEF")] - public double? SmokeGrenadeRadiusCoefficient - { - get; - set; - } + public double? SmokeGrenadeRadiusCoefficient { get; set; } [JsonPropertyName("GRENADE_PRECISION")] - public double? GrenadePrecision - { - get; - set; - } + public double? GrenadePrecision { get; set; } [JsonPropertyName("MAX_WARNS_BEFORE_KILL")] - public double? MaxWarningsBeforeKill - { - get; - set; - } + public double? MaxWarningsBeforeKill { get; set; } [JsonPropertyName("CARE_ENEMY_ONLY_TIME")] - public double? CareEnemyOnlyTime - { - get; - set; - } + public double? CareEnemyOnlyTime { get; set; } [JsonPropertyName("MIDDLE_POINT_COEF")] - public double? MiddlePointCoefficient - { - get; - set; - } + public double? MiddlePointCoefficient { get; set; } [JsonPropertyName("MAIN_TACTIC_ONLY_ATTACK")] - public bool? MainTacticOnlyAttack - { - get; - set; - } + public bool? MainTacticOnlyAttack { get; set; } [JsonPropertyName("LAST_DAMAGE_ACTIVE")] - public double? LastDamageActive - { - get; - set; - } + public double? LastDamageActive { get; set; } [JsonPropertyName("SHALL_DIE_IF_NOT_INITED")] - public bool? ShallDieIfNotInitialized - { - get; - set; - } + public bool? ShallDieIfNotInitialized { get; set; } [JsonPropertyName("CHECK_BOT_INIT_TIME_SEC")] - public double? CheckBotInitializationTimeSeconds - { - get; - set; - } + public double? CheckBotInitializationTimeSeconds { get; set; } [JsonPropertyName("WEAPON_ROOT_Y_OFFSET")] - public double? WeaponRootYOffset - { - get; - set; - } + public double? WeaponRootYOffset { get; set; } [JsonPropertyName("DELTA_SUPRESS_DISTANCE_SQRT")] - public double? DeltaSuppressDistanceSqrt - { - get; - set; - } + public double? DeltaSuppressDistanceSqrt { get; set; } [JsonPropertyName("DELTA_SUPRESS_DISTANCE")] - public double? DeltaSuppressDistance - { - get; - set; - } + public double? DeltaSuppressDistance { get; set; } [JsonPropertyName("WAVE_COEF_LOW")] - public double? WaveCoefficientLow - { - get; - set; - } + public double? WaveCoefficientLow { get; set; } [JsonPropertyName("WAVE_COEF_MID")] - public double? WaveCoefficientMid - { - get; - set; - } + public double? WaveCoefficientMid { get; set; } [JsonPropertyName("WAVE_COEF_HIGH")] - public double? WaveCoefficientHigh - { - get; - set; - } + public double? WaveCoefficientHigh { get; set; } [JsonPropertyName("WAVE_COEF_HORDE")] - public double? WaveCoefficientHorde - { - get; - set; - } + public double? WaveCoefficientHorde { get; set; } [JsonPropertyName("WAVE_ONLY_AS_ONLINE")] - public bool? WaveOnlyAsOnline - { - get; - set; - } + public bool? WaveOnlyAsOnline { get; set; } [JsonPropertyName("LOCAL_BOTS_COUNT")] - public double? LocalBotsCount - { - get; - set; - } + public double? LocalBotsCount { get; set; } [JsonPropertyName("AXE_MAN_KILLS_END")] - public double? AxeManKillsEnd - { - get; - set; - } + public double? AxeManKillsEnd { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotType.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotType.cs index f0864c5e..10ff0633 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotType.cs @@ -11,74 +11,34 @@ public record BotType public Dictionary ExtensionData { get; set; } [JsonPropertyName("appearance")] - public Appearance? BotAppearance - { - get; - set; - } + public Appearance? BotAppearance { get; set; } [JsonPropertyName("chances")] - public Chances? BotChances - { - get; - set; - } + public Chances? BotChances { get; set; } [JsonPropertyName("difficulty")] - public Dictionary? BotDifficulty - { - get; - set; - } + public Dictionary? BotDifficulty { get; set; } [JsonPropertyName("experience")] - public Experience? BotExperience - { - get; - set; - } + public Experience? BotExperience { get; set; } [JsonPropertyName("firstName")] - public List? FirstNames - { - get; - set; - } + public List? FirstNames { get; set; } [JsonPropertyName("generation")] - public Generation? BotGeneration - { - get; - set; - } + public Generation? BotGeneration { get; set; } [JsonPropertyName("health")] - public BotTypeHealth? BotHealth - { - get; - set; - } + public BotTypeHealth? BotHealth { get; set; } [JsonPropertyName("inventory")] - public BotTypeInventory? BotInventory - { - get; - set; - } + public BotTypeInventory? BotInventory { get; set; } [JsonPropertyName("lastName")] - public List? LastNames - { - get; - set; - } + public List? LastNames { get; set; } [JsonPropertyName("skills")] - public BotDbSkills? BotSkills - { - get; - set; - } + public BotDbSkills? BotSkills { get; set; } } public record Appearance @@ -87,42 +47,22 @@ public record Appearance public Dictionary ExtensionData { get; set; } [JsonPropertyName("body")] - public Dictionary? Body - { - get; - set; - } + public Dictionary? Body { get; set; } [JsonPropertyName("feet")] - public Dictionary? Feet - { - get; - set; - } + public Dictionary? Feet { get; set; } [JsonPropertyName("hands")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Hands - { - get; - set; - } + public Dictionary? Hands { get; set; } [JsonPropertyName("head")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Head - { - get; - set; - } + public Dictionary? Head { get; set; } [JsonPropertyName("voice")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Voice - { - get; - set; - } + public Dictionary? Voice { get; set; } } public record Chances @@ -131,32 +71,16 @@ public record Chances public Dictionary ExtensionData { get; set; } [JsonPropertyName("equipment")] - public Dictionary? EquipmentChances - { - get; - set; - } + public Dictionary? EquipmentChances { get; set; } [JsonPropertyName("weaponMods")] - public Dictionary? WeaponModsChances - { - get; - set; - } + public Dictionary? WeaponModsChances { get; set; } [JsonPropertyName("equipmentMods")] - public Dictionary? EquipmentModsChances - { - get; - set; - } + public Dictionary? EquipmentModsChances { get; set; } [JsonPropertyName("mods")] - public Dictionary? Mods - { - get; - set; - } + public Dictionary? Mods { get; set; } } /* record removed in favor of Dictionary @@ -333,32 +257,16 @@ public record Difficulties public Dictionary ExtensionData { get; set; } [JsonPropertyName("easy")] - public DifficultyCategories? Easy - { - get; - set; - } + public DifficultyCategories? Easy { get; set; } [JsonPropertyName("normal")] - public DifficultyCategories? Normal - { - get; - set; - } + public DifficultyCategories? Normal { get; set; } [JsonPropertyName("hard")] - public DifficultyCategories? Hard - { - get; - set; - } + public DifficultyCategories? Hard { get; set; } [JsonPropertyName("impossible")] - public DifficultyCategories? Impossible - { - get; - set; - } + public DifficultyCategories? Impossible { get; set; } } public record DifficultyCategories @@ -366,89 +274,33 @@ public record DifficultyCategories [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary? Aiming - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Aiming { get; set; } // TODO: string | number | boolean - public Dictionary? Boss - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Boss { get; set; } // TODO: string | number | boolean - public Dictionary? Change - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Change { get; set; } // TODO: string | number | boolean - public Dictionary? Core - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Core { get; set; } // TODO: string | number | boolean - public Dictionary? Cover - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Cover { get; set; } // TODO: string | number | boolean - public Dictionary? Grenade - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Grenade { get; set; } // TODO: string | number | boolean - public Dictionary? Hearing - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Hearing { get; set; } // TODO: string | number | boolean - public Dictionary? Lay - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Lay { get; set; } // TODO: string | number | boolean - public Dictionary? Look - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Look { get; set; } // TODO: string | number | boolean - public Dictionary? Mind - { - get; - set; - } // TODO: string | number | boolean | string[] + public Dictionary? Mind { get; set; } // TODO: string | number | boolean | string[] - public Dictionary? Move - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Move { get; set; } // TODO: string | number | boolean - public Dictionary? Patrol - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Patrol { get; set; } // TODO: string | number | boolean - public Dictionary? Scattering - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Scattering { get; set; } // TODO: string | number | boolean - public Dictionary? Shoot - { - get; - set; - } // TODO: string | number | boolean + public Dictionary? Shoot { get; set; } // TODO: string | number | boolean } public record Experience @@ -460,45 +312,25 @@ public record Experience /// key = bot difficulty /// [JsonPropertyName("aggressorBonus")] - public Dictionary? AggressorBonus - { - get; - set; - } + public Dictionary? AggressorBonus { get; set; } [JsonPropertyName("level")] - public MinMax? Level - { - get; - set; - } + public MinMax? Level { get; set; } /// /// key = bot difficulty /// [JsonPropertyName("reward")] - public Dictionary>? Reward - { - get; - set; - } + public Dictionary>? Reward { get; set; } /// /// key = bot difficulty /// [JsonPropertyName("standingForKill")] - public Dictionary? StandingForKill - { - get; - set; - } + public Dictionary? StandingForKill { get; set; } [JsonPropertyName("useSimpleAnimator")] - public bool? UseSimpleAnimator - { - get; - set; - } + public bool? UseSimpleAnimator { get; set; } } public record Generation @@ -507,11 +339,7 @@ public record Generation public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public GenerationWeightingItems? Items - { - get; - set; - } + public GenerationWeightingItems? Items { get; set; } } public record GenerationData @@ -523,22 +351,14 @@ public record GenerationData /// key: number of items, value: weighting /// [JsonPropertyName("weights")] - public Dictionary? Weights - { - get; - set; - } + public Dictionary? Weights { get; set; } /// /// Array of item tpls /// [JsonPropertyName("whitelist")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] - public Dictionary? Whitelist - { - get; - set; - } + public Dictionary? Whitelist { get; set; } } public record GenerationWeightingItems @@ -547,95 +367,43 @@ public record GenerationWeightingItems public Dictionary ExtensionData { get; set; } [JsonPropertyName("grenades")] - public GenerationData Grenades - { - get; - set; - } + public GenerationData Grenades { get; set; } [JsonPropertyName("healing")] - public GenerationData Healing - { - get; - set; - } + public GenerationData Healing { get; set; } [JsonPropertyName("drugs")] - public GenerationData Drugs - { - get; - set; - } + public GenerationData Drugs { get; set; } [JsonPropertyName("food")] - public GenerationData Food - { - get; - set; - } + public GenerationData Food { get; set; } [JsonPropertyName("drink")] - public GenerationData Drink - { - get; - set; - } + public GenerationData Drink { get; set; } [JsonPropertyName("currency")] - public GenerationData Currency - { - get; - set; - } + public GenerationData Currency { get; set; } [JsonPropertyName("stims")] - public GenerationData Stims - { - get; - set; - } + public GenerationData Stims { get; set; } [JsonPropertyName("backpackLoot")] - public GenerationData BackpackLoot - { - get; - set; - } + public GenerationData BackpackLoot { get; set; } [JsonPropertyName("pocketLoot")] - public GenerationData PocketLoot - { - get; - set; - } + public GenerationData PocketLoot { get; set; } [JsonPropertyName("vestLoot")] - public GenerationData VestLoot - { - get; - set; - } + public GenerationData VestLoot { get; set; } [JsonPropertyName("magazines")] - public GenerationData Magazines - { - get; - set; - } + public GenerationData Magazines { get; set; } [JsonPropertyName("specialItems")] - public GenerationData SpecialItems - { - get; - set; - } + public GenerationData SpecialItems { get; set; } [JsonPropertyName("looseLoot")] - public GenerationData LooseLoot - { - get; - set; - } + public GenerationData LooseLoot { get; set; } } public record BotTypeHealth @@ -643,29 +411,13 @@ public record BotTypeHealth [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public List? BodyParts - { - get; - set; - } + public List? BodyParts { get; set; } - public MinMax? Energy - { - get; - set; - } + public MinMax? Energy { get; set; } - public MinMax? Hydration - { - get; - set; - } + public MinMax? Hydration { get; set; } - public MinMax? Temperature - { - get; - set; - } + public MinMax? Temperature { get; set; } } public record BodyPart @@ -673,47 +425,19 @@ public record BodyPart [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public MinMax? Chest - { - get; - set; - } + public MinMax? Chest { get; set; } - public MinMax? Head - { - get; - set; - } + public MinMax? Head { get; set; } - public MinMax? LeftArm - { - get; - set; - } + public MinMax? LeftArm { get; set; } - public MinMax? LeftLeg - { - get; - set; - } + public MinMax? LeftLeg { get; set; } - public MinMax? RightArm - { - get; - set; - } + public MinMax? RightArm { get; set; } - public MinMax? RightLeg - { - get; - set; - } + public MinMax? RightLeg { get; set; } - public MinMax? Stomach - { - get; - set; - } + public MinMax? Stomach { get; set; } } public record BotTypeInventory @@ -722,31 +446,15 @@ public record BotTypeInventory public Dictionary ExtensionData { get; set; } [JsonPropertyName("equipment")] - public Dictionary>? Equipment - { - get; - set; - } + public Dictionary>? Equipment { get; set; } - public GlobalAmmo? Ammo - { - get; - set; - } + public GlobalAmmo? Ammo { get; set; } [JsonPropertyName("items")] - public ItemPools? Items - { - get; - set; - } + public ItemPools? Items { get; set; } [JsonPropertyName("mods")] - public GlobalMods? Mods - { - get; - set; - } + public GlobalMods? Mods { get; set; } } public record Equipment @@ -754,89 +462,33 @@ public record Equipment [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary? ArmBand - { - get; - set; - } + public Dictionary? ArmBand { get; set; } - public Dictionary? ArmorVest - { - get; - set; - } + public Dictionary? ArmorVest { get; set; } - public Dictionary? Backpack - { - get; - set; - } + public Dictionary? Backpack { get; set; } - public Dictionary? Earpiece - { - get; - set; - } + public Dictionary? Earpiece { get; set; } - public Dictionary? Eyewear - { - get; - set; - } + public Dictionary? Eyewear { get; set; } - public Dictionary? FaceCover - { - get; - set; - } + public Dictionary? FaceCover { get; set; } - public Dictionary? FirstPrimaryWeapon - { - get; - set; - } + public Dictionary? FirstPrimaryWeapon { get; set; } - public Dictionary? Headwear - { - get; - set; - } + public Dictionary? Headwear { get; set; } - public Dictionary? Holster - { - get; - set; - } + public Dictionary? Holster { get; set; } - public Dictionary? Pockets - { - get; - set; - } + public Dictionary? Pockets { get; set; } - public Dictionary? Scabbard - { - get; - set; - } + public Dictionary? Scabbard { get; set; } - public Dictionary? SecondPrimaryWeapon - { - get; - set; - } + public Dictionary? SecondPrimaryWeapon { get; set; } - public Dictionary? SecuredContainer - { - get; - set; - } + public Dictionary? SecuredContainer { get; set; } - public Dictionary? TacticalVest - { - get; - set; - } + public Dictionary? TacticalVest { get; set; } } public record ItemPools @@ -844,35 +496,15 @@ public record ItemPools [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary? Backpack - { - get; - set; - } + public Dictionary? Backpack { get; set; } - public Dictionary? Pockets - { - get; - set; - } + public Dictionary? Pockets { get; set; } - public Dictionary? SecuredContainer - { - get; - set; - } + public Dictionary? SecuredContainer { get; set; } - public Dictionary? SpecialLoot - { - get; - set; - } + public Dictionary? SpecialLoot { get; set; } - public Dictionary? TacticalVest - { - get; - set; - } + public Dictionary? TacticalVest { get; set; } } public record BotDbSkills @@ -880,15 +512,7 @@ public record BotDbSkills [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Dictionary>? Common - { - get; - set; - } + public Dictionary>? Common { get; set; } - public Dictionary>? Mastering - { - get; - set; - } + public Dictionary>? Mastering { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomisationStorage.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomisationStorage.cs index bd3268d9..9ab09095 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomisationStorage.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomisationStorage.cs @@ -9,25 +9,13 @@ public record CustomisationStorage // Customisation.json/itemId [JsonPropertyName("id")] - public string Id - { - get; - set; - } + public string Id { get; set; } [JsonPropertyName("source")] - public string? Source - { - get; - set; - } + public string? Source { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record CustomisationType diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomizationItem.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomizationItem.cs index 99b51c82..a7c7c31c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomizationItem.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/CustomizationItem.cs @@ -8,46 +8,22 @@ public record CustomizationItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("_parent")] - public string? Parent - { - get; - set; - } + public string? Parent { get; set; } [JsonPropertyName("_type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("_props")] - public CustomizationProps? Properties - { - get; - set; - } + public CustomizationProps? Properties { get; set; } [JsonPropertyName("_proto")] - public string? Proto - { - get; - set; - } + public string? Proto { get; set; } } public class CustomizationProps @@ -56,163 +32,71 @@ public class CustomizationProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("Prefab")] - public object? Prefab - { - get; - set; - } // Prefab object or string + public object? Prefab { get; set; } // Prefab object or string [JsonPropertyName("WatchPrefab")] - public Prefab? WatchPrefab - { - get; - set; - } + public Prefab? WatchPrefab { get; set; } [JsonPropertyName("WatchRotation")] - public XYZ? WatchRotation - { - get; - set; - } + public XYZ? WatchRotation { get; set; } [JsonPropertyName("WatchPosition")] - public XYZ? WatchPosition - { - get; - set; - } + public XYZ? WatchPosition { get; set; } [JsonPropertyName("IntegratedArmorVest")] - public bool? IntegratedArmorVest - { - get; - set; - } + public bool? IntegratedArmorVest { get; set; } [JsonPropertyName("MannequinPoseName")] - public string? MannequinPoseName - { - get; - set; - } + public string? MannequinPoseName { get; set; } [JsonPropertyName("BodyPart")] - public string? BodyPart - { - get; - set; - } + public string? BodyPart { get; set; } [JsonPropertyName("Game")] - public List? Game - { - get; - set; - } + public List? Game { get; set; } [JsonPropertyName("Hands")] - public string? Hands - { - get; - set; - } + public string? Hands { get; set; } [JsonPropertyName("Feet")] - public string? Feet - { - get; - set; - } + public string? Feet { get; set; } [JsonPropertyName("Body")] - public string? Body - { - get; - set; - } + public string? Body { get; set; } [JsonPropertyName("ProfileVersions")] - public List? ProfileVersions - { - get; - set; - } + public List? ProfileVersions { get; set; } [JsonPropertyName("Side")] - public List? Side - { - get; - set; - } + public List? Side { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("ShortName")] - public string? ShortName - { - get; - set; - } + public string? ShortName { get; set; } [JsonPropertyName("Description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("AvailableAsDefault")] - public bool? AvailableAsDefault - { - get; - set; - } + public bool? AvailableAsDefault { get; set; } [JsonPropertyName("EnvironmentUIType")] - public string? EnvironmentUIType - { - get; - set; - } + public string? EnvironmentUIType { get; set; } [JsonPropertyName("Interaction")] - public string? Interaction - { - get; - set; - } + public string? Interaction { get; set; } [JsonPropertyName("UsecTemplateId")] - public string? UsecTemplateId - { - get; - set; - } + public string? UsecTemplateId { get; set; } [JsonPropertyName("BearTemplateId")] - public string? BearTemplateId - { - get; - set; - } + public string? BearTemplateId { get; set; } [JsonPropertyName("AssetPath")] - public Prefab? AssetPath - { - get; - set; - } + public Prefab? AssetPath { get; set; } [JsonPropertyName("HideGarbage")] - public bool? HideGarbage - { - get; - set; - } + public bool? HideGarbage { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/GlobalTablesUsings.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/GlobalTablesUsings.cs index bac47306..49cfd599 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/GlobalTablesUsings.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/GlobalTablesUsings.cs @@ -1,3 +1,8 @@ -global using GlobalAmmo = System.Collections.Generic.Dictionary>; -global using GlobalMods = - System.Collections.Generic.Dictionary>>; +global using GlobalAmmo = System.Collections.Generic.Dictionary< + string, + System.Collections.Generic.Dictionary +>; +global using GlobalMods = System.Collections.Generic.Dictionary< + string, + System.Collections.Generic.Dictionary> +>; diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/HandbookBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/HandbookBase.cs index 7532d7e6..d19035b5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/HandbookBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/HandbookBase.cs @@ -8,18 +8,10 @@ public record HandbookBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("Categories")] - public List? Categories - { - get; - set; - } + public List? Categories { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record HandbookCategory @@ -28,41 +20,21 @@ public record HandbookCategory public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("ParentId")] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? ParentId - { - get; - set; - } + public string? ParentId { get; set; } [JsonPropertyName("Icon")] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? Icon - { - get; - set; - } + public string? Icon { get; set; } [JsonPropertyName("Color")] - public string? Color - { - get; - set; - } + public string? Color { get; set; } [JsonPropertyName("Order")] - public string? Order - { - get; - set; - } + public string? Order { get; set; } } public record HandbookItem @@ -71,24 +43,12 @@ public record HandbookItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("ParentId")] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? ParentId - { - get; - set; - } + public string? ParentId { get; set; } [JsonPropertyName("Price")] - public double? Price - { - get; - set; - } + public double? Price { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Item.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Item.cs index 8d7602e6..9415d079 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Item.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Item.cs @@ -21,76 +21,40 @@ public record Item [JsonPropertyName("_id")] public string? Id { - get - { - return _id; - } - set - { - _id = string.Intern(value); - } + get { return _id; } + set { _id = string.Intern(value); } } [JsonPropertyName("_tpl")] // MongoId public string? Template { - get - { - return _tpl; - } - set - { - _tpl = string.Intern(value); - } + get { return _tpl; } + set { _tpl = string.Intern(value); } } [JsonPropertyName("parentId")] public string? ParentId { - get - { - return _parentId; - } - set - { - _parentId = value == null ? null : string.Intern(value); - } + get { return _parentId; } + set { _parentId = value == null ? null : string.Intern(value); } } [JsonPropertyName("slotId")] public string? SlotId { - get - { - return _SlotId; - } - set - { - _SlotId = value == null ? null : string.Intern(value); - } + get { return _SlotId; } + set { _SlotId = value == null ? null : string.Intern(value); } } [JsonPropertyName("location")] - public object? Location - { - get; - set; - } // TODO: Can be IItemLocation or number + public object? Location { get; set; } // TODO: Can be IItemLocation or number [JsonPropertyName("desc")] - public string? Desc - { - get; - set; - } + public string? Desc { get; set; } [JsonPropertyName("upd")] - public Upd? Upd - { - get; - set; - } + public Upd? Upd { get; set; } } public record HideoutItem @@ -104,10 +68,7 @@ public record HideoutItem [JsonPropertyName("_id")] public string? _Id { - get - { - return Id; - } + get { return Id; } set { if (value == null) @@ -120,32 +81,16 @@ public record HideoutItem } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_tpl")] - public string? Template - { - get; - set; - } + public string? Template { get; set; } [JsonPropertyName("upd")] - public Upd? Upd - { - get; - set; - } + public Upd? Upd { get; set; } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } public Item ConvertToItem() { @@ -153,7 +98,7 @@ public record HideoutItem { Id = Id, Template = Template, - Upd = Upd + Upd = Upd, }; } } @@ -164,51 +109,32 @@ public record ItemLocation public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public int? X - { - get; - set; - } + public int? X { get; set; } [JsonPropertyName("y")] - public int? Y - { - get; - set; - } + public int? Y { get; set; } [JsonPropertyName("isSearched")] - public bool? IsSearched - { - get; - set; - } + public bool? IsSearched { get; set; } /// /// SPT property? /// [JsonPropertyName("rotation")] - public bool? Rotation - { - get; - set; - } + public bool? Rotation { get; set; } [JsonPropertyName("r")] [JsonConverter(typeof(JsonStringEnumConverter))] - public ItemRotation R - { - get; - set; - } + public ItemRotation R { get; set; } } public enum ItemRotation { // Token: 0x0400259F RID: 9631 Horizontal, + // Token: 0x040025A0 RID: 9632 - Vertical + Vertical, } public record Upd @@ -216,178 +142,66 @@ public record Upd [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public UpdBuff? Buff - { - get; - set; - } + public UpdBuff? Buff { get; set; } - public double? OriginalStackObjectsCount - { - get; - set; - } + public double? OriginalStackObjectsCount { get; set; } - public UpdTogglable? Togglable - { - get; - set; - } + public UpdTogglable? Togglable { get; set; } - public UpdMap? Map - { - get; - set; - } + public UpdMap? Map { get; set; } - public UpdTag? Tag - { - get; - set; - } + public UpdTag? Tag { get; set; } /// /// SPT specific property, not made by BSG /// [JsonPropertyName("sptPresetId")] - public string? SptPresetId - { - get; - set; - } + public string? SptPresetId { get; set; } - public UpdFaceShield? FaceShield - { - get; - set; - } + public UpdFaceShield? FaceShield { get; set; } [JsonConverter(typeof(StringToNumberFactoryConverter))] - public double? StackObjectsCount - { - get; - set; - } // TODO: LootDumpGen is outputting doubles, we can turn back to int once fixed + public double? StackObjectsCount { get; set; } // TODO: LootDumpGen is outputting doubles, we can turn back to int once fixed - public bool? UnlimitedCount - { - get; - set; - } + public bool? UnlimitedCount { get; set; } - public UpdRepairable? Repairable - { - get; - set; - } + public UpdRepairable? Repairable { get; set; } - public UpdRecodableComponent? RecodableComponent - { - get; - set; - } + public UpdRecodableComponent? RecodableComponent { get; set; } - public UpdFireMode? FireMode - { - get; - set; - } + public UpdFireMode? FireMode { get; set; } - public bool? SpawnedInSession - { - get; - set; - } + public bool? SpawnedInSession { get; set; } - public UpdLight? Light - { - get; - set; - } + public UpdLight? Light { get; set; } - public UpdKey? Key - { - get; - set; - } + public UpdKey? Key { get; set; } - public UpdResource? Resource - { - get; - set; - } + public UpdResource? Resource { get; set; } - public UpdSight? Sight - { - get; - set; - } + public UpdSight? Sight { get; set; } - public UpdMedKit? MedKit - { - get; - set; - } + public UpdMedKit? MedKit { get; set; } - public UpdFoodDrink? FoodDrink - { - get; - set; - } + public UpdFoodDrink? FoodDrink { get; set; } - public UpdDogtag? Dogtag - { - get; - set; - } + public UpdDogtag? Dogtag { get; set; } - public int? BuyRestrictionMax - { - get; - set; - } + public int? BuyRestrictionMax { get; set; } - public int? BuyRestrictionCurrent - { - get; - set; - } + public int? BuyRestrictionCurrent { get; set; } - public UpdFoldable? Foldable - { - get; - set; - } + public UpdFoldable? Foldable { get; set; } - public UpdSideEffect? SideEffect - { - get; - set; - } + public UpdSideEffect? SideEffect { get; set; } - public UpdRepairKit? RepairKit - { - get; - set; - } + public UpdRepairKit? RepairKit { get; set; } - public UpdCultistAmulet? CultistAmulet - { - get; - set; - } + public UpdCultistAmulet? CultistAmulet { get; set; } - public PinLockState? PinLockState - { - get; - set; - } + public PinLockState? PinLockState { get; set; } - public LockableComponent? Lockable - { - get; - set; - } + public LockableComponent? Lockable { get; set; } } public record LockableKeyComponent @@ -397,7 +211,6 @@ public record LockableKeyComponent public float? RelativeValue { get; set; } public int? NumberOfUsages { get; set; } - } public record LockableComponent @@ -415,7 +228,7 @@ public enum PinLockState { Free, Pinned, - Locked + Locked, } public record UpdBuff @@ -424,33 +237,17 @@ public record UpdBuff public Dictionary ExtensionData { get; set; } [JsonPropertyName("Rarity")] - public string? Rarity - { - get; - set; - } + public string? Rarity { get; set; } [JsonPropertyName("BuffType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public BuffType? BuffType - { - get; - set; - } + public BuffType? BuffType { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("ThresholdDurability")] - public double? ThresholdDurability - { - get; - set; - } + public double? ThresholdDurability { get; set; } } public record UpdTogglable @@ -459,11 +256,7 @@ public record UpdTogglable public Dictionary ExtensionData { get; set; } [JsonPropertyName("On")] - public bool? On - { - get; - set; - } + public bool? On { get; set; } } public record UpdMap @@ -472,11 +265,7 @@ public record UpdMap public Dictionary ExtensionData { get; set; } [JsonPropertyName("Markers")] - public List? Markers - { - get; - set; - } + public List? Markers { get; set; } } public record MapMarker @@ -485,32 +274,16 @@ public record MapMarker public Dictionary ExtensionData { get; set; } [JsonPropertyName("Type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("X")] - public double? X - { - get; - set; - } + public double? X { get; set; } [JsonPropertyName("Y")] - public double? Y - { - get; - set; - } + public double? Y { get; set; } [JsonPropertyName("Note")] - public string? Note - { - get; - set; - } + public string? Note { get; set; } } public record UpdTag @@ -519,18 +292,10 @@ public record UpdTag public Dictionary ExtensionData { get; set; } [JsonPropertyName("Color")] - public int? Color - { - get; - set; - } + public int? Color { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } } public record UpdFaceShield @@ -539,18 +304,10 @@ public record UpdFaceShield public Dictionary ExtensionData { get; set; } [JsonPropertyName("Hits")] - public int? Hits - { - get; - set; - } + public int? Hits { get; set; } [JsonPropertyName("HitSeed")] - public int? HitSeed - { - get; - set; - } + public int? HitSeed { get; set; } } public record UpdRepairable @@ -559,18 +316,10 @@ public record UpdRepairable public Dictionary ExtensionData { get; set; } [JsonPropertyName("Durability")] - public double? Durability - { - get; - set; - } + public double? Durability { get; set; } [JsonPropertyName("MaxDurability")] - public double? MaxDurability - { - get; - set; - } + public double? MaxDurability { get; set; } } public record UpdRecodableComponent @@ -579,11 +328,7 @@ public record UpdRecodableComponent public Dictionary ExtensionData { get; set; } [JsonPropertyName("IsEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } } public record UpdMedKit @@ -592,11 +337,7 @@ public record UpdMedKit public Dictionary ExtensionData { get; set; } [JsonPropertyName("HpResource")] - public double? HpResource - { - get; - set; - } + public double? HpResource { get; set; } } public record UpdSight @@ -605,31 +346,15 @@ public record UpdSight public Dictionary ExtensionData { get; set; } [JsonPropertyName("ScopesCurrentCalibPointIndexes")] - public List? ScopesCurrentCalibPointIndexes - { - get; - set; - } + public List? ScopesCurrentCalibPointIndexes { get; set; } [JsonPropertyName("ScopesSelectedModes")] - public List? ScopesSelectedModes - { - get; - set; - } + public List? ScopesSelectedModes { get; set; } [JsonPropertyName("SelectedScope")] - public int? SelectedScope - { - get; - set; - } + public int? SelectedScope { get; set; } - public double? ScopeZoomValue - { - get; - set; - } + public double? ScopeZoomValue { get; set; } } public record UpdFoldable @@ -638,11 +363,7 @@ public record UpdFoldable public Dictionary ExtensionData { get; set; } [JsonPropertyName("Folded")] - public bool? Folded - { - get; - set; - } + public bool? Folded { get; set; } } public record UpdFireMode @@ -651,11 +372,7 @@ public record UpdFireMode public Dictionary ExtensionData { get; set; } [JsonPropertyName("FireMode")] - public string? FireMode - { - get; - set; - } + public string? FireMode { get; set; } } public record UpdFoodDrink @@ -664,11 +381,7 @@ public record UpdFoodDrink public Dictionary ExtensionData { get; set; } [JsonPropertyName("HpPercent")] - public double? HpPercent - { - get; - set; - } + public double? HpPercent { get; set; } } public record UpdKey @@ -678,11 +391,7 @@ public record UpdKey // Checked in client [JsonPropertyName("NumberOfUsages")] - public int? NumberOfUsages - { - get; - set; - } + public int? NumberOfUsages { get; set; } } public record UpdResource @@ -691,18 +400,10 @@ public record UpdResource public Dictionary ExtensionData { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("UnitsConsumed")] - public double? UnitsConsumed - { - get; - set; - } + public double? UnitsConsumed { get; set; } } public record UpdLight @@ -711,18 +412,10 @@ public record UpdLight public Dictionary ExtensionData { get; set; } [JsonPropertyName("IsActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("SelectedMode")] - public int? SelectedMode - { - get; - set; - } + public int? SelectedMode { get; set; } } public record UpdDogtag @@ -731,88 +424,40 @@ public record UpdDogtag public Dictionary ExtensionData { get; set; } [JsonPropertyName("AccountId")] - public string? AccountId - { - get; - set; - } + public string? AccountId { get; set; } [JsonPropertyName("ProfileId")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("Side")] [JsonConverter(typeof(DogtagSideConverter))] - public DogtagSide? Side - { - get; - set; - } + public DogtagSide? Side { get; set; } [JsonPropertyName("Level")] - public double? Level - { - get; - set; - } + public double? Level { get; set; } [JsonPropertyName("Time")] - public string? Time - { - get; - set; - } + public string? Time { get; set; } [JsonPropertyName("Status")] - public string? Status - { - get; - set; - } + public string? Status { get; set; } [JsonPropertyName("KillerAccountId")] - public string? KillerAccountId - { - get; - set; - } + public string? KillerAccountId { get; set; } [JsonPropertyName("KillerProfileId")] - public string? KillerProfileId - { - get; - set; - } + public string? KillerProfileId { get; set; } [JsonPropertyName("KillerName")] - public string? KillerName - { - get; - set; - } + public string? KillerName { get; set; } [JsonPropertyName("WeaponName")] - public string? WeaponName - { - get; - set; - } + public string? WeaponName { get; set; } - public bool? CarriedByGroupMember - { - get; - set; - } + public bool? CarriedByGroupMember { get; set; } } public record UpdSideEffect @@ -821,11 +466,7 @@ public record UpdSideEffect public Dictionary ExtensionData { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record UpdRepairKit @@ -834,11 +475,7 @@ public record UpdRepairKit public Dictionary ExtensionData { get; set; } [JsonPropertyName("Resource")] - public double? Resource - { - get; - set; - } + public double? Resource { get; set; } } public record UpdCultistAmulet @@ -847,9 +484,5 @@ public record UpdCultistAmulet public Dictionary ExtensionData { get; set; } [JsonPropertyName("NumberOfUsages")] - public double? NumberOfUsages - { - get; - set; - } + public double? NumberOfUsages { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationServices.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationServices.cs index 7bd945ed..51709cc8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationServices.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationServices.cs @@ -10,18 +10,10 @@ public record LocationServices public Dictionary ExtensionData { get; set; } [JsonPropertyName("TraderServerSettings")] - public TraderServerSettings? TraderServerSettings - { - get; - set; - } + public TraderServerSettings? TraderServerSettings { get; set; } [JsonPropertyName("BTRServerSettings")] - public BtrServerSettings? BtrServerSettings - { - get; - set; - } + public BtrServerSettings? BtrServerSettings { get; set; } } public record TraderServerSettings @@ -30,11 +22,7 @@ public record TraderServerSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("TraderServices")] - public TraderServices? TraderServices - { - get; - set; - } + public TraderServices? TraderServices { get; set; } } public record TraderServices @@ -43,53 +31,25 @@ public record TraderServices public Dictionary ExtensionData { get; set; } [JsonPropertyName("ExUsecLoyalty")] - public TraderService? ExUsecLoyalty - { - get; - set; - } + public TraderService? ExUsecLoyalty { get; set; } [JsonPropertyName("ZryachiyAid")] - public TraderService? ZryachiyAid - { - get; - set; - } + public TraderService? ZryachiyAid { get; set; } [JsonPropertyName("CultistsAid")] - public TraderService? CultistsAid - { - get; - set; - } + public TraderService? CultistsAid { get; set; } [JsonPropertyName("PlayerTaxi")] - public TraderService? PlayerTaxi - { - get; - set; - } + public TraderService? PlayerTaxi { get; set; } [JsonPropertyName("BtrItemsDelivery")] - public TraderService? BtrItemsDelivery - { - get; - set; - } + public TraderService? BtrItemsDelivery { get; set; } [JsonPropertyName("BtrBotCover")] - public TraderService? BtrBotCover - { - get; - set; - } + public TraderService? BtrBotCover { get; set; } [JsonPropertyName("TransitItemsDelivery")] - public TraderService? TransitItemsDelivery - { - get; - set; - } + public TraderService? TransitItemsDelivery { get; set; } } public record TraderService @@ -98,41 +58,21 @@ public record TraderService public Dictionary ExtensionData { get; set; } [JsonPropertyName("TraderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("TraderServiceType")] - public TraderServiceType? TraderServiceType - { - get; - set; - } + public TraderServiceType? TraderServiceType { get; set; } [JsonPropertyName("Requirements")] - public ServiceRequirements? Requirements - { - get; - set; - } + public ServiceRequirements? Requirements { get; set; } [JsonPropertyName("ServiceItemCost")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? ServiceItemCost - { - get; - set; - } + public Dictionary? ServiceItemCost { get; set; } [JsonPropertyName("UniqueItems")] - public List? UniqueItems - { - get; - set; - } + public List? UniqueItems { get; set; } } public record ServiceRequirements @@ -142,20 +82,12 @@ public record ServiceRequirements [JsonPropertyName("CompletedQuests")] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public List? CompletedQuests - { - get; - set; - } + public List? CompletedQuests { get; set; } [JsonPropertyName("Standings")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? Standings - { - get; - set; - } + public Dictionary? Standings { get; set; } } public record CompletedQuest @@ -164,11 +96,7 @@ public record CompletedQuest public Dictionary ExtensionData { get; set; } [JsonPropertyName("QuestId")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } } public record StandingRequirement @@ -177,11 +105,7 @@ public record StandingRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("Value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record ServiceItemCostDetails @@ -190,11 +114,7 @@ public record ServiceItemCostDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("Count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } public record BtrServerSettings @@ -203,109 +123,49 @@ public record BtrServerSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("ChanceSpawn")] - public double? ChanceSpawn - { - get; - set; - } + public double? ChanceSpawn { get; set; } [JsonPropertyName("SpawnPeriod")] - public XYZ? SpawnPeriod - { - get; - set; - } + public XYZ? SpawnPeriod { get; set; } [JsonPropertyName("MoveSpeed")] - public float? MoveSpeed - { - get; - set; - } + public float? MoveSpeed { get; set; } [JsonPropertyName("ReadyToDepartureTime")] - public float? ReadyToDepartureTime - { - get; - set; - } + public float? ReadyToDepartureTime { get; set; } [JsonPropertyName("CheckTurnDistanceTime")] - public float? CheckTurnDistanceTime - { - get; - set; - } + public float? CheckTurnDistanceTime { get; set; } [JsonPropertyName("TurnCheckSensitivity")] - public float? TurnCheckSensitivity - { - get; - set; - } + public float? TurnCheckSensitivity { get; set; } [JsonPropertyName("DecreaseSpeedOnTurnLimit")] - public double? DecreaseSpeedOnTurnLimit - { - get; - set; - } + public double? DecreaseSpeedOnTurnLimit { get; set; } [JsonPropertyName("EndSplineDecelerationDistance")] - public double? EndSplineDecelerationDistance - { - get; - set; - } + public double? EndSplineDecelerationDistance { get; set; } [JsonPropertyName("AccelerationSpeed")] - public double? AccelerationSpeed - { - get; - set; - } + public double? AccelerationSpeed { get; set; } [JsonPropertyName("DecelerationSpeed")] - public double? DecelerationSpeed - { - get; - set; - } + public double? DecelerationSpeed { get; set; } [JsonPropertyName("PauseDurationRange")] - public XYZ? PauseDurationRange - { - get; - set; - } + public XYZ? PauseDurationRange { get; set; } [JsonPropertyName("BodySwingReturnSpeed")] - public float? BodySwingReturnSpeed - { - get; - set; - } + public float? BodySwingReturnSpeed { get; set; } [JsonPropertyName("BodySwingDamping")] - public float? BodySwingDamping - { - get; - set; - } + public float? BodySwingDamping { get; set; } [JsonPropertyName("BodySwingIntensity")] - public float? BodySwingIntensity - { - get; - set; - } + public float? BodySwingIntensity { get; set; } [JsonPropertyName("ServerMapBTRSettings")] - public Dictionary? ServerMapBTRSettings - { - get; - set; - } + public Dictionary? ServerMapBTRSettings { get; set; } } public record ServerMapBtrsettings @@ -314,107 +174,47 @@ public record ServerMapBtrsettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("MapID")] - public string? MapID - { - get; - set; - } + public string? MapID { get; set; } [JsonPropertyName("ChanceSpawn")] - public double? ChanceSpawn - { - get; - set; - } + public double? ChanceSpawn { get; set; } [JsonPropertyName("SpawnPeriod")] - public XYZ? SpawnPeriod - { - get; - set; - } + public XYZ? SpawnPeriod { get; set; } [JsonPropertyName("MoveSpeed")] - public float? MoveSpeed - { - get; - set; - } + public float? MoveSpeed { get; set; } [JsonPropertyName("ReadyToDepartureTime")] - public float? ReadyToDepartureTime - { - get; - set; - } + public float? ReadyToDepartureTime { get; set; } [JsonPropertyName("CheckTurnDistanceTime")] - public float? CheckTurnDistanceTime - { - get; - set; - } + public float? CheckTurnDistanceTime { get; set; } [JsonPropertyName("TurnCheckSensitivity")] - public float? TurnCheckSensitivity - { - get; - set; - } + public float? TurnCheckSensitivity { get; set; } [JsonPropertyName("DecreaseSpeedOnTurnLimit")] - public float? DecreaseSpeedOnTurnLimit - { - get; - set; - } + public float? DecreaseSpeedOnTurnLimit { get; set; } [JsonPropertyName("EndSplineDecelerationDistance")] - public float? EndSplineDecelerationDistance - { - get; - set; - } + public float? EndSplineDecelerationDistance { get; set; } [JsonPropertyName("AccelerationSpeed")] - public float? AccelerationSpeed - { - get; - set; - } + public float? AccelerationSpeed { get; set; } [JsonPropertyName("DecelerationSpeed")] - public float? DecelerationSpeed - { - get; - set; - } + public float? DecelerationSpeed { get; set; } [JsonPropertyName("PauseDurationRange")] - public XYZ? PauseDurationRange - { - get; - set; - } + public XYZ? PauseDurationRange { get; set; } [JsonPropertyName("BodySwingReturnSpeed")] - public float? BodySwingReturnSpeed - { - get; - set; - } + public float? BodySwingReturnSpeed { get; set; } [JsonPropertyName("BodySwingDamping")] - public float? BodySwingDamping - { - get; - set; - } + public float? BodySwingDamping { get; set; } [JsonPropertyName("BodySwingIntensity")] - public float? BodySwingIntensity - { - get; - set; - } + public float? BodySwingIntensity { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsBase.cs index 6a86b4ca..e18a0803 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsBase.cs @@ -8,18 +8,10 @@ public record LocationsBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("locations")] - public Locations? Locations - { - get; - set; - } + public Locations? Locations { get; set; } [JsonPropertyName("paths")] - public List? Paths - { - get; - set; - } + public List? Paths { get; set; } } public record Locations @@ -36,22 +28,10 @@ public record Path public Dictionary ExtensionData { get; set; } [JsonPropertyName("Source")] - public string? Source - { - get; - set; - } + public string? Source { get; set; } [JsonPropertyName("Destination")] - public string? Destination - { - get; - set; - } + public string? Destination { get; set; } - public bool? Event - { - get; - set; - } + public bool? Event { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsGenerateAllResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsGenerateAllResponse.cs index 851c12f2..401c2405 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsGenerateAllResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/LocationsGenerateAllResponse.cs @@ -8,16 +8,8 @@ public record LocationsGenerateAllResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("locations")] - public Dictionary Locations - { - get; - set; - } + public Dictionary Locations { get; set; } [JsonPropertyName("paths")] - public List? Paths - { - get; - set; - } + public List? Paths { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Match.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Match.cs index 9d5f862f..58055880 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Match.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Match.cs @@ -8,11 +8,7 @@ public record Match public Dictionary ExtensionData { get; set; } [JsonPropertyName("metrics")] - public Metrics? Metrics - { - get; - set; - } + public Metrics? Metrics { get; set; } } public record Metrics @@ -21,44 +17,20 @@ public record Metrics public Dictionary ExtensionData { get; set; } [JsonPropertyName("Keys")] - public List? Keys - { - get; - set; - } + public List? Keys { get; set; } [JsonPropertyName("NetProcessingBins")] - public List? NetProcessingBins - { - get; - set; - } + public List? NetProcessingBins { get; set; } [JsonPropertyName("RenderBins")] - public List? RenderBins - { - get; - set; - } + public List? RenderBins { get; set; } [JsonPropertyName("GameUpdateBins")] - public List? GameUpdateBins - { - get; - set; - } + public List? GameUpdateBins { get; set; } [JsonPropertyName("MemoryMeasureInterval")] - public int? MemoryMeasureInterval - { - get; - set; - } + public int? MemoryMeasureInterval { get; set; } [JsonPropertyName("PauseReasons")] - public List? PauseReasons - { - get; - set; - } + public List? PauseReasons { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Prestige.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Prestige.cs index b0a9e02d..9dcc2f76 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Prestige.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Prestige.cs @@ -8,11 +8,7 @@ public record Prestige public Dictionary ExtensionData { get; set; } [JsonPropertyName("elements")] - public List? Elements - { - get; - set; - } + public List? Elements { get; set; } } public record PrestigeElement @@ -21,46 +17,22 @@ public record PrestigeElement public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("conditions")] - public List? Conditions - { - get; - set; - } + public List? Conditions { get; set; } [JsonPropertyName("rewards")] - public List? Rewards - { - get; - set; - } + public List? Rewards { get; set; } [JsonPropertyName("transferConfigs")] - public TransferConfigs? TransferConfigs - { - get; - set; - } + public TransferConfigs? TransferConfigs { get; set; } [JsonPropertyName("image")] - public string? Image - { - get; - set; - } + public string? Image { get; set; } [JsonPropertyName("bigImage")] - public string? BigImage - { - get; - set; - } + public string? BigImage { get; set; } } public record TransferConfigs @@ -69,25 +41,13 @@ public record TransferConfigs public Dictionary ExtensionData { get; set; } [JsonPropertyName("stashConfig")] - public StashPrestigeConfig? StashConfig - { - get; - set; - } + public StashPrestigeConfig? StashConfig { get; set; } [JsonPropertyName("skillConfig")] - public PrestigeSkillConfig? SkillConfig - { - get; - set; - } + public PrestigeSkillConfig? SkillConfig { get; set; } [JsonPropertyName("masteringConfig")] - public PrestigeMasteringConfig? MasteringConfig - { - get; - set; - } + public PrestigeMasteringConfig? MasteringConfig { get; set; } } public record StashPrestigeConfig @@ -96,25 +56,13 @@ public record StashPrestigeConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("xCellCount")] - public int? XCellCount - { - get; - set; - } + public int? XCellCount { get; set; } [JsonPropertyName("yCellCount")] - public int? YCellCount - { - get; - set; - } + public int? YCellCount { get; set; } [JsonPropertyName("filters")] - public StashPrestigeFilters? Filters - { - get; - set; - } + public StashPrestigeFilters? Filters { get; set; } } public record StashPrestigeFilters @@ -123,18 +71,10 @@ public record StashPrestigeFilters public Dictionary ExtensionData { get; set; } [JsonPropertyName("includedItems")] - public List? IncludedItems - { - get; - set; - } + public List? IncludedItems { get; set; } [JsonPropertyName("excludedItems")] - public List? ExcludedItems - { - get; - set; - } + public List? ExcludedItems { get; set; } } public record PrestigeSkillConfig @@ -143,11 +83,7 @@ public record PrestigeSkillConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("transferMultiplier")] - public double? TransferMultiplier - { - get; - set; - } + public double? TransferMultiplier { get; set; } } public record PrestigeMasteringConfig @@ -156,9 +92,5 @@ public record PrestigeMasteringConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("transferMultiplier")] - public double? TransferMultiplier - { - get; - set; - } + public double? TransferMultiplier { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/ProfileTemplate.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/ProfileTemplate.cs index 8a15511e..facc4516 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/ProfileTemplate.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/ProfileTemplate.cs @@ -9,25 +9,13 @@ public record ProfileSides public Dictionary ExtensionData { get; set; } [JsonPropertyName("descriptionLocaleKey")] - public string? DescriptionLocaleKey - { - get; - set; - } + public string? DescriptionLocaleKey { get; set; } [JsonPropertyName("usec")] - public TemplateSide? Usec - { - get; - set; - } + public TemplateSide? Usec { get; set; } [JsonPropertyName("bear")] - public TemplateSide? Bear - { - get; - set; - } + public TemplateSide? Bear { get; set; } } public record TemplateSide @@ -36,53 +24,25 @@ public record TemplateSide public Dictionary ExtensionData { get; set; } [JsonPropertyName("character")] - public PmcData? Character - { - get; - set; - } + public PmcData? Character { get; set; } [JsonPropertyName("suits")] - public List? Suits - { - get; - set; - } + public List? Suits { get; set; } [JsonPropertyName("dialogues")] - public Dictionary? Dialogues - { - get; - set; - } + public Dictionary? Dialogues { get; set; } [JsonPropertyName("userbuilds")] - public UserBuilds? UserBuilds - { - get; - set; - } + public UserBuilds? UserBuilds { get; set; } [JsonPropertyName("trader")] - public ProfileTraderTemplate? Trader - { - get; - set; - } + public ProfileTraderTemplate? Trader { get; set; } [JsonPropertyName("equipmentBuilds")] - public object? EquipmentBuilds - { - get; - set; - } + public object? EquipmentBuilds { get; set; } [JsonPropertyName("weaponbuilds")] - public object? WeaponBuilds - { - get; - set; - } + public object? WeaponBuilds { get; set; } } public record ProfileTraderTemplate @@ -91,74 +51,38 @@ public record ProfileTraderTemplate public Dictionary ExtensionData { get; set; } [JsonPropertyName("initialLoyaltyLevel")] - public Dictionary? InitialLoyaltyLevel - { - get; - set; - } + public Dictionary? InitialLoyaltyLevel { get; set; } [JsonPropertyName("initialStanding")] - public Dictionary? InitialStanding - { - get; - set; - } + public Dictionary? InitialStanding { get; set; } [JsonPropertyName("setQuestsAvailableForStart")] - public bool? SetQuestsAvailableForStart - { - get; - set; - } + public bool? SetQuestsAvailableForStart { get; set; } [JsonPropertyName("setQuestsAvailableForFinish")] - public bool? SetQuestsAvailableForFinish - { - get; - set; - } + public bool? SetQuestsAvailableForFinish { get; set; } [JsonPropertyName("initialSalesSum")] - public int? InitialSalesSum - { - get; - set; - } + public int? InitialSalesSum { get; set; } [JsonPropertyName("jaegerUnlocked")] - public bool? JaegerUnlocked - { - get; - set; - } + public bool? JaegerUnlocked { get; set; } /// /// How many days is usage of the flea blocked for upon profile creation /// [JsonPropertyName("fleaBlockedDays")] - public int? FleaBlockedDays - { - get; - set; - } + public int? FleaBlockedDays { get; set; } /// /// What traders default to being locked on profile creation /// [JsonPropertyName("lockedByDefaultOverride")] - public List? LockedByDefaultOverride - { - get; - set; - } + public List? LockedByDefaultOverride { get; set; } /// /// What traders should have their clothing unlocked/purchased on creation /// [JsonPropertyName("purchaseAllClothingByDefaultForTrader")] - public List? PurchaseAllClothingByDefaultForTrader - { - get; - set; - } + public List? PurchaseAllClothingByDefaultForTrader { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Quest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Quest.cs index 6a19ff33..855b246a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Quest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Quest.cs @@ -14,269 +14,125 @@ public record Quest /// SPT addition - human readable quest name /// [JsonPropertyName("QuestName")] - public string? QuestName - { - get; - set; - } + public string? QuestName { get; set; } /// /// _id /// [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("canShowNotificationsInGame")] - public bool? CanShowNotificationsInGame - { - get; - set; - } + public bool? CanShowNotificationsInGame { get; set; } [JsonPropertyName("conditions")] - public QuestConditionTypes? Conditions - { - get; - set; - } + public QuestConditionTypes? Conditions { get; set; } [JsonPropertyName("description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("failMessageText")] - public string? FailMessageText - { - get; - set; - } + public string? FailMessageText { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("note")] - public string? Note - { - get; - set; - } + public string? Note { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("image")] - public string? Image - { - get; - set; - } + public string? Image { get; set; } [JsonPropertyName("type")] // can be string or QuestTypeEnum [JsonConverter(typeof(JsonStringEnumConverter))] - public QuestTypeEnum? Type - { - get; - set; - } + public QuestTypeEnum? Type { get; set; } [JsonPropertyName("isKey")] - public bool? IsKey - { - get; - set; - } + public bool? IsKey { get; set; } [JsonPropertyName("restartable")] - public bool? Restartable - { - get; - set; - } + public bool? Restartable { get; set; } [JsonPropertyName("instantComplete")] - public bool? InstantComplete - { - get; - set; - } + public bool? InstantComplete { get; set; } [JsonPropertyName("secretQuest")] - public bool? SecretQuest - { - get; - set; - } + public bool? SecretQuest { get; set; } [JsonPropertyName("startedMessageText")] - public string? StartedMessageText - { - get; - set; - } + public string? StartedMessageText { get; set; } [JsonPropertyName("successMessageText")] - public string? SuccessMessageText - { - get; - set; - } + public string? SuccessMessageText { get; set; } [JsonPropertyName("acceptPlayerMessage")] - public string? AcceptPlayerMessage - { - get; - set; - } + public string? AcceptPlayerMessage { get; set; } [JsonPropertyName("declinePlayerMessage")] - public string? DeclinePlayerMessage - { - get; - set; - } + public string? DeclinePlayerMessage { get; set; } [JsonPropertyName("completePlayerMessage")] - public string? CompletePlayerMessage - { - get; - set; - } + public string? CompletePlayerMessage { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("rewards")] - public QuestRewards? Rewards - { - get; - set; - } + public QuestRewards? Rewards { get; set; } /// /// Becomes 'AppearStatus' inside client /// [JsonPropertyName("status")] - public int? Status - { - get; - set; - } + public int? Status { get; set; } [JsonPropertyName("KeyQuest")] - public bool? KeyQuest - { - get; - set; - } + public bool? KeyQuest { get; set; } [JsonPropertyName("changeQuestMessageText")] - public string? ChangeQuestMessageText - { - get; - set; - } + public string? ChangeQuestMessageText { get; set; } /// /// "Pmc" or "Scav" /// [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("acceptanceAndFinishingSource")] - public string? AcceptanceAndFinishingSource - { - get; - set; - } + public string? AcceptanceAndFinishingSource { get; set; } [JsonPropertyName("progressSource")] - public string? ProgressSource - { - get; - set; - } + public string? ProgressSource { get; set; } [JsonPropertyName("rankingModes")] - public List? RankingModes - { - get; - set; - } + public List? RankingModes { get; set; } [JsonPropertyName("gameModes")] - public List? GameModes - { - get; - set; - } + public List? GameModes { get; set; } [JsonPropertyName("arenaLocations")] - public List? ArenaLocations - { - get; - set; - } + public List? ArenaLocations { get; set; } /// /// Status of quest to player /// [JsonPropertyName("sptStatus")] - public QuestStatusEnum? SptStatus - { - get; - set; - } + public QuestStatusEnum? SptStatus { get; set; } [JsonPropertyName("questStatus")] - public QuestStatus? QuestStatus - { - get; - set; - } + public QuestStatus? QuestStatus { get; set; } [JsonPropertyName("changeCost")] - public List ChangeCost - { - get; - set; - } + public List ChangeCost { get; set; } [JsonPropertyName("changeStandingCost")] - public double ChangeStandingCost - { - get; - set; - } + public double ChangeStandingCost { get; set; } } /// @@ -288,60 +144,28 @@ public record QuestStatus public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } [JsonPropertyName("qid")] - public string? QId - { - get; - set; - } + public string? QId { get; set; } [JsonPropertyName("startTime")] - public double? StartTime - { - get; - set; - } + public double? StartTime { get; set; } [JsonPropertyName("status")] - public QuestStatusEnum? Status - { - get; - set; - } + public QuestStatusEnum? Status { get; set; } [JsonPropertyName("statusTimers")] - public Dictionary? StatusTimers - { - get; - set; - } + public Dictionary? StatusTimers { get; set; } [JsonPropertyName("completedConditions")] - public List? CompletedConditions - { - get; - set; - } + public List? CompletedConditions { get; set; } [JsonPropertyName("availableAfter")] - public double? AvailableAfter - { - get; - set; - } + public double? AvailableAfter { get; set; } } public record QuestConditionTypes @@ -350,39 +174,19 @@ public record QuestConditionTypes public Dictionary ExtensionData { get; set; } [JsonPropertyName("Started")] - public List? Started - { - get; - set; - } + public List? Started { get; set; } [JsonPropertyName("AvailableForFinish")] - public List? AvailableForFinish - { - get; - set; - } + public List? AvailableForFinish { get; set; } [JsonPropertyName("AvailableForStart")] - public List? AvailableForStart - { - get; - set; - } + public List? AvailableForStart { get; set; } [JsonPropertyName("Success")] - public List? Success - { - get; - set; - } + public List? Success { get; set; } [JsonPropertyName("Fail")] - public List? Fail - { - get; - set; - } + public List? Fail { get; set; } } public record QuestCondition @@ -391,311 +195,139 @@ public record QuestCondition public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("compareMethod")] - public string? CompareMethod - { - get; - set; - } + public string? CompareMethod { get; set; } [JsonPropertyName("dynamicLocale")] - public bool? DynamicLocale - { - get; - set; - } + public bool? DynamicLocale { get; set; } [JsonPropertyName("visibilityConditions")] - public List? VisibilityConditions - { - get; - set; - } + public List? VisibilityConditions { get; set; } [JsonPropertyName("globalQuestCounterId")] - public string? GlobalQuestCounterId - { - get; - set; - } + public string? GlobalQuestCounterId { get; set; } [JsonPropertyName("parentId")] - public string? ParentId - { - get; - set; - } + public string? ParentId { get; set; } /// /// Can be: string[] or string /// [JsonPropertyName("target")] [JsonConverter(typeof(ListOrTConverterFactory))] - public ListOrT? Target - { - get; - set; - } + public ListOrT? Target { get; set; } [JsonPropertyName("value")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("status")] - public List? Status - { - get; - set; - } + public List? Status { get; set; } [JsonPropertyName("availableAfter")] - public int? AvailableAfter - { - get; - set; - } + public int? AvailableAfter { get; set; } [JsonPropertyName("dispersion")] - public double? Dispersion - { - get; - set; - } + public double? Dispersion { get; set; } [JsonPropertyName("onlyFoundInRaid")] - public bool? OnlyFoundInRaid - { - get; - set; - } + public bool? OnlyFoundInRaid { get; set; } [JsonPropertyName("oneSessionOnly")] - public bool? OneSessionOnly - { - get; - set; - } + public bool? OneSessionOnly { get; set; } [JsonPropertyName("isResetOnConditionFailed")] - public bool? IsResetOnConditionFailed - { - get; - set; - } + public bool? IsResetOnConditionFailed { get; set; } [JsonPropertyName("isNecessary")] - public bool? IsNecessary - { - get; - set; - } + public bool? IsNecessary { get; set; } [JsonPropertyName("doNotResetIfCounterCompleted")] - public bool? DoNotResetIfCounterCompleted - { - get; - set; - } + public bool? DoNotResetIfCounterCompleted { get; set; } [JsonPropertyName("dogtagLevel")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? DogtagLevel - { - get; - set; - } + public int? DogtagLevel { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("maxDurability")] - public double? MaxDurability - { - get; - set; - } + public double? MaxDurability { get; set; } [JsonPropertyName("minDurability")] - public double? MinDurability - { - get; - set; - } + public double? MinDurability { get; set; } [JsonPropertyName("counter")] - public QuestConditionCounter? Counter - { - get; - set; - } + public QuestConditionCounter? Counter { get; set; } [JsonPropertyName("plantTime")] - public double? PlantTime - { - get; - set; - } + public double? PlantTime { get; set; } [JsonPropertyName("zoneId")] - public string? ZoneId - { - get; - set; - } + public string? ZoneId { get; set; } [JsonPropertyName("countInRaid")] - public bool? CountInRaid - { - get; - set; - } + public bool? CountInRaid { get; set; } [JsonPropertyName("completeInSeconds")] - public double? CompleteInSeconds - { - get; - set; - } + public double? CompleteInSeconds { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("conditionType")] - public string? ConditionType - { - get; - set; - } + public string? ConditionType { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("baseAccuracy")] - public ValueCompare? BaseAccuracy - { - get; - set; - } + public ValueCompare? BaseAccuracy { get; set; } [JsonPropertyName("containsItems")] - public List? ContainsItems - { - get; - set; - } + public List? ContainsItems { get; set; } [JsonPropertyName("durability")] - public ValueCompare? Durability - { - get; - set; - } + public ValueCompare? Durability { get; set; } [JsonPropertyName("effectiveDistance")] - public ValueCompare? EffectiveDistance - { - get; - set; - } + public ValueCompare? EffectiveDistance { get; set; } [JsonPropertyName("emptyTacticalSlot")] - public ValueCompare? EmptyTacticalSlot - { - get; - set; - } + public ValueCompare? EmptyTacticalSlot { get; set; } [JsonPropertyName("ergonomics")] - public ValueCompare? Ergonomics - { - get; - set; - } + public ValueCompare? Ergonomics { get; set; } [JsonPropertyName("height")] - public ValueCompare? Height - { - get; - set; - } + public ValueCompare? Height { get; set; } [JsonPropertyName("hasItemFromCategory")] - public List? HasItemFromCategory - { - get; - set; - } + public List? HasItemFromCategory { get; set; } [JsonPropertyName("magazineCapacity")] - public ValueCompare? MagazineCapacity - { - get; - set; - } + public ValueCompare? MagazineCapacity { get; set; } [JsonPropertyName("muzzleVelocity")] - public ValueCompare? MuzzleVelocity - { - get; - set; - } + public ValueCompare? MuzzleVelocity { get; set; } [JsonPropertyName("recoil")] - public ValueCompare? Recoil - { - get; - set; - } + public ValueCompare? Recoil { get; set; } [JsonPropertyName("weight")] - public ValueCompare? Weight - { - get; - set; - } + public ValueCompare? Weight { get; set; } [JsonPropertyName("width")] - public ValueCompare? Width - { - get; - set; - } + public ValueCompare? Width { get; set; } } public record QuestConditionCounter @@ -704,18 +336,10 @@ public record QuestConditionCounter public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("conditions")] - public List? Conditions - { - get; - set; - } + public List? Conditions { get; set; } } public record QuestConditionCounterCondition @@ -724,208 +348,92 @@ public record QuestConditionCounterCondition public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("dynamicLocale")] - public bool? DynamicLocale - { - get; - set; - } + public bool? DynamicLocale { get; set; } [JsonPropertyName("target")] [JsonConverter(typeof(ListOrTConverterFactory))] - public ListOrT? Target - { - get; - set; - } + public ListOrT? Target { get; set; } [JsonPropertyName("completeInSeconds")] - public int? CompleteInSeconds - { - get; - set; - } + public int? CompleteInSeconds { get; set; } [JsonPropertyName("energy")] - public ValueCompare? Energy - { - get; - set; - } + public ValueCompare? Energy { get; set; } [JsonPropertyName("exitName")] - public string? ExitName - { - get; - set; - } + public string? ExitName { get; set; } [JsonPropertyName("hydration")] - public ValueCompare? Hydration - { - get; - set; - } + public ValueCompare? Hydration { get; set; } [JsonPropertyName("time")] - public ValueCompare? Time - { - get; - set; - } + public ValueCompare? Time { get; set; } [JsonPropertyName("compareMethod")] - public string? CompareMethod - { - get; - set; - } + public string? CompareMethod { get; set; } [JsonPropertyName("value")] - public object? Value - { - get; - set; - } + public object? Value { get; set; } [JsonPropertyName("weapon")] - public List? Weapon - { - get; - set; - } + public List? Weapon { get; set; } [JsonPropertyName("distance")] - public CounterConditionDistance? Distance - { - get; - set; - } + public CounterConditionDistance? Distance { get; set; } [JsonPropertyName("equipmentInclusive")] - public List>? EquipmentInclusive - { - get; - set; - } + public List>? EquipmentInclusive { get; set; } [JsonPropertyName("weaponModsInclusive")] - public List>? WeaponModsInclusive - { - get; - set; - } + public List>? WeaponModsInclusive { get; set; } [JsonPropertyName("weaponModsExclusive")] - public List>? WeaponModsExclusive - { - get; - set; - } + public List>? WeaponModsExclusive { get; set; } [JsonPropertyName("enemyEquipmentInclusive")] - public List>? EnemyEquipmentInclusive - { - get; - set; - } + public List>? EnemyEquipmentInclusive { get; set; } [JsonPropertyName("enemyEquipmentExclusive")] - public List>? EnemyEquipmentExclusive - { - get; - set; - } + public List>? EnemyEquipmentExclusive { get; set; } [JsonPropertyName("weaponCaliber")] - public List? WeaponCaliber - { - get; - set; - } + public List? WeaponCaliber { get; set; } [JsonPropertyName("savageRole")] - public List? SavageRole - { - get; - set; - } + public List? SavageRole { get; set; } [JsonPropertyName("status")] - public List? Status - { - get; - set; - } + public List? Status { get; set; } [JsonPropertyName("bodyPart")] - public List? BodyPart - { - get; - set; - } + public List? BodyPart { get; set; } [JsonPropertyName("daytime")] - public DaytimeCounter? Daytime - { - get; - set; - } + public DaytimeCounter? Daytime { get; set; } [JsonPropertyName("conditionType")] - public string? ConditionType - { - get; - set; - } + public string? ConditionType { get; set; } [JsonPropertyName("enemyHealthEffects")] - public List? EnemyHealthEffects - { - get; - set; - } + public List? EnemyHealthEffects { get; set; } [JsonPropertyName("resetOnSessionEnd")] - public bool? ResetOnSessionEnd - { - get; - set; - } + public bool? ResetOnSessionEnd { get; set; } [JsonPropertyName("bodyPartsWithEffects")] - public List? BodyPartsWithEffects - { - get; - set; - } + public List? BodyPartsWithEffects { get; set; } [JsonPropertyName("IncludeNotEquippedItems")] - public bool? IncludeNotEquippedItems - { - get; - set; - } + public bool? IncludeNotEquippedItems { get; set; } [JsonPropertyName("equipmentExclusive")] - public List>? EquipmentExclusive - { - get; - set; - } + public List>? EquipmentExclusive { get; set; } [JsonPropertyName("zoneIds")] - public List? Zones - { - get; - set; - } + public List? Zones { get; set; } } public record EnemyHealthEffect @@ -934,18 +442,10 @@ public record EnemyHealthEffect public Dictionary ExtensionData { get; set; } [JsonPropertyName("bodyParts")] - public List? BodyParts - { - get; - set; - } + public List? BodyParts { get; set; } [JsonPropertyName("effects")] - public List? Effects - { - get; - set; - } + public List? Effects { get; set; } } public record ValueCompare @@ -954,18 +454,10 @@ public record ValueCompare public Dictionary ExtensionData { get; set; } [JsonPropertyName("compareMethod")] - public string? CompareMethod - { - get; - set; - } + public string? CompareMethod { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record CounterConditionDistance @@ -974,18 +466,10 @@ public record CounterConditionDistance public Dictionary ExtensionData { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("compareMethod")] - public string? CompareMethod - { - get; - set; - } + public string? CompareMethod { get; set; } } public record DaytimeCounter @@ -994,18 +478,10 @@ public record DaytimeCounter public Dictionary ExtensionData { get; set; } [JsonPropertyName("from")] - public int? From - { - get; - set; - } + public int? From { get; set; } [JsonPropertyName("to")] - public int? To - { - get; - set; - } + public int? To { get; set; } } public record VisibilityCondition @@ -1014,46 +490,22 @@ public record VisibilityCondition public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("target")] - public string? Target - { - get; - set; - } + public string? Target { get; set; } [JsonPropertyName("value")] - public int? Value - { - get; - set; - } + public int? Value { get; set; } [JsonPropertyName("dynamicLocale")] - public bool? DynamicLocale - { - get; - set; - } + public bool? DynamicLocale { get; set; } [JsonPropertyName("oneSessionOnly")] - public bool? OneSessionOnly - { - get; - set; - } + public bool? OneSessionOnly { get; set; } [JsonPropertyName("conditionType")] - public string? ConditionType - { - get; - set; - } + public string? ConditionType { get; set; } } public record QuestRewards @@ -1062,51 +514,23 @@ public record QuestRewards public Dictionary ExtensionData { get; set; } [JsonPropertyName("AvailableForStart")] - public List? AvailableForStart - { - get; - set; - } + public List? AvailableForStart { get; set; } [JsonPropertyName("AvailableForFinish")] - public List? AvailableForFinish - { - get; - set; - } + public List? AvailableForFinish { get; set; } [JsonPropertyName("Started")] - public List? Started - { - get; - set; - } + public List? Started { get; set; } [JsonPropertyName("Success")] - public List? Success - { - get; - set; - } + public List? Success { get; set; } [JsonPropertyName("Fail")] - public List? Fail - { - get; - set; - } + public List? Fail { get; set; } [JsonPropertyName("FailRestartable")] - public List? FailRestartable - { - get; - set; - } + public List? FailRestartable { get; set; } [JsonPropertyName("Expired")] - public List? Expired - { - get; - set; - } + public List? Expired { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/RepeatableQuests.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/RepeatableQuests.cs index f55a1663..9bb8dc8c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/RepeatableQuests.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/RepeatableQuests.cs @@ -5,67 +5,31 @@ namespace SPTarkov.Server.Core.Models.Eft.Common.Tables; public record RepeatableQuest : Quest { [JsonPropertyName("changeCost")] - public List? ChangeCost - { - get; - set; - } + public List? ChangeCost { get; set; } [JsonPropertyName("changeStandingCost")] - public int? ChangeStandingCost - { - get; - set; - } + public int? ChangeStandingCost { get; set; } [JsonPropertyName("sptRepatableGroupName")] - public string? SptRepatableGroupName - { - get; - set; - } + public string? SptRepatableGroupName { get; set; } [JsonPropertyName("acceptanceAndFinishingSource")] - public string? AcceptanceAndFinishingSource - { - get; - set; - } + public string? AcceptanceAndFinishingSource { get; set; } [JsonPropertyName("progressSource")] - public string? ProgressSource - { - get; - set; - } + public string? ProgressSource { get; set; } [JsonPropertyName("rankingModes")] - public List? RankingModes - { - get; - set; - } + public List? RankingModes { get; set; } [JsonPropertyName("gameModes")] - public List? GameModes - { - get; - set; - } + public List? GameModes { get; set; } [JsonPropertyName("arenaLocations")] - public List? ArenaLocations - { - get; - set; - } + public List? ArenaLocations { get; set; } [JsonPropertyName("questStatus")] - public RepeatableQuestStatus? QuestStatus - { - get; - set; - } + public RepeatableQuestStatus? QuestStatus { get; set; } } public record RepeatableQuestDatabase @@ -74,32 +38,16 @@ public record RepeatableQuestDatabase public Dictionary ExtensionData { get; set; } [JsonPropertyName("templates")] - public RepeatableTemplates? Templates - { - get; - set; - } + public RepeatableTemplates? Templates { get; set; } [JsonPropertyName("rewards")] - public RewardOptions? Rewards - { - get; - set; - } + public RewardOptions? Rewards { get; set; } [JsonPropertyName("data")] - public Options? Data - { - get; - set; - } + public Options? Data { get; set; } [JsonPropertyName("samples")] - public List? Samples - { - get; - set; - } + public List? Samples { get; set; } } public record RepeatableQuestStatus @@ -108,46 +56,22 @@ public record RepeatableQuestStatus public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } [JsonPropertyName("qid")] - public string? QId - { - get; - set; - } + public string? QId { get; set; } [JsonPropertyName("startTime")] - public long? StartTime - { - get; - set; - } + public long? StartTime { get; set; } [JsonPropertyName("status")] - public int? Status - { - get; - set; - } + public int? Status { get; set; } [JsonPropertyName("statusTimers")] - public object? StatusTimers - { - get; - set; - } // Use object for any type + public object? StatusTimers { get; set; } // Use object for any type } public record RepeatableTemplates @@ -156,32 +80,16 @@ public record RepeatableTemplates public Dictionary ExtensionData { get; set; } [JsonPropertyName("Elimination")] - public RepeatableQuest? Elimination - { - get; - set; - } + public RepeatableQuest? Elimination { get; set; } [JsonPropertyName("Completion")] - public RepeatableQuest? Completion - { - get; - set; - } + public RepeatableQuest? Completion { get; set; } [JsonPropertyName("Exploration")] - public RepeatableQuest? Exploration - { - get; - set; - } + public RepeatableQuest? Exploration { get; set; } [JsonPropertyName("Pickup")] - public RepeatableQuest? Pickup - { - get; - set; - } + public RepeatableQuest? Pickup { get; set; } } public record PmcDataRepeatableQuest @@ -190,71 +98,35 @@ public record PmcDataRepeatableQuest public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("unavailableTime")] - public string? UnavailableTime - { - get; - set; - } + public string? UnavailableTime { get; set; } [JsonPropertyName("activeQuests")] - public List? ActiveQuests - { - get; - set; - } + public List? ActiveQuests { get; set; } [JsonPropertyName("inactiveQuests")] - public List? InactiveQuests - { - get; - set; - } + public List? InactiveQuests { get; set; } [JsonPropertyName("endTime")] - public long? EndTime - { - get; - set; - } + public long? EndTime { get; set; } /// /// What it costs to reset: QuestId, ChangeRequirement. Redundant to change requirements within RepeatableQuest /// [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("changeRequirement")] - public Dictionary? ChangeRequirement - { - get; - set; - } + public Dictionary? ChangeRequirement { get; set; } [JsonPropertyName("freeChanges")] - public int? FreeChanges - { - get; - set; - } + public int? FreeChanges { get; set; } [JsonPropertyName("freeChangesAvailable")] - public int? FreeChangesAvailable - { - get; - set; - } + public int? FreeChangesAvailable { get; set; } } public record ChangeRequirement @@ -263,18 +135,10 @@ public record ChangeRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("changeCost")] - public List? ChangeCost - { - get; - set; - } + public List? ChangeCost { get; set; } [JsonPropertyName("changeStandingCost")] - public double? ChangeStandingCost - { - get; - set; - } + public double? ChangeStandingCost { get; set; } } public record ChangeCost @@ -286,21 +150,13 @@ public record ChangeCost /// What item it will take to reset daily /// [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } /// /// Amount of item needed to reset /// [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } // Config Options @@ -311,11 +167,7 @@ public record RewardOptions public Dictionary ExtensionData { get; set; } [JsonPropertyName("itemsBlacklist")] - public List? ItemsBlacklist - { - get; - set; - } + public List? ItemsBlacklist { get; set; } } public record Options @@ -324,11 +176,7 @@ public record Options public Dictionary ExtensionData { get; set; } [JsonPropertyName("Completion")] - public CompletionFilter? Completion - { - get; - set; - } + public CompletionFilter? Completion { get; set; } } public record CompletionFilter @@ -337,18 +185,10 @@ public record CompletionFilter public Dictionary ExtensionData { get; set; } [JsonPropertyName("itemsBlacklist")] - public List? ItemsBlacklist - { - get; - set; - } + public List? ItemsBlacklist { get; set; } [JsonPropertyName("itemsWhitelist")] - public List? ItemsWhitelist - { - get; - set; - } + public List? ItemsWhitelist { get; set; } } public record ItemsBlacklist @@ -357,18 +197,10 @@ public record ItemsBlacklist public Dictionary ExtensionData { get; set; } [JsonPropertyName("minPlayerLevel")] - public int? MinPlayerLevel - { - get; - set; - } + public int? MinPlayerLevel { get; set; } [JsonPropertyName("itemIds")] - public List? ItemIds - { - get; - set; - } + public List? ItemIds { get; set; } } public record ItemsWhitelist @@ -377,18 +209,10 @@ public record ItemsWhitelist public Dictionary ExtensionData { get; set; } [JsonPropertyName("minPlayerLevel")] - public int? MinPlayerLevel - { - get; - set; - } + public int? MinPlayerLevel { get; set; } [JsonPropertyName("itemIds")] - public List? ItemIds - { - get; - set; - } + public List? ItemIds { get; set; } } public record SampleQuests @@ -397,135 +221,59 @@ public record SampleQuests public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("image")] - public string? Image - { - get; - set; - } + public string? Image { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("isKey")] - public bool? IsKey - { - get; - set; - } + public bool? IsKey { get; set; } [JsonPropertyName("restartable")] - public bool? Restartable - { - get; - set; - } + public bool? Restartable { get; set; } [JsonPropertyName("instantComplete")] - public bool? InstantComplete - { - get; - set; - } + public bool? InstantComplete { get; set; } [JsonPropertyName("secretQuest")] - public bool? SecretQuest - { - get; - set; - } + public bool? SecretQuest { get; set; } [JsonPropertyName("canShowNotificationsInGame")] - public bool? CanShowNotificationsInGame - { - get; - set; - } + public bool? CanShowNotificationsInGame { get; set; } [JsonPropertyName("rewards")] - public QuestRewards? Rewards - { - get; - set; - } + public QuestRewards? Rewards { get; set; } [JsonPropertyName("conditions")] - public QuestConditionTypes? Conditions - { - get; - set; - } + public QuestConditionTypes? Conditions { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("note")] - public string? Note - { - get; - set; - } + public string? Note { get; set; } [JsonPropertyName("description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("successMessageText")] - public string? SuccessMessageText - { - get; - set; - } + public string? SuccessMessageText { get; set; } [JsonPropertyName("failMessageText")] - public string? FailMessageText - { - get; - set; - } + public string? FailMessageText { get; set; } [JsonPropertyName("startedMessageText")] - public string? StartedMessageText - { - get; - set; - } + public string? StartedMessageText { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Reward.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Reward.cs index 6a12ae06..acb1e022 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Reward.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Reward.cs @@ -11,125 +11,61 @@ public record Reward [JsonPropertyName("value")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public RewardType? Type - { - get; - set; - } + public RewardType? Type { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("target")] - public string? Target - { - get; - set; - } + public string? Target { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("loyaltyLevel")] - public int? LoyaltyLevel - { - get; - set; - } + public int? LoyaltyLevel { get; set; } /// /// Hideout area id /// [JsonPropertyName("traderId")] - public object? TraderId - { - get; - set; - } // TODO: string | int + public object? TraderId { get; set; } // TODO: string | int [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("unknown")] - public bool? Unknown - { - get; - set; - } + public bool? Unknown { get; set; } [JsonPropertyName("findInRaid")] - public bool? FindInRaid - { - get; - set; - } + public bool? FindInRaid { get; set; } [JsonPropertyName("gameMode")] - public List? GameMode - { - get; - set; - } + public List? GameMode { get; set; } /// /// Game editions whitelisted to get reward /// [JsonPropertyName("availableInGameEditions")] - public HashSet? AvailableInGameEditions - { - get; - set; - } + public HashSet? AvailableInGameEditions { get; set; } /// /// Game editions blacklisted from getting reward /// [JsonPropertyName("notAvailableInGameEditions")] - public HashSet? NotAvailableInGameEditions - { - get; - set; - } + public HashSet? NotAvailableInGameEditions { get; set; } // This is always Null atm in the achievements.json [JsonPropertyName("illustrationConfig")] - public object? IllustrationConfig - { - get; - set; - } + public object? IllustrationConfig { get; set; } [JsonPropertyName("isHidden")] - public bool? IsHidden - { - get; - set; - } + public bool? IsHidden { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/TemplateItem.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/TemplateItem.cs index 175271ba..31dcacdc 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/TemplateItem.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/TemplateItem.cs @@ -25,73 +25,39 @@ public record TemplateItem [JsonPropertyName("_id")] public string? Id { - get - { - return _id; - } - set - { - _id = string.Intern(value); - } + get { return _id; } + set { _id = string.Intern(value); } } [JsonPropertyName("_name")] public string? Name { - get - { - return _name; - } - set - { - _name = string.Intern(value); - } + get { return _name; } + set { _name = string.Intern(value); } } [JsonPropertyName("_parent")] public string? Parent { - get - { - return _parent; - } - set - { - _parent = string.Intern(value); - } + get { return _parent; } + set { _parent = string.Intern(value); } } [JsonPropertyName("_type")] public string? Type { - get - { - return _type; - } - set - { - _type = value != null ? string.Intern(value) : null; - } + get { return _type; } + set { _type = value != null ? string.Intern(value) : null; } } [JsonPropertyName("_props")] - public Props? Properties - { - get; - set; - } + public Props? Properties { get; set; } [JsonPropertyName("_proto")] public string? Prototype { - get - { - return _prototype; - } - set - { - _prototype = string.Intern(value); - } + get { return _prototype; } + set { _prototype = string.Intern(value); } } /// @@ -110,7 +76,7 @@ public record TemplateItem { Containers.Eyewear, Properties?.BlocksEyewear ?? false }, { Containers.FaceCover, Properties?.BlocksFaceCover ?? false }, { Containers.Folding, Properties?.BlocksFolding ?? false }, - { Containers.Headwear, Properties?.BlocksHeadwear ?? false } + { Containers.Headwear, Properties?.BlocksHeadwear ?? false }, }; } } @@ -131,3398 +97,1485 @@ public record Props private string? _unlootableFromSlot; [JsonPropertyName("AllowSpawnOnLocations")] - public List? AllowSpawnOnLocations - { - get; - set; - } + public List? AllowSpawnOnLocations { get; set; } [JsonPropertyName("BeltMagazineRefreshCount")] - public double? BeltMagazineRefreshCount - { - get; - set; - } + public double? BeltMagazineRefreshCount { get; set; } [JsonPropertyName("ChangePriceCoef")] - public double? ChangePriceCoef - { - get; - set; - } + public double? ChangePriceCoef { get; set; } [JsonPropertyName("FixedPrice")] - public bool? FixedPrice - { - get; - set; - } + public bool? FixedPrice { get; set; } [JsonPropertyName("SendToClient")] - public bool? SendToClient - { - get; - set; - } + public bool? SendToClient { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("ShortName")] - public string? ShortName - { - get; - set; - } + public string? ShortName { get; set; } [JsonPropertyName("Description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("Weight")] - public double? Weight - { - get; - set; - } + public double? Weight { get; set; } [JsonPropertyName("WeightMultipliers")] - public object? WeightMultipliers - { - get; - set; - } + public object? WeightMultipliers { get; set; } [JsonPropertyName("BackgroundColor")] public string? BackgroundColor { - get - { - return _backgroundColor; - } - set - { - _backgroundColor = string.Intern(value); - } + get { return _backgroundColor; } + set { _backgroundColor = string.Intern(value); } } // Type confirmed via client [JsonPropertyName("Width")] - public int? Width - { - get; - set; - } + public int? Width { get; set; } // Type confirmed via client [JsonPropertyName("Height")] - public int? Height - { - get; - set; - } + public int? Height { get; set; } // Type confirmed via client [JsonPropertyName("StackMaxSize")] - public int? StackMaxSize - { - get; - set; - } + public int? StackMaxSize { get; set; } // Type confirmed via client [JsonPropertyName("Rarity")] - public LootRarity? Rarity - { - get; - set; - } + public LootRarity? Rarity { get; set; } [JsonPropertyName("SpawnChance")] - public double? SpawnChance - { - get; - set; - } + public double? SpawnChance { get; set; } [JsonPropertyName("CreditsPrice")] - public double? CreditsPrice - { - get; - set; - } + public double? CreditsPrice { get; set; } [JsonPropertyName("ItemSound")] public string? ItemSound { - get - { - return _itemSound; - } - set - { - _itemSound = string.Intern(value); - } + get { return _itemSound; } + set { _itemSound = string.Intern(value); } } [JsonPropertyName("Prefab")] // TODO: TYPE FUCKERY: can be a Prefab object or empty string or a string - public Prefab? Prefab - { - get; - set; - } + public Prefab? Prefab { get; set; } [JsonPropertyName("UsePrefab")] - public Prefab? UsePrefab - { - get; - set; - } + public Prefab? UsePrefab { get; set; } [JsonPropertyName("airDropTemplateId")] - public string? AirDropTemplateId - { - get; - set; - } + public string? AirDropTemplateId { get; set; } [JsonPropertyName("StackObjectsCount")] - public double? StackObjectsCount - { - get; - set; - } + public double? StackObjectsCount { get; set; } [JsonPropertyName("NotShownInSlot")] - public bool? NotShownInSlot - { - get; - set; - } + public bool? NotShownInSlot { get; set; } [JsonPropertyName("ParticleCapacity")] - public double? ParticleCapacity - { - get; - set; - } + public double? ParticleCapacity { get; set; } [JsonPropertyName("ParticleDuration")] - public double? ParticleDuration - { - get; - set; - } + public double? ParticleDuration { get; set; } [JsonPropertyName("ParticleSize")] - public double? ParticleSize - { - get; - set; - } + public double? ParticleSize { get; set; } [JsonPropertyName("ExaminedByDefault")] - public bool? ExaminedByDefault - { - get; - set; - } + public bool? ExaminedByDefault { get; set; } [JsonPropertyName("ExplosionRadius")] - public double? ExplosionRadius - { - get; - set; - } + public double? ExplosionRadius { get; set; } [JsonPropertyName("ExplosionStrength")] - public double? ExplosionStrength - { - get; - set; - } + public double? ExplosionStrength { get; set; } [JsonPropertyName("ExamineTime")] - public double? ExamineTime - { - get; - set; - } + public double? ExamineTime { get; set; } [JsonPropertyName("IsUndiscardable")] - public bool? IsUndiscardable - { - get; - set; - } + public bool? IsUndiscardable { get; set; } [JsonPropertyName("IsUnsaleable")] - public bool? IsUnsaleable - { - get; - set; - } + public bool? IsUnsaleable { get; set; } [JsonPropertyName("IsUnbuyable")] - public bool? IsUnbuyable - { - get; - set; - } + public bool? IsUnbuyable { get; set; } [JsonPropertyName("IsUngivable")] - public bool? IsUngivable - { - get; - set; - } + public bool? IsUngivable { get; set; } [JsonPropertyName("IsUnremovable")] - public bool? IsUnRemovable - { - get; - set; - } + public bool? IsUnRemovable { get; set; } [JsonPropertyName("IsLockedafterEquip")] - public bool? IsLockedAfterEquip - { - get; - set; - } + public bool? IsLockedAfterEquip { get; set; } [JsonPropertyName("IsSecretExitRequirement")] - public bool? IsSecretExitRequirement - { - get; - set; - } + public bool? IsSecretExitRequirement { get; set; } [JsonPropertyName("IsRagfairCurrency")] - public bool? IsRagfairCurrency - { - get; - set; - } + public bool? IsRagfairCurrency { get; set; } [JsonPropertyName("IsSpecialSlotOnly")] - public bool? IsSpecialSlotOnly - { - get; - set; - } + public bool? IsSpecialSlotOnly { get; set; } [JsonPropertyName("IsStationaryWeapon")] - public bool? IsStationaryWeapon - { - get; - set; - } + public bool? IsStationaryWeapon { get; set; } [JsonPropertyName("QuestItem")] - public bool? QuestItem - { - get; - set; - } + public bool? QuestItem { get; set; } [JsonPropertyName("QuestStashMaxCount")] - public double? QuestStashMaxCount - { - get; - set; - } + public double? QuestStashMaxCount { get; set; } // Type confirmed via client [JsonPropertyName("LootExperience")] - public int? LootExperience - { - get; - set; - } + public int? LootExperience { get; set; } // Type confirmed via client [JsonPropertyName("ExamineExperience")] - public int? ExamineExperience - { - get; - set; - } + public int? ExamineExperience { get; set; } [JsonPropertyName("HideEntrails")] - public bool? HideEntrails - { - get; - set; - } + public bool? HideEntrails { get; set; } [JsonPropertyName("InsuranceDisabled")] - public bool? InsuranceDisabled - { - get; - set; - } + public bool? InsuranceDisabled { get; set; } // Type confirmed via client [JsonPropertyName("RepairCost")] - public int? RepairCost - { - get; - set; - } + public int? RepairCost { get; set; } // Type confirmed via client [JsonPropertyName("RepairSpeed")] - public int? RepairSpeed - { - get; - set; - } + public int? RepairSpeed { get; set; } [JsonPropertyName("ExtraSizeLeft")] - public int? ExtraSizeLeft - { - get; - set; - } + public int? ExtraSizeLeft { get; set; } [JsonPropertyName("ExtraSizeRight")] - public int? ExtraSizeRight - { - get; - set; - } + public int? ExtraSizeRight { get; set; } [JsonPropertyName("ExtraSizeUp")] - public int? ExtraSizeUp - { - get; - set; - } + public int? ExtraSizeUp { get; set; } [JsonPropertyName("FlareTypes")] - public List? FlareTypes - { - get; - set; - } + public List? FlareTypes { get; set; } [JsonPropertyName("ExtraSizeDown")] - public int? ExtraSizeDown - { - get; - set; - } + public int? ExtraSizeDown { get; set; } [JsonPropertyName("ExtraSizeForceAdd")] - public bool? ExtraSizeForceAdd - { - get; - set; - } + public bool? ExtraSizeForceAdd { get; set; } [JsonPropertyName("MergesWithChildren")] - public bool? MergesWithChildren - { - get; - set; - } + public bool? MergesWithChildren { get; set; } [JsonPropertyName("MetascoreGroup")] public string? MetascoreGroup { - get - { - return _metascoreGroup; - } - set - { - _metascoreGroup = value == null ? null : string.Intern(value); - } + get { return _metascoreGroup; } + set { _metascoreGroup = value == null ? null : string.Intern(value); } } [JsonPropertyName("NpcCompressorSendLevel")] - public double? NpcCompressorSendLevel - { - get; - set; - } + public double? NpcCompressorSendLevel { get; set; } [JsonPropertyName("ObservedPlayerCompressorSendLevel")] - public double? ObservedPlayerCompressorSendLevel - { - get; - set; - } + public double? ObservedPlayerCompressorSendLevel { get; set; } [JsonPropertyName("CanSellOnRagfair")] - public bool? CanSellOnRagfair - { - get; - set; - } + public bool? CanSellOnRagfair { get; set; } [JsonPropertyName("ComputableUnitDamage")] - public XY? ComputableUnitDamage - { - get; - set; - } + public XY? ComputableUnitDamage { get; set; } [JsonPropertyName("ComputableUnitSize")] - public double? ComputableUnitSize - { - get; - set; - } + public double? ComputableUnitSize { get; set; } [JsonPropertyName("ComputableUnitType")] - public string? ComputableUnitType - { - get; - set; - } + public string? ComputableUnitType { get; set; } [JsonPropertyName("CanUnloadAmmoByPlayer")] - public bool? CanUnloadAmmoByPlayer - { - get; - set; - } + public bool? CanUnloadAmmoByPlayer { get; set; } [JsonPropertyName("CanRequireOnRagfair")] - public bool? CanRequireOnRagfair - { - get; - set; - } + public bool? CanRequireOnRagfair { get; set; } [JsonPropertyName("ConflictingItems")] - public HashSet? ConflictingItems - { - get; - set; - } + public HashSet? ConflictingItems { get; set; } [JsonPropertyName("Unlootable")] - public bool? Unlootable - { - get; - set; - } + public bool? Unlootable { get; set; } [JsonPropertyName("UnlootableFromSlot")] public string? UnlootableFromSlot { - get - { - return _unlootableFromSlot; - } - set - { - _unlootableFromSlot = value == null ? null : string.Intern(value); - } + get { return _unlootableFromSlot; } + set { _unlootableFromSlot = value == null ? null : string.Intern(value); } } [JsonPropertyName("UnlootableFromSide")] - public List? UnlootableFromSide - { - get; - set; - } + public List? UnlootableFromSide { get; set; } // Type confirmed via client [JsonPropertyName("AnimationVariantsNumber")] - public int? AnimationVariantsNumber - { - get; - set; - } + public int? AnimationVariantsNumber { get; set; } [JsonPropertyName("DiscardingBlock")] - public bool? DiscardingBlock - { - get; - set; - } + public bool? DiscardingBlock { get; set; } [JsonPropertyName("DropSoundType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public ItemDropSoundType? DropSoundType - { - get; - set; - } + public ItemDropSoundType? DropSoundType { get; set; } [JsonPropertyName("RagFairCommissionModifier")] - public double? RagFairCommissionModifier - { - get; - set; - } + public double? RagFairCommissionModifier { get; set; } [JsonPropertyName("RarityPvE")] public string? RarityPvE { - get - { - return _rarityPvE; - } - set - { - _rarityPvE = value == null ? null : string.Intern(value); - } + get { return _rarityPvE; } + set { _rarityPvE = value == null ? null : string.Intern(value); } } [JsonPropertyName("IsAlwaysAvailableForInsurance")] - public bool? IsAlwaysAvailableForInsurance - { - get; - set; - } + public bool? IsAlwaysAvailableForInsurance { get; set; } [JsonPropertyName("DiscardLimit")] - public double? DiscardLimit - { - get; - set; - } + public double? DiscardLimit { get; set; } // Type confirmed via client [JsonPropertyName("MaxResource")] - public int? MaxResource - { - get; - set; - } + public int? MaxResource { get; set; } [JsonPropertyName("Resource")] - public double? Resource - { - get; - set; - } + public double? Resource { get; set; } [JsonPropertyName("DogTagQualities")] - public bool? DogTagQualities - { - get; - set; - } + public bool? DogTagQualities { get; set; } [JsonPropertyName("Grids")] - public List? Grids - { - get; - set; - } + public List? Grids { get; set; } [JsonPropertyName("Slots")] - public List? Slots - { - get; - set; - } + public List? Slots { get; set; } [JsonPropertyName("CanPutIntoDuringTheRaid")] - public bool? CanPutIntoDuringTheRaid - { - get; - set; - } + public bool? CanPutIntoDuringTheRaid { get; set; } [JsonPropertyName("CantRemoveFromSlotsDuringRaid")] - public List? CantRemoveFromSlotsDuringRaid - { - get; - set; - } + public List? CantRemoveFromSlotsDuringRaid { get; set; } [JsonPropertyName("KeyIds")] - public List? KeyIds - { - get; - set; - } + public List? KeyIds { get; set; } [JsonPropertyName("TagColor")] - public double? TagColor - { - get; - set; - } + public double? TagColor { get; set; } [JsonPropertyName("TagName")] - public string? TagName - { - get; - set; - } + public string? TagName { get; set; } [JsonPropertyName("Durability")] - public double? Durability - { - get; - set; - } + public double? Durability { get; set; } [JsonPropertyName("Accuracy")] - public double? Accuracy - { - get; - set; - } + public double? Accuracy { get; set; } [JsonPropertyName("Recoil")] - public double? Recoil - { - get; - set; - } + public double? Recoil { get; set; } [JsonPropertyName("Loudness")] - public double? Loudness - { - get; - set; - } + public double? Loudness { get; set; } [JsonPropertyName("EffectiveDistance")] - public double? EffectiveDistance - { - get; - set; - } + public double? EffectiveDistance { get; set; } [JsonPropertyName("Ergonomics")] - public double? Ergonomics - { - get; - set; - } + public double? Ergonomics { get; set; } [JsonPropertyName("UseAltMountBone")] - public bool? UseAltMountBone - { - get; - set; - } + public bool? UseAltMountBone { get; set; } [JsonPropertyName("Velocity")] - public double? Velocity - { - get; - set; - } + public double? Velocity { get; set; } [JsonPropertyName("WeaponRecoilSettings")] - public WeaponRecoilSettings? WeaponRecoilSettings - { - get; - set; - } + public WeaponRecoilSettings? WeaponRecoilSettings { get; set; } [JsonPropertyName("WithAnimatorAiming")] - public bool? WithAnimatorAiming - { - get; - set; - } + public bool? WithAnimatorAiming { get; set; } [JsonPropertyName("RaidModdable")] - public bool? RaidModdable - { - get; - set; - } + public bool? RaidModdable { get; set; } [JsonPropertyName("ToolModdable")] - public bool? ToolModdable - { - get; - set; - } + public bool? ToolModdable { get; set; } [JsonPropertyName("UniqueAnimationModID")] - public double? UniqueAnimationModID - { - get; - set; - } + public double? UniqueAnimationModID { get; set; } [JsonPropertyName("BlocksFolding")] - public bool? BlocksFolding - { - get; - set; - } + public bool? BlocksFolding { get; set; } [JsonPropertyName("BlocksCollapsible")] - public bool? BlocksCollapsible - { - get; - set; - } + public bool? BlocksCollapsible { get; set; } [JsonPropertyName("IsAnimated")] - public bool? IsAnimated - { - get; - set; - } + public bool? IsAnimated { get; set; } [JsonPropertyName("HasShoulderContact")] - public bool? HasShoulderContact - { - get; - set; - } + public bool? HasShoulderContact { get; set; } [JsonPropertyName("SightingRange")] - public double? SightingRange - { - get; - set; - } + public double? SightingRange { get; set; } [JsonPropertyName("ZoomSensitivity")] - public double? ZoomSensitivity - { - get; - set; - } + public double? ZoomSensitivity { get; set; } [JsonPropertyName("DoubleActionAccuracyPenaltyMult")] - public double? DoubleActionAccuracyPenaltyMult - { - get; - set; - } + public double? DoubleActionAccuracyPenaltyMult { get; set; } [JsonPropertyName("ModesCount")] - public object? ModesCount - { - get; - set; - } // TODO: object here + public object? ModesCount { get; set; } // TODO: object here [JsonPropertyName("DurabilityBurnModificator")] - public double? DurabilityBurnModificator - { - get; - set; - } + public double? DurabilityBurnModificator { get; set; } [JsonPropertyName("HeatFactor")] - public double? HeatFactor - { - get; - set; - } + public double? HeatFactor { get; set; } [JsonPropertyName("CoolFactor")] - public double? CoolFactor - { - get; - set; - } + public double? CoolFactor { get; set; } [JsonPropertyName("muzzleModType")] - public string? MuzzleModType - { - get; - set; - } + public string? MuzzleModType { get; set; } [JsonPropertyName("CustomAimPlane")] - public string? CustomAimPlane - { - get; - set; - } + public string? CustomAimPlane { get; set; } [JsonPropertyName("IsAdjustableOptic")] - public bool? IsAdjustableOptic - { - get; - set; - } + public bool? IsAdjustableOptic { get; set; } [JsonPropertyName("MinMaxFov")] - public XYZ? MinMaxFov - { - get; - set; - } + public XYZ? MinMaxFov { get; set; } [JsonPropertyName("sightModType")] - public string? SightModType - { - get; - set; - } + public string? SightModType { get; set; } [JsonPropertyName("SightModesCount")] - public double? SightModesCount - { - get; - set; - } + public double? SightModesCount { get; set; } [JsonPropertyName("OpticCalibrationDistances")] - public List? OpticCalibrationDistances - { - get; - set; - } + public List? OpticCalibrationDistances { get; set; } [JsonPropertyName("ScopesCount")] - public double? ScopesCount - { - get; - set; - } + public double? ScopesCount { get; set; } [JsonPropertyName("AimSensitivity")] - public object? AimSensitivity - { - get; - set; - } // TODO: object here + public object? AimSensitivity { get; set; } // TODO: object here [JsonPropertyName("Zooms")] - public List>? Zooms - { - get; - set; - } + public List>? Zooms { get; set; } [JsonPropertyName("CalibrationDistances")] - public List>? CalibrationDistances - { - get; - set; - } + public List>? CalibrationDistances { get; set; } [JsonPropertyName("Intensity")] - public double? Intensity - { - get; - set; - } + public double? Intensity { get; set; } [JsonPropertyName("Mask")] - public string? Mask - { - get; - set; - } + public string? Mask { get; set; } [JsonPropertyName("MaskSize")] - public double? MaskSize - { - get; - set; - } + public double? MaskSize { get; set; } [JsonPropertyName("IsMagazineForStationaryWeapon")] - public bool? IsMagazineForStationaryWeapon - { - get; - set; - } + public bool? IsMagazineForStationaryWeapon { get; set; } [JsonPropertyName("NoiseIntensity")] - public double? NoiseIntensity - { - get; - set; - } + public double? NoiseIntensity { get; set; } [JsonPropertyName("NoiseScale")] - public double? NoiseScale - { - get; - set; - } + public double? NoiseScale { get; set; } [JsonPropertyName("Color")] - public Color? Color - { - get; - set; - } + public Color? Color { get; set; } [JsonPropertyName("DiffuseIntensity")] - public double? DiffuseIntensity - { - get; - set; - } + public double? DiffuseIntensity { get; set; } [JsonPropertyName("MagazineWithBelt")] - public bool? MagazineWithBelt - { - get; - set; - } + public bool? MagazineWithBelt { get; set; } [JsonPropertyName("HasHinge")] - public bool? HasHinge - { - get; - set; - } + public bool? HasHinge { get; set; } [JsonPropertyName("RampPalette")] - public string? RampPalette - { - get; - set; - } + public string? RampPalette { get; set; } [JsonPropertyName("DepthFade")] - public double? DepthFade - { - get; - set; - } + public double? DepthFade { get; set; } [JsonPropertyName("RoughnessCoef")] - public double? RoughnessCoef - { - get; - set; - } + public double? RoughnessCoef { get; set; } [JsonPropertyName("SpecularCoef")] - public double? SpecularCoef - { - get; - set; - } + public double? SpecularCoef { get; set; } [JsonPropertyName("MainTexColorCoef")] - public double? MainTexColorCoef - { - get; - set; - } + public double? MainTexColorCoef { get; set; } [JsonPropertyName("MinimumTemperatureValue")] - public double? MinimumTemperatureValue - { - get; - set; - } + public double? MinimumTemperatureValue { get; set; } [JsonPropertyName("RampShift")] - public double? RampShift - { - get; - set; - } + public double? RampShift { get; set; } [JsonPropertyName("HeatMin")] - public double? HeatMin - { - get; - set; - } + public double? HeatMin { get; set; } [JsonPropertyName("ColdMax")] - public double? ColdMax - { - get; - set; - } + public double? ColdMax { get; set; } [JsonPropertyName("IsNoisy")] - public bool? IsNoisy - { - get; - set; - } + public bool? IsNoisy { get; set; } [JsonPropertyName("IsFpsStuck")] - public bool? IsFpsStuck - { - get; - set; - } + public bool? IsFpsStuck { get; set; } [JsonPropertyName("IsGlitch")] - public bool? IsGlitch - { - get; - set; - } + public bool? IsGlitch { get; set; } [JsonPropertyName("IsMotionBlurred")] - public bool? IsMotionBlurred - { - get; - set; - } + public bool? IsMotionBlurred { get; set; } [JsonPropertyName("IsPixelated")] - public bool? IsPixelated - { - get; - set; - } + public bool? IsPixelated { get; set; } [JsonPropertyName("PixelationBlockCount")] - public double? PixelationBlockCount - { - get; - set; - } + public double? PixelationBlockCount { get; set; } [JsonPropertyName("ShiftsAimCamera")] - public double? ShiftsAimCamera - { - get; - set; - } + public double? ShiftsAimCamera { get; set; } [JsonPropertyName("magAnimationIndex")] - public double? MagAnimationIndex - { - get; - set; - } + public double? MagAnimationIndex { get; set; } [JsonPropertyName("Cartridges")] - public List? Cartridges - { - get; - set; - } + public List? Cartridges { get; set; } [JsonPropertyName("CanFast")] - public bool? CanFast - { - get; - set; - } + public bool? CanFast { get; set; } [JsonPropertyName("CanHit")] - public bool? CanHit - { - get; - set; - } + public bool? CanHit { get; set; } [JsonPropertyName("CanAdmin")] - public bool? CanAdmin - { - get; - set; - } + public bool? CanAdmin { get; set; } [JsonPropertyName("LoadUnloadModifier")] - public double? LoadUnloadModifier - { - get; - set; - } + public double? LoadUnloadModifier { get; set; } [JsonPropertyName("CheckTimeModifier")] - public double? CheckTimeModifier - { - get; - set; - } + public double? CheckTimeModifier { get; set; } [JsonPropertyName("CheckOverride")] - public double? CheckOverride - { - get; - set; - } + public double? CheckOverride { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] [JsonPropertyName("ReloadMagType")] - public ReloadMode? ReloadMagType - { - get; - set; - } + public ReloadMode? ReloadMagType { get; set; } [JsonPropertyName("VisibleAmmoRangesString")] - public string? VisibleAmmoRangesString - { - get; - set; - } + public string? VisibleAmmoRangesString { get; set; } [JsonPropertyName("MalfunctionChance")] - public double? MalfunctionChance - { - get; - set; - } + public double? MalfunctionChance { get; set; } [JsonPropertyName("IsShoulderContact")] - public bool? IsShoulderContact - { - get; - set; - } + public bool? IsShoulderContact { get; set; } [JsonPropertyName("Foldable")] - public bool? Foldable - { - get; - set; - } + public bool? Foldable { get; set; } [JsonPropertyName("Retractable")] - public bool? Retractable - { - get; - set; - } + public bool? Retractable { get; set; } [JsonPropertyName("SizeReduceRight")] - public int? SizeReduceRight - { - get; - set; - } + public int? SizeReduceRight { get; set; } [JsonPropertyName("CenterOfImpact")] - public double? CenterOfImpact - { - get; - set; - } + public double? CenterOfImpact { get; set; } [JsonPropertyName("IsSilencer")] - public bool? IsSilencer - { - get; - set; - } + public bool? IsSilencer { get; set; } [JsonPropertyName("DeviationCurve")] - public double? DeviationCurve - { - get; - set; - } + public double? DeviationCurve { get; set; } [JsonPropertyName("DeviationMax")] - public double? DeviationMax - { - get; - set; - } + public double? DeviationMax { get; set; } [JsonPropertyName("SearchSound")] - public string? SearchSound - { - get; - set; - } + public string? SearchSound { get; set; } [JsonPropertyName("BlocksArmorVest")] - public bool? BlocksArmorVest - { - get; - set; - } + public bool? BlocksArmorVest { get; set; } [JsonPropertyName("speedPenaltyPercent")] - public double? SpeedPenaltyPercent - { - get; - set; - } + public double? SpeedPenaltyPercent { get; set; } [JsonPropertyName("GridLayoutName")] - public string? GridLayoutName - { - get; - set; - } + public string? GridLayoutName { get; set; } [JsonPropertyName("ContainerSpawnChanceModifier")] - public double? ContainerSpawnChanceModifier - { - get; - set; - } + public double? ContainerSpawnChanceModifier { get; set; } [JsonPropertyName("SpawnFilter")] - public List? SpawnFilter - { - get; - set; - } // TODO: object here + public List? SpawnFilter { get; set; } // TODO: object here [JsonPropertyName("containType")] - public List? ContainType - { - get; - set; - } // TODO: object here + public List? ContainType { get; set; } // TODO: object here [JsonPropertyName("sizeWidth")] - public double? SizeWidth - { - get; - set; - } + public double? SizeWidth { get; set; } [JsonPropertyName("sizeHeight")] - public double? SizeHeight - { - get; - set; - } + public double? SizeHeight { get; set; } [JsonPropertyName("isSecured")] - public bool? IsSecured - { - get; - set; - } + public bool? IsSecured { get; set; } [JsonPropertyName("spawnTypes")] - public string? SpawnTypes - { - get; - set; - } + public string? SpawnTypes { get; set; } [JsonPropertyName("lootFilter")] - public List? LootFilter - { - get; - set; - } // TODO: object here + public List? LootFilter { get; set; } // TODO: object here [JsonPropertyName("spawnRarity")] - public string? SpawnRarity - { - get; - set; - } + public string? SpawnRarity { get; set; } [JsonPropertyName("minCountSpawn")] - public double? MinCountSpawn - { - get; - set; - } + public double? MinCountSpawn { get; set; } [JsonPropertyName("maxCountSpawn")] - public double? MaxCountSpawn - { - get; - set; - } + public double? MaxCountSpawn { get; set; } [JsonPropertyName("openedByKeyID")] - public List? OpenedByKeyID - { - get; - set; - } + public List? OpenedByKeyID { get; set; } [JsonPropertyName("RigLayoutName")] - public string? RigLayoutName - { - get; - set; - } + public string? RigLayoutName { get; set; } [JsonPropertyName("MaxDurability")] - public double? MaxDurability - { - get; - set; - } + public double? MaxDurability { get; set; } [JsonPropertyName("armorZone")] - public List? ArmorZone - { - get; - set; - } + public List? ArmorZone { get; set; } // Type confirmed via client [JsonPropertyName("armorClass")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? ArmorClass - { - get; - set; - } + public int? ArmorClass { get; set; } [JsonPropertyName("armorColliders")] - public List? ArmorColliders - { - get; - set; - } + public List? ArmorColliders { get; set; } [JsonPropertyName("armorPlateColliders")] - public List? ArmorPlateColliders - { - get; - set; - } + public List? ArmorPlateColliders { get; set; } [JsonPropertyName("bluntDamageReduceFromSoftArmor")] - public bool? BluntDamageReduceFromSoftArmor - { - get; - set; - } + public bool? BluntDamageReduceFromSoftArmor { get; set; } [JsonPropertyName("mousePenalty")] - public double? MousePenalty - { - get; - set; - } + public double? MousePenalty { get; set; } [JsonPropertyName("weaponErgonomicPenalty")] - public double? WeaponErgonomicPenalty - { - get; - set; - } + public double? WeaponErgonomicPenalty { get; set; } [JsonPropertyName("BluntThroughput")] - public double? BluntThroughput - { - get; - set; - } + public double? BluntThroughput { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] [JsonPropertyName("ArmorMaterial")] - public ArmorMaterial? ArmorMaterial - { - get; - set; - } + public ArmorMaterial? ArmorMaterial { get; set; } [JsonPropertyName("ArmorType")] - public string? ArmorType - { - get; - set; - } + public string? ArmorType { get; set; } [JsonPropertyName("weapClass")] - public string? WeapClass - { - get; - set; - } + public string? WeapClass { get; set; } [JsonPropertyName("weapUseType")] - public string? WeapUseType - { - get; - set; - } + public string? WeapUseType { get; set; } [JsonPropertyName("ammoCaliber")] - public string? AmmoCaliber - { - get; - set; - } + public string? AmmoCaliber { get; set; } [JsonPropertyName("OperatingResource")] - public double? OperatingResource - { - get; - set; - } + public double? OperatingResource { get; set; } [JsonPropertyName("PostRecoilHorizontalRangeHandRotation")] - public XYZ? PostRecoilHorizontalRangeHandRotation - { - get; - set; - } + public XYZ? PostRecoilHorizontalRangeHandRotation { get; set; } [JsonPropertyName("PostRecoilVerticalRangeHandRotation")] - public XYZ? PostRecoilVerticalRangeHandRotation - { - get; - set; - } + public XYZ? PostRecoilVerticalRangeHandRotation { get; set; } [JsonPropertyName("ProgressRecoilAngleOnStable")] - public XYZ? ProgressRecoilAngleOnStable - { - get; - set; - } + public XYZ? ProgressRecoilAngleOnStable { get; set; } [JsonPropertyName("RepairComplexity")] - public double? RepairComplexity - { - get; - set; - } + public double? RepairComplexity { get; set; } + [JsonPropertyName("ResetAfterShot")] - public bool? ResetAfterShot - { - get; - set; - } + public bool? ResetAfterShot { get; set; } [JsonPropertyName("durabSpawnMin")] - public double? DurabSpawnMin - { - get; - set; - } + public double? DurabSpawnMin { get; set; } [JsonPropertyName("durabSpawnMax")] - public double? DurabSpawnMax - { - get; - set; - } + public double? DurabSpawnMax { get; set; } [JsonPropertyName("isFastReload")] - public bool? IsFastReload - { - get; - set; - } + public bool? IsFastReload { get; set; } [JsonPropertyName("RecoilForceUp")] - public double? RecoilForceUp - { - get; - set; - } + public double? RecoilForceUp { get; set; } [JsonPropertyName("RecoilForceBack")] - public double? RecoilForceBack - { - get; - set; - } + public double? RecoilForceBack { get; set; } [JsonPropertyName("RecoilAngle")] - public double? RecoilAngle - { - get; - set; - } + public double? RecoilAngle { get; set; } [JsonPropertyName("RecoilCamera")] - public double? RecoilCamera - { - get; - set; - } + public double? RecoilCamera { get; set; } [JsonPropertyName("RecoilCategoryMultiplierHandRotation")] - public double? RecoilCategoryMultiplierHandRotation - { - get; - set; - } + public double? RecoilCategoryMultiplierHandRotation { get; set; } [JsonPropertyName("weapFireType")] - public HashSet? WeapFireType - { - get; - set; - } + public HashSet? WeapFireType { get; set; } [JsonPropertyName("RecolDispersion")] - public double? RecolDispersion - { - get; - set; - } + public double? RecolDispersion { get; set; } [JsonPropertyName("SingleFireRate")] - public double? SingleFireRate - { - get; - set; - } + public double? SingleFireRate { get; set; } [JsonPropertyName("CanQueueSecondShot")] - public bool? CanQueueSecondShot - { - get; - set; - } + public bool? CanQueueSecondShot { get; set; } [JsonPropertyName("bFirerate")] - public double? BFirerate - { - get; - set; - } + public double? BFirerate { get; set; } [JsonPropertyName("bEffDist")] - public double? BEffDist - { - get; - set; - } + public double? BEffDist { get; set; } [JsonPropertyName("bHearDist")] - public double? BHearDist - { - get; - set; - } + public double? BHearDist { get; set; } [JsonPropertyName("blockLeftStance")] - public bool? BlockLeftStance - { - get; - set; - } + public bool? BlockLeftStance { get; set; } [JsonPropertyName("isChamberLoad")] - public bool? IsChamberLoad - { - get; - set; - } + public bool? IsChamberLoad { get; set; } [JsonPropertyName("chamberAmmoCount")] - public double? ChamberAmmoCount - { - get; - set; - } + public double? ChamberAmmoCount { get; set; } [JsonPropertyName("isBoltCatch")] - public bool? IsBoltCatch - { - get; - set; - } + public bool? IsBoltCatch { get; set; } [JsonPropertyName("defMagType")] - public string? DefMagType - { - get; - set; - } + public string? DefMagType { get; set; } [JsonPropertyName("defAmmo")] - public string? DefAmmo - { - get; - set; - } + public string? DefAmmo { get; set; } [JsonPropertyName("AdjustCollimatorsToTrajectory")] - public bool? AdjustCollimatorsToTrajectory - { - get; - set; - } + public bool? AdjustCollimatorsToTrajectory { get; set; } [JsonPropertyName("ShotgunDispersion")] - public double? ShotgunDispersion - { - get; - set; - } + public double? ShotgunDispersion { get; set; } [JsonPropertyName("shotgunDispersion")] - public double? shotgunDispersion - { - get; - set; - } + public double? shotgunDispersion { get; set; } [JsonPropertyName("Chambers")] - public List? Chambers - { - get; - set; - } + public List? Chambers { get; set; } [JsonPropertyName("CameraSnap")] - public double? CameraSnap - { - get; - set; - } + public double? CameraSnap { get; set; } [JsonPropertyName("CameraToWeaponAngleSpeedRange")] - public XYZ? CameraToWeaponAngleSpeedRange - { - get; - set; - } + public XYZ? CameraToWeaponAngleSpeedRange { get; set; } [JsonPropertyName("CameraToWeaponAngleStep")] - public double? CameraToWeaponAngleStep - { - get; - set; - } + public double? CameraToWeaponAngleStep { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] [JsonPropertyName("ReloadMode")] - public ReloadMode? ReloadMode - { - get; - set; - } + public ReloadMode? ReloadMode { get; set; } [JsonPropertyName("AimPlane")] - public double? AimPlane - { - get; - set; - } + public double? AimPlane { get; set; } [JsonPropertyName("TacticalReloadStiffnes")] - public XYZ? TacticalReloadStiffnes - { - get; - set; - } + public XYZ? TacticalReloadStiffnes { get; set; } [JsonPropertyName("TacticalReloadFixation")] - public double? TacticalReloadFixation - { - get; - set; - } + public double? TacticalReloadFixation { get; set; } [JsonPropertyName("RecoilCenter")] - public XYZ? RecoilCenter - { - get; - set; - } + public XYZ? RecoilCenter { get; set; } [JsonPropertyName("RotationCenter")] - public XYZ? RotationCenter - { - get; - set; - } + public XYZ? RotationCenter { get; set; } [JsonPropertyName("RotationCenterNoStock")] - public XYZ? RotationCenterNoStock - { - get; - set; - } + public XYZ? RotationCenterNoStock { get; set; } [JsonPropertyName("ShotsGroupSettings")] - public List? ShotsGroupSettings - { - get; - set; - } + public List? ShotsGroupSettings { get; set; } [JsonPropertyName("FoldedSlot")] - public string? FoldedSlot - { - get; - set; - } + public string? FoldedSlot { get; set; } [JsonPropertyName("ForbidMissingVitalParts")] - public bool? ForbidMissingVitalParts - { - get; - set; - } + public bool? ForbidMissingVitalParts { get; set; } [JsonPropertyName("ForbidNonEmptyContainers")] - public bool? ForbidNonEmptyContainers - { - get; - set; - } + public bool? ForbidNonEmptyContainers { get; set; } [JsonPropertyName("CompactHandling")] - public bool? CompactHandling - { - get; - set; - } + public bool? CompactHandling { get; set; } [JsonPropertyName("MinRepairDegradation")] - public double? MinRepairDegradation - { - get; - set; - } + public double? MinRepairDegradation { get; set; } [JsonPropertyName("MaxRepairDegradation")] - public double? MaxRepairDegradation - { - get; - set; - } + public double? MaxRepairDegradation { get; set; } [JsonPropertyName("IronSightRange")] - public double? IronSightRange - { - get; - set; - } + public double? IronSightRange { get; set; } [JsonPropertyName("IsBeltMachineGun")] - public bool? IsBeltMachineGun - { - get; - set; - } + public bool? IsBeltMachineGun { get; set; } [JsonPropertyName("IsFlareGun")] - public bool? IsFlareGun - { - get; - set; - } + public bool? IsFlareGun { get; set; } [JsonPropertyName("IsGrenadeLauncher")] - public bool? IsGrenadeLauncher - { - get; - set; - } + public bool? IsGrenadeLauncher { get; set; } [JsonPropertyName("IsOneoff")] - public bool? IsOneoff - { - get; - set; - } + public bool? IsOneoff { get; set; } [JsonPropertyName("MustBoltBeOpennedForExternalReload")] - public bool? MustBoltBeOpennedForExternalReload - { - get; - set; - } + public bool? MustBoltBeOpennedForExternalReload { get; set; } [JsonPropertyName("MustBoltBeOpennedForInternalReload")] - public bool? MustBoltBeOpennedForInternalReload - { - get; - set; - } + public bool? MustBoltBeOpennedForInternalReload { get; set; } [JsonPropertyName("NoFiremodeOnBoltcatch")] - public bool? NoFiremodeOnBoltcatch - { - get; - set; - } + public bool? NoFiremodeOnBoltcatch { get; set; } [JsonPropertyName("BoltAction")] - public bool? BoltAction - { - get; - set; - } + public bool? BoltAction { get; set; } [JsonPropertyName("HipAccuracyRestorationDelay")] - public double? HipAccuracyRestorationDelay - { - get; - set; - } + public double? HipAccuracyRestorationDelay { get; set; } [JsonPropertyName("HipAccuracyRestorationSpeed")] - public double? HipAccuracyRestorationSpeed - { - get; - set; - } + public double? HipAccuracyRestorationSpeed { get; set; } [JsonPropertyName("HipInnaccuracyGain")] - public double? HipInnaccuracyGain - { - get; - set; - } + public double? HipInnaccuracyGain { get; set; } [JsonPropertyName("ManualBoltCatch")] - public bool? ManualBoltCatch - { - get; - set; - } + public bool? ManualBoltCatch { get; set; } [JsonPropertyName("BurstShotsCount")] - public double? BurstShotsCount - { - get; - set; - } + public double? BurstShotsCount { get; set; } [JsonPropertyName("BaseMalfunctionChance")] - public double? BaseMalfunctionChance - { - get; - set; - } + public double? BaseMalfunctionChance { get; set; } [JsonPropertyName("AllowJam")] - public bool? AllowJam - { - get; - set; - } + public bool? AllowJam { get; set; } [JsonPropertyName("AllowFeed")] - public bool? AllowFeed - { - get; - set; - } + public bool? AllowFeed { get; set; } [JsonPropertyName("AllowMisfire")] - public bool? AllowMisfire - { - get; - set; - } + public bool? AllowMisfire { get; set; } [JsonPropertyName("AllowSlide")] - public bool? AllowSlide - { - get; - set; - } + public bool? AllowSlide { get; set; } [JsonPropertyName("DurabilityBurnRatio")] - public double? DurabilityBurnRatio - { - get; - set; - } + public double? DurabilityBurnRatio { get; set; } [JsonPropertyName("HeatFactorGun")] - public double? HeatFactorGun - { - get; - set; - } + public double? HeatFactorGun { get; set; } [JsonPropertyName("CoolFactorGun")] - public double? CoolFactorGun - { - get; - set; - } + public double? CoolFactorGun { get; set; } [JsonPropertyName("CoolFactorGunMods")] - public double? CoolFactorGunMods - { - get; - set; - } + public double? CoolFactorGunMods { get; set; } [JsonPropertyName("HeatFactorByShot")] - public double? HeatFactorByShot - { - get; - set; - } + public double? HeatFactorByShot { get; set; } [JsonPropertyName("AllowOverheat")] - public bool? AllowOverheat - { - get; - set; - } + public bool? AllowOverheat { get; set; } [JsonPropertyName("DoubleActionAccuracyPenalty")] - public double? DoubleActionAccuracyPenalty - { - get; - set; - } + public double? DoubleActionAccuracyPenalty { get; set; } [JsonPropertyName("RecoilPosZMult")] - public double? RecoilPosZMult - { - get; - set; - } + public double? RecoilPosZMult { get; set; } [JsonPropertyName("RecoilReturnPathDampingHandRotation")] - public double? RecoilReturnPathDampingHandRotation - { - get; - set; - } + public double? RecoilReturnPathDampingHandRotation { get; set; } [JsonPropertyName("RecoilReturnPathOffsetHandRotation")] - public double? RecoilReturnPathOffsetHandRotation - { - get; - set; - } + public double? RecoilReturnPathOffsetHandRotation { get; set; } [JsonPropertyName("RecoilReturnSpeedHandRotation")] - public double? RecoilReturnSpeedHandRotation - { - get; - set; - } + public double? RecoilReturnSpeedHandRotation { get; set; } [JsonPropertyName("RecoilStableAngleIncreaseStep")] - public double? RecoilStableAngleIncreaseStep - { - get; - set; - } + public double? RecoilStableAngleIncreaseStep { get; set; } [JsonPropertyName("RecoilStableIndexShot")] - public double? RecoilStableIndexShot - { - get; - set; - } + public double? RecoilStableIndexShot { get; set; } [JsonPropertyName("MinRepairKitDegradation")] - public double? MinRepairKitDegradation - { - get; - set; - } + public double? MinRepairKitDegradation { get; set; } [JsonPropertyName("MaxRepairKitDegradation")] - public double? MaxRepairKitDegradation - { - get; - set; - } + public double? MaxRepairKitDegradation { get; set; } [JsonPropertyName("MountCameraSnapMultiplier")] - public double? MountCameraSnapMultiplier - { - get; - set; - } + public double? MountCameraSnapMultiplier { get; set; } [JsonPropertyName("MountHorizontalRecoilMultiplier")] - public double? MountHorizontalRecoilMultiplier - { - get; - set; - } + public double? MountHorizontalRecoilMultiplier { get; set; } [JsonPropertyName("MountReturnSpeedHandMultiplier")] - public double? MountReturnSpeedHandMultiplier - { - get; - set; - } + public double? MountReturnSpeedHandMultiplier { get; set; } [JsonPropertyName("MountVerticalRecoilMultiplier")] - public double? MountVerticalRecoilMultiplier - { - get; - set; - } + public double? MountVerticalRecoilMultiplier { get; set; } [JsonPropertyName("MountingHorizontalOutOfBreathMultiplier")] - public double? MountingHorizontalOutOfBreathMultiplier - { - get; - set; - } + public double? MountingHorizontalOutOfBreathMultiplier { get; set; } [JsonPropertyName("MountingPosition")] - public XYZ? MountingPosition - { - get; - set; - } + public XYZ? MountingPosition { get; set; } [JsonPropertyName("MountingVerticalOutOfBreathMultiplier")] - public double? MountingVerticalOutOfBreathMultiplier - { - get; - set; - } + public double? MountingVerticalOutOfBreathMultiplier { get; set; } [JsonPropertyName("BlocksEarpiece")] - public bool? BlocksEarpiece - { - get; - set; - } + public bool? BlocksEarpiece { get; set; } [JsonPropertyName("BlocksEyewear")] - public bool? BlocksEyewear - { - get; - set; - } + public bool? BlocksEyewear { get; set; } [JsonPropertyName("BlocksHeadwear")] - public bool? BlocksHeadwear - { - get; - set; - } + public bool? BlocksHeadwear { get; set; } [JsonPropertyName("BlocksFaceCover")] - public bool? BlocksFaceCover - { - get; - set; - } + public bool? BlocksFaceCover { get; set; } [JsonPropertyName("Indestructibility")] - public double? Indestructibility - { - get; - set; - } + public double? Indestructibility { get; set; } [JsonPropertyName("FaceShieldComponent")] - public bool? FaceShieldComponent - { - get; - set; - } + public bool? FaceShieldComponent { get; set; } [JsonPropertyName("FaceShieldMask")] - public string? FaceShieldMask - { - get; - set; - } + public string? FaceShieldMask { get; set; } [JsonPropertyName("MaterialType")] - public string? MaterialType - { - get; - set; - } + public string? MaterialType { get; set; } [JsonPropertyName("RicochetParams")] - public XYZ? RicochetParams - { - get; - set; - } + public XYZ? RicochetParams { get; set; } [JsonPropertyName("DeafStrength")] - public string? DeafStrength - { - get; - set; - } + public string? DeafStrength { get; set; } [JsonPropertyName("BlindnessProtection")] - public double? BlindnessProtection - { - get; - set; - } + public double? BlindnessProtection { get; set; } [JsonPropertyName("Distortion")] - public double? Distortion - { - get; - set; - } + public double? Distortion { get; set; } [JsonPropertyName("CompressorAttack")] - public double? CompressorAttack - { - get; - set; - } + public double? CompressorAttack { get; set; } [JsonPropertyName("CompressorRelease")] - public double? CompressorRelease - { - get; - set; - } + public double? CompressorRelease { get; set; } [JsonPropertyName("CompressorGain")] - public double? CompressorGain - { - get; - set; - } + public double? CompressorGain { get; set; } [JsonPropertyName("EQBand1Frequency")] - public double? EQBand1Frequency - { - get; - set; - } + public double? EQBand1Frequency { get; set; } [JsonPropertyName("EQBand1Gain")] - public double? EQBand1Gain - { - get; - set; - } + public double? EQBand1Gain { get; set; } [JsonPropertyName("EQBand1Q")] - public double? EQBand1Q - { - get; - set; - } + public double? EQBand1Q { get; set; } [JsonPropertyName("EQBand2Frequency")] - public double? EQBand2Frequency - { - get; - set; - } + public double? EQBand2Frequency { get; set; } [JsonPropertyName("EQBand2Gain")] - public double? EQBand2Gain - { - get; - set; - } + public double? EQBand2Gain { get; set; } [JsonPropertyName("EQBand2Q")] - public double? EQBand2Q - { - get; - set; - } + public double? EQBand2Q { get; set; } [JsonPropertyName("EQBand3Frequency")] - public double? EQBand3Frequency - { - get; - set; - } + public double? EQBand3Frequency { get; set; } [JsonPropertyName("EQBand3Gain")] - public double? EQBand3Gain - { - get; - set; - } + public double? EQBand3Gain { get; set; } [JsonPropertyName("EQBand3Q")] - public double? EQBand3Q - { - get; - set; - } + public double? EQBand3Q { get; set; } [JsonPropertyName("EffectsReturnsCompressorSendLevel")] - public double? EffectsReturnsCompressorSendLevel - { - get; - set; - } + public double? EffectsReturnsCompressorSendLevel { get; set; } [JsonPropertyName("EffectsReturnsGroupVolume")] - public double? EffectsReturnsGroupVolume - { - get; - set; - } + public double? EffectsReturnsGroupVolume { get; set; } [JsonPropertyName("EnvCommonCompressorSendLevel")] - public double? EffectsReturnsGrEnvCommonCompressorSendLeveloupVolume - { - get; - set; - } + public double? EffectsReturnsGrEnvCommonCompressorSendLeveloupVolume { get; set; } [JsonPropertyName("EnvNatureCompressorSendLevel")] - public double? EnvNatureCompressorSendLevel - { - get; - set; - } + public double? EnvNatureCompressorSendLevel { get; set; } [JsonPropertyName("EnvTechnicalCompressorSendLevel")] - public double? EnvTechnicalCompressorSendLevel - { - get; - set; - } + public double? EnvTechnicalCompressorSendLevel { get; set; } [JsonPropertyName("GunsCompressorSendLevel")] - public double? GunsCompressorSendLevel - { - get; - set; - } + public double? GunsCompressorSendLevel { get; set; } [JsonPropertyName("HeadphonesMixerVolume")] - public double? HeadphonesMixerVolume - { - get; - set; - } + public double? HeadphonesMixerVolume { get; set; } [JsonPropertyName("HighpassFreq")] - public double? HighpassFreq - { - get; - set; - } + public double? HighpassFreq { get; set; } [JsonPropertyName("HighpassResonance")] - public double? HighpassResonance - { - get; - set; - } + public double? HighpassResonance { get; set; } [JsonPropertyName("LowpassFreq")] - public double? LowpassFreq - { - get; - set; - } + public double? LowpassFreq { get; set; } [JsonPropertyName("RolloffMultiplier")] - public double? RolloffMultiplier - { - get; - set; - } + public double? RolloffMultiplier { get; set; } [JsonPropertyName("AmbientVolume")] - public double? AmbientVolume - { - get; - set; - } + public double? AmbientVolume { get; set; } [JsonPropertyName("AmbientCompressorSendLevel")] - public double? AmbientCompressorSendLevel - { - get; - set; - } + public double? AmbientCompressorSendLevel { get; set; } [JsonPropertyName("ClientPlayerCompressorSendLevel")] - public double? ClientPlayerCompressorSendLevel - { - get; - set; - } + public double? ClientPlayerCompressorSendLevel { get; set; } [JsonPropertyName("CompressorThreshold")] - public double? CompressorThreshold - { - get; - set; - } + public double? CompressorThreshold { get; set; } [JsonPropertyName("DryVolume")] - public double? DryVolume - { - get; - set; - } + public double? DryVolume { get; set; } [JsonPropertyName("foodUseTime")] - public double? FoodUseTime - { - get; - set; - } + public double? FoodUseTime { get; set; } [JsonPropertyName("foodEffectType")] - public string? FoodEffectType - { - get; - set; - } + public string? FoodEffectType { get; set; } [JsonPropertyName("StimulatorBuffs")] - public string? StimulatorBuffs - { - get; - set; - } + public string? StimulatorBuffs { get; set; } [JsonPropertyName("effects_health")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? EffectsHealth - { - get; - set; - } + public Dictionary? EffectsHealth { get; set; } [JsonPropertyName("effects_damage")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? EffectsDamage - { - get; - set; - } + public Dictionary? EffectsDamage { get; set; } // Confirmed in client [JsonPropertyName("MaximumNumberOfUsage")] - public int? MaximumNumberOfUsage - { - get; - set; - } + public int? MaximumNumberOfUsage { get; set; } [JsonPropertyName("knifeHitDelay")] - public double? KnifeHitDelay - { - get; - set; - } + public double? KnifeHitDelay { get; set; } [JsonPropertyName("knifeHitSlashRate")] - public double? KnifeHitSlashRate - { - get; - set; - } + public double? KnifeHitSlashRate { get; set; } [JsonPropertyName("knifeHitStabRate")] - public double? KnifeHitStabRate - { - get; - set; - } + public double? KnifeHitStabRate { get; set; } [JsonPropertyName("knifeHitRadius")] - public double? KnifeHitRadius - { - get; - set; - } + public double? KnifeHitRadius { get; set; } // Confirmed on client [JsonPropertyName("knifeHitSlashDam")] - public int? KnifeHitSlashDam - { - get; - set; - } + public int? KnifeHitSlashDam { get; set; } // Confirmed on client [JsonPropertyName("knifeHitStabDam")] - public int? KnifeHitStabDam - { - get; - set; - } + public int? KnifeHitStabDam { get; set; } [JsonPropertyName("knifeDurab")] - public double? KnifeDurab - { - get; - set; - } + public double? KnifeDurab { get; set; } [JsonPropertyName("PrimaryDistance")] - public double? PrimaryDistance - { - get; - set; - } + public double? PrimaryDistance { get; set; } [JsonPropertyName("SecondryDistance")] - public double? SecondryDistance - { - get; - set; - } + public double? SecondryDistance { get; set; } // Confirmed on client [JsonPropertyName("SlashPenetration")] - public int? SlashPenetration - { - get; - set; - } + public int? SlashPenetration { get; set; } // Confirmed on client [JsonPropertyName("StabPenetration")] - public int? StabPenetration - { - get; - set; - } + public int? StabPenetration { get; set; } [JsonPropertyName("PrimaryConsumption")] - public double? PrimaryConsumption - { - get; - set; - } + public double? PrimaryConsumption { get; set; } [JsonPropertyName("SecondryConsumption")] - public double? SecondryConsumption - { - get; - set; - } + public double? SecondryConsumption { get; set; } [JsonPropertyName("DeflectionConsumption")] - public double? DeflectionConsumption - { - get; - set; - } + public double? DeflectionConsumption { get; set; } [JsonPropertyName("AppliedTrunkRotation")] - public XYZ? AppliedTrunkRotation - { - get; - set; - } + public XYZ? AppliedTrunkRotation { get; set; } [JsonPropertyName("AppliedHeadRotation")] - public XYZ? AppliedHeadRotation - { - get; - set; - } + public XYZ? AppliedHeadRotation { get; set; } [JsonPropertyName("DisplayOnModel")] - public bool? DisplayOnModel - { - get; - set; - } + public bool? DisplayOnModel { get; set; } [JsonPropertyName("AdditionalAnimationLayer")] - public int? AdditionalAnimationLayer - { - get; - set; - } + public int? AdditionalAnimationLayer { get; set; } [JsonPropertyName("StaminaBurnRate")] - public double? StaminaBurnRate - { - get; - set; - } + public double? StaminaBurnRate { get; set; } [JsonPropertyName("ColliderScaleMultiplier")] - public XYZ? ColliderScaleMultiplier - { - get; - set; - } + public XYZ? ColliderScaleMultiplier { get; set; } [JsonPropertyName("ConfigPathStr")] - public string? ConfigPathStr - { - get; - set; - } + public string? ConfigPathStr { get; set; } // Confirmed on client [JsonPropertyName("MaxMarkersCount")] - public int? MaxMarkersCount - { - get; - set; - } + public int? MaxMarkersCount { get; set; } [JsonPropertyName("scaleMin")] - public double? ScaleMin - { - get; - set; - } + public double? ScaleMin { get; set; } [JsonPropertyName("scaleMax")] - public double? ScaleMax - { - get; - set; - } + public double? ScaleMax { get; set; } [JsonPropertyName("medUseTime")] - public double? MedUseTime - { - get; - set; - } + public double? MedUseTime { get; set; } [JsonPropertyName("medEffectType")] - public string? MedEffectType - { - get; - set; - } + public string? MedEffectType { get; set; } // Confirmed in client [JsonPropertyName("MaxHpResource")] - public int? MaxHpResource - { - get; - set; - } + public int? MaxHpResource { get; set; } [JsonPropertyName("hpResourceRate")] - public double? HpResourceRate - { - get; - set; - } + public double? HpResourceRate { get; set; } [JsonPropertyName("apResource")] - public double? ApResource - { - get; - set; - } + public double? ApResource { get; set; } [JsonPropertyName("krResource")] - public double? KrResource - { - get; - set; - } + public double? KrResource { get; set; } [JsonPropertyName("MaxOpticZoom")] - public double? MaxOpticZoom - { - get; - set; - } + public double? MaxOpticZoom { get; set; } // Confirmed in client [JsonPropertyName("MaxRepairResource")] - public int? MaxRepairResource - { - get; - set; - } + public int? MaxRepairResource { get; set; } // Confirmed on client - MongoId [JsonPropertyName("TargetItemFilter")] - public List? TargetItemFilter - { - get; - set; - } + public List? TargetItemFilter { get; set; } [JsonPropertyName("RepairQuality")] - public double? RepairQuality - { - get; - set; - } + public double? RepairQuality { get; set; } [JsonPropertyName("RepairType")] - public string? RepairType - { - get; - set; - } + public string? RepairType { get; set; } [JsonPropertyName("StackMinRandom")] - public int? StackMinRandom - { - get; - set; - } + public int? StackMinRandom { get; set; } [JsonPropertyName("StackMaxRandom")] - public int? StackMaxRandom - { - get; - set; - } + public int? StackMaxRandom { get; set; } [JsonPropertyName("ammoType")] - public string? AmmoType - { - get; - set; - } + public string? AmmoType { get; set; } [JsonPropertyName("InitialSpeed")] - public double? InitialSpeed - { - get; - set; - } + public double? InitialSpeed { get; set; } [JsonPropertyName("BulletMassGram")] - public double? BulletMassGram - { - get; - set; - } + public double? BulletMassGram { get; set; } [JsonPropertyName("BulletDiameterMillimeters")] - public double? BulletDiameterMillimeters - { - get; - set; - } + public double? BulletDiameterMillimeters { get; set; } [JsonPropertyName("Damage")] - public double? Damage - { - get; - set; - } + public double? Damage { get; set; } [JsonPropertyName("ammoAccr")] - public double? AmmoAccr - { - get; - set; - } + public double? AmmoAccr { get; set; } [JsonPropertyName("ammoRec")] - public double? AmmoRec - { - get; - set; - } + public double? AmmoRec { get; set; } [JsonPropertyName("ammoDist")] - public double? AmmoDist - { - get; - set; - } + public double? AmmoDist { get; set; } [JsonPropertyName("buckshotBullets")] - public double? BuckshotBullets - { - get; - set; - } + public double? BuckshotBullets { get; set; } // Confirmed in client [JsonPropertyName("PenetrationPower")] - public int? PenetrationPower - { - get; - set; - } + public int? PenetrationPower { get; set; } [JsonPropertyName("PenetrationPowerDeviation")] - public double? PenetrationPowerDeviation - { - get; - set; - } + public double? PenetrationPowerDeviation { get; set; } [JsonPropertyName("ammoHear")] - public double? AmmoHear - { - get; - set; - } + public double? AmmoHear { get; set; } [JsonPropertyName("ammoSfx")] - public string? AmmoSfx - { - get; - set; - } + public string? AmmoSfx { get; set; } [JsonPropertyName("MisfireChance")] - public double? MisfireChance - { - get; - set; - } + public double? MisfireChance { get; set; } // Confirmed in client [JsonPropertyName("MinFragmentsCount")] - public int? MinFragmentsCount - { - get; - set; - } + public int? MinFragmentsCount { get; set; } // Confirmed in client [JsonPropertyName("MaxFragmentsCount")] - public int? MaxFragmentsCount - { - get; - set; - } + public int? MaxFragmentsCount { get; set; } [JsonPropertyName("ammoShiftChance")] - public double? AmmoShiftChance - { - get; - set; - } + public double? AmmoShiftChance { get; set; } [JsonPropertyName("casingName")] - public string? CasingName - { - get; - set; - } + public string? CasingName { get; set; } [JsonPropertyName("casingEjectPower")] - public double? CasingEjectPower - { - get; - set; - } + public double? CasingEjectPower { get; set; } [JsonPropertyName("casingMass")] - public double? CasingMass - { - get; - set; - } + public double? CasingMass { get; set; } [JsonPropertyName("casingSounds")] - public string? CasingSounds - { - get; - set; - } + public string? CasingSounds { get; set; } [JsonPropertyName("ArmingTime")] - public double? ArmingTime - { - get; - set; - } + public double? ArmingTime { get; set; } [JsonPropertyName("ProjectileCount")] - public double? ProjectileCount - { - get; - set; - } + public double? ProjectileCount { get; set; } [JsonPropertyName("PropagationSpeed")] - public double? PropagationSpeed - { - get; - set; - } + public double? PropagationSpeed { get; set; } [JsonPropertyName("PenetrationChanceObstacle")] - public double? PenetrationChanceObstacle - { - get; - set; - } + public double? PenetrationChanceObstacle { get; set; } [JsonPropertyName("PenetrationDamageMod")] - public double? PenetrationDamageMod - { - get; - set; - } + public double? PenetrationDamageMod { get; set; } [JsonPropertyName("RicochetChance")] - public double? RicochetChance - { - get; - set; - } + public double? RicochetChance { get; set; } [JsonPropertyName("FragmentationChance")] - public double? FragmentationChance - { - get; - set; - } + public double? FragmentationChance { get; set; } [JsonPropertyName("Deterioration")] - public double? Deterioration - { - get; - set; - } + public double? Deterioration { get; set; } [JsonPropertyName("SpeedRetardation")] - public double? SpeedRetardation - { - get; - set; - } + public double? SpeedRetardation { get; set; } [JsonPropertyName("Tracer")] - public bool? Tracer - { - get; - set; - } + public bool? Tracer { get; set; } [JsonPropertyName("TracerColor")] - public string? TracerColor - { - get; - set; - } + public string? TracerColor { get; set; } [JsonPropertyName("TracerDistance")] - public double? TracerDistance - { - get; - set; - } + public double? TracerDistance { get; set; } [JsonPropertyName("ArmorDamage")] - public double? ArmorDamage - { - get; - set; - } + public double? ArmorDamage { get; set; } [JsonPropertyName("Caliber")] - public string? Caliber - { - get; - set; - } + public string? Caliber { get; set; } [JsonPropertyName("StaminaBurnPerDamage")] - public double? StaminaBurnPerDamage - { - get; - set; - } + public double? StaminaBurnPerDamage { get; set; } [JsonPropertyName("HeavyBleedingDelta")] - public double? HeavyBleedingDelta - { - get; - set; - } + public double? HeavyBleedingDelta { get; set; } [JsonPropertyName("LightBleedingDelta")] - public double? LightBleedingDelta - { - get; - set; - } + public double? LightBleedingDelta { get; set; } [JsonPropertyName("ShowBullet")] - public bool? ShowBullet - { - get; - set; - } + public bool? ShowBullet { get; set; } [JsonPropertyName("HasGrenaderComponent")] - public bool? HasGrenaderComponent - { - get; - set; - } + public bool? HasGrenaderComponent { get; set; } [JsonPropertyName("FuzeArmTimeSec")] - public double? FuzeArmTimeSec - { - get; - set; - } + public double? FuzeArmTimeSec { get; set; } [JsonPropertyName("MinExplosionDistance")] - public double? MinExplosionDistance - { - get; - set; - } + public double? MinExplosionDistance { get; set; } [JsonPropertyName("PenetrationPowerDiviation")] - public double? PenetrationPowerDiviation - { - get; - set; - } + public double? PenetrationPowerDiviation { get; set; } [JsonPropertyName("MaxExplosionDistance")] - public double? MaxExplosionDistance - { - get; - set; - } + public double? MaxExplosionDistance { get; set; } // Confirmed in client [JsonPropertyName("FragmentsCount")] - public int? FragmentsCount - { - get; - set; - } + public int? FragmentsCount { get; set; } [JsonPropertyName("FragmentType")] - public string? FragmentType - { - get; - set; - } + public string? FragmentType { get; set; } [JsonPropertyName("ShowHitEffectOnExplode")] - public bool? ShowHitEffectOnExplode - { - get; - set; - } + public bool? ShowHitEffectOnExplode { get; set; } [JsonPropertyName("ExplosionType")] - public string? ExplosionType - { - get; - set; - } + public string? ExplosionType { get; set; } [JsonPropertyName("AmmoLifeTimeSec")] - public double? AmmoLifeTimeSec - { - get; - set; - } + public double? AmmoLifeTimeSec { get; set; } [JsonPropertyName("AmmoTooltipClass")] - public string? AmmoTooltipClass - { - get; - set; - } + public string? AmmoTooltipClass { get; set; } [JsonPropertyName("Contusion")] - public XYZ? Contusion - { - get; - set; - } + public XYZ? Contusion { get; set; } [JsonPropertyName("ArmorDistanceDistanceDamage")] - public XYZ? ArmorDistanceDistanceDamage - { - get; - set; - } + public XYZ? ArmorDistanceDistanceDamage { get; set; } [JsonPropertyName("BackBlastConeAngle")] - public double? BackBlastConeAngle - { - get; - set; - } + public double? BackBlastConeAngle { get; set; } [JsonPropertyName("BackblastDamage")] - public XY? BackblastDamage - { - get; - set; - } + public XY? BackblastDamage { get; set; } [JsonPropertyName("BackblastDistance")] - public double? BackblastDistance - { - get; - set; - } + public double? BackblastDistance { get; set; } [JsonPropertyName("Blindness")] - public XYZ? Blindness - { - get; - set; - } + public XYZ? Blindness { get; set; } [JsonPropertyName("IsLightAndSoundShot")] - public bool? IsLightAndSoundShot - { - get; - set; - } + public bool? IsLightAndSoundShot { get; set; } [JsonPropertyName("IsMountable")] - public bool? IsMountable - { - get; - set; - } + public bool? IsMountable { get; set; } [JsonPropertyName("LightAndSoundShotAngle")] - public double? LightAndSoundShotAngle - { - get; - set; - } + public double? LightAndSoundShotAngle { get; set; } [JsonPropertyName("LightAndSoundShotSelfContusionTime")] - public double? LightAndSoundShotSelfContusionTime - { - get; - set; - } + public double? LightAndSoundShotSelfContusionTime { get; set; } [JsonPropertyName("LightAndSoundShotSelfContusionStrength")] - public double? LightAndSoundShotSelfContusionStrength - { - get; - set; - } + public double? LightAndSoundShotSelfContusionStrength { get; set; } [JsonPropertyName("MalfMisfireChance")] - public double? MalfMisfireChance - { - get; - set; - } + public double? MalfMisfireChance { get; set; } [JsonPropertyName("MalfFeedChance")] - public double? MalfFeedChance - { - get; - set; - } + public double? MalfFeedChance { get; set; } [JsonPropertyName("StackSlots")] - public List? StackSlots - { - get; - set; - } + public List? StackSlots { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("eqMin")] - public double? EqMin - { - get; - set; - } + public double? EqMin { get; set; } [JsonPropertyName("eqMax")] - public double? EqMax - { - get; - set; - } + public double? EqMax { get; set; } [JsonPropertyName("rate")] - public double? Rate - { - get; - set; - } + public double? Rate { get; set; } [JsonPropertyName("ThrowType")] - public ThrowWeapType? ThrowType - { - get; - set; - } + public ThrowWeapType? ThrowType { get; set; } [JsonPropertyName("ExplDelay")] - public double? ExplDelay - { - get; - set; - } + public double? ExplDelay { get; set; } [JsonPropertyName("explDelay")] - public double? explDelay - { - get; - set; - } + public double? explDelay { get; set; } [JsonPropertyName("Strength")] - public double? Strength - { - get; - set; - } + public double? Strength { get; set; } [JsonPropertyName("ContusionDistance")] - public double? ContusionDistance - { - get; - set; - } + public double? ContusionDistance { get; set; } [JsonPropertyName("throwDamMax")] - public double? ThrowDamMax - { - get; - set; - } + public double? ThrowDamMax { get; set; } [JsonPropertyName("EmitTime")] - public double? EmitTime - { - get; - set; - } + public double? EmitTime { get; set; } [JsonPropertyName("CanBeHiddenDuringThrow")] - public bool? CanBeHiddenDuringThrow - { - get; - set; - } + public bool? CanBeHiddenDuringThrow { get; set; } [JsonPropertyName("CanPlantOnGround")] - public bool? CanPlantOnGround - { - get; - set; - } + public bool? CanPlantOnGround { get; set; } [JsonPropertyName("MinTimeToContactExplode")] - public double? MinTimeToContactExplode - { - get; - set; - } + public double? MinTimeToContactExplode { get; set; } [JsonPropertyName("ExplosionEffectType")] - public string? ExplosionEffectType - { - get; - set; - } + public string? ExplosionEffectType { get; set; } [JsonPropertyName("LinkedWeapon")] - public string? LinkedWeapon - { - get; - set; - } + public string? LinkedWeapon { get; set; } [JsonPropertyName("UseAmmoWithoutShell")] - public bool? UseAmmoWithoutShell - { - get; - set; - } + public bool? UseAmmoWithoutShell { get; set; } [JsonPropertyName("RecoilDampingHandRotation")] - public double? RecoilDampingHandRotation - { - get; - set; - } + public double? RecoilDampingHandRotation { get; set; } [JsonPropertyName("LeanWeaponAgainstBody")] - public bool? LeanWeaponAgainstBody - { - get; - set; - } + public bool? LeanWeaponAgainstBody { get; set; } [JsonPropertyName("RemoveShellAfterFire")] - public bool? RemoveShellAfterFire - { - get; - set; - } + public bool? RemoveShellAfterFire { get; set; } [JsonPropertyName("RepairStrategyTypes")] - public List? RepairStrategyTypes - { - get; - set; - } + public List? RepairStrategyTypes { get; set; } [JsonPropertyName("IsEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("LayoutName")] - public string? LayoutName - { - get; - set; - } + public string? LayoutName { get; set; } [JsonPropertyName("Lower75Prefab")] - public Prefab? Lower75Prefab - { - get; - set; - } + public Prefab? Lower75Prefab { get; set; } [JsonPropertyName("MaxUsages")] - public double? MaxUsages - { - get; - set; - } + public double? MaxUsages { get; set; } [JsonPropertyName("BallisticCoeficient")] - public double? BallisticCoeficient - { - get; - set; - } + public double? BallisticCoeficient { get; set; } [JsonPropertyName("BulletDiameterMilimeters")] - public double? BulletDiameterMilimeters - { - get; - set; - } + public double? BulletDiameterMilimeters { get; set; } [JsonPropertyName("ScavKillExpPenalty")] - public double? ScavKillExpPenalty - { - get; - set; - } + public double? ScavKillExpPenalty { get; set; } [JsonPropertyName("ScavKillExpPenaltyPVE")] - public double? ScavKillExpPenaltyPVE - { - get; - set; - } + public double? ScavKillExpPenaltyPVE { get; set; } [JsonPropertyName("ScavKillStandingPenalty")] - public double? ScavKillStandingPenalty - { - get; - set; - } + public double? ScavKillStandingPenalty { get; set; } [JsonPropertyName("ScavKillStandingPenaltyPVE")] - public double? ScavKillStandingPenaltyPVE - { - get; - set; - } + public double? ScavKillStandingPenaltyPVE { get; set; } [JsonPropertyName("TradersDiscount")] - public double? TradersDiscount - { - get; - set; - } + public double? TradersDiscount { get; set; } [JsonPropertyName("TradersDiscountPVE")] - public double? TradersDiscountPVE - { - get; - set; - } + public double? TradersDiscountPVE { get; set; } [JsonPropertyName("AvailableAsDefault")] - public bool? AvailableAsDefault - { - get; - set; - } + public bool? AvailableAsDefault { get; set; } [JsonPropertyName("ProfileVersions")] - public List? ProfileVersions - { - get; - set; - } + public List? ProfileVersions { get; set; } [JsonPropertyName("Side")] - public List? Side - { - get; - set; - } + public List? Side { get; set; } [JsonPropertyName("BipodCameraSnapMultiplier")] - public double? BipodCameraSnapMultiplier - { - get; - set; - } + public double? BipodCameraSnapMultiplier { get; set; } [JsonPropertyName("BipodOutOfStaminaBreathMultiplier")] - public double? BipodOutOfStaminaBreathMultiplier - { - get; - set; - } + public double? BipodOutOfStaminaBreathMultiplier { get; set; } [JsonPropertyName("BipodRecoilMultiplier")] - public double? BipodRecoilMultiplier - { - get; - set; - } + public double? BipodRecoilMultiplier { get; set; } [JsonPropertyName("BipodReturnHandSpeedMultiplier")] - public double? BipodReturnHandSpeedMultiplier - { - get; - set; - } + public double? BipodReturnHandSpeedMultiplier { get; set; } [JsonPropertyName("PitchLimitProneBipod")] - public XYZ? PitchLimitProneBipod - { - get; - set; - } + public XYZ? PitchLimitProneBipod { get; set; } [JsonPropertyName("YawLimitProneBipod")] - public XYZ? YawLimitProneBipod - { - get; - set; - } + public XYZ? YawLimitProneBipod { get; set; } [JsonPropertyName("AdjustableOpticSensitivity")] - public double? AdjustableOpticSensitivity - { - get; - set; - } + public double? AdjustableOpticSensitivity { get; set; } [JsonPropertyName("AdjustableOpticSensitivityMax")] - public double? AdjustableOpticSensitivityMax - { - get; - set; - } + public double? AdjustableOpticSensitivityMax { get; set; } } public record WeaponRecoilSettings @@ -3531,18 +1584,10 @@ public record WeaponRecoilSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("Enable")] - public bool? Enable - { - get; - set; - } + public bool? Enable { get; set; } [JsonPropertyName("Values")] - public List? Values - { - get; - set; - } + public List? Values { get; set; } } public record WeaponRecoilSettingValues @@ -3551,25 +1596,13 @@ public record WeaponRecoilSettingValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("Enable")] - public bool? Enable - { - get; - set; - } + public bool? Enable { get; set; } [JsonPropertyName("Process")] - public WeaponRecoilProcess? Process - { - get; - set; - } + public WeaponRecoilProcess? Process { get; set; } [JsonPropertyName("Target")] - public string? Target - { - get; - set; - } + public string? Target { get; set; } } public record WeaponRecoilProcess @@ -3578,39 +1611,19 @@ public record WeaponRecoilProcess public Dictionary ExtensionData { get; set; } [JsonPropertyName("ComponentType")] - public string? ComponentType - { - get; - set; - } + public string? ComponentType { get; set; } [JsonPropertyName("CurveAimingValueMultiply")] - public double? CurveAimingValueMultiply - { - get; - set; - } + public double? CurveAimingValueMultiply { get; set; } [JsonPropertyName("CurveTimeMultiply")] - public double? CurveTimeMultiply - { - get; - set; - } + public double? CurveTimeMultiply { get; set; } [JsonPropertyName("CurveValueMultiply")] - public double? CurveValueMultiply - { - get; - set; - } + public double? CurveValueMultiply { get; set; } [JsonPropertyName("TransformationCurve")] - public WeaponRecoilTransformationCurve? TransformationCurve - { - get; - set; - } + public WeaponRecoilTransformationCurve? TransformationCurve { get; set; } } public record WeaponRecoilTransformationCurve @@ -3619,11 +1632,7 @@ public record WeaponRecoilTransformationCurve public Dictionary ExtensionData { get; set; } [JsonPropertyName("Keys")] - public List? Keys - { - get; - set; - } + public List? Keys { get; set; } } public record WeaponRecoilTransformationCurveKey @@ -3632,32 +1641,16 @@ public record WeaponRecoilTransformationCurveKey public Dictionary ExtensionData { get; set; } [JsonPropertyName("inTangent")] - public double? InTangent - { - get; - set; - } + public double? InTangent { get; set; } [JsonPropertyName("outTangent")] - public double? OutTangent - { - get; - set; - } + public double? OutTangent { get; set; } [JsonPropertyName("time")] - public double? Time - { - get; - set; - } + public double? Time { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record HealthEffect @@ -3666,18 +1659,10 @@ public record HealthEffect public Dictionary ExtensionData { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } } public record Prefab @@ -3686,18 +1671,10 @@ public record Prefab public Dictionary ExtensionData { get; set; } [JsonPropertyName("path")] - public string? Path - { - get; - set; - } + public string? Path { get; set; } [JsonPropertyName("rcid")] - public string? Rcid - { - get; - set; - } + public string? Rcid { get; set; } } public record Grid @@ -3706,39 +1683,19 @@ public record Grid public Dictionary ExtensionData { get; set; } [JsonPropertyName("_name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_parent")] - public string? Parent - { - get; - set; - } + public string? Parent { get; set; } [JsonPropertyName("_props")] - public GridProps? Props - { - get; - set; - } + public GridProps? Props { get; set; } [JsonPropertyName("_proto")] - public string? Proto - { - get; - set; - } + public string? Proto { get; set; } } public record GridProps @@ -3747,53 +1704,25 @@ public record GridProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("filters")] - public List? Filters - { - get; - set; - } + public List? Filters { get; set; } [JsonPropertyName("cellsH")] - public int? CellsH - { - get; - set; - } + public int? CellsH { get; set; } [JsonPropertyName("cellsV")] - public int? CellsV - { - get; - set; - } + public int? CellsV { get; set; } [JsonPropertyName("minCount")] - public double? MinCount - { - get; - set; - } + public double? MinCount { get; set; } [JsonPropertyName("maxCount")] - public double? MaxCount - { - get; - set; - } + public double? MaxCount { get; set; } [JsonPropertyName("maxWeight")] - public double? MaxWeight - { - get; - set; - } + public double? MaxWeight { get; set; } [JsonPropertyName("isSortingTable")] - public bool? IsSortingTable - { - get; - set; - } + public bool? IsSortingTable { get; set; } } public record GridFilter @@ -3802,25 +1731,13 @@ public record GridFilter public Dictionary ExtensionData { get; set; } [JsonPropertyName("Filter")] - public HashSet? Filter - { - get; - set; - } + public HashSet? Filter { get; set; } [JsonPropertyName("ExcludedFilter")] - public List? ExcludedFilter - { - get; - set; - } + public List? ExcludedFilter { get; set; } [JsonPropertyName("locked")] - public bool? Locked - { - get; - set; - } + public bool? Locked { get; set; } } public record Slot @@ -3835,69 +1752,33 @@ public record Slot [JsonPropertyName("_name")] public string? Name { - get - { - return _name; - } - set - { - _name = value == null ? null : string.Intern(value); - } + get { return _name; } + set { _name = value == null ? null : string.Intern(value); } } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_parent")] - public string? Parent - { - get; - set; - } + public string? Parent { get; set; } [JsonPropertyName("_props")] - public SlotProps? Props - { - get; - set; - } + public SlotProps? Props { get; set; } [JsonPropertyName("_max_count")] - public double? MaxCount - { - get; - set; - } + public double? MaxCount { get; set; } [JsonPropertyName("_required")] - public bool? Required - { - get; - set; - } + public bool? Required { get; set; } [JsonPropertyName("_mergeSlotWithChildren")] - public bool? MergeSlotWithChildren - { - get; - set; - } + public bool? MergeSlotWithChildren { get; set; } [JsonPropertyName("_proto")] public string? Proto { - get - { - return _proto; - } - set - { - _proto = value == null ? null : string.Intern(value); - } + get { return _proto; } + set { _proto = value == null ? null : string.Intern(value); } } } @@ -3907,18 +1788,10 @@ public record SlotProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("filters")] - public List? Filters - { - get; - set; - } + public List? Filters { get; set; } [JsonPropertyName("MaxStackCount")] - public double? MaxStackCount - { - get; - set; - } + public double? MaxStackCount { get; set; } } public record SlotFilter @@ -3927,67 +1800,31 @@ public record SlotFilter public Dictionary ExtensionData { get; set; } [JsonPropertyName("Shift")] - public double? Shift - { - get; - set; - } + public double? Shift { get; set; } [JsonPropertyName("locked")] - public bool? Locked - { - get; - set; - } + public bool? Locked { get; set; } [JsonPropertyName("Plate")] - public string? Plate - { - get; - set; - } + public string? Plate { get; set; } [JsonPropertyName("armorColliders")] - public List? ArmorColliders - { - get; - set; - } + public List? ArmorColliders { get; set; } [JsonPropertyName("armorPlateColliders")] - public List? ArmorPlateColliders - { - get; - set; - } + public List? ArmorPlateColliders { get; set; } [JsonPropertyName("Filter")] - public HashSet? Filter - { - get; - set; - } + public HashSet? Filter { get; set; } [JsonPropertyName("AnimationIndex")] - public double? AnimationIndex - { - get; - set; - } + public double? AnimationIndex { get; set; } [JsonPropertyName("MaxStackCount")] - public double? MaxStackCount - { - get; - set; - } + public double? MaxStackCount { get; set; } [JsonPropertyName("bluntDamageReduceFromSoftArmor")] - public bool? BluntDamageReduceFromSoftArmor - { - get; - set; - } + public bool? BluntDamageReduceFromSoftArmor { get; set; } } public record StackSlot @@ -3996,53 +1833,25 @@ public record StackSlot public Dictionary ExtensionData { get; set; } [JsonPropertyName("_name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("_parent")] - public string? Parent - { - get; - set; - } + public string? Parent { get; set; } [JsonPropertyName("_max_count")] - public double? MaxCount - { - get; - set; - } + public double? MaxCount { get; set; } [JsonPropertyName("_props")] - public StackSlotProps? Props - { - get; - set; - } + public StackSlotProps? Props { get; set; } [JsonPropertyName("_proto")] - public string? Proto - { - get; - set; - } + public string? Proto { get; set; } [JsonPropertyName("upd")] - public object? Upd - { - get; - set; - } // TODO: object here + public object? Upd { get; set; } // TODO: object here } public record StackSlotProps @@ -4051,11 +1860,7 @@ public record StackSlotProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("filters")] - public List? Filters - { - get; - set; - } + public List? Filters { get; set; } } public record RandomLootSettings @@ -4064,60 +1869,28 @@ public record RandomLootSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("allowToSpawnIdenticalItems")] - public bool? AllowToSpawnIdenticalItems - { - get; - set; - } + public bool? AllowToSpawnIdenticalItems { get; set; } [JsonPropertyName("allowToSpawnQuestItems")] - public bool? AllowToSpawnQuestItems - { - get; - set; - } + public bool? AllowToSpawnQuestItems { get; set; } [JsonPropertyName("countByRarity")] - public List? CountByRarity - { - get; - set; - } // TODO: object here + public List? CountByRarity { get; set; } // TODO: object here [JsonPropertyName("excluded")] - public RandomLootExcluded? Excluded - { - get; - set; - } + public RandomLootExcluded? Excluded { get; set; } [JsonPropertyName("filters")] - public List? Filters - { - get; - set; - } // TODO: object here + public List? Filters { get; set; } // TODO: object here [JsonPropertyName("findInRaid")] - public bool? FindInRaid - { - get; - set; - } + public bool? FindInRaid { get; set; } [JsonPropertyName("maxCount")] - public double? MaxCount - { - get; - set; - } + public double? MaxCount { get; set; } [JsonPropertyName("minCount")] - public double? MinCount - { - get; - set; - } + public double? MinCount { get; set; } } public record RandomLootExcluded @@ -4126,25 +1899,13 @@ public record RandomLootExcluded public Dictionary ExtensionData { get; set; } [JsonPropertyName("categoryTemplates")] - public List? CategoryTemplates - { - get; - set; - } // TODO: object here + public List? CategoryTemplates { get; set; } // TODO: object here [JsonPropertyName("rarity")] - public List? Rarity - { - get; - set; - } + public List? Rarity { get; set; } [JsonPropertyName("templates")] - public List? Templates - { - get; - set; - } // TODO: object here + public List? Templates { get; set; } // TODO: object here } public record EffectsHealth @@ -4153,18 +1914,10 @@ public record EffectsHealth public Dictionary ExtensionData { get; set; } [JsonPropertyName("Energy")] - public EffectsHealthProps? Energy - { - get; - set; - } + public EffectsHealthProps? Energy { get; set; } [JsonPropertyName("Hydration")] - public EffectsHealthProps? Hydration - { - get; - set; - } + public EffectsHealthProps? Hydration { get; set; } } public record EffectsHealthProps @@ -4173,25 +1926,13 @@ public record EffectsHealthProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("delay")] - public double? Delay - { - get; - set; - } + public double? Delay { get; set; } [JsonPropertyName("duration")] - public double? Duration - { - get; - set; - } + public double? Duration { get; set; } } public record EffectsDamage @@ -4200,53 +1941,25 @@ public record EffectsDamage public Dictionary ExtensionData { get; set; } [JsonPropertyName("Pain")] - public EffectDamageProps? Pain - { - get; - set; - } + public EffectDamageProps? Pain { get; set; } [JsonPropertyName("LightBleeding")] - public EffectDamageProps? LightBleeding - { - get; - set; - } + public EffectDamageProps? LightBleeding { get; set; } [JsonPropertyName("HeavyBleeding")] - public EffectDamageProps? HeavyBleeding - { - get; - set; - } + public EffectDamageProps? HeavyBleeding { get; set; } [JsonPropertyName("Contusion")] - public EffectDamageProps? Contusion - { - get; - set; - } + public EffectDamageProps? Contusion { get; set; } [JsonPropertyName("RadExposure")] - public EffectDamageProps? RadExposure - { - get; - set; - } + public EffectDamageProps? RadExposure { get; set; } [JsonPropertyName("Fracture")] - public EffectDamageProps? Fracture - { - get; - set; - } + public EffectDamageProps? Fracture { get; set; } [JsonPropertyName("DestroyedPart")] - public EffectDamageProps? DestroyedPart - { - get; - set; - } + public EffectDamageProps? DestroyedPart { get; set; } } public record EffectDamageProps @@ -4255,53 +1968,25 @@ public record EffectDamageProps public Dictionary ExtensionData { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("delay")] - public double? Delay - { - get; - set; - } + public double? Delay { get; set; } [JsonPropertyName("duration")] - public double? Duration - { - get; - set; - } + public double? Duration { get; set; } [JsonPropertyName("fadeOut")] - public double? FadeOut - { - get; - set; - } + public double? FadeOut { get; set; } [JsonPropertyName("cost")] - public double? Cost - { - get; - set; - } + public double? Cost { get; set; } [JsonPropertyName("healthPenaltyMin")] - public double? HealthPenaltyMin - { - get; - set; - } + public double? HealthPenaltyMin { get; set; } [JsonPropertyName("healthPenaltyMax")] - public double? HealthPenaltyMax - { - get; - set; - } + public double? HealthPenaltyMax { get; set; } } public record Color @@ -4310,32 +1995,16 @@ public record Color public Dictionary ExtensionData { get; set; } [JsonPropertyName("r")] - public double? R - { - get; - set; - } + public double? R { get; set; } [JsonPropertyName("g")] - public double? G - { - get; - set; - } + public double? G { get; set; } [JsonPropertyName("b")] - public double? B - { - get; - set; - } + public double? B { get; set; } [JsonPropertyName("a")] - public double? A - { - get; - set; - } + public double? A { get; set; } } public record ShotsGroupSettings @@ -4344,43 +2013,23 @@ public record ShotsGroupSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("EndShotIndex")] - public double? EndShotIndex - { - get; - set; - } + public double? EndShotIndex { get; set; } [JsonPropertyName("ShotRecoilPositionStrength")] - public XYZ? ShotRecoilPositionStrength - { - get; - set; - } + public XYZ? ShotRecoilPositionStrength { get; set; } [JsonPropertyName("ShotRecoilRadianRange")] - public XYZ? ShotRecoilRadianRange - { - get; - set; - } + public XYZ? ShotRecoilRadianRange { get; set; } [JsonPropertyName("ShotRecoilRotationStrength")] - public XYZ? ShotRecoilRotationStrength - { - get; - set; - } + public XYZ? ShotRecoilRotationStrength { get; set; } [JsonPropertyName("StartShotIndex")] - public double? StartShotIndex - { - get; - set; - } + public double? StartShotIndex { get; set; } } public enum ItemType { NODE = 1, - ITEM = 2 + ITEM = 2, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs index 00446fbd..a02b5249 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs @@ -11,46 +11,22 @@ public record Trader public Dictionary ExtensionData { get; set; } [JsonPropertyName("assort")] - public TraderAssort? Assort - { - get; - set; - } + public TraderAssort? Assort { get; set; } [JsonPropertyName("base")] - public TraderBase? Base - { - get; - set; - } + public TraderBase? Base { get; set; } [JsonPropertyName("dialogue")] - public Dictionary?>? Dialogue - { - get; - set; - } + public Dictionary?>? Dialogue { get; set; } [JsonPropertyName("questassort")] - public Dictionary>? QuestAssort - { - get; - set; - } + public Dictionary>? QuestAssort { get; set; } [JsonPropertyName("suits")] - public List? Suits - { - get; - set; - } + public List? Suits { get; set; } [JsonPropertyName("services")] - public List? Services - { - get; - set; - } + public List? Services { get; set; } } public record TraderBase @@ -59,215 +35,95 @@ public record TraderBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("refreshTraderRagfairOffers")] - public bool? RefreshTraderRagfairOffers - { - get; - set; - } + public bool? RefreshTraderRagfairOffers { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("availableInRaid")] - public bool? AvailableInRaid - { - get; - set; - } + public bool? AvailableInRaid { get; set; } [JsonPropertyName("avatar")] - public string? Avatar - { - get; - set; - } + public string? Avatar { get; set; } [JsonPropertyName("balance_dol")] - public decimal? BalanceDollar - { - get; - set; - } + public decimal? BalanceDollar { get; set; } [JsonPropertyName("balance_eur")] - public decimal? BalanceEuro - { - get; - set; - } + public decimal? BalanceEuro { get; set; } [JsonPropertyName("balance_rub")] - public decimal? BalanceRub - { - get; - set; - } + public decimal? BalanceRub { get; set; } [JsonPropertyName("buyer_up")] - public bool? BuyerUp - { - get; - set; - } + public bool? BuyerUp { get; set; } [JsonPropertyName("currency")] - public CurrencyType? Currency - { - get; - set; - } + public CurrencyType? Currency { get; set; } [JsonPropertyName("customization_seller")] - public bool? CustomizationSeller - { - get; - set; - } + public bool? CustomizationSeller { get; set; } [JsonPropertyName("discount")] - public decimal? Discount - { - get; - set; - } + public decimal? Discount { get; set; } [JsonPropertyName("discount_end")] - public decimal? DiscountEnd - { - get; - set; - } + public decimal? DiscountEnd { get; set; } [JsonPropertyName("gridHeight")] - public double? GridHeight - { - get; - set; - } + public double? GridHeight { get; set; } [JsonPropertyName("sell_modifier_for_prohibited_items")] - public int? ProhibitedItemsSellModifier - { - get; - set; - } + public int? ProhibitedItemsSellModifier { get; set; } [JsonPropertyName("insurance")] - public TraderInsurance? Insurance - { - get; - set; - } + public TraderInsurance? Insurance { get; set; } [JsonPropertyName("items_buy")] - public ItemBuyData? ItemsBuy - { - get; - set; - } + public ItemBuyData? ItemsBuy { get; set; } [JsonPropertyName("items_buy_prohibited")] - public ItemBuyData? ItemsBuyProhibited - { - get; - set; - } + public ItemBuyData? ItemsBuyProhibited { get; set; } [JsonPropertyName("isCanTransferItems")] - public bool? IsCanTransferItems - { - get; - set; - } + public bool? IsCanTransferItems { get; set; } [JsonPropertyName("transferableItems")] - public ItemBuyData? TransferableItems - { - get; - set; - } + public ItemBuyData? TransferableItems { get; set; } [JsonPropertyName("prohibitedTransferableItems")] - public ItemBuyData? ProhibitedTransferableItems - { - get; - set; - } + public ItemBuyData? ProhibitedTransferableItems { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("loyaltyLevels")] - public List? LoyaltyLevels - { - get; - set; - } + public List? LoyaltyLevels { get; set; } [JsonPropertyName("medic")] - public bool? Medic - { - get; - set; - } + public bool? Medic { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } // Confirmed in client [JsonPropertyName("nextResupply")] - public int? NextResupply - { - get; - set; - } + public int? NextResupply { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("repair")] - public TraderRepair? Repair - { - get; - set; - } + public TraderRepair? Repair { get; set; } [JsonPropertyName("sell_category")] - public List? SellCategory - { - get; - set; - } + public List? SellCategory { get; set; } [JsonPropertyName("surname")] - public string? Surname - { - get; - set; - } + public string? Surname { get; set; } [JsonPropertyName("unlockedByDefault")] - public bool? UnlockedByDefault - { - get; - set; - } + public bool? UnlockedByDefault { get; set; } } public record ItemBuyData @@ -277,19 +133,11 @@ public record ItemBuyData // MongoId [JsonPropertyName("category")] - public List? Category - { - get; - set; - } + public List? Category { get; set; } // MongoId [JsonPropertyName("id_list")] - public List? IdList - { - get; - set; - } + public List? IdList { get; set; } } public record TraderInsurance @@ -298,50 +146,26 @@ public record TraderInsurance public Dictionary ExtensionData { get; set; } [JsonPropertyName("availability")] - public bool? Availability - { - get; - set; - } + public bool? Availability { get; set; } // MongoId [JsonPropertyName("excluded_category")] - public List? ExcludedCategory - { - get; - set; - } + public List? ExcludedCategory { get; set; } // Confirmed in client [JsonPropertyName("max_return_hour")] - public int? MaxReturnHour - { - get; - set; - } + public int? MaxReturnHour { get; set; } [JsonPropertyName("max_storage_time")] - public double? MaxStorageTime - { - get; - set; - } + public double? MaxStorageTime { get; set; } // Confirmed in client [JsonPropertyName("min_payment")] - public int? MinPayment - { - get; - set; - } + public int? MinPayment { get; set; } // Confirmed in client [JsonPropertyName("min_return_hour")] - public int? MinReturnHour - { - get; - set; - } + public int? MinReturnHour { get; set; } } public record TraderLoyaltyLevel @@ -350,62 +174,30 @@ public record TraderLoyaltyLevel public Dictionary ExtensionData { get; set; } [JsonPropertyName("buy_price_coef")] - public double? BuyPriceCoefficient - { - get; - set; - } + public double? BuyPriceCoefficient { get; set; } [JsonPropertyName("exchange_price_coef")] - public double? ExchangePriceCoefficient - { - get; - set; - } + public double? ExchangePriceCoefficient { get; set; } [JsonPropertyName("heal_price_coef")] - public double? HealPriceCoefficient - { - get; - set; - } + public double? HealPriceCoefficient { get; set; } [JsonPropertyName("insurance_price_coef")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public double? InsurancePriceCoefficient - { - get; - set; - } + public double? InsurancePriceCoefficient { get; set; } // Chceked on client [JsonPropertyName("minLevel")] - public int? MinLevel - { - get; - set; - } + public int? MinLevel { get; set; } [JsonPropertyName("minSalesSum")] - public long? MinSalesSum - { - get; - set; - } + public long? MinSalesSum { get; set; } [JsonPropertyName("minStanding")] - public double? MinStanding - { - get; - set; - } + public double? MinStanding { get; set; } [JsonPropertyName("repair_price_coef")] - public double? RepairPriceCoefficient - { - get; - set; - } + public double? RepairPriceCoefficient { get; set; } } public record TraderRepair @@ -414,57 +206,29 @@ public record TraderRepair public Dictionary ExtensionData { get; set; } [JsonPropertyName("availability")] - public bool? Availability - { - get; - set; - } + public bool? Availability { get; set; } [JsonPropertyName("currency")] - public string? Currency - { - get; - set; - } + public string? Currency { get; set; } [JsonPropertyName("currency_coefficient")] - public double? CurrencyCoefficient - { - get; - set; - } + public double? CurrencyCoefficient { get; set; } [JsonPropertyName("excluded_category")] - public List? ExcludedCategory - { - get; - set; - } + public List? ExcludedCategory { get; set; } /// /// Doesn't exist in client object /// [JsonPropertyName("excluded_id_list")] - public List? ExcludedIdList - { - get; - set; - } + public List? ExcludedIdList { get; set; } [JsonPropertyName("quality")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public double? Quality - { - get; - set; - } + public double? Quality { get; set; } [JsonPropertyName("price_rate")] - public double? PriceRate - { - get; - set; - } + public double? PriceRate { get; set; } } public record TraderAssort @@ -473,32 +237,16 @@ public record TraderAssort public Dictionary ExtensionData { get; set; } [JsonPropertyName("nextResupply")] - public double? NextResupply - { - get; - set; - } + public double? NextResupply { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("barter_scheme")] - public Dictionary>>? BarterScheme - { - get; - set; - } + public Dictionary>>? BarterScheme { get; set; } [JsonPropertyName("loyal_level_items")] - public Dictionary? LoyalLevelItems - { - get; - set; - } + public Dictionary? LoyalLevelItems { get; set; } } public record BarterScheme @@ -508,47 +256,23 @@ public record BarterScheme // Confirmed in client [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("_tpl")] - public string? Template - { - get; - set; - } + public string? Template { get; set; } [JsonPropertyName("onlyFunctional")] - public bool? OnlyFunctional - { - get; - set; - } + public bool? OnlyFunctional { get; set; } [JsonPropertyName("sptQuestLocked")] - public bool? SptQuestLocked - { - get; - set; - } + public bool? SptQuestLocked { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("side")] [JsonConverter(typeof(JsonStringEnumConverter))] - public DogtagExchangeSide? Side - { - get; - set; - } + public DogtagExchangeSide? Side { get; set; } } public record Suit @@ -557,67 +281,31 @@ public record Suit public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("externalObtain")] - public bool? ExternalObtain - { - get; - set; - } + public bool? ExternalObtain { get; set; } [JsonPropertyName("internalObtain")] - public bool? InternalObtain - { - get; - set; - } + public bool? InternalObtain { get; set; } [JsonPropertyName("isHiddenInPVE")] - public bool? IsHiddenInPVE - { - get; - set; - } + public bool? IsHiddenInPVE { get; set; } [JsonPropertyName("tid")] - public string? Tid - { - get; - set; - } + public string? Tid { get; set; } [JsonPropertyName("suiteId")] - public string? SuiteId - { - get; - set; - } + public string? SuiteId { get; set; } [JsonPropertyName("isActive")] - public bool? IsActive - { - get; - set; - } + public bool? IsActive { get; set; } [JsonPropertyName("requirements")] - public SuitRequirements? Requirements - { - get; - set; - } + public SuitRequirements? Requirements { get; set; } [JsonPropertyName("relatedBattlePassSeason")] - public int? RelatedBattlePassSeason - { - get; - set; - } + public int? RelatedBattlePassSeason { get; set; } } public record SuitRequirements @@ -626,61 +314,29 @@ public record SuitRequirements public Dictionary ExtensionData { get; set; } [JsonPropertyName("achievementRequirements")] - public List? AchievementRequirements - { - get; - set; - } + public List? AchievementRequirements { get; set; } [JsonPropertyName("loyaltyLevel")] - public double? LoyaltyLevel - { - get; - set; - } + public double? LoyaltyLevel { get; set; } [JsonPropertyName("profileLevel")] - public double? ProfileLevel - { - get; - set; - } + public double? ProfileLevel { get; set; } // Checked in client [JsonPropertyName("standing")] - public double? Standing - { - get; - set; - } + public double? Standing { get; set; } [JsonPropertyName("skillRequirements")] - public List? SkillRequirements - { - get; - set; - } + public List? SkillRequirements { get; set; } [JsonPropertyName("questRequirements")] - public List? QuestRequirements - { - get; - set; - } + public List? QuestRequirements { get; set; } [JsonPropertyName("itemRequirements")] - public List? ItemRequirements - { - get; - set; - } + public List? ItemRequirements { get; set; } [JsonPropertyName("requiredTid")] - public string? RequiredTid - { - get; - set; - } + public string? RequiredTid { get; set; } } public record ItemRequirement @@ -689,37 +345,17 @@ public record ItemRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("_tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("onlyFunctional")] - public bool? OnlyFunctional - { - get; - set; - } + public bool? OnlyFunctional { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XY.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XY.cs index 7a3d8f07..afa00181 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XY.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XY.cs @@ -8,16 +8,8 @@ public record XY public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public double? X - { - get; - set; - } + public double? X { get; set; } [JsonPropertyName("y")] - public double? Y - { - get; - set; - } + public double? Y { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XYZ.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XYZ.cs index 4b5e12b0..a99ac51f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XYZ.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/XYZ.cs @@ -8,23 +8,11 @@ public record XYZ public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public double? X - { - get; - set; - } + public double? X { get; set; } [JsonPropertyName("y")] - public double? Y - { - get; - set; - } + public double? Y { get; set; } [JsonPropertyName("z")] - public double? Z - { - get; - set; - } + public double? Z { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/BuyClothingRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/BuyClothingRequestData.cs index b1185789..b6ec6bcf 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/BuyClothingRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/BuyClothingRequestData.cs @@ -9,18 +9,10 @@ public record BuyClothingRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("offer")] - public string? Offer - { - get; - set; - } + public string? Offer { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record PaymentItemForClothing @@ -29,23 +21,11 @@ public record PaymentItemForClothing public Dictionary ExtensionData { get; set; } [JsonPropertyName("del")] - public bool? Del - { - get; - set; - } + public bool? Del { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/CustomizationSetRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/CustomizationSetRequest.cs index d2b355b5..702b9c2d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/CustomizationSetRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/CustomizationSetRequest.cs @@ -9,11 +9,7 @@ public record CustomizationSetRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("customizations")] - public List? Customizations - { - get; - set; - } + public List? Customizations { get; set; } } public record CustomizationSetOption @@ -22,23 +18,11 @@ public record CustomizationSetOption public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("source")] - public string? Source - { - get; - set; - } + public string? Source { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/WearClothingRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/WearClothingRequestData.cs index 1c688844..0b731e25 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/WearClothingRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Customization/WearClothingRequestData.cs @@ -1,9 +1,9 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Eft.Customization; public record WearClothingRequestData { [JsonExtensionData] public Dictionary ExtensionData { get; set; } - } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AcceptFriendRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AcceptFriendRequestData.cs index be9e42d6..7e96b0ac 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AcceptFriendRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AcceptFriendRequestData.cs @@ -3,17 +3,11 @@ using SPTarkov.Server.Core.Models.Utils; namespace SPTarkov.Server.Core.Models.Eft.Dialog; -public record AcceptFriendRequestData : BaseFriendRequest -{ -} +public record AcceptFriendRequestData : BaseFriendRequest { } -public record CancelFriendRequestData : BaseFriendRequest -{ -} +public record CancelFriendRequestData : BaseFriendRequest { } -public record DeclineFriendRequestData : BaseFriendRequest -{ -} +public record DeclineFriendRequestData : BaseFriendRequest { } public record BaseFriendRequest : IRequestData { @@ -21,9 +15,5 @@ public record BaseFriendRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("profileId")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs index cd0719e7..f42900ff 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs @@ -9,16 +9,8 @@ public record AddUserGroupMailRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs index 4216d3b4..28d57f07 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs @@ -9,16 +9,8 @@ public record ChangeGroupMailOwnerRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChatServer.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChatServer.cs index 169728bf..7d1b1df1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChatServer.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ChatServer.cs @@ -8,70 +8,34 @@ public record ChatServer public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("RegistrationId")] - public int? RegistrationId - { - get; - set; - } + public int? RegistrationId { get; set; } [JsonPropertyName("VersionId")] - public string? VersionId - { - get; - set; - } + public string? VersionId { get; set; } [JsonPropertyName("Ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("Port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } [JsonPropertyName("DateTime")] - public long? DateTime - { - get; - set; - } + public long? DateTime { get; set; } [JsonPropertyName("Chats")] - public List? Chats - { - get; - set; - } + public List? Chats { get; set; } [JsonPropertyName("Regions")] - public List? Regions - { - get; - set; - } + public List? Regions { get; set; } /// /// Possibly removed /// [JsonPropertyName("IsDeveloper")] - public bool? IsDeveloper - { - get; - set; - } + public bool? IsDeveloper { get; set; } } public record Chat @@ -80,16 +44,8 @@ public record Chat public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Members")] - public int? Members - { - get; - set; - } + public int? Members { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ClearMailMessageRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ClearMailMessageRequest.cs index ec941036..bf0c40aa 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ClearMailMessageRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/ClearMailMessageRequest.cs @@ -9,9 +9,5 @@ public record ClearMailMessageRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/CreateGroupMailRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/CreateGroupMailRequest.cs index 7120ff6e..f3478189 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/CreateGroupMailRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/CreateGroupMailRequest.cs @@ -9,16 +9,8 @@ public record CreateGroupMailRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("Users")] - public List? Users - { - get; - set; - } + public List? Users { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/DeleteFriendRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/DeleteFriendRequest.cs index 3de7b686..b411ddcd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/DeleteFriendRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/DeleteFriendRequest.cs @@ -9,9 +9,5 @@ public record DeleteFriendRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("friend_id")] - public string? FriendId - { - get; - set; - } + public string? FriendId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestData.cs index 948fed41..d508a121 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestData.cs @@ -9,30 +9,14 @@ public record FriendRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("status")] - public int? Status - { - get; - set; - } + public int? Status { get; set; } [JsonPropertyName("requestId")] - public string? RequestId - { - get; - set; - } + public string? RequestId { get; set; } [JsonPropertyName("retryAfter")] - public int? RetryAfter - { - get; - set; - } + public int? RetryAfter { get; set; } [JsonPropertyName("to")] - public string? To - { - get; - set; - } + public string? To { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestSendResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestSendResponse.cs index b07cbe5b..ba08fff7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestSendResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/FriendRequestSendResponse.cs @@ -9,23 +9,11 @@ public record FriendRequestSendResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("status")] - public BackendErrorCodes? Status - { - get; - set; - } + public BackendErrorCodes? Status { get; set; } [JsonPropertyName("requestId")] - public string? RequestId - { - get; - set; - } + public string? RequestId { get; set; } [JsonPropertyName("retryAfter")] - public int? RetryAfter - { - get; - set; - } + public int? RetryAfter { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsRequestData.cs index a7ea469f..5424e33b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsRequestData.cs @@ -9,9 +9,5 @@ public record GetAllAttachmentsRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string DialogId - { - get; - set; - } + public string DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsResponse.cs index 297b3b09..201bdc7e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetAllAttachmentsResponse.cs @@ -9,23 +9,11 @@ public record GetAllAttachmentsResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("messages")] - public List? Messages - { - get; - set; - } + public List? Messages { get; set; } [JsonPropertyName("profiles")] - public List? Profiles - { - get; - set; - } // Assuming 'any' translates to 'object' + public List? Profiles { get; set; } // Assuming 'any' translates to 'object' [JsonPropertyName("hasMessagesWithRewards")] - public bool? HasMessagesWithRewards - { - get; - set; - } + public bool? HasMessagesWithRewards { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetChatServerListRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetChatServerListRequestData.cs index 0150eb7f..d109f7ed 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetChatServerListRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetChatServerListRequestData.cs @@ -9,9 +9,5 @@ public record GetChatServerListRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("VersionId")] - public string? VersionId - { - get; - set; - } + public string? VersionId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetFriendListDataResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetFriendListDataResponse.cs index 867f23dd..eea68c7a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetFriendListDataResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetFriendListDataResponse.cs @@ -9,23 +9,11 @@ public record GetFriendListDataResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("Friends")] - public List? Friends - { - get; - set; - } + public List? Friends { get; set; } [JsonPropertyName("Ignore")] - public List? Ignore - { - get; - set; - } + public List? Ignore { get; set; } [JsonPropertyName("InIgnoreList")] - public List? InIgnoreList - { - get; - set; - } + public List? InIgnoreList { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs index 6cd7adfb..0327a078 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs @@ -9,9 +9,5 @@ public record GetMailDialogInfoRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs index 8972acdd..d1a587a4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs @@ -9,16 +9,8 @@ public record GetMailDialogListRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("limit")] - public int? Limit - { - get; - set; - } + public int? Limit { get; set; } [JsonPropertyName("offset")] - public int? Offset - { - get; - set; - } + public int? Offset { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs index 07e84a98..1d55a72d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs @@ -10,30 +10,14 @@ public record GetMailDialogViewRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("type")] - public MessageType? Type - { - get; - set; - } + public MessageType? Type { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("limit")] - public int? Limit - { - get; - set; - } + public int? Limit { get; set; } [JsonPropertyName("time")] - public decimal? Time - { - get; - set; - } // decimal + public decimal? Time { get; set; } // decimal } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs index 24148bd7..5a539891 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs @@ -9,23 +9,11 @@ public record GetMailDialogViewResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("messages")] - public List? Messages - { - get; - set; - } + public List? Messages { get; set; } [JsonPropertyName("profiles")] - public List? Profiles - { - get; - set; - } + public List? Profiles { get; set; } [JsonPropertyName("hasMessagesWithRewards")] - public bool? HasMessagesWithRewards - { - get; - set; - } + public bool? HasMessagesWithRewards { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/PinDialogRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/PinDialogRequestData.cs index e8ac34b2..e2594b07 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/PinDialogRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/PinDialogRequestData.cs @@ -9,9 +9,5 @@ public record PinDialogRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveDialogRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveDialogRequestData.cs index 041d282b..3db35edb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveDialogRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveDialogRequestData.cs @@ -9,9 +9,5 @@ public record RemoveDialogRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs index 7ba1768c..3e84cdea 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs @@ -9,9 +9,5 @@ public record RemoveMailMessageRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs index 9681e7f0..2a09bf66 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs @@ -9,16 +9,8 @@ public record RemoveUserGroupMailRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("uid")] - public string? Uid - { - get; - set; - } + public string? Uid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SendMessageRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SendMessageRequest.cs index 2f523234..a20fa773 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SendMessageRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SendMessageRequest.cs @@ -10,30 +10,14 @@ public record SendMessageRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("type")] - public MessageType? Type - { - get; - set; - } + public MessageType? Type { get; set; } [JsonPropertyName("text")] - public string? Text - { - get; - set; - } + public string? Text { get; set; } [JsonPropertyName("replyTo")] - public string? ReplyTo - { - get; - set; - } + public string? ReplyTo { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SetDialogReadRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SetDialogReadRequestData.cs index 21ff8d08..1de92b34 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SetDialogReadRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Dialog/SetDialogReadRequestData.cs @@ -9,9 +9,5 @@ public record SetDialogReadRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("dialogs")] - public List? Dialogs - { - get; - set; - } + public List? Dialogs { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CheckVersionResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CheckVersionResponse.cs index c801c1e4..4f06862b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CheckVersionResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CheckVersionResponse.cs @@ -8,16 +8,8 @@ public record CheckVersionResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("isvalid")] - public bool? IsValid - { - get; - set; - } + public bool? IsValid { get; set; } [JsonPropertyName("latestVersion")] - public string? LatestVersion - { - get; - set; - } + public string? LatestVersion { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CurrentGroupResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CurrentGroupResponse.cs index 65a5fc75..5fa63738 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CurrentGroupResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/CurrentGroupResponse.cs @@ -9,11 +9,7 @@ public record CurrentGroupResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("squad")] - public List? Squad - { - get; - set; - } + public List? Squad { get; set; } } public record CurrentGroupSquadMember @@ -22,39 +18,19 @@ public record CurrentGroupSquadMember public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public string? Aid - { - get; - set; - } + public string? Aid { get; set; } [JsonPropertyName("info")] - public CurrentGroupMemberInfo? Info - { - get; - set; - } + public CurrentGroupMemberInfo? Info { get; set; } [JsonPropertyName("isLeader")] - public bool? IsLeader - { - get; - set; - } + public bool? IsLeader { get; set; } [JsonPropertyName("isReady")] - public bool? IsReady - { - get; - set; - } + public bool? IsReady { get; set; } } public record CurrentGroupMemberInfo @@ -63,30 +39,14 @@ public record CurrentGroupMemberInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Level")] - public string? Level - { - get; - set; - } + public string? Level { get; set; } [JsonPropertyName("MemberCategory")] - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameConfigResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameConfigResponse.cs index fa25631d..455be628 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameConfigResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameConfigResponse.cs @@ -8,112 +8,52 @@ public record GameConfigResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("aid")] - public double? Aid - { - get; - set; - } + public double? Aid { get; set; } [JsonPropertyName("lang")] - public string? Language - { - get; - set; - } + public string? Language { get; set; } [JsonPropertyName("languages")] - public Dictionary? Languages - { - get; - set; - } + public Dictionary? Languages { get; set; } [JsonPropertyName("ndaFree")] - public bool? IsNdaFree - { - get; - set; - } + public bool? IsNdaFree { get; set; } [JsonPropertyName("taxonomy")] - public int? Taxonomy - { - get; - set; - } + public int? Taxonomy { get; set; } [JsonPropertyName("activeProfileId")] - public string? ActiveProfileId - { - get; - set; - } + public string? ActiveProfileId { get; set; } [JsonPropertyName("backend")] - public Backend? Backend - { - get; - set; - } + public Backend? Backend { get; set; } [JsonPropertyName("useProtobuf")] - public bool? UseProtobuf - { - get; - set; - } + public bool? UseProtobuf { get; set; } [JsonPropertyName("utc_time")] - public double? UtcTime - { - get; - set; - } + public double? UtcTime { get; set; } /// /// Total in game time /// [JsonPropertyName("totalInGame")] - public double? TotalInGame - { - get; - set; - } + public double? TotalInGame { get; set; } [JsonPropertyName("reportAvailable")] - public bool? IsReportAvailable - { - get; - set; - } + public bool? IsReportAvailable { get; set; } [JsonPropertyName("twitchEventMember")] - public bool? IsTwitchEventMember - { - get; - set; - } + public bool? IsTwitchEventMember { get; set; } [JsonPropertyName("sessionMode")] - public string? SessionMode - { - get; - set; - } + public string? SessionMode { get; set; } [JsonPropertyName("purchasedGames")] - public PurchasedGames? PurchasedGames - { - get; - set; - } + public PurchasedGames? PurchasedGames { get; set; } [JsonPropertyName("isGameSynced")] - public bool? IsGameSynced - { - get; - set; - } + public bool? IsGameSynced { get; set; } } public record PurchasedGames @@ -122,18 +62,10 @@ public record PurchasedGames public Dictionary ExtensionData { get; set; } [JsonPropertyName("eft")] - public bool? IsEftPurchased - { - get; - set; - } + public bool? IsEftPurchased { get; set; } [JsonPropertyName("arena")] - public bool? IsArenaPurchased - { - get; - set; - } + public bool? IsArenaPurchased { get; set; } } public record Backend @@ -142,37 +74,17 @@ public record Backend public Dictionary ExtensionData { get; set; } [JsonPropertyName("Lobby")] - public string? Lobby - { - get; - set; - } + public string? Lobby { get; set; } [JsonPropertyName("Trading")] - public string? Trading - { - get; - set; - } + public string? Trading { get; set; } [JsonPropertyName("Messaging")] - public string? Messaging - { - get; - set; - } + public string? Messaging { get; set; } [JsonPropertyName("Main")] - public string? Main - { - get; - set; - } + public string? Main { get; set; } [JsonPropertyName("RagFair")] - public string? RagFair - { - get; - set; - } + public string? RagFair { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameEmptyCrcRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameEmptyCrcRequestData.cs index c51a6359..ff02a6af 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameEmptyCrcRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameEmptyCrcRequestData.cs @@ -9,9 +9,5 @@ public record GameEmptyCrcRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("crc")] - public int? Crc - { - get; - set; - } + public int? Crc { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameKeepAliveResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameKeepAliveResponse.cs index 7fd44835..40a5ce87 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameKeepAliveResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameKeepAliveResponse.cs @@ -8,16 +8,8 @@ public record GameKeepAliveResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("msg")] - public string? Message - { - get; - set; - } + public string? Message { get; set; } [JsonPropertyName("utc_time")] - public double? UtcTime - { - get; - set; - } + public double? UtcTime { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameLogoutResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameLogoutResponseData.cs index fdea02e5..a104aeee 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameLogoutResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameLogoutResponseData.cs @@ -8,9 +8,5 @@ public record GameLogoutResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("status")] - public string? Status - { - get; - set; - } + public string? Status { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeRequestData.cs index a5c36968..4ec91f5c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeRequestData.cs @@ -9,9 +9,5 @@ public record GameModeRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("sessionMode")] - public string? SessionMode - { - get; - set; - } + public string? SessionMode { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeResponse.cs index 29b55f92..a5d38cff 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameModeResponse.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Eft.Game; public enum SessionMode { REGULAR, - PVE + PVE, } public record GameModeResponse @@ -14,16 +14,8 @@ public record GameModeResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("gameMode")] - public string? GameMode - { - get; - set; - } + public string? GameMode { get; set; } [JsonPropertyName("backendUrl")] - public string? BackendUrl - { - get; - set; - } + public string? BackendUrl { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameStartResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameStartResponse.cs index ce84b837..755103ff 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameStartResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GameStartResponse.cs @@ -8,9 +8,5 @@ public record GameStartResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("utc_time")] - public double UtcTime - { - get; - set; - } + public double UtcTime { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetItemPricesResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetItemPricesResponse.cs index 65f649aa..0e21379c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetItemPricesResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetItemPricesResponse.cs @@ -8,23 +8,11 @@ public record GetItemPricesResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("supplyNextTime")] - public double? SupplyNextTime - { - get; - set; - } + public double? SupplyNextTime { get; set; } [JsonPropertyName("prices")] - public Dictionary? Prices - { - get; - set; - } + public Dictionary? Prices { get; set; } [JsonPropertyName("currencyCourses")] - public Dictionary? CurrencyCourses - { - get; - set; - } + public Dictionary? CurrencyCourses { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeRequest.cs index 0318b81e..43d7f0ed 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeRequest.cs @@ -9,16 +9,8 @@ public record GetRaidTimeRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeResponse.cs index 3b84d42a..60d9cd39 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/GetRaidTimeResponse.cs @@ -8,16 +8,8 @@ public record GetRaidTimeResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("NewSurviveTimeSeconds")] - public double? NewSurviveTimeSeconds - { - get; - set; - } + public double? NewSurviveTimeSeconds { get; set; } [JsonPropertyName("OriginalSurvivalTimeSeconds")] - public double? OriginalSurvivalTimeSeconds - { - get; - set; - } + public double? OriginalSurvivalTimeSeconds { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SendSurveyOpinionRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SendSurveyOpinionRequest.cs index e04a94d7..1b771e3b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SendSurveyOpinionRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SendSurveyOpinionRequest.cs @@ -9,25 +9,13 @@ public record SendSurveyOpinionRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("resultJson")] - public string? ResultJson - { - get; - set; - } + public string? ResultJson { get; set; } [JsonPropertyName("surveyId")] - public int? SurveyId - { - get; - set; - } + public int? SurveyId { get; set; } [JsonPropertyName("answers")] - public List? Answers - { - get; - set; - } + public List? Answers { get; set; } } public record SurveyOpinionAnswer @@ -36,23 +24,11 @@ public record SurveyOpinionAnswer public Dictionary ExtensionData { get; set; } [JsonPropertyName("questionId")] - public int? QuestionId - { - get; - set; - } + public int? QuestionId { get; set; } [JsonPropertyName("answerType")] - public string? AnswerType - { - get; - set; - } + public string? AnswerType { get; set; } [JsonPropertyName("answers")] - public object? Answers - { - get; - set; - } + public object? Answers { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/ServerDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/ServerDetails.cs index 63fe2b0e..99f38986 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/ServerDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/ServerDetails.cs @@ -8,16 +8,8 @@ public record ServerDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SurveyResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SurveyResponseData.cs index ae4870bb..76be7e98 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SurveyResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/SurveyResponseData.cs @@ -8,18 +8,10 @@ public record SurveyResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("locale")] - public Dictionary>? Locale - { - get; - set; - } + public Dictionary>? Locale { get; set; } [JsonPropertyName("survey")] - public Survey? Survey - { - get; - set; - } + public Survey? Survey { get; set; } } public record Survey @@ -28,46 +20,22 @@ public record Survey public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public int? Id - { - get; - set; - } + public int? Id { get; set; } [JsonPropertyName("welcomePageData")] - public WelcomePageData? WelcomePageData - { - get; - set; - } + public WelcomePageData? WelcomePageData { get; set; } [JsonPropertyName("farewellPageData")] - public FarewellPageData? FarewellPageData - { - get; - set; - } + public FarewellPageData? FarewellPageData { get; set; } [JsonPropertyName("pages")] - public List>? Pages - { - get; - set; - } + public List>? Pages { get; set; } [JsonPropertyName("questions")] - public List? Questions - { - get; - set; - } + public List? Questions { get; set; } [JsonPropertyName("isNew")] - public bool? IsNew - { - get; - set; - } + public bool? IsNew { get; set; } } public record WelcomePageData @@ -76,25 +44,13 @@ public record WelcomePageData public Dictionary ExtensionData { get; set; } [JsonPropertyName("titleLocaleKey")] - public string? TitleLocaleKey - { - get; - set; - } + public string? TitleLocaleKey { get; set; } [JsonPropertyName("timeLocaleKey")] - public string? TimeLocaleKey - { - get; - set; - } + public string? TimeLocaleKey { get; set; } [JsonPropertyName("descriptionLocaleKey")] - public string? DescriptionLocaleKey - { - get; - set; - } + public string? DescriptionLocaleKey { get; set; } } public record FarewellPageData @@ -103,11 +59,7 @@ public record FarewellPageData public Dictionary ExtensionData { get; set; } [JsonPropertyName("textLocaleKey")] - public string? TextLocaleKey - { - get; - set; - } + public string? TextLocaleKey { get; set; } } public record SurveyQuestion @@ -116,53 +68,25 @@ public record SurveyQuestion public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public int? Id - { - get; - set; - } + public int? Id { get; set; } [JsonPropertyName("sortIndex")] - public int? SortIndex - { - get; - set; - } + public int? SortIndex { get; set; } [JsonPropertyName("titleLocaleKey")] - public string? TitleLocaleKey - { - get; - set; - } + public string? TitleLocaleKey { get; set; } [JsonPropertyName("hintLocaleKey")] - public string? HintLocaleKey - { - get; - set; - } + public string? HintLocaleKey { get; set; } [JsonPropertyName("answerLimit")] - public int? AnswerLimit - { - get; - set; - } + public int? AnswerLimit { get; set; } [JsonPropertyName("answerType")] - public string? AnswerType - { - get; - set; - } + public string? AnswerType { get; set; } [JsonPropertyName("answers")] - public List? Answers - { - get; - set; - } + public List? Answers { get; set; } } public record SurveyAnswer @@ -171,30 +95,14 @@ public record SurveyAnswer public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public int? Id - { - get; - set; - } + public int? Id { get; set; } [JsonPropertyName("questionId")] - public int? QuestionId - { - get; - set; - } + public int? QuestionId { get; set; } [JsonPropertyName("sortIndex")] - public int? SortIndex - { - get; - set; - } + public int? SortIndex { get; set; } [JsonPropertyName("localeKey")] - public string? LocaleKey - { - get; - set; - } + public string? LocaleKey { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/VersionValidateRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/VersionValidateRequestData.cs index eed922b5..10da4b32 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Game/VersionValidateRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Game/VersionValidateRequestData.cs @@ -9,18 +9,10 @@ public record VersionValidateRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("version")] - public Version? Version - { - get; - set; - } + public Version? Version { get; set; } [JsonPropertyName("develop")] - public bool? Develop - { - get; - set; - } + public bool? Develop { get; set; } } public record Version @@ -29,37 +21,17 @@ public record Version public Dictionary ExtensionData { get; set; } [JsonPropertyName("major")] - public string? Major - { - get; - set; - } + public string? Major { get; set; } [JsonPropertyName("minor")] - public string? Minor - { - get; - set; - } + public string? Minor { get; set; } [JsonPropertyName("game")] - public string? Game - { - get; - set; - } + public string? Game { get; set; } [JsonPropertyName("backend")] - public string? Backend - { - get; - set; - } + public string? Backend { get; set; } [JsonPropertyName("taxonomy")] - public string? Taxonomy - { - get; - set; - } + public string? Taxonomy { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/Effect.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/Effect.cs index 3e18a739..1633cd99 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/Effect.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/Effect.cs @@ -6,5 +6,5 @@ public enum Effect LightBleeding, HeavyBleeding, MildMusclePain, - SevereMusclePain + SevereMusclePain, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs index 16623936..c323005f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs @@ -10,36 +10,20 @@ public record HealthTreatmentRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("trader")] - public string? Trader - { - get; - set; - } + public string? Trader { get; set; } /// /// Id of stack to take money from
/// Amount of money to take off player for treatment ///
[JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("difference")] - public Difference? Difference - { - get; - set; - } + public Difference? Difference { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } public record Difference @@ -48,25 +32,13 @@ public record Difference public Dictionary ExtensionData { get; set; } [JsonPropertyName("BodyParts")] - public BodyParts? BodyParts - { - get; - set; - } + public BodyParts? BodyParts { get; set; } [JsonPropertyName("Energy")] - public double? Energy - { - get; - set; - } + public double? Energy { get; set; } [JsonPropertyName("Hydration")] - public double? Hydration - { - get; - set; - } + public double? Hydration { get; set; } } public record BodyParts @@ -75,53 +47,25 @@ public record BodyParts public Dictionary ExtensionData { get; set; } [JsonPropertyName("Head")] - public BodyPartEffects? Head - { - get; - set; - } + public BodyPartEffects? Head { get; set; } [JsonPropertyName("Chest")] - public BodyPartEffects? Chest - { - get; - set; - } + public BodyPartEffects? Chest { get; set; } [JsonPropertyName("Stomach")] - public BodyPartEffects? Stomach - { - get; - set; - } + public BodyPartEffects? Stomach { get; set; } [JsonPropertyName("LeftArm")] - public BodyPartEffects? LeftArm - { - get; - set; - } + public BodyPartEffects? LeftArm { get; set; } [JsonPropertyName("RightArm")] - public BodyPartEffects? RightArm - { - get; - set; - } + public BodyPartEffects? RightArm { get; set; } [JsonPropertyName("LeftLeg")] - public BodyPartEffects? LeftLeg - { - get; - set; - } + public BodyPartEffects? LeftLeg { get; set; } [JsonPropertyName("RightLeg")] - public BodyPartEffects? RightLeg - { - get; - set; - } + public BodyPartEffects? RightLeg { get; set; } } public record BodyPartEffects @@ -129,18 +73,10 @@ public record BodyPartEffects [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double Health - { - get; - set; - } + public double Health { get; set; } /// /// Effects in array to be removed /// - public List Effects - { - get; - set; - } + public List Effects { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidEatRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidEatRequestData.cs index 8911deb8..ae67909a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidEatRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidEatRequestData.cs @@ -9,23 +9,11 @@ public record OffraidEatRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("time")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidHealRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidHealRequestData.cs index b4cd0dca..cd869f21 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidHealRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/OffraidHealRequestData.cs @@ -9,32 +9,16 @@ public record OffraidHealRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("part")] - public string? Part - { - get; - set; - } + public string? Part { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("time")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } } public enum BodyPart @@ -46,5 +30,5 @@ public enum BodyPart RightArm, LeftLeg, RightLeg, - Common + Common, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/SyncHealthRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/SyncHealthRequestData.cs index a342aa7b..78890545 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/SyncHealthRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/SyncHealthRequestData.cs @@ -8,39 +8,19 @@ public record SyncHealthRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Health")] - public List? Health - { - get; - set; - } + public List? Health { get; set; } [JsonPropertyName("IsAlive")] - public bool? IsAlive - { - get; - set; - } + public bool? IsAlive { get; set; } [JsonPropertyName("Hydration")] - public double? Hydration - { - get; - set; - } + public double? Hydration { get; set; } [JsonPropertyName("Energy")] - public double? Energy - { - get; - set; - } + public double? Energy { get; set; } [JsonPropertyName("Temperature")] - public double? Temperature - { - get; - set; - } + public double? Temperature { get; set; } } public record BodyPartCollection @@ -49,53 +29,25 @@ public record BodyPartCollection public Dictionary ExtensionData { get; set; } [JsonPropertyName("Head")] - public BodyPartHealth? Head - { - get; - set; - } + public BodyPartHealth? Head { get; set; } [JsonPropertyName("Chest")] - public BodyPartHealth? Chest - { - get; - set; - } + public BodyPartHealth? Chest { get; set; } [JsonPropertyName("Stomach")] - public BodyPartHealth? Stomach - { - get; - set; - } + public BodyPartHealth? Stomach { get; set; } [JsonPropertyName("LeftArm")] - public BodyPartHealth? LeftArm - { - get; - set; - } + public BodyPartHealth? LeftArm { get; set; } [JsonPropertyName("RightArm")] - public BodyPartHealth? RightArm - { - get; - set; - } + public BodyPartHealth? RightArm { get; set; } [JsonPropertyName("LeftLeg")] - public BodyPartHealth? LeftLeg - { - get; - set; - } + public BodyPartHealth? LeftLeg { get; set; } [JsonPropertyName("RightLeg")] - public BodyPartHealth? RightLeg - { - get; - set; - } + public BodyPartHealth? RightLeg { get; set; } } public record BodyPartHealth @@ -104,23 +56,11 @@ public record BodyPartHealth public Dictionary ExtensionData { get; set; } [JsonPropertyName("Maximum")] - public int? Maximum - { - get; - set; - } + public int? Maximum { get; set; } [JsonPropertyName("Current")] - public int? Current - { - get; - set; - } + public int? Current { get; set; } [JsonPropertyName("Effects")] - public Dictionary? Effects - { - get; - set; - } + public Dictionary? Effects { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/WorkoutData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/WorkoutData.cs index 384ad26a..890eccc3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/WorkoutData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/WorkoutData.cs @@ -11,11 +11,7 @@ public class WorkoutData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("skills")] - public WorkoutSkills? Skills - { - get; - set; - } + public WorkoutSkills? Skills { get; set; } } public record WorkoutSkills @@ -24,30 +20,14 @@ public record WorkoutSkills public Dictionary ExtensionData { get; set; } [JsonPropertyName("Common")] - public List Common - { - get; - set; - } + public List Common { get; set; } [JsonPropertyName("Mastering")] - public List? Mastering - { - get; - set; - } + public List? Mastering { get; set; } [JsonPropertyName("Bonuses")] - public Bonus? Bonuses - { - get; - set; - } + public Bonus? Bonuses { get; set; } [JsonPropertyName("Points")] - public int? Points - { - get; - set; - } + public int? Points { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HandleQTEEventRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HandleQTEEventRequestData.cs index e6b3c60c..c3f9d8a6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HandleQTEEventRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HandleQTEEventRequestData.cs @@ -12,26 +12,14 @@ public record HandleQTEEventRequestData : InventoryBaseActionRequestData /// true if QTE was successful, otherwise false /// [JsonPropertyName("results")] - public List? Results - { - get; - set; - } + public List? Results { get; set; } /// /// Id of the QTE object used from db/hideout/qte.json /// [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutArea.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutArea.cs index 34d50c42..b8033f95 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutArea.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutArea.cs @@ -10,81 +10,37 @@ public record HideoutArea public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public HideoutAreas? Type - { - get; - set; - } + public HideoutAreas? Type { get; set; } [JsonPropertyName("enabled")] - public bool? IsEnabled - { - get; - set; - } + public bool? IsEnabled { get; set; } [JsonPropertyName("needsFuel")] - public bool? NeedsFuel - { - get; - set; - } + public bool? NeedsFuel { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } [JsonPropertyName("takeFromSlotLocked")] - public bool? IsTakeFromSlotLocked - { - get; - set; - } + public bool? IsTakeFromSlotLocked { get; set; } [JsonPropertyName("craftGivesExp")] - public bool? CraftGivesExperience - { - get; - set; - } + public bool? CraftGivesExperience { get; set; } [JsonPropertyName("displayLevel")] - public bool? DisplayLevel - { - get; - set; - } + public bool? DisplayLevel { get; set; } [JsonPropertyName("enableAreaRequirements")] - public bool? EnableAreaRequirements - { - get; - set; - } + public bool? EnableAreaRequirements { get; set; } [JsonPropertyName("parentArea")] - public string? ParentArea - { - get; - set; - } + public string? ParentArea { get; set; } [JsonPropertyName("stages")] - public Dictionary? Stages - { - get; - set; - } + public Dictionary? Stages { get; set; } } public record HideoutAreaRequirement @@ -93,25 +49,13 @@ public record HideoutAreaRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public int? AreaType - { - get; - set; - } + public int? AreaType { get; set; } [JsonPropertyName("requiredLevel")] - public int? RequiredLevel - { - get; - set; - } + public int? RequiredLevel { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record Stage @@ -120,77 +64,37 @@ public record Stage public Dictionary ExtensionData { get; set; } [JsonPropertyName("autoUpgrade")] - public bool? AutoUpgrade - { - get; - set; - } + public bool? AutoUpgrade { get; set; } [JsonPropertyName("bonuses")] - public List? Bonuses - { - get; - set; - } + public List? Bonuses { get; set; } [JsonPropertyName("constructionTime")] - public double? ConstructionTime - { - get; - set; - } + public double? ConstructionTime { get; set; } /// /// Containers inventory tpl /// [JsonPropertyName("container")] - public string? Container - { - get; - set; - } + public string? Container { get; set; } [JsonPropertyName("description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } [JsonPropertyName("globalCounterId")] - public string? GlobalCounterId - { - get; - set; - } + public string? GlobalCounterId { get; set; } [JsonPropertyName("displayInterface")] - public bool? DisplayInterface - { - get; - set; - } + public bool? DisplayInterface { get; set; } [JsonPropertyName("improvements")] - public List? Improvements - { - get; - set; - } + public List? Improvements { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } [JsonPropertyName("slots")] - public int? Slots - { - get; - set; - } + public int? Slots { get; set; } } public record StageImprovement @@ -199,32 +103,16 @@ public record StageImprovement public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("bonuses")] - public List? Bonuses - { - get; - set; - } + public List? Bonuses { get; set; } [JsonPropertyName("improvementTime")] - public double? ImprovementTime - { - get; - set; - } + public double? ImprovementTime { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } } public record StageImprovementBonus @@ -233,53 +121,25 @@ public record StageImprovementBonus public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("passive")] - public bool? IsPassive - { - get; - set; - } + public bool? IsPassive { get; set; } [JsonPropertyName("production")] - public bool? IsProduction - { - get; - set; - } + public bool? IsProduction { get; set; } [JsonPropertyName("skillType")] - public SkillClass? SkillType - { - get; - set; - } + public SkillClass? SkillType { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("visible")] - public bool? IsVisible - { - get; - set; - } + public bool? IsVisible { get; set; } } public record StageImprovementRequirement @@ -288,46 +148,22 @@ public record StageImprovementRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("isFunctional")] - public bool? IsFunctional - { - get; - set; - } + public bool? IsFunctional { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("isSpawnedInSession")] - public bool? IsSpawnedInSession - { - get; - set; - } + public bool? IsSpawnedInSession { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record StageRequirement @@ -336,86 +172,38 @@ public record StageRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public int? AreaType - { - get; - set; - } + public int? AreaType { get; set; } [JsonPropertyName("requiredLevel")] - public int? RequiredLevel - { - get; - set; - } + public int? RequiredLevel { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } = false; + public bool? IsEncoded { get; set; } = false; [JsonPropertyName("isFunctional")] - public bool? IsFunctional - { - get; - set; - } + public bool? IsFunctional { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("isSpawnedInSession")] - public bool? IsSpawnedInSession - { - get; - set; - } + public bool? IsSpawnedInSession { get; set; } [JsonPropertyName("loyaltyLevel")] - public int? LoyaltyLevel - { - get; - set; - } + public int? LoyaltyLevel { get; set; } [JsonPropertyName("skillName")] - public string? SkillName - { - get; - set; - } + public string? SkillName { get; set; } [JsonPropertyName("skillLevel")] - public int? SkillLevel - { - get; - set; - } + public int? SkillLevel { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCancelProductionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCancelProductionRequestData.cs index 15b8a049..325fdf96 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCancelProductionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCancelProductionRequestData.cs @@ -6,16 +6,8 @@ namespace SPTarkov.Server.Core.Models.Eft.Hideout; public record HideoutCancelProductionRequestData : BaseInteractionRequestData { [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCircleOfCultistProductionStartRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCircleOfCultistProductionStartRequestData.cs index b28fa4ee..b8bc0396 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCircleOfCultistProductionStartRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCircleOfCultistProductionStartRequestData.cs @@ -9,9 +9,5 @@ public record HideoutCircleOfCultistProductionStartRequestData : InventoryBaseAc public Dictionary ExtensionData { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutContinuousProductionStartRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutContinuousProductionStartRequestData.cs index dbe748a2..193dd9bd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutContinuousProductionStartRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutContinuousProductionStartRequestData.cs @@ -9,18 +9,10 @@ public record HideoutContinuousProductionStartRequestData : InventoryBaseActionR public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("timestamp")] - public double? Timestamp - { - get; - set; - } + public double? Timestamp { get; set; } } public record HideoutProperties @@ -28,21 +20,9 @@ public record HideoutProperties [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public int? BtcFarmGcs - { - get; - set; - } + public int? BtcFarmGcs { get; set; } - public bool IsGeneratorOn - { - get; - set; - } + public bool IsGeneratorOn { get; set; } - public bool WaterCollectorHasFilter - { - get; - set; - } + public bool WaterCollectorHasFilter { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomisation.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomisation.cs index 6fb75b75..d8db3f63 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomisation.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomisation.cs @@ -9,18 +9,10 @@ public record HideoutCustomisation public Dictionary ExtensionData { get; set; } [JsonPropertyName("globals")] - public List? Globals - { - get; - set; - } + public List? Globals { get; set; } [JsonPropertyName("slots")] - public List? Slots - { - get; - set; - } + public List? Slots { get; set; } } public record HideoutCustomisationGlobal @@ -29,53 +21,25 @@ public record HideoutCustomisationGlobal public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("conditions")] - public List? Conditions - { - get; - set; - } + public List? Conditions { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("systemName")] - public string? SystemName - { - get; - set; - } + public string? SystemName { get; set; } [JsonPropertyName("isEnabled")] - public bool? IsEnabled - { - get; - set; - } + public bool? IsEnabled { get; set; } [JsonPropertyName("itemId")] - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } } public record HideoutCustomisationSlot @@ -84,58 +48,26 @@ public record HideoutCustomisationSlot public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("conditions")] - public List? Conditions - { - get; - set; - } + public List? Conditions { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("systemName")] - public string? SystemName - { - get; - set; - } + public string? SystemName { get; set; } [JsonPropertyName("isEnabled")] - public bool? IsEnabled - { - get; - set; - } + public bool? IsEnabled { get; set; } [JsonPropertyName("slotId")] - public string? SlotId - { - get; - set; - } + public string? SlotId { get; set; } [JsonPropertyName("areaTypeId")] - public int? AreaTypeId - { - get; - set; - } + public int? AreaTypeId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationApplyRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationApplyRequestData.cs index bf54c40e..26f6f08d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationApplyRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationApplyRequestData.cs @@ -12,16 +12,8 @@ public record HideoutCustomizationApplyRequestData : InventoryBaseActionRequestD /// Id of the newly picked item to apply to hideout /// [JsonPropertyName("offerId")] - public string? OfferId - { - get; - set; - } + public string? OfferId { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationSetMannequinPoseRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationSetMannequinPoseRequest.cs index ee3c3f71..391e9233 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationSetMannequinPoseRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutCustomizationSetMannequinPoseRequest.cs @@ -9,16 +9,8 @@ public record HideoutCustomizationSetMannequinPoseRequest : InventoryBaseActionR public Dictionary ExtensionData { get; set; } [JsonPropertyName("poses")] - public Dictionary? Poses - { - get; - set; - } + public Dictionary? Poses { get; set; } [JsonPropertyName("timestamp")] - public double? Timestamp - { - get; - set; - } + public double? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutDeleteProductionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutDeleteProductionRequestData.cs index 7fdb55fd..9a385f30 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutDeleteProductionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutDeleteProductionRequestData.cs @@ -9,16 +9,8 @@ public record HideoutDeleteProductionRequestData : InventoryBaseActionRequestDat public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("timestamp")] - public double? Timestamp - { - get; - set; - } + public double? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutImproveAreaRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutImproveAreaRequestData.cs index e9f69b2d..0c7ac782 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutImproveAreaRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutImproveAreaRequestData.cs @@ -14,30 +14,14 @@ public record HideoutImproveAreaRequestData : InventoryBaseActionRequestData /// Hideout area id from areas.json /// [JsonPropertyName("id")] - public string? AreaId - { - get; - set; - } + public string? AreaId { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutProduction.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutProduction.cs index a35ed26a..4fe033f5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutProduction.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutProduction.cs @@ -10,25 +10,13 @@ public record HideoutProductionData public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipes")] - public List? Recipes - { - get; - set; - } + public List? Recipes { get; set; } [JsonPropertyName("scavRecipes")] - public List? ScavRecipes - { - get; - set; - } + public List? ScavRecipes { get; set; } [JsonPropertyName("cultistRecipes")] - public List? CultistRecipes - { - get; - set; - } + public List? CultistRecipes { get; set; } } public record HideoutProduction @@ -37,91 +25,43 @@ public record HideoutProduction public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } [JsonPropertyName("productionTime")] - public double? ProductionTime - { - get; - set; - } + public double? ProductionTime { get; set; } /// /// Tpl of item being crafted /// [JsonPropertyName("endProduct")] - public string? EndProduct - { - get; - set; - } + public string? EndProduct { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("locked")] - public bool? Locked - { - get; - set; - } + public bool? Locked { get; set; } [JsonPropertyName("needFuelForAllProductionTime")] - public bool? NeedFuelForAllProductionTime - { - get; - set; - } + public bool? NeedFuelForAllProductionTime { get; set; } [JsonPropertyName("continuous")] - public bool? Continuous - { - get; - set; - } + public bool? Continuous { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("productionLimitCount")] - public int? ProductionLimitCount - { - get; - set; - } + public int? ProductionLimitCount { get; set; } [JsonPropertyName("isCodeProduction")] - public bool? IsCodeProduction - { - get; - set; - } + public bool? IsCodeProduction { get; set; } } public record Requirement @@ -130,81 +70,37 @@ public record Requirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } [JsonPropertyName("isFunctional")] - public bool? IsFunctional - { - get; - set; - } + public bool? IsFunctional { get; set; } [JsonPropertyName("areaType")] - public int? AreaType - { - get; - set; - } + public int? AreaType { get; set; } [JsonPropertyName("requiredLevel")] - public int? RequiredLevel - { - get; - set; - } + public int? RequiredLevel { get; set; } [JsonPropertyName("resource")] - public int? Resource - { - get; - set; - } + public int? Resource { get; set; } [JsonPropertyName("questId")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } [JsonPropertyName("isSpawnedInSession")] - public bool? IsSpawnedInSession - { - get; - set; - } + public bool? IsSpawnedInSession { get; set; } [JsonPropertyName("gameVersions")] - public List? GameVersions - { - get; - set; - } + public List? GameVersions { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record ScavRecipe @@ -213,32 +109,16 @@ public record ScavRecipe public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } [JsonPropertyName("productionTime")] - public double? ProductionTime - { - get; - set; - } + public double? ProductionTime { get; set; } [JsonPropertyName("endProducts")] - public EndProducts? EndProducts - { - get; - set; - } + public EndProducts? EndProducts { get; set; } } public record EndProducts @@ -247,25 +127,13 @@ public record EndProducts public Dictionary ExtensionData { get; set; } [JsonPropertyName("Common")] - public MinMax? Common - { - get; - set; - } + public MinMax? Common { get; set; } [JsonPropertyName("Rare")] - public MinMax? Rare - { - get; - set; - } + public MinMax? Rare { get; set; } [JsonPropertyName("Superrare")] - public MinMax? Superrare - { - get; - set; - } + public MinMax? Superrare { get; set; } } public record CultistRecipe @@ -274,9 +142,5 @@ public record CultistRecipe public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutPutItemInRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutPutItemInRequestData.cs index 69da7af6..11f5f4d1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutPutItemInRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutPutItemInRequestData.cs @@ -11,23 +11,11 @@ public record HideoutPutItemInRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("items")] - public Dictionary? Items - { - get; - set; - } + public Dictionary? Items { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutScavCaseStartRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutScavCaseStartRequestData.cs index b41f18cb..e1211c52 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutScavCaseStartRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutScavCaseStartRequestData.cs @@ -10,30 +10,14 @@ public record HideoutScavCaseStartRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("tools")] - public List? Tools - { - get; - set; - } + public List? Tools { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSettingsBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSettingsBase.cs index d8b84344..91af193c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSettingsBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSettingsBase.cs @@ -8,37 +8,17 @@ public record HideoutSettingsBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("generatorSpeedWithoutFuel")] - public double? GeneratorSpeedWithoutFuel - { - get; - set; - } + public double? GeneratorSpeedWithoutFuel { get; set; } [JsonPropertyName("generatorFuelFlowRate")] - public double? GeneratorFuelFlowRate - { - get; - set; - } + public double? GeneratorFuelFlowRate { get; set; } [JsonPropertyName("airFilterUnitFlowRate")] - public double? AirFilterUnitFlowRate - { - get; - set; - } + public double? AirFilterUnitFlowRate { get; set; } [JsonPropertyName("cultistAmuletBonusPercent")] - public double? CultistAmuletBonusPercent - { - get; - set; - } + public double? CultistAmuletBonusPercent { get; set; } [JsonPropertyName("gpuBoostRate")] - public double? GpuBoostRate - { - get; - set; - } + public double? GpuBoostRate { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSingleProductionStartRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSingleProductionStartRequestData.cs index 5033171b..8879924a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSingleProductionStartRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutSingleProductionStartRequestData.cs @@ -10,30 +10,14 @@ public record HideoutSingleProductionStartRequestData : InventoryBaseActionReque public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("tools")] - public List? Tools - { - get; - set; - } + public List? Tools { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeItemOutRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeItemOutRequestData.cs index 9ee2ed63..05a2ba6f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeItemOutRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeItemOutRequestData.cs @@ -10,23 +10,11 @@ public record HideoutTakeItemOutRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("slots")] - public List? Slots - { - get; - set; - } + public List? Slots { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeProductionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeProductionRequestData.cs index 38127a2c..a48f7a44 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeProductionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutTakeProductionRequestData.cs @@ -9,16 +9,8 @@ public record HideoutTakeProductionRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("recipeId")] - public string? RecipeId - { - get; - set; - } + public string? RecipeId { get; set; } [JsonPropertyName("timestamp")] - public int? Timestamp - { - get; - set; - } + public int? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutToggleAreaRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutToggleAreaRequestData.cs index 9f6489ba..b611a29c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutToggleAreaRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutToggleAreaRequestData.cs @@ -10,23 +10,11 @@ public record HideoutToggleAreaRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeCompleteRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeCompleteRequestData.cs index d8413c86..1abed3eb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeCompleteRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeCompleteRequestData.cs @@ -10,16 +10,8 @@ public record HideoutUpgradeCompleteRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeRequestData.cs index ae531e2b..a3220ed4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/HideoutUpgradeRequestData.cs @@ -11,23 +11,11 @@ public record HideoutUpgradeRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/QteData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/QteData.cs index 482c53fc..952f3aaf 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/QteData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/QteData.cs @@ -11,46 +11,23 @@ public record QteData public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public QteActivityType? Type - { - get; - set; - } + public QteActivityType? Type { get; set; } [JsonPropertyName("area")] - public HideoutAreas? Area - { - get; - set; - } + public HideoutAreas? Area { get; set; } [JsonPropertyName("areaLevel")] - public int? AreaLevel - { - get; - set; - } + public int? AreaLevel { get; set; } [JsonPropertyName("quickTimeEvents")] - public List? QuickTimeEvents - { - get; - set; - } + public List? QuickTimeEvents { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } + /* TODO: Could be an array of any of these: | IAreaRequirement @@ -66,11 +43,7 @@ public record QteData */ [JsonPropertyName("results")] - public Dictionary? Results - { - get; - set; - } + public Dictionary? Results { get; set; } } public record QuickTimeEvent @@ -80,53 +53,25 @@ public record QuickTimeEvent [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public QteType? EventType - { - get; - set; - } + public QteType? EventType { get; set; } [JsonPropertyName("position")] - public Position? Coordinates - { - get; - set; - } + public Position? Coordinates { get; set; } [JsonPropertyName("startDelay")] - public double? StartDelay - { - get; - set; - } + public double? StartDelay { get; set; } [JsonPropertyName("endDelay")] - public double? EndDelay - { - get; - set; - } + public double? EndDelay { get; set; } [JsonPropertyName("speed")] - public float? MovementSpeed - { - get; - set; - } + public float? MovementSpeed { get; set; } [JsonPropertyName("successRange")] - public Position? SuccessCoordinates - { - get; - set; - } + public Position? SuccessCoordinates { get; set; } [JsonPropertyName("key")] - public string? UniqueKey - { - get; - set; - } + public string? UniqueKey { get; set; } } public record QteRequirement @@ -135,11 +80,7 @@ public record QteRequirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("type")] - public RequirementType? RequirementType - { - get; - set; - } + public RequirementType? RequirementType { get; set; } } public record QteResult @@ -148,25 +89,13 @@ public record QteResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("energy")] - public int? Energy - { - get; - set; - } + public int? Energy { get; set; } [JsonPropertyName("hydration")] - public int? Hydration - { - get; - set; - } + public int? Hydration { get; set; } [JsonPropertyName("rewardsRange")] - public List? RewardEffects - { - get; - set; - } + public List? RewardEffects { get; set; } } public record QteEffect @@ -176,48 +105,24 @@ public record QteEffect [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public QteRewardType? Type - { - get; - set; - } + public QteRewardType? Type { get; set; } [JsonPropertyName("skillId")] [JsonConverter(typeof(JsonStringEnumConverter))] - public SkillTypes? SkillId - { - get; - set; - } + public SkillTypes? SkillId { get; set; } [JsonPropertyName("levelMultipliers")] - public List? LevelMultipliers - { - get; - set; - } + public List? LevelMultipliers { get; set; } [JsonPropertyName("time")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } [JsonPropertyName("weight")] - public float? Weight - { - get; - set; - } + public float? Weight { get; set; } [JsonPropertyName("result")] [JsonConverter(typeof(JsonStringEnumConverter))] - public QteResultType? Result - { - get; - set; - } + public QteResultType? Result { get; set; } } public record SkillLevelMultiplier @@ -226,18 +131,10 @@ public record SkillLevelMultiplier public Dictionary ExtensionData { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("multiplier")] - public float? MultiplierValue - { - get; - set; - } + public float? MultiplierValue { get; set; } } public record Position @@ -246,278 +143,138 @@ public record Position public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public float? X - { - get; - set; - } + public float? X { get; set; } [JsonPropertyName("y")] - public float? Y - { - get; - set; - } + public float? Y { get; set; } } public record AreaRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Area; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Area; [JsonPropertyName("areaType")] - public HideoutAreas? AreaType - { - get; - set; - } + public HideoutAreas? AreaType { get; set; } [JsonPropertyName("requiredLevel")] - public int? RequiredLevel - { - get; - set; - } + public int? RequiredLevel { get; set; } } public record TraderUnlockRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.TraderUnlock; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.TraderUnlock; [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } } public record TraderLoyaltyRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.TraderLoyalty; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.TraderLoyalty; [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("loyaltyLevel")] - public int? LoyaltyLevel - { - get; - set; - } + public int? LoyaltyLevel { get; set; } } public record SkillRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Skill; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Skill; [JsonPropertyName("skillName")] [JsonConverter(typeof(JsonStringEnumConverter))] - public SkillTypes? SkillName - { - get; - set; - } + public SkillTypes? SkillName { get; set; } [JsonPropertyName("skillLevel")] - public int? SkillLevel - { - get; - set; - } + public int? SkillLevel { get; set; } } public record ResourceRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Resource; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Resource; [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("resource")] - public int? Resource - { - get; - set; - } + public int? Resource { get; set; } } public record ItemRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Item; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Item; [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("isFunctional")] - public bool? IsFunctional - { - get; - set; - } + public bool? IsFunctional { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } } public record ToolRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Tool; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Tool; [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("isFunctional")] - public bool? IsFunctional - { - get; - set; - } + public bool? IsFunctional { get; set; } [JsonPropertyName("isEncoded")] - public bool? IsEncoded - { - get; - set; - } + public bool? IsEncoded { get; set; } } public record QuestRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.QuestComplete; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.QuestComplete; [JsonPropertyName("questId")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } } public record HealthRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.Health; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.Health; [JsonPropertyName("energy")] - public int? Energy - { - get; - set; - } + public int? Energy { get; set; } [JsonPropertyName("hydration")] - public int? Hydration - { - get; - set; - } + public int? Hydration { get; set; } } public record BodyPartBuffRequirement : QteRequirement { [JsonPropertyName("type")] - public RequirementType? Type - { - get; - set; - } = Enums.Hideout.RequirementType.BodyPartBuff; + public RequirementType? Type { get; set; } = Enums.Hideout.RequirementType.BodyPartBuff; [JsonPropertyName("effectName")] - public Effect? EffectName - { - get; - set; - } + public Effect? EffectName { get; set; } [JsonPropertyName("bodyPart")] - public BodyPart? BodyPart - { - get; - set; - } + public BodyPart? BodyPart { get; set; } [JsonPropertyName("excluded")] - public bool? Excluded - { - get; - set; - } + public bool? Excluded { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/RecordShootingRangePoints.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/RecordShootingRangePoints.cs index f3c8bc30..f95d7787 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/RecordShootingRangePoints.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Hideout/RecordShootingRangePoints.cs @@ -9,9 +9,5 @@ public record RecordShootingRangePoints : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("points")] - public int? Points - { - get; - set; - } + public int? Points { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/GetBodyResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/GetBodyResponseData.cs index 16c10fbb..2e2044de 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/GetBodyResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/GetBodyResponseData.cs @@ -9,24 +9,12 @@ public record GetBodyResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("err")] - public BackendErrorCodes? Err - { - get; - set; - } + public BackendErrorCodes? Err { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("errmsg")] - public string? ErrMsg - { - get; - set; - } + public string? ErrMsg { get; set; } [JsonPropertyName("data")] - public T? Data - { - get; - set; - } + public T? Data { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/NullResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/NullResponseData.cs index f12f1220..648ca7bc 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/NullResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/HttpResponse/NullResponseData.cs @@ -8,23 +8,11 @@ public record NullResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("err")] - public int? Err - { - get; - set; - } + public int? Err { get; set; } [JsonPropertyName("errmsg")] - public object? ErrMsg - { - get; - set; - } + public object? ErrMsg { get; set; } [JsonPropertyName("data")] - public object? Data - { - get; - set; - } + public object? Data { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/InsuredItemsData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/InsuredItemsData.cs index aeb1f7a4..d63b76a5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/InsuredItemsData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/InsuredItemsData.cs @@ -8,37 +8,17 @@ public record InsuredItemsData public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("durability")] - public int? Durability - { - get; - set; - } + public int? Durability { get; set; } [JsonPropertyName("maxDurability")] - public int? MaxDurability - { - get; - set; - } + public int? MaxDurability { get; set; } [JsonPropertyName("hits")] - public int? Hits - { - get; - set; - } + public int? Hits { get; set; } [JsonPropertyName("usedInQuest")] - public bool? UsedInQuest - { - get; - set; - } + public bool? UsedInQuest { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ItemDeliveryRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ItemDeliveryRequestData.cs index 01e2d60b..0a2fb595 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ItemDeliveryRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ItemDeliveryRequestData.cs @@ -9,16 +9,8 @@ public record ItemDeliveryRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/RegisterPlayerRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/RegisterPlayerRequestData.cs index 93f82ab6..30dbf2d1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/RegisterPlayerRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/RegisterPlayerRequestData.cs @@ -9,23 +9,11 @@ public record RegisterPlayerRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("crc")] - public int? Crc - { - get; - set; - } + public int? Crc { get; set; } [JsonPropertyName("locationId")] - public string? LocationId - { - get; - set; - } + public string? LocationId { get; set; } [JsonPropertyName("variantId")] - public int? VariantId - { - get; - set; - } + public int? VariantId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ScavSaveRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ScavSaveRequestData.cs index 1d3592de..a8332166 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ScavSaveRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/InRaid/ScavSaveRequestData.cs @@ -3,6 +3,4 @@ using SPTarkov.Server.Core.Models.Utils; namespace SPTarkov.Server.Core.Models.Eft.InRaid; -public record ScavSaveRequestData : PostRaidPmcData, IRequestData -{ -} +public record ScavSaveRequestData : PostRaidPmcData, IRequestData { } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostRequestData.cs index a84437df..9384c84a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostRequestData.cs @@ -9,16 +9,8 @@ public record GetInsuranceCostRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("traders")] - public List? Traders - { - get; - set; - } + public List? Traders { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostResponseData.cs index ab0a4ef3..863202c1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/GetInsuranceCostResponseData.cs @@ -1,5 +1,3 @@ namespace SPTarkov.Server.Core.Models.Eft.Insurance; -public class GetInsuranceCostResponseData : Dictionary> -{ -} +public class GetInsuranceCostResponseData : Dictionary> { } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/InsureRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/InsureRequestData.cs index 41dcdcb1..0e243b06 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/InsureRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Insurance/InsureRequestData.cs @@ -9,16 +9,8 @@ public record InsureRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("tid")] - public string? TransactionId - { - get; - set; - } + public string? TransactionId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemDirectRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemDirectRequest.cs index 7bdb47ff..226c893f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemDirectRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemDirectRequest.cs @@ -12,30 +12,14 @@ public record AddItemDirectRequest /// Item and child mods to add to player inventory /// [JsonPropertyName("itemWithModsToAdd")] - public List? ItemWithModsToAdd - { - get; - set; - } + public List? ItemWithModsToAdd { get; set; } [JsonPropertyName("foundInRaid")] - public bool? FoundInRaid - { - get; - set; - } + public bool? FoundInRaid { get; set; } [JsonPropertyName("callback")] - public Action? Callback - { - get; - set; - } + public Action? Callback { get; set; } [JsonPropertyName("useSortingTable")] - public bool? UseSortingTable - { - get; - set; - } + public bool? UseSortingTable { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemRequestData.cs index b830393c..8b63ffa2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemRequestData.cs @@ -11,18 +11,10 @@ public record AddItemRequestData /// Trader id /// [JsonPropertyName("tid")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record ItemToAdd @@ -31,23 +23,11 @@ public record ItemToAdd public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("sptIsPreset")] - public bool? IsPreset - { - get; - set; - } + public bool? IsPreset { get; set; } [JsonPropertyName("item_id")] - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemTempObject.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemTempObject.cs index c7bd5074..be095539 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemTempObject.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemTempObject.cs @@ -9,40 +9,20 @@ public record AddItemTempObject public Dictionary ExtensionData { get; set; } [JsonPropertyName("itemRef")] - public Item? ItemReference - { - get; - set; - } + public Item? ItemReference { get; set; } [JsonPropertyName("count")] - public int? ItemCount - { - get; - set; - } + public int? ItemCount { get; set; } [JsonPropertyName("isPreset")] - public bool? IsPresetItem - { - get; - set; - } + public bool? IsPresetItem { get; set; } [JsonPropertyName("location")] - public ItemLocation? ItemLocation - { - get; - set; - } + public ItemLocation? ItemLocation { get; set; } /// /// Container item will be placed in - stash or sorting table /// [JsonPropertyName("containerId")] - public string? ContainerIdentifier - { - get; - set; - } + public string? ContainerIdentifier { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemsDirectRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemsDirectRequest.cs index fdebe9df..45de4d54 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemsDirectRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/AddItemsDirectRequest.cs @@ -12,36 +12,20 @@ public record AddItemsDirectRequest /// Item and child mods to add to player inventory /// [JsonPropertyName("itemsWithModsToAdd")] - public List>? ItemsWithModsToAdd - { - get; - set; - } + public List>? ItemsWithModsToAdd { get; set; } [JsonPropertyName("foundInRaid")] - public bool? FoundInRaid - { - get; - set; - } + public bool? FoundInRaid { get; set; } /// /// Runs after EACH item with children is added /// [JsonPropertyName("callback")] - public Action? Callback - { - get; - set; - } + public Action? Callback { get; set; } /// /// Should sorting table be used when no space found in stash /// [JsonPropertyName("useSortingTable")] - public bool? UseSortingTable - { - get; - set; - } + public bool? UseSortingTable { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryAddRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryAddRequestData.cs index a3b870c5..79c2782c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryAddRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryAddRequestData.cs @@ -8,16 +8,8 @@ public record InventoryAddRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("container")] - public Container? Container - { - get; - set; - } + public Container? Container { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBaseActionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBaseActionRequestData.cs index 13b2a650..0578dd11 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBaseActionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBaseActionRequestData.cs @@ -3,9 +3,7 @@ using SPTarkov.Server.Core.Models.Eft.Common.Request; namespace SPTarkov.Server.Core.Models.Eft.Inventory; -public abstract record InventoryBaseActionRequestData : BaseInteractionRequestData -{ -} +public abstract record InventoryBaseActionRequestData : BaseInteractionRequestData { } public record To { @@ -13,32 +11,16 @@ public record To public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("container")] - public string? Container - { - get; - set; - } + public string? Container { get; set; } [JsonPropertyName("location")] - public object? Location - { - get; - set; - } // TODO: types given IItemLocation or number + public object? Location { get; set; } // TODO: types given IItemLocation or number [JsonPropertyName("isSearched")] - public bool? IsSearched - { - get; - set; - } + public bool? IsSearched { get; set; } } public record Container @@ -47,25 +29,13 @@ public record Container public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("container")] - public string? ContainerName - { - get; - set; - } + public string? ContainerName { get; set; } [JsonPropertyName("location")] - public object? Location - { - get; - set; - } // TODO: types given: ILocation or number - BSG data object shows as location only. + public object? Location { get; set; } // TODO: types given: ILocation or number - BSG data object shows as location only. } public record Location @@ -74,37 +44,17 @@ public record Location public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public double? X - { - get; - set; - } + public double? X { get; set; } [JsonPropertyName("y")] - public double? Y - { - get; - set; - } + public double? Y { get; set; } [JsonPropertyName("r")] - public string? R - { - get; - set; - } + public string? R { get; set; } [JsonPropertyName("rotation")] - public string? Rotation - { - get; - set; - } + public string? Rotation { get; set; } [JsonPropertyName("isSearched")] - public bool? IsSearched - { - get; - set; - } + public bool? IsSearched { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBindRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBindRequestData.cs index 4fce8041..35a7bbb0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBindRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryBindRequestData.cs @@ -8,16 +8,8 @@ public record InventoryBindRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("index")] - public string? Index - { - get; - set; - } + public string? Index { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryCreateMarkerRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryCreateMarkerRequestData.cs index 5fcdc305..5d2fcba4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryCreateMarkerRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryCreateMarkerRequestData.cs @@ -9,16 +9,8 @@ public record InventoryCreateMarkerRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("mapMarker")] - public MapMarker? MapMarker - { - get; - set; - } + public MapMarker? MapMarker { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryDeleteMarkerRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryDeleteMarkerRequestData.cs index 4d668c32..152edd4b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryDeleteMarkerRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryDeleteMarkerRequestData.cs @@ -8,23 +8,11 @@ public record InventoryDeleteMarkerRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("X")] - public int? X - { - get; - set; - } + public int? X { get; set; } [JsonPropertyName("Y")] - public int? Y - { - get; - set; - } + public int? Y { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryEditMarkerRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryEditMarkerRequestData.cs index c2cd0d4a..6ef627cd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryEditMarkerRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryEditMarkerRequestData.cs @@ -9,30 +9,14 @@ public record InventoryEditMarkerRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("X")] - public double? X - { - get; - set; - } + public double? X { get; set; } [JsonPropertyName("Y")] - public double? Y - { - get; - set; - } + public double? Y { get; set; } [JsonPropertyName("mapMarker")] - public MapMarker? MapMarker - { - get; - set; - } + public MapMarker? MapMarker { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryExamineRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryExamineRequestData.cs index 69f1ddc7..6f44dd90 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryExamineRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryExamineRequestData.cs @@ -8,9 +8,5 @@ public record InventoryExamineRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryFoldRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryFoldRequestData.cs index 721680b9..2fa3482e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryFoldRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryFoldRequestData.cs @@ -8,16 +8,8 @@ public record InventoryFoldRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("value")] - public bool? Value - { - get; - set; - } + public bool? Value { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMergeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMergeRequestData.cs index a15af410..09898ecd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMergeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMergeRequestData.cs @@ -8,16 +8,8 @@ public record InventoryMergeRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("with")] - public string? With - { - get; - set; - } + public string? With { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMoveRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMoveRequestData.cs index 577ac6d6..361a40e4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMoveRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryMoveRequestData.cs @@ -8,16 +8,8 @@ public record InventoryMoveRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("to")] - public To? To - { - get; - set; - } + public To? To { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryReadEncyclopediaRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryReadEncyclopediaRequestData.cs index 76d56503..074c125f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryReadEncyclopediaRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryReadEncyclopediaRequestData.cs @@ -8,9 +8,5 @@ public record InventoryReadEncyclopediaRequestData : InventoryBaseActionRequestD public Dictionary ExtensionData { get; set; } [JsonPropertyName("ids")] - public List Ids - { - get; - set; - } + public List Ids { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryRemoveRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryRemoveRequestData.cs index cf2be023..8ceeee08 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryRemoveRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryRemoveRequestData.cs @@ -8,9 +8,5 @@ public record InventoryRemoveRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySortRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySortRequestData.cs index dd592ee2..54ec6fdd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySortRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySortRequestData.cs @@ -9,9 +9,5 @@ public record InventorySortRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("changedItems")] - public List? ChangedItems - { - get; - set; - } + public List? ChangedItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySplitRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySplitRequestData.cs index db617573..4c3892f4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySplitRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySplitRequestData.cs @@ -11,36 +11,20 @@ public record InventorySplitRequestData : InventoryBaseActionRequestData /// Id of item to split /// [JsonPropertyName("splitItem")] - public string? SplitItem - { - get; - set; - } + public string? SplitItem { get; set; } /// /// Id of new item stack /// [JsonPropertyName("newItem")] - public string? NewItem - { - get; - set; - } + public string? NewItem { get; set; } /// /// Destination new item will be placed in /// [JsonPropertyName("container")] - public Container? Container - { - get; - set; - } + public Container? Container { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySwapRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySwapRequestData.cs index aa720a3a..974ce256 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySwapRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventorySwapRequestData.cs @@ -9,44 +9,20 @@ public record InventorySwapRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("to")] - public To? To - { - get; - set; - } + public To? To { get; set; } [JsonPropertyName("item2")] - public string? Item2 - { - get; - set; - } + public string? Item2 { get; set; } [JsonPropertyName("to2")] - public To? To2 - { - get; - set; - } + public To? To2 { get; set; } [JsonPropertyName("fromOwner2")] - public OwnerInfo? FromOwner2 - { - get; - set; - } + public OwnerInfo? FromOwner2 { get; set; } [JsonPropertyName("toOwner2")] - public OwnerInfo? ToOwner2 - { - get; - set; - } + public OwnerInfo? ToOwner2 { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTagRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTagRequestData.cs index 010f3a64..9b93420e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTagRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTagRequestData.cs @@ -8,23 +8,11 @@ public record InventoryTagRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("TagName")] - public string? TagName - { - get; - set; - } + public string? TagName { get; set; } [JsonPropertyName("TagColor")] - public int? TagColor - { - get; - set; - } + public int? TagColor { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryToggleRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryToggleRequestData.cs index 3d1d9fb9..73b7b9c3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryToggleRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryToggleRequestData.cs @@ -8,16 +8,8 @@ public record InventoryToggleRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("value")] - public bool? Value - { - get; - set; - } + public bool? Value { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTransferRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTransferRequestData.cs index b3bd40f5..44206471 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTransferRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryTransferRequestData.cs @@ -8,23 +8,11 @@ public record InventoryTransferRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("with")] - public string? With - { - get; - set; - } + public string? With { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryUnbindRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryUnbindRequestData.cs index 7f887f5c..aae8b130 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryUnbindRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/InventoryUnbindRequestData.cs @@ -8,16 +8,8 @@ public record InventoryUnbindRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/OpenRandomLootContainerRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/OpenRandomLootContainerRequestData.cs index a543658f..35b7d374 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/OpenRandomLootContainerRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/OpenRandomLootContainerRequestData.cs @@ -11,16 +11,8 @@ public record OpenRandomLootContainerRequestData : InventoryBaseActionRequestDat /// Container item id being opened /// [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("to")] - public List? To - { - get; - set; - } + public List? To { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/PinOrLockItemRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/PinOrLockItemRequest.cs index a98d136f..32e507c3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/PinOrLockItemRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/PinOrLockItemRequest.cs @@ -12,20 +12,12 @@ public record PinOrLockItemRequest : InventoryBaseActionRequestData /// Id of item being pinned /// [JsonPropertyName("Item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } /// /// "Pinned"/"Locked"/"Free" /// [JsonPropertyName("State")] [JsonConverter(typeof(JsonStringEnumConverter))] - public PinLockState? State - { - get; - set; - } + public PinLockState? State { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/RedeemProfileRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/RedeemProfileRequestData.cs index 12305442..c8275beb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/RedeemProfileRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/RedeemProfileRequestData.cs @@ -8,11 +8,7 @@ public record RedeemProfileRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("events")] - public List? Events - { - get; - set; - } + public List? Events { get; set; } } public record RedeemProfileRequestEvent @@ -21,16 +17,8 @@ public record RedeemProfileRequestEvent public Dictionary ExtensionData { get; set; } [JsonPropertyName("MessageId")] - public string? MessageId - { - get; - set; - } + public string? MessageId { get; set; } [JsonPropertyName("EventId")] - public string? EventId - { - get; - set; - } + public string? EventId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/SetFavoriteItems.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/SetFavoriteItems.cs index 26abca57..c1471550 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/SetFavoriteItems.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Inventory/SetFavoriteItems.cs @@ -8,16 +8,8 @@ public record SetFavoriteItems : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs index e761f06e..340afa75 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs @@ -8,9 +8,5 @@ public record EmptyItemEventRouterResponse : ItemEventRouterBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("profileChanges")] - public string? ProfileChanges - { - get; - set; - } = ""; + public string? ProfileChanges { get; set; } = ""; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs index c6953451..3085288b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs @@ -12,18 +12,10 @@ public record ItemEventRouterBase [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("warnings")] - public List? Warnings - { - get; - set; - } + public List? Warnings { get; set; } [JsonPropertyName("profileChanges")] - public Dictionary ProfileChanges - { - get; - set; - } + public Dictionary ProfileChanges { get; set; } } public record Warning @@ -32,32 +24,16 @@ public record Warning public Dictionary ExtensionData { get; set; } [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("errmsg")] - public string? ErrorMessage - { - get; - set; - } + public string? ErrorMessage { get; set; } [JsonPropertyName("code")] - public BackendErrorCodes? Code - { - get; - set; - } + public BackendErrorCodes? Code { get; set; } [JsonPropertyName("data")] - public object? Data - { - get; - set; - } + public object? Data { get; set; } } public record ProfileChange @@ -66,129 +42,61 @@ public record ProfileChange public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("experience")] - public double? Experience - { - get; - set; - } + public double? Experience { get; set; } [JsonPropertyName("quests")] - public List? Quests - { - get; - set; - } + public List? Quests { get; set; } [JsonPropertyName("ragFairOffers")] - public List? RagFairOffers - { - get; - set; - } + public List? RagFairOffers { get; set; } [JsonPropertyName("weaponBuilds")] - public List? WeaponBuilds - { - get; - set; - } + public List? WeaponBuilds { get; set; } [JsonPropertyName("equipmentBuilds")] - public List? EquipmentBuilds - { - get; - set; - } + public List? EquipmentBuilds { get; set; } [JsonPropertyName("items")] - public ItemChanges? Items - { - get; - set; - } + public ItemChanges? Items { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("production")] - public Dictionary? Production - { - get; - set; - } + public Dictionary? Production { get; set; } /// /// Hideout area improvement id /// [JsonPropertyName("improvements")] - public Dictionary? Improvements - { - get; - set; - } + public Dictionary? Improvements { get; set; } [JsonPropertyName("skills")] - public Skills? Skills - { - get; - set; - } + public Skills? Skills { get; set; } [JsonPropertyName("health")] - public BotBaseHealth Health - { - get; - set; - } + public BotBaseHealth Health { get; set; } [JsonPropertyName("traderRelations")] - public Dictionary? TraderRelations - { - get; - set; - } + public Dictionary? TraderRelations { get; set; } [JsonPropertyName("moneyTransferLimitData")] - public MoneyTransferLimits? MoneyTransferLimitData - { - get; - set; - } + public MoneyTransferLimits? MoneyTransferLimitData { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("repeatableQuests")] - public List? RepeatableQuests - { - get; - set; - } + public List? RepeatableQuests { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("recipeUnlocked")] - public Dictionary? RecipeUnlocked - { - get; - set; - } + public Dictionary? RecipeUnlocked { get; set; } [JsonPropertyName("changedHideoutStashes")] - public Dictionary? ChangedHideoutStashes - { - get; - set; - } + public Dictionary? ChangedHideoutStashes { get; set; } [JsonPropertyName("questsStatus")] - public List? QuestsStatus - { - get; - set; - } + public List? QuestsStatus { get; set; } } public record HideoutStashItem @@ -197,18 +105,10 @@ public record HideoutStashItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("tpl")] - public string? Template - { - get; - set; - } + public string? Template { get; set; } } public record WeaponBuildChange @@ -217,32 +117,16 @@ public record WeaponBuildChange public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record EquipmentBuildChange @@ -251,53 +135,25 @@ public record EquipmentBuildChange public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("fastpanel")] - public List? FastPanel - { - get; - set; - } + public List? FastPanel { get; set; } [JsonPropertyName("buildType")] - public EquipmentBuildType? BuildType - { - get; - set; - } + public EquipmentBuildType? BuildType { get; set; } } public record ItemChanges @@ -306,25 +162,13 @@ public record ItemChanges public Dictionary ExtensionData { get; set; } [JsonPropertyName("new")] - public List? NewItems - { - get; - set; - } + public List? NewItems { get; set; } [JsonPropertyName("change")] - public List? ChangedItems - { - get; - set; - } + public List? ChangedItems { get; set; } [JsonPropertyName("del")] - public List DeletedItems - { - get; - set; - } // Only needs _id property + public List DeletedItems { get; set; } // Only needs _id property } /// @@ -336,37 +180,17 @@ public record TraderData public Dictionary ExtensionData { get; set; } [JsonPropertyName("salesSum")] - public double? SalesSum - { - get; - set; - } + public double? SalesSum { get; set; } [JsonPropertyName("standing")] - public double? Standing - { - get; - set; - } + public double? Standing { get; set; } [JsonPropertyName("loyalty")] - public double? Loyalty - { - get; - set; - } + public double? Loyalty { get; set; } [JsonPropertyName("unlocked")] - public bool? Unlocked - { - get; - set; - } + public bool? Unlocked { get; set; } [JsonPropertyName("disabled")] - public bool? Disabled - { - get; - set; - } + public bool? Disabled { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs index d5a2bf04..bb6cd0ea 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs @@ -11,25 +11,13 @@ public record ItemEventRouterRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("data")] - public List? Data - { - get; - set; - } + public List? Data { get; set; } [JsonPropertyName("tm")] - public long? Time - { - get; - set; - } + public long? Time { get; set; } [JsonPropertyName("reload")] - public int? Reload - { - get; - set; - } + public int? Reload { get; set; } } public record Daum @@ -38,60 +26,28 @@ public record Daum public Dictionary ExtensionData { get; set; } [JsonPropertyName("Action")] - public string? Action - { - get; - set; - } + public string? Action { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("to")] - public To? To - { - get; - set; - } + public To? To { get; set; } [JsonPropertyName("with")] - public string? With - { - get; - set; - } + public string? With { get; set; } [JsonPropertyName("fromOwner")] - public FromOwner? FromOwner - { - get; - set; - } + public FromOwner? FromOwner { get; set; } [JsonPropertyName("qid")] - public string? Qid - { - get; - set; - } + public string? Qid { get; set; } [JsonPropertyName("offer")] - public string? Offer - { - get; - set; - } + public string? Offer { get; set; } } public record FromOwner @@ -100,18 +56,10 @@ public record FromOwner public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record To @@ -120,25 +68,13 @@ public record To public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("container")] - public string? Container - { - get; - set; - } + public string? Container { get; set; } [JsonPropertyName("location")] - public Location? Location - { - get; - set; - } + public Location? Location { get; set; } } public record Location @@ -147,30 +83,14 @@ public record Location public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public int? X - { - get; - set; - } + public int? X { get; set; } [JsonPropertyName("y")] - public int? Y - { - get; - set; - } + public int? Y { get; set; } [JsonPropertyName("r")] - public string? R - { - get; - set; - } + public string? R { get; set; } [JsonPropertyName("isSearched")] - public bool? IsSearched - { - get; - set; - } + public bool? IsSearched { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs index a181be98..a8816ba2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Eft.ItemEvent; /// @@ -8,5 +9,4 @@ public record ItemEventRouterResponse : ItemEventRouterBase { [JsonExtensionData] public Dictionary ExtensionData { get; set; } - } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/ChangeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/ChangeRequestData.cs index e2f6bb4d..1a22edf2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/ChangeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/ChangeRequestData.cs @@ -5,9 +5,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Launcher; public record ChangeRequestData : LoginRequestData { [JsonPropertyName("change")] - public string? Change - { - get; - set; - } + public string? Change { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/GetMiniProfileRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/GetMiniProfileRequestData.cs index acc507ba..0e71777f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/GetMiniProfileRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/GetMiniProfileRequestData.cs @@ -9,16 +9,8 @@ public record GetMiniProfileRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("username")] - public string? Username - { - get; - set; - } + public string? Username { get; set; } [JsonPropertyName("password")] - public string? Password - { - get; - set; - } + public string? Password { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/LoginRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/LoginRequestData.cs index 125321dc..2c44f739 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/LoginRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/LoginRequestData.cs @@ -9,16 +9,8 @@ public record LoginRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("username")] - public string? Username - { - get; - set; - } + public string? Username { get; set; } [JsonPropertyName("password")] - public string? Password - { - get; - set; - } + public string? Password { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/MiniProfile.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/MiniProfile.cs index 9dbaa094..751f8637 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/MiniProfile.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/MiniProfile.cs @@ -8,86 +8,38 @@ public record MiniProfile public Dictionary ExtensionData { get; set; } [JsonPropertyName("username")] - public string? Username - { - get; - set; - } + public string? Username { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("currlvl")] - public int? CurrentLevel - { - get; - set; - } + public int? CurrentLevel { get; set; } [JsonPropertyName("currexp")] - public int? CurrentExperience - { - get; - set; - } + public int? CurrentExperience { get; set; } [JsonPropertyName("prevexp")] - public int? PreviousExperience - { - get; - set; - } + public int? PreviousExperience { get; set; } [JsonPropertyName("nextlvl")] - public int? NextLevel - { - get; - set; - } + public int? NextLevel { get; set; } [JsonPropertyName("maxlvl")] - public int? MaxLevel - { - get; - set; - } + public int? MaxLevel { get; set; } [JsonPropertyName("edition")] - public string? Edition - { - get; - set; - } + public string? Edition { get; set; } [JsonPropertyName("profileId")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("sptData")] - public Profile.Spt? SptData - { - get; - set; - } + public Profile.Spt? SptData { get; set; } [JsonPropertyName("hasPassword")] - public bool? HasPassword - { - get; - set; - } + public bool? HasPassword { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RegisterData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RegisterData.cs index 3a1ab4ab..1537fa83 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RegisterData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RegisterData.cs @@ -5,9 +5,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Launcher; public record RegisterData : LoginRequestData { [JsonPropertyName("edition")] - public string? Edition - { - get; - set; - } + public string? Edition { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RemoveProfileData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RemoveProfileData.cs index a42d8d41..36a56d04 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RemoveProfileData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Launcher/RemoveProfileData.cs @@ -1,5 +1,3 @@ namespace SPTarkov.Server.Core.Models.Eft.Launcher; -public record RemoveProfileData : LoginRequestData -{ -} +public record RemoveProfileData : LoginRequestData { } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/AirdropLootResult.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/AirdropLootResult.cs index 73221ae8..2e627934 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/AirdropLootResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/AirdropLootResult.cs @@ -9,16 +9,8 @@ public record AirdropLootResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("dropType")] - public string? DropType - { - get; - set; - } + public string? DropType { get; set; } [JsonPropertyName("loot")] - public List? Loot - { - get; - set; - } + public List? Loot { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootRequest.cs index ab1e58ab..fe06544d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootRequest.cs @@ -9,9 +9,5 @@ public record GetAirdropLootRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("containerId")] - public string? ContainerId - { - get; - set; - } + public string? ContainerId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootResponse.cs index 707b5ec8..2968427e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetAirdropLootResponse.cs @@ -13,16 +13,8 @@ public record GetAirdropLootResponse /// The type of airdrop /// [JsonPropertyName("icon")] - public AirdropTypeEnum? Icon - { - get; - set; - } + public AirdropTypeEnum? Icon { get; set; } [JsonPropertyName("container")] - public List? Container - { - get; - set; - } + public List? Container { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetLocationRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetLocationRequestData.cs index bdf2a3b5..3d190f67 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetLocationRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Location/GetLocationRequestData.cs @@ -8,23 +8,11 @@ public record GetLocationRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("crc")] - public int? Crc - { - get; - set; - } + public int? Crc { get; set; } [JsonPropertyName("locationId")] - public string? LocationId - { - get; - set; - } + public string? LocationId { get; set; } [JsonPropertyName("variantId")] - public int? VariantId - { - get; - set; - } + public int? VariantId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndLocalRaidRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndLocalRaidRequestData.cs index ee1307a5..f9851411 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndLocalRaidRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndLocalRaidRequestData.cs @@ -15,45 +15,25 @@ public record EndLocalRaidRequestData : IRequestData /// ID of server player just left /// [JsonPropertyName("serverId")] - public string? ServerId - { - get; - set; - } + public string? ServerId { get; set; } [JsonPropertyName("results")] - public EndRaidResult? Results - { - get; - set; - } + public EndRaidResult? Results { get; set; } /// /// Insured items left in raid by player /// [JsonPropertyName("lostInsuredItems")] - public List? LostInsuredItems - { - get; - set; - } + public List? LostInsuredItems { get; set; } /// /// Items sent via traders to player, keyed to service e.g. BTRTransferStash /// [JsonPropertyName("transferItems")] - public Dictionary>? TransferItems - { - get; - set; - } + public Dictionary>? TransferItems { get; set; } [JsonPropertyName("locationTransit")] - public LocationTransit? LocationTransit - { - get; - set; - } + public LocationTransit? LocationTransit { get; set; } } public record EndRaidResult @@ -62,70 +42,38 @@ public record EndRaidResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("profile")] - public PmcData? Profile - { - get; - set; - } + public PmcData? Profile { get; set; } /// /// "Survived/Transit" etc /// [JsonPropertyName("result")] [JsonConverter(typeof(JsonStringEnumConverter))] - public ExitStatus? Result - { - get; - set; - } + public ExitStatus? Result { get; set; } [JsonPropertyName("killerId")] - public string? KillerId - { - get; - set; - } + public string? KillerId { get; set; } [JsonPropertyName("killerAid")] - public string? KillerAid - { - get; - set; - } + public string? KillerAid { get; set; } /// /// "Gate 3" etc /// [JsonPropertyName("exitName")] - public string? ExitName - { - get; - set; - } + public string? ExitName { get; set; } [JsonPropertyName("inSession")] - public bool? InSession - { - get; - set; - } + public bool? InSession { get; set; } [JsonPropertyName("favorite")] - public bool? Favorite - { - get; - set; - } + public bool? Favorite { get; set; } /// /// Seconds in raid /// [JsonPropertyName("playTime")] - public double? PlayTime - { - get; - set; - } + public double? PlayTime { get; set; } } public record LocationTransit @@ -134,87 +82,43 @@ public record LocationTransit public Dictionary ExtensionData { get; set; } [JsonPropertyName("hash")] - public string? Hash - { - get; - set; - } + public string? Hash { get; set; } [JsonPropertyName("playersCount")] - public int? PlayersCount - { - get; - set; - } + public int? PlayersCount { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("profiles")] - public Dictionary? Profiles - { - get; - set; - } + public Dictionary? Profiles { get; set; } [JsonPropertyName("transitionRaidId")] - public string? TransitionRaidId - { - get; - set; - } + public string? TransitionRaidId { get; set; } [JsonPropertyName("raidMode")] - public string? RaidMode - { - get; - set; - } + public string? RaidMode { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("dayTime")] - public string? DayTime - { - get; - set; - } + public string? DayTime { get; set; } /// /// The location player last visited /// [JsonPropertyName("sptLastVisitedLocation")] - public string? SptLastVisitedLocation - { - get; - set; - } + public string? SptLastVisitedLocation { get; set; } /// /// Name of exit taken /// [JsonPropertyName("sptExitName")] - public string? SptExitName - { - get; - set; - } + public string? SptExitName { get; set; } } public record TransitProfile @@ -223,23 +127,11 @@ public record TransitProfile public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("keyId")] - public string? KeyId - { - get; - set; - } + public string? KeyId { get; set; } [JsonPropertyName("isSolo")] - public bool? IsSolo - { - get; - set; - } + public bool? IsSolo { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndOfflineRaidRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndOfflineRaidRequestData.cs index 1dc80be6..db37906e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndOfflineRaidRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/EndOfflineRaidRequestData.cs @@ -8,30 +8,14 @@ public record EndOfflineRaidRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("crc")] - public int? Crc - { - get; - set; - } + public int? Crc { get; set; } [JsonPropertyName("exitStatus")] - public string? ExitStatus - { - get; - set; - } + public string? ExitStatus { get; set; } [JsonPropertyName("exitName")] - public string? ExitName - { - get; - set; - } + public string? ExitName { get; set; } [JsonPropertyName("raidSeconds")] - public int? RaidSeconds - { - get; - set; - } + public int? RaidSeconds { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GetRaidConfigurationRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GetRaidConfigurationRequestData.cs index 0241b42c..356f79a2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GetRaidConfigurationRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GetRaidConfigurationRequestData.cs @@ -7,42 +7,22 @@ namespace SPTarkov.Server.Core.Models.Eft.Match; public record GetRaidConfigurationRequestData : RaidSettings, IRequestData { [JsonPropertyName("keyId")] - public string? KeyId - { - get; - set; - } + public string? KeyId { get; set; } [JsonPropertyName("onlinePveRaidStates")] - public Dictionary? OnlinePveRaidStates - { - get; - set; - } + public Dictionary? OnlinePveRaidStates { get; set; } [JsonPropertyName("MaxGroupCount")] - public int? MaxGroupCount - { - get; - set; - } + public int? MaxGroupCount { get; set; } [JsonPropertyName("transitionType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public TransitionType TransitionType - { - get; - set; - } + public TransitionType TransitionType { get; set; } /// /// Custom property that is not received from or sent to the client. /// We calculate this once based on the time slot selected for the raid to use it during inventory generation. /// [JsonIgnore] - public bool IsNightRaid - { - get; - set; - } + public bool IsNightRaid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GroupCharacter.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GroupCharacter.cs index 0b7e4f7f..ce497eb1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GroupCharacter.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/GroupCharacter.cs @@ -10,60 +10,28 @@ public record GroupCharacter public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Info")] - public CharacterInfo? Info - { - get; - set; - } + public CharacterInfo? Info { get; set; } [JsonPropertyName("PlayerVisualRepresentation")] - public PlayerVisualRepresentation? VisualRepresentation - { - get; - set; - } + public PlayerVisualRepresentation? VisualRepresentation { get; set; } [JsonPropertyName("isLeader")] - public bool? IsLeader - { - get; - set; - } + public bool? IsLeader { get; set; } [JsonPropertyName("isReady")] - public bool? IsReady - { - get; - set; - } + public bool? IsReady { get; set; } [JsonPropertyName("region")] - public string? Region - { - get; - set; - } + public string? Region { get; set; } [JsonPropertyName("lookingGroup")] - public bool? LookingGroup - { - get; - set; - } + public bool? LookingGroup { get; set; } } public record CharacterInfo @@ -72,60 +40,28 @@ public record CharacterInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("MemberCategory")] - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } [JsonPropertyName("GameVersion")] - public string? GameVersion - { - get; - set; - } + public string? GameVersion { get; set; } [JsonPropertyName("SavageLockTime")] - public double? SavageLockTime - { - get; - set; - } + public double? SavageLockTime { get; set; } [JsonPropertyName("SavageNickname")] - public string? SavageNickname - { - get; - set; - } + public string? SavageNickname { get; set; } [JsonPropertyName("hasCoopExtension")] - public bool? HasCoopExtension - { - get; - set; - } + public bool? HasCoopExtension { get; set; } } public record PlayerVisualRepresentation @@ -134,25 +70,13 @@ public record PlayerVisualRepresentation public Dictionary ExtensionData { get; set; } [JsonPropertyName("Info")] - public VisualInfo? Info - { - get; - set; - } + public VisualInfo? Info { get; set; } [JsonPropertyName("Customization")] - public Customization? Customization - { - get; - set; - } + public Customization? Customization { get; set; } [JsonPropertyName("Equipment")] - public Equipment? Equipment - { - get; - set; - } + public Equipment? Equipment { get; set; } } public record VisualInfo @@ -161,39 +85,19 @@ public record VisualInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("MemberCategory")] - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } [JsonPropertyName("GameVersion")] - public string? GameVersion - { - get; - set; - } + public string? GameVersion { get; set; } } public record Customization @@ -202,32 +106,16 @@ public record Customization public Dictionary ExtensionData { get; set; } [JsonPropertyName("Head")] - public string? Head - { - get; - set; - } + public string? Head { get; set; } [JsonPropertyName("Body")] - public string? Body - { - get; - set; - } + public string? Body { get; set; } [JsonPropertyName("Feet")] - public string? Feet - { - get; - set; - } + public string? Feet { get; set; } [JsonPropertyName("Hands")] - public string? Hands - { - get; - set; - } + public string? Hands { get; set; } } public record Equipment @@ -236,16 +124,8 @@ public record Equipment public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupCurrentResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupCurrentResponse.cs index f9bc5f67..cd2a98ac 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupCurrentResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupCurrentResponse.cs @@ -8,9 +8,5 @@ public record MatchGroupCurrentResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("squad")] - public List? Squad - { - get; - set; - } + public List? Squad { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupInviteSendRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupInviteSendRequest.cs index 49e8c14d..d9c5f16e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupInviteSendRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupInviteSendRequest.cs @@ -9,16 +9,8 @@ public record MatchGroupInviteSendRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("to")] - public string? To - { - get; - set; - } + public string? To { get; set; } [JsonPropertyName("inLobby")] - public bool? InLobby - { - get; - set; - } + public bool? InLobby { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupPlayerRemoveRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupPlayerRemoveRequest.cs index 9a33b06e..130ff8f4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupPlayerRemoveRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupPlayerRemoveRequest.cs @@ -9,9 +9,5 @@ public record MatchGroupPlayerRemoveRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("aidToKick")] - public string? AidToKick - { - get; - set; - } + public string? AidToKick { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStartGameRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStartGameRequest.cs index 3b00e0dc..bbe985c9 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStartGameRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStartGameRequest.cs @@ -9,16 +9,8 @@ public record MatchGroupStartGameRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("groupId")] - public string? GroupId - { - get; - set; - } + public string? GroupId { get; set; } [JsonPropertyName("servers")] - public List? Servers - { - get; - set; - } + public List? Servers { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusRequest.cs index f614d805..d4a531c1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusRequest.cs @@ -10,44 +10,20 @@ public record MatchGroupStatusRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("savage")] - public bool? IsSavage - { - get; - set; - } + public bool? IsSavage { get; set; } [JsonPropertyName("dt")] - public string? DateTime - { - get; - set; - } + public string? DateTime { get; set; } [JsonPropertyName("keyId")] - public string? KeyId - { - get; - set; - } + public string? KeyId { get; set; } [JsonPropertyName("raidMode")] - public RaidMode? RaidMode - { - get; - set; - } + public RaidMode? RaidMode { get; set; } [JsonPropertyName("spawnPlace")] - public string? SpawnPlace - { - get; - set; - } + public string? SpawnPlace { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusResponse.cs index 84c99fe1..d165ee24 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupStatusResponse.cs @@ -8,16 +8,8 @@ public record MatchGroupStatusResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("players")] - public List? Players - { - get; - set; - } + public List? Players { get; set; } [JsonPropertyName("maxPveCountExceeded")] - public bool? MaxPveCountExceeded - { - get; - set; - } + public bool? MaxPveCountExceeded { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupTransferRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupTransferRequest.cs index d4c8da91..d3aee82e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupTransferRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/MatchGroupTransferRequest.cs @@ -9,9 +9,5 @@ public record MatchGroupTransferRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("aidToChange")] - public string? AidToChange - { - get; - set; - } + public string? AidToChange { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusRequest.cs index ffe8a382..003c617a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusRequest.cs @@ -8,9 +8,5 @@ public record ProfileStatusRequest public Dictionary ExtensionData { get; set; } [JsonPropertyName("groupId")] - public int? GroupId - { - get; - set; - } + public int? GroupId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusResponse.cs index c4d151ed..ec612f87 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/ProfileStatusResponse.cs @@ -8,16 +8,8 @@ public record ProfileStatusResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("maxPveCountExceeded")] - public bool? MaxPveCountExceeded - { - get; - set; - } + public bool? MaxPveCountExceeded { get; set; } [JsonPropertyName("profiles")] - public List? Profiles - { - get; - set; - } + public List? Profiles { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/PutMetricsRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/PutMetricsRequestData.cs index c6252262..ddaf9768 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/PutMetricsRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/PutMetricsRequestData.cs @@ -9,67 +9,31 @@ public record PutMetricsRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("sid")] - public string? SessionId - { - get; - set; - } + public string? SessionId { get; set; } [JsonPropertyName("Settings")] - public object? Settings - { - get; - set; - } + public object? Settings { get; set; } [JsonPropertyName("SharedSettings")] - public SharedSettings? SharedSettings - { - get; - set; - } + public SharedSettings? SharedSettings { get; set; } [JsonPropertyName("HardwareDescription")] - public HardwareDescription? HardwareDescription - { - get; - set; - } + public HardwareDescription? HardwareDescription { get; set; } [JsonPropertyName("Location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("Metrics")] - public object? Metrics - { - get; - set; - } + public object? Metrics { get; set; } [JsonPropertyName("ClientEvents")] - public ClientEvents? ClientEvents - { - get; - set; - } + public ClientEvents? ClientEvents { get; set; } [JsonPropertyName("SpikeSamples")] - public List? SpikeSamples - { - get; - set; - } + public List? SpikeSamples { get; set; } [JsonPropertyName("mode")] - public string? Mode - { - get; - set; - } + public string? Mode { get; set; } } public record SharedSettings @@ -78,11 +42,7 @@ public record SharedSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("StatedFieldOfView")] - public double? StatedFieldOfView - { - get; - set; - } + public double? StatedFieldOfView { get; set; } } public record HardwareDescription @@ -91,123 +51,55 @@ public record HardwareDescription public Dictionary ExtensionData { get; set; } [JsonPropertyName("deviceUniqueIdentifier")] - public string? DeviceUniqueIdentifier - { - get; - set; - } + public string? DeviceUniqueIdentifier { get; set; } [JsonPropertyName("systemMemorySize")] - public double? SystemMemorySize - { - get; - set; - } + public double? SystemMemorySize { get; set; } [JsonPropertyName("graphicsDeviceID")] - public double? GraphicsDeviceId - { - get; - set; - } + public double? GraphicsDeviceId { get; set; } [JsonPropertyName("graphicsDeviceName")] - public string? GraphicsDeviceName - { - get; - set; - } + public string? GraphicsDeviceName { get; set; } [JsonPropertyName("graphicsDeviceType")] - public string? GraphicsDeviceType - { - get; - set; - } + public string? GraphicsDeviceType { get; set; } [JsonPropertyName("graphicsDeviceVendor")] - public string? GraphicsDeviceVendor - { - get; - set; - } + public string? GraphicsDeviceVendor { get; set; } [JsonPropertyName("graphicsDeviceVendorID")] - public double? GraphicsDeviceVendorId - { - get; - set; - } + public double? GraphicsDeviceVendorId { get; set; } [JsonPropertyName("graphicsDeviceVersion")] - public string? GraphicsDeviceVersion - { - get; - set; - } + public string? GraphicsDeviceVersion { get; set; } [JsonPropertyName("graphicsMemorySize")] - public double? GraphicsMemorySize - { - get; - set; - } + public double? GraphicsMemorySize { get; set; } [JsonPropertyName("graphicsMultiThreaded")] - public bool? GraphicsMultiThreaded - { - get; - set; - } + public bool? GraphicsMultiThreaded { get; set; } [JsonPropertyName("graphicsShaderLevel")] - public double? GraphicsShaderLevel - { - get; - set; - } + public double? GraphicsShaderLevel { get; set; } [JsonPropertyName("operatingSystem")] - public string? OperatingSystem - { - get; - set; - } + public string? OperatingSystem { get; set; } [JsonPropertyName("processorCount")] - public double? ProcessorCount - { - get; - set; - } + public double? ProcessorCount { get; set; } [JsonPropertyName("processorFrequency")] - public double? ProcessorFrequency - { - get; - set; - } + public double? ProcessorFrequency { get; set; } [JsonPropertyName("processorType")] - public string? ProcessorType - { - get; - set; - } + public string? ProcessorType { get; set; } [JsonPropertyName("driveType")] - public string? DriveType - { - get; - set; - } + public string? DriveType { get; set; } [JsonPropertyName("swapDriveType")] - public string? SwapDriveType - { - get; - set; - } + public string? SwapDriveType { get; set; } } public record ClientEvents @@ -216,156 +108,68 @@ public record ClientEvents public Dictionary ExtensionData { get; set; } [JsonPropertyName("MatchingCompleted")] - public double? MatchingCompleted - { - get; - set; - } + public double? MatchingCompleted { get; set; } [JsonPropertyName("MatchingCompletedReal")] - public double? MatchingCompletedReal - { - get; - set; - } + public double? MatchingCompletedReal { get; set; } [JsonPropertyName("LocationLoaded")] - public double? LocationLoaded - { - get; - set; - } + public double? LocationLoaded { get; set; } [JsonPropertyName("LocationLoadedReal")] - public double? LocationLoadedReal - { - get; - set; - } + public double? LocationLoadedReal { get; set; } [JsonPropertyName("GamePrepared")] - public double? GamePrepared - { - get; - set; - } + public double? GamePrepared { get; set; } [JsonPropertyName("GamePreparedReal")] - public double? GamePreparedReal - { - get; - set; - } + public double? GamePreparedReal { get; set; } [JsonPropertyName("GameCreated")] - public double? GameCreated - { - get; - set; - } + public double? GameCreated { get; set; } [JsonPropertyName("GameCreatedReal")] - public double? GameCreatedReal - { - get; - set; - } + public double? GameCreatedReal { get; set; } [JsonPropertyName("GamePooled")] - public double? GamePooled - { - get; - set; - } + public double? GamePooled { get; set; } [JsonPropertyName("GamePooledReal")] - public double? GamePooledReal - { - get; - set; - } + public double? GamePooledReal { get; set; } [JsonPropertyName("GameRunned")] - public double? GameRunned - { - get; - set; - } + public double? GameRunned { get; set; } [JsonPropertyName("GameRunnedReal")] - public double? GameRunnedReal - { - get; - set; - } + public double? GameRunnedReal { get; set; } [JsonPropertyName("GameSpawn")] - public double? GameSpawn - { - get; - set; - } + public double? GameSpawn { get; set; } [JsonPropertyName("GameSpawnReal")] - public double? GameSpawnReal - { - get; - set; - } + public double? GameSpawnReal { get; set; } [JsonPropertyName("PlayerSpawnEvent")] - public double? PlayerSpawnEvent - { - get; - set; - } + public double? PlayerSpawnEvent { get; set; } [JsonPropertyName("PlayerSpawnEventReal")] - public double? PlayerSpawnEventReal - { - get; - set; - } + public double? PlayerSpawnEventReal { get; set; } [JsonPropertyName("GameSpawned")] - public double? GameSpawned - { - get; - set; - } + public double? GameSpawned { get; set; } [JsonPropertyName("GameSpawnedReal")] - public double? GameSpawnedReal - { - get; - set; - } + public double? GameSpawnedReal { get; set; } [JsonPropertyName("GameStarting")] - public double? GameStarting - { - get; - set; - } + public double? GameStarting { get; set; } [JsonPropertyName("GameStartingReal")] - public double? GameStartingReal - { - get; - set; - } + public double? GameStartingReal { get; set; } [JsonPropertyName("GameStarted")] - public double? GameStarted - { - get; - set; - } + public double? GameStarted { get; set; } [JsonPropertyName("GameStartedReal")] - public double? GameStartedReal - { - get; - set; - } + public double? GameStartedReal { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RaidSettings.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RaidSettings.cs index b14dd0b3..75926273 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RaidSettings.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RaidSettings.cs @@ -11,98 +11,46 @@ public record RaidSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("keyId")] - public string? KeyId - { - get; - set; - } + public string? KeyId { get; set; } [JsonPropertyName("onlinePveRaidStates")] - public Dictionary OnlinePveRaidStates - { - get; - set; - } = []; + public Dictionary OnlinePveRaidStates { get; set; } = []; [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("isLocationTransition")] - public bool? IsLocationTransition - { - get; - set; - } + public bool? IsLocationTransition { get; set; } [JsonPropertyName("timeVariant")] [JsonConverter(typeof(JsonStringEnumConverter))] - public DateTimeEnum TimeVariant - { - get; - set; - } + public DateTimeEnum TimeVariant { get; set; } [JsonPropertyName("metabolismDisabled")] - public bool? MetabolismDisabled - { - get; - set; - } + public bool? MetabolismDisabled { get; set; } [JsonPropertyName("timeAndWeatherSettings")] - public TimeAndWeatherSettings? TimeAndWeatherSettings - { - get; - set; - } + public TimeAndWeatherSettings? TimeAndWeatherSettings { get; set; } [JsonPropertyName("botSettings")] - public BotSettings? BotSettings - { - get; - set; - } + public BotSettings? BotSettings { get; set; } [JsonPropertyName("wavesSettings")] - public WavesSettings? WavesSettings - { - get; - set; - } + public WavesSettings? WavesSettings { get; set; } [JsonPropertyName("side")] - public SideType? Side - { - get; - set; - } + public SideType? Side { get; set; } [JsonPropertyName("raidMode")] [JsonConverter(typeof(JsonStringEnumConverter))] - public RaidMode? RaidMode - { - get; - set; - } + public RaidMode? RaidMode { get; set; } [JsonPropertyName("playersSpawnPlace")] [JsonConverter(typeof(JsonStringEnumConverter))] - public PlayersSpawnPlace? PlayersSpawnPlace - { - get; - set; - } + public PlayersSpawnPlace? PlayersSpawnPlace { get; set; } [JsonPropertyName("CanShowGroupPreview")] - public bool? CanShowGroupPreview - { - get; - set; - } + public bool? CanShowGroupPreview { get; set; } } public record TimeAndWeatherSettings @@ -111,65 +59,33 @@ public record TimeAndWeatherSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("isRandomTime")] - public bool? IsRandomTime - { - get; - set; - } + public bool? IsRandomTime { get; set; } [JsonPropertyName("isRandomWeather")] - public bool? IsRandomWeather - { - get; - set; - } + public bool? IsRandomWeather { get; set; } [JsonPropertyName("cloudinessType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public CloudinessType? CloudinessType - { - get; - set; - } + public CloudinessType? CloudinessType { get; set; } [JsonPropertyName("rainType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public RainType? RainType - { - get; - set; - } + public RainType? RainType { get; set; } [JsonPropertyName("fogType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public FogType? FogType - { - get; - set; - } + public FogType? FogType { get; set; } [JsonPropertyName("windType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public WindSpeed? WindType - { - get; - set; - } + public WindSpeed? WindType { get; set; } [JsonPropertyName("timeFlowType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public TimeFlowType? TimeFlowType - { - get; - set; - } + public TimeFlowType? TimeFlowType { get; set; } [JsonPropertyName("hourOfDay")] - public int? HourOfDay - { - get; - set; - } + public int? HourOfDay { get; set; } } public record BotSettings @@ -178,19 +94,11 @@ public record BotSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("isScavWars")] - public bool? IsScavWars - { - get; - set; - } + public bool? IsScavWars { get; set; } [JsonPropertyName("botAmount")] [JsonConverter(typeof(JsonStringEnumConverter))] - public BotAmount? BotAmount - { - get; - set; - } + public BotAmount? BotAmount { get; set; } } public record WavesSettings @@ -200,31 +108,15 @@ public record WavesSettings [JsonPropertyName("botAmount")] [JsonConverter(typeof(JsonStringEnumConverter))] - public BotAmount? BotAmount - { - get; - set; - } + public BotAmount? BotAmount { get; set; } [JsonPropertyName("botDifficulty")] [JsonConverter(typeof(JsonStringEnumConverter))] - public BotDifficulty? BotDifficulty - { - get; - set; - } + public BotDifficulty? BotDifficulty { get; set; } [JsonPropertyName("isBosses")] - public bool? IsBosses - { - get; - set; - } + public bool? IsBosses { get; set; } [JsonPropertyName("isTaggedAndCursed")] - public bool? IsTaggedAndCursed - { - get; - set; - } + public bool? IsTaggedAndCursed { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RequestIdRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RequestIdRequest.cs index a3acb481..5e06d356 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RequestIdRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/RequestIdRequest.cs @@ -9,9 +9,5 @@ public record RequestIdRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("requestId")] - public string? RequestId - { - get; - set; - } + public string? RequestId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/Server.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/Server.cs index 1f26a21f..bf9000c6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/Server.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/Server.cs @@ -8,23 +8,11 @@ public record Server public Dictionary ExtensionData { get; set; } [JsonPropertyName("ping")] - public int? Ping - { - get; - set; - } + public int? Ping { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/SessionStatus.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/SessionStatus.cs index 0e7c11e0..30ded9d2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/SessionStatus.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/SessionStatus.cs @@ -8,86 +8,38 @@ public record SessionStatus public Dictionary ExtensionData { get; set; } [JsonPropertyName("profileid")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("profileToken")] - public string? ProfileToken - { - get; - set; - } + public string? ProfileToken { get; set; } [JsonPropertyName("status")] - public string? Status - { - get; - set; - } + public string? Status { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } [JsonPropertyName("sid")] - public string? Sid - { - get; - set; - } + public string? Sid { get; set; } [JsonPropertyName("version")] - public string? Version - { - get; - set; - } + public string? Version { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("raidMode")] - public string? RaidMode - { - get; - set; - } + public string? RaidMode { get; set; } [JsonPropertyName("mode")] - public string? Mode - { - get; - set; - } + public string? Mode { get; set; } [JsonPropertyName("shortId")] - public string? ShortId - { - get; - set; - } + public string? ShortId { get; set; } [JsonPropertyName("additional_info")] - public List? AdditionalInfo - { - get; - set; - } + public List? AdditionalInfo { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidRequestData.cs index 2fd8b4e8..62261c4d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidRequestData.cs @@ -10,61 +10,29 @@ public record StartLocalRaidRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("serverId")] - public string? ServerId - { - get; - set; - } + public string? ServerId { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("timeVariant")] - public string? TimeVariant - { - get; - set; - } + public string? TimeVariant { get; set; } [JsonPropertyName("mode")] - public string? Mode - { - get; - set; - } + public string? Mode { get; set; } [JsonPropertyName("playerSide")] - public string? PlayerSide - { - get; - set; - } + public string? PlayerSide { get; set; } [JsonPropertyName("transitionType")] - public TransitionType? TransitionType - { - get; - set; - } + public TransitionType? TransitionType { get; set; } [JsonPropertyName("transition")] - public Transition? Transition - { - get; - set; - } + public Transition? Transition { get; set; } /// /// Should loot generation be skipped, default false /// [JsonPropertyName("sptSkipLootGeneration")] - public bool? ShouldSkipLootGeneration - { - get; - set; - } + public bool? ShouldSkipLootGeneration { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidResponseData.cs index cb4fa85f..2a0c19a2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/StartLocalRaidResponseData.cs @@ -11,47 +11,23 @@ public record StartLocalRaidResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("serverId")] - public string? ServerId - { - get; - set; - } + public string? ServerId { get; set; } [JsonPropertyName("serverSettings")] - public LocationServices? ServerSettings - { - get; - set; - } + public LocationServices? ServerSettings { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("profile")] - public ProfileInsuredItems? Profile - { - get; - set; - } + public ProfileInsuredItems? Profile { get; set; } [JsonPropertyName("locationLoot")] - public LocationBase? LocationLoot - { - get; - set; - } + public LocationBase? LocationLoot { get; set; } [JsonPropertyName("transitionType")] - public TransitionType? TransitionType - { - get; - set; - } + public TransitionType? TransitionType { get; set; } [JsonPropertyName("transition")] - public Transition? Transition - { - get; - set; - } + public Transition? Transition { get; set; } } public record ProfileInsuredItems @@ -60,11 +36,7 @@ public record ProfileInsuredItems public Dictionary ExtensionData { get; set; } [JsonPropertyName("insuredItems")] - public List? InsuredItems - { - get; - set; - } + public List? InsuredItems { get; set; } } public record Transition @@ -73,30 +45,14 @@ public record Transition public Dictionary ExtensionData { get; set; } [JsonPropertyName("transitionType")] - public TransitionType? TransitionType - { - get; - set; - } + public TransitionType? TransitionType { get; set; } [JsonPropertyName("transitionRaidId")] - public string? TransitionRaidId - { - get; - set; - } + public string? TransitionRaidId { get; set; } [JsonPropertyName("transitionCount")] - public int? TransitionCount - { - get; - set; - } + public int? TransitionCount { get; set; } [JsonPropertyName("visitedLocations")] - public List? VisitedLocations - { - get; - set; - } + public List? VisitedLocations { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/UpdatePingRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/UpdatePingRequestData.cs index db739aa5..32b52a13 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Match/UpdatePingRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Match/UpdatePingRequestData.cs @@ -9,9 +9,5 @@ public record UpdatePingRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("servers")] - public List? servers - { - get; - set; - } + public List? servers { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Notes/NoteActionRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Notes/NoteActionRequest.cs index fdd3f5f6..e931460b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Notes/NoteActionRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Notes/NoteActionRequest.cs @@ -6,18 +6,10 @@ namespace SPTarkov.Server.Core.Models.Eft.Notes; public record NoteActionRequest : BaseInteractionRequestData { [JsonPropertyName("index")] - public int? Index - { - get; - set; - } + public int? Index { get; set; } [JsonPropertyName("note")] - public Note? Note - { - get; - set; - } + public Note? Note { get; set; } } public record Note @@ -26,16 +18,8 @@ public record Note public Dictionary ExtensionData { get; set; } [JsonPropertyName("Time")] - public double? Time - { - get; - set; - } + public double? Time { get; set; } [JsonPropertyName("Text")] - public string? Text - { - get; - set; - } + public string? Text { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/Notifier.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/Notifier.cs index 25331cd9..2a887047 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/Notifier.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/Notifier.cs @@ -8,37 +8,17 @@ public record NotifierChannel public Dictionary ExtensionData { get; set; } [JsonPropertyName("server")] - public string? Server - { - get; - set; - } + public string? Server { get; set; } [JsonPropertyName("channel_id")] - public string? ChannelId - { - get; - set; - } + public string? ChannelId { get; set; } [JsonPropertyName("url")] - public string? Url - { - get; - set; - } + public string? Url { get; set; } [JsonPropertyName("notifierServer")] - public string? NotifierServer - { - get; - set; - } + public string? NotifierServer { get; set; } [JsonPropertyName("ws")] - public string? WebSocket - { - get; - set; - } + public string? WebSocket { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/SelectProfileResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/SelectProfileResponse.cs index dd51bfde..bc7210fa 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/SelectProfileResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Notifier/SelectProfileResponse.cs @@ -8,9 +8,5 @@ public record SelectProfileResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("status")] - public string? Status - { - get; - set; - } + public string? Status { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Player/PlayerIncrementSkillLevelRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Player/PlayerIncrementSkillLevelRequestData.cs index 3117dc69..e5c62845 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Player/PlayerIncrementSkillLevelRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Player/PlayerIncrementSkillLevelRequestData.cs @@ -9,67 +9,31 @@ public record PlayerIncrementSkillLevelRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("experience")] - public int? Experience - { - get; - set; - } + public int? Experience { get; set; } [JsonPropertyName("quests")] - public List? Quests - { - get; - set; - } + public List? Quests { get; set; } [JsonPropertyName("ragFairOffers")] - public List? RagFairOffers - { - get; - set; - } + public List? RagFairOffers { get; set; } [JsonPropertyName("builds")] - public List? Builds - { - get; - set; - } + public List? Builds { get; set; } [JsonPropertyName("items")] - public Items? Items - { - get; - set; - } + public Items? Items { get; set; } [JsonPropertyName("production")] - public Production? Production - { - get; - set; - } + public Production? Production { get; set; } [JsonPropertyName("skills")] - public Skills? Skills - { - get; - set; - } + public Skills? Skills { get; set; } [JsonPropertyName("traderRelations")] - public TraderRelations? TraderRelations - { - get; - set; - } + public TraderRelations? TraderRelations { get; set; } } // TODO: These are all lists of objects. @@ -79,37 +43,23 @@ public record Items public Dictionary ExtensionData { get; set; } [JsonPropertyName("new")] - public List? NewItems - { - get; - set; - } + public List? NewItems { get; set; } [JsonPropertyName("change")] - public List? ChangedItems - { - get; - set; - } + public List? ChangedItems { get; set; } [JsonPropertyName("del")] - public List? DeletedItems - { - get; - set; - } + public List? DeletedItems { get; set; } } public record Production { [JsonExtensionData] public Dictionary ExtensionData { get; set; } - } public record TraderRelations { [JsonExtensionData] public Dictionary ExtensionData { get; set; } - } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs index 28e3e104..bef250db 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs @@ -10,40 +10,20 @@ public record PresetBuildActionRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Action")] - public string? Action - { - get; - set; - } + public string? Action { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } /// /// name of preset given by player /// [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("Root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs index 1276eff8..671e235d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs @@ -9,9 +9,5 @@ public record RemoveBuildRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/GetPrestigeResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/GetPrestigeResponse.cs index f66bf6a7..1e1159de 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/GetPrestigeResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/GetPrestigeResponse.cs @@ -8,9 +8,5 @@ public record GetPrestigeResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("elements")] - public List? Elements - { - get; - set; - } + public List? Elements { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/ObtainPrestigeRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/ObtainPrestigeRequest.cs index b1347179..55fc71c3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/ObtainPrestigeRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Prestige/ObtainPrestigeRequest.cs @@ -3,9 +3,7 @@ using SPTarkov.Server.Core.Models.Utils; namespace SPTarkov.Server.Core.Models.Eft.Prestige; -public class ObtainPrestigeRequestList : List, IRequestData -{ -} +public class ObtainPrestigeRequestList : List, IRequestData { } public record ObtainPrestigeRequest : IRequestData { @@ -13,18 +11,10 @@ public record ObtainPrestigeRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string Id - { - get; - set; - } + public string Id { get; set; } [JsonPropertyName("location")] - public Location Location - { - get; - set; - } + public Location Location { get; set; } } public record Location @@ -33,30 +23,14 @@ public record Location public Dictionary ExtensionData { get; set; } [JsonPropertyName("x")] - public int X - { - get; - set; - } + public int X { get; set; } [JsonPropertyName("y")] - public int Y - { - get; - set; - } + public int Y { get; set; } [JsonPropertyName("z")] - public int Z - { - get; - set; - } + public int Z { get; set; } [JsonPropertyName("r")] - public string R - { - get; - set; - } + public string R { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CompletedAchievementsResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CompletedAchievementsResponse.cs index cfcb05d5..170907a4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CompletedAchievementsResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CompletedAchievementsResponse.cs @@ -8,9 +8,5 @@ public record CompletedAchievementsResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("elements")] - public Dictionary? Elements - { - get; - set; - } + public Dictionary? Elements { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ConnectResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ConnectResponse.cs index 5a34975e..702e2bef 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ConnectResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ConnectResponse.cs @@ -8,30 +8,14 @@ public record ConnectResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("backendUrl")] - public string? BackendUrl - { - get; - set; - } + public string? BackendUrl { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("editions")] - public List? Editions - { - get; - set; - } + public List? Editions { get; set; } [JsonPropertyName("profileDescriptions")] - public Dictionary? ProfileDescriptions - { - get; - set; - } + public Dictionary? ProfileDescriptions { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CreateProfileResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CreateProfileResponse.cs index f035961b..09d374a1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CreateProfileResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/CreateProfileResponse.cs @@ -8,9 +8,5 @@ public record CreateProfileResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("uid")] - public string? UserId - { - get; - set; - } + public string? UserId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetAchievementsResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetAchievementsResponse.cs index adfc6b0c..85969b03 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetAchievementsResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetAchievementsResponse.cs @@ -9,9 +9,5 @@ public record GetAchievementsResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("elements")] - public List? Elements - { - get; - set; - } + public List? Elements { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileRequest.cs index eb42a564..85f457ba 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileRequest.cs @@ -9,9 +9,5 @@ public record GetOtherProfileRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("accountId")] - public string? AccountId - { - get; - set; - } + public string? AccountId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileResponse.cs index d7c3e15a..00c76c91 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetOtherProfileResponse.cs @@ -9,102 +9,46 @@ public record GetOtherProfileResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("info")] - public OtherProfileInfo? Info - { - get; - set; - } + public OtherProfileInfo? Info { get; set; } [JsonPropertyName("customization")] - public OtherProfileCustomization? Customization - { - get; - set; - } + public OtherProfileCustomization? Customization { get; set; } [JsonPropertyName("skills")] - public Skills? Skills - { - get; - set; - } + public Skills? Skills { get; set; } [JsonPropertyName("equipment")] - public OtherProfileEquipment? Equipment - { - get; - set; - } + public OtherProfileEquipment? Equipment { get; set; } [JsonPropertyName("achievements")] - public Dictionary? Achievements - { - get; - set; - } + public Dictionary? Achievements { get; set; } [JsonPropertyName("favoriteItems")] - public List? FavoriteItems - { - get; - set; - } + public List? FavoriteItems { get; set; } [JsonPropertyName("pmcStats")] - public OtherProfileStats? PmcStats - { - get; - set; - } + public OtherProfileStats? PmcStats { get; set; } [JsonPropertyName("scavStats")] - public OtherProfileStats? ScavStats - { - get; - set; - } + public OtherProfileStats? ScavStats { get; set; } [JsonPropertyName("hideout")] - public Common.Tables.Hideout Hideout - { - get; - set; - } + public Common.Tables.Hideout Hideout { get; set; } [JsonPropertyName("customizationStash")] - public string CustomizationStash - { - get; - set; - } + public string CustomizationStash { get; set; } [JsonPropertyName("hideoutAreaStashes")] - public Dictionary HideoutAreaStashes - { - get; - set; - } + public Dictionary HideoutAreaStashes { get; set; } [JsonPropertyName("items")] - public List Items - { - get; - set; - } + public List Items { get; set; } } public record OtherProfileInfo @@ -113,53 +57,25 @@ public record OtherProfileInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("experience")] - public int? Experience - { - get; - set; - } + public int? Experience { get; set; } [JsonPropertyName("memberCategory")] - public int? MemberCategory - { - get; - set; - } + public int? MemberCategory { get; set; } [JsonPropertyName("bannedState")] - public bool? BannedState - { - get; - set; - } + public bool? BannedState { get; set; } [JsonPropertyName("bannedUntil")] - public long? BannedUntil - { - get; - set; - } + public long? BannedUntil { get; set; } [JsonPropertyName("registrationDate")] - public long? RegistrationDate - { - get; - set; - } + public long? RegistrationDate { get; set; } } public record OtherProfileCustomization @@ -168,39 +84,19 @@ public record OtherProfileCustomization public Dictionary ExtensionData { get; set; } [JsonPropertyName("head")] - public string? Head - { - get; - set; - } + public string? Head { get; set; } [JsonPropertyName("body")] - public string? Body - { - get; - set; - } + public string? Body { get; set; } [JsonPropertyName("feet")] - public string? Feet - { - get; - set; - } + public string? Feet { get; set; } [JsonPropertyName("hands")] - public string? Hands - { - get; - set; - } + public string? Hands { get; set; } [JsonPropertyName("dogtag")] - public string? Dogtag - { - get; - set; - } + public string? Dogtag { get; set; } } public record OtherProfileEquipment @@ -209,18 +105,10 @@ public record OtherProfileEquipment public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record OtherProfileStats @@ -229,11 +117,7 @@ public record OtherProfileStats public Dictionary ExtensionData { get; set; } [JsonPropertyName("eft")] - public OtherProfileSubStats? Eft - { - get; - set; - } + public OtherProfileSubStats? Eft { get; set; } } public record OtherProfileSubStats @@ -242,16 +126,8 @@ public record OtherProfileSubStats public Dictionary ExtensionData { get; set; } [JsonPropertyName("totalInGameTime")] - public long? TotalInGameTime - { - get; - set; - } + public long? TotalInGameTime { get; set; } [JsonPropertyName("overAllCounters")] - public OverallCounters? OverAllCounters - { - get; - set; - } + public OverallCounters? OverAllCounters { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileSettingsRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileSettingsRequest.cs index 20ff3c3e..3970bb5f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileSettingsRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileSettingsRequest.cs @@ -12,16 +12,8 @@ public record GetProfileSettingsRequest : IRequestData /// Chosen value for profile.Info.SelectedMemberCategory /// [JsonPropertyName("memberCategory")] - public int? MemberCategory - { - get; - set; - } + public int? MemberCategory { get; set; } [JsonPropertyName("squadInviteRestriction")] - public bool? SquadInviteRestriction - { - get; - set; - } + public bool? SquadInviteRestriction { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileStatusResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileStatusResponseData.cs index 235725a3..3e5c5168 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileStatusResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/GetProfileStatusResponseData.cs @@ -8,18 +8,10 @@ public record GetProfileStatusResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("maxPveCountExceeded")] - public bool? MaxPveCountExceeded - { - get; - set; - } = false; + public bool? MaxPveCountExceeded { get; set; } = false; [JsonPropertyName("profiles")] - public List? Profiles - { - get; - set; - } + public List? Profiles { get; set; } } public record ProfileStatusData @@ -28,86 +20,38 @@ public record ProfileStatusData public Dictionary ExtensionData { get; set; } [JsonPropertyName("profileid")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("profileToken")] - public string? ProfileToken - { - get; - set; - } + public string? ProfileToken { get; set; } [JsonPropertyName("status")] - public string? Status - { - get; - set; - } + public string? Status { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } [JsonPropertyName("sid")] - public string? Sid - { - get; - set; - } + public string? Sid { get; set; } [JsonPropertyName("version")] - public string? Version - { - get; - set; - } + public string? Version { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("raidMode")] - public string? RaidMode - { - get; - set; - } + public string? RaidMode { get; set; } [JsonPropertyName("mode")] - public string? Mode - { - get; - set; - } + public string? Mode { get; set; } [JsonPropertyName("shortId")] - public string? ShortId - { - get; - set; - } + public string? ShortId { get; set; } [JsonPropertyName("additional_info")] - public List? AdditionalInfo - { - get; - set; - } // TODO: Was `any` in the node server + public List? AdditionalInfo { get; set; } // TODO: Was `any` in the node server } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/MessageContentRagfair.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/MessageContentRagfair.cs index db40cfcf..5a791b81 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/MessageContentRagfair.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/MessageContentRagfair.cs @@ -8,23 +8,11 @@ public record MessageContentRagfair public Dictionary ExtensionData { get; set; } [JsonPropertyName("offerId")] - public string? OfferId - { - get; - set; - } + public string? OfferId { get; set; } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("handbookId")] - public string? HandbookId - { - get; - set; - } + public string? HandbookId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeNicknameRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeNicknameRequestData.cs index e9dcb690..0a85beab 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeNicknameRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeNicknameRequestData.cs @@ -9,9 +9,5 @@ public record ProfileChangeNicknameRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeVoiceRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeVoiceRequestData.cs index 0b70df52..6caa4308 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeVoiceRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileChangeVoiceRequestData.cs @@ -9,9 +9,5 @@ public record ProfileChangeVoiceRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("voice")] - public string? Voice - { - get; - set; - } + public string? Voice { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileCreateRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileCreateRequestData.cs index 55ddb174..1b2ca16d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileCreateRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ProfileCreateRequestData.cs @@ -9,37 +9,17 @@ public record ProfileCreateRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("headId")] - public string? HeadId - { - get; - set; - } + public string? HeadId { get; set; } [JsonPropertyName("voiceId")] - public string? VoiceId - { - get; - set; - } + public string? VoiceId { get; set; } [JsonPropertyName("sptForcePrestigeLevel")] - public int? SptForcePrestigeLevel - { - get; - set; - } + public int? SptForcePrestigeLevel { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchFriendResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchFriendResponse.cs index dd2c1363..2e3a3622 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchFriendResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchFriendResponse.cs @@ -11,23 +11,11 @@ public record SearchFriendResponse public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Info")] - public UserDialogDetails? Info - { - get; - set; - } + public UserDialogDetails? Info { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchProfilesRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchProfilesRequestData.cs index 86e6ea1b..fa5c1603 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchProfilesRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SearchProfilesRequestData.cs @@ -9,9 +9,5 @@ public record SearchProfilesRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SptProfile.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SptProfile.cs index 0c2a0334..412b4dc3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SptProfile.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SptProfile.cs @@ -13,108 +13,59 @@ public record SptProfile public Dictionary ExtensionData { get; set; } [JsonPropertyName("info")] - public Info? ProfileInfo - { - get; - set; - } + public Info? ProfileInfo { get; set; } [JsonPropertyName("characters")] - public Characters? CharacterData - { - get; - set; - } + public Characters? CharacterData { get; set; } /// /// No longer used as of 4.0.0 /// [Obsolete("Replaced with CustomisationUnlocks")] [JsonPropertyName("suits")] - public List? Suits - { - get; - set; - } + public List? Suits { get; set; } [JsonPropertyName("userbuilds")] - public UserBuilds? UserBuildData - { - get; - set; - } + public UserBuilds? UserBuildData { get; set; } [JsonPropertyName("dialogues")] - public Dictionary? DialogueRecords - { - get; - set; - } + public Dictionary? DialogueRecords { get; set; } [JsonPropertyName("spt")] - public Spt? SptData - { - get; - set; - } + public Spt? SptData { get; set; } [JsonPropertyName("vitality")] - public Vitality? VitalityData - { - get; - set; - } + public Vitality? VitalityData { get; set; } [JsonPropertyName("inraid")] - public Inraid? InraidData - { - get; - set; - } + public Inraid? InraidData { get; set; } [JsonPropertyName("insurance")] - public List? InsuranceList - { - get; - set; - } + public List? InsuranceList { get; set; } [JsonPropertyName("btrDelivery")] - public List? BtrDeliveryList - { - get; - set; - } + public List? BtrDeliveryList { get; set; } /// /// Assort purchases made by player since last trader refresh /// [JsonPropertyName("traderPurchases")] - public Dictionary?>? TraderPurchases - { - get; - set; - } + public Dictionary< + string, + Dictionary? + >? TraderPurchases { get; set; } /// /// List of friend profile IDs /// [JsonPropertyName("friends")] - public List? FriendProfileIds - { - get; - set; - } + public List? FriendProfileIds { get; set; } /// /// Stores profile-related customisation, e.g. clothing / hideout walls / floors /// [JsonPropertyName("customisationUnlocks")] - public List? CustomisationUnlocks - { - get; - set; - } + public List? CustomisationUnlocks { get; set; } } public record TraderPurchaseData @@ -123,18 +74,10 @@ public record TraderPurchaseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public double? PurchaseCount - { - get; - set; - } + public double? PurchaseCount { get; set; } [JsonPropertyName("purchaseTimestamp")] - public long? PurchaseTimestamp - { - get; - set; - } + public long? PurchaseTimestamp { get; set; } } public record Info @@ -146,53 +89,25 @@ public record Info /// main profile id /// [JsonPropertyName("id")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("scavId")] - public string? ScavengerId - { - get; - set; - } + public string? ScavengerId { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("username")] - public string? Username - { - get; - set; - } + public string? Username { get; set; } [JsonPropertyName("password")] - public string? Password - { - get; - set; - } + public string? Password { get; set; } [JsonPropertyName("wipe")] - public bool? IsWiped - { - get; - set; - } + public bool? IsWiped { get; set; } [JsonPropertyName("edition")] - public string? Edition - { - get; - set; - } + public string? Edition { get; set; } } public record Characters @@ -201,18 +116,10 @@ public record Characters public Dictionary ExtensionData { get; set; } [JsonPropertyName("pmc")] - public PmcData? PmcData - { - get; - set; - } + public PmcData? PmcData { get; set; } [JsonPropertyName("scav")] - public PmcData? ScavData - { - get; - set; - } + public PmcData? ScavData { get; set; } } /// @@ -224,25 +131,13 @@ public record UserBuilds public Dictionary ExtensionData { get; set; } [JsonPropertyName("weaponBuilds")] - public List? WeaponBuilds - { - get; - set; - } + public List? WeaponBuilds { get; set; } [JsonPropertyName("equipmentBuilds")] - public List? EquipmentBuilds - { - get; - set; - } + public List? EquipmentBuilds { get; set; } [JsonPropertyName("magazineBuilds")] - public List? MagazineBuilds - { - get; - set; - } + public List? MagazineBuilds { get; set; } } public record UserBuild @@ -251,91 +146,47 @@ public record UserBuild public Dictionary ExtensionData { get; set; } [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } } public record WeaponBuild : UserBuild { [JsonPropertyName("Root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } // Same as PMC inventory items + public List? Items { get; set; } // Same as PMC inventory items } public record EquipmentBuild : UserBuild { [JsonPropertyName("Root")] - public string? Root - { - get; - set; - } + public string? Root { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } // Same as PMC inventory items + public List? Items { get; set; } // Same as PMC inventory items [JsonPropertyName("BuildType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public EquipmentBuildType? BuildType - { - get; - set; - } + public EquipmentBuildType? BuildType { get; set; } } public record MagazineBuild : UserBuild { [JsonPropertyName("Caliber")] - public string? Caliber - { - get; - set; - } + public string? Caliber { get; set; } [JsonPropertyName("TopCount")] - public int? TopCount - { - get; - set; - } + public int? TopCount { get; set; } [JsonPropertyName("BottomCount")] - public int? BottomCount - { - get; - set; - } + public int? BottomCount { get; set; } [JsonPropertyName("Items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record MagazineTemplateAmmoItem @@ -344,18 +195,10 @@ public record MagazineTemplateAmmoItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("TemplateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("Count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } /// @@ -364,11 +207,7 @@ public record MagazineTemplateAmmoItem public record DefaultEquipmentPreset : EquipmentBuild { [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } public record Dialogue @@ -377,53 +216,25 @@ public record Dialogue public Dictionary ExtensionData { get; set; } [JsonPropertyName("attachmentsNew")] - public int? AttachmentsNew - { - get; - set; - } + public int? AttachmentsNew { get; set; } [JsonPropertyName("new")] - public int? New - { - get; - set; - } + public int? New { get; set; } [JsonPropertyName("type")] - public MessageType? Type - { - get; - set; - } + public MessageType? Type { get; set; } [JsonPropertyName("Users")] - public List? Users - { - get; - set; - } + public List? Users { get; set; } [JsonPropertyName("pinned")] - public bool? Pinned - { - get; - set; - } + public bool? Pinned { get; set; } [JsonPropertyName("messages")] - public List? Messages - { - get; - set; - } + public List? Messages { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } } //TODO: @Cleanup: Maybe the same as Dialogue? @@ -433,53 +244,25 @@ public record DialogueInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("attachmentsNew")] - public int? AttachmentsNew - { - get; - set; - } + public int? AttachmentsNew { get; set; } [JsonPropertyName("new")] - public int? New - { - get; - set; - } + public int? New { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("type")] - public MessageType? Type - { - get; - set; - } + public MessageType? Type { get; set; } [JsonPropertyName("pinned")] - public bool? Pinned - { - get; - set; - } + public bool? Pinned { get; set; } [JsonPropertyName("Users")] - public List? Users - { - get; - set; - } + public List? Users { get; set; } [JsonPropertyName("message")] - public MessagePreview? Message - { - get; - set; - } + public MessagePreview? Message { get; set; } } public record Message @@ -488,109 +271,49 @@ public record Message public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("uid")] - public string? UserId - { - get; - set; - } + public string? UserId { get; set; } [JsonPropertyName("type")] - public MessageType? MessageType - { - get; - set; - } + public MessageType? MessageType { get; set; } [JsonPropertyName("dt")] - public long? DateTime - { - get; - set; - } + public long? DateTime { get; set; } [JsonPropertyName("UtcDateTime")] - public long? UtcDateTime - { - get; - set; - } + public long? UtcDateTime { get; set; } [JsonPropertyName("Member")] - public UpdatableChatMember? Member - { - get; - set; - } + public UpdatableChatMember? Member { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("text")] - public string? Text - { - get; - set; - } + public string? Text { get; set; } [JsonPropertyName("replyTo")] - public ReplyTo? ReplyTo - { - get; - set; - } + public ReplyTo? ReplyTo { get; set; } [JsonPropertyName("hasRewards")] - public bool? HasRewards - { - get; - set; - } + public bool? HasRewards { get; set; } [JsonPropertyName("rewardCollected")] - public bool? RewardCollected - { - get; - set; - } + public bool? RewardCollected { get; set; } [JsonPropertyName("items")] - public MessageItems? Items - { - get; - set; - } + public MessageItems? Items { get; set; } [JsonPropertyName("maxStorageTime")] - public long? MaxStorageTime - { - get; - set; - } + public long? MaxStorageTime { get; set; } [JsonPropertyName("systemData")] - public SystemData? SystemData - { - get; - set; - } + public SystemData? SystemData { get; set; } [JsonPropertyName("profileChangeEvents")] - public List? ProfileChangeEvents - { - get; - set; - } + public List? ProfileChangeEvents { get; set; } } public record ReplyTo @@ -599,39 +322,19 @@ public record ReplyTo public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("uid")] - public string? UserId - { - get; - set; - } + public string? UserId { get; set; } [JsonPropertyName("type")] - public MessageType? MessageType - { - get; - set; - } + public MessageType? MessageType { get; set; } [JsonPropertyName("dt")] - public long? DateTime - { - get; - set; - } + public long? DateTime { get; set; } [JsonPropertyName("text")] - public string? Text - { - get; - set; - } + public string? Text { get; set; } } public record MessagePreview @@ -640,46 +343,22 @@ public record MessagePreview public Dictionary ExtensionData { get; set; } [JsonPropertyName("uid")] - public string? UserId - { - get; - set; - } + public string? UserId { get; set; } [JsonPropertyName("type")] - public MessageType? MessageType - { - get; - set; - } + public MessageType? MessageType { get; set; } [JsonPropertyName("dt")] - public long? DateTime - { - get; - set; - } + public long? DateTime { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } [JsonPropertyName("text")] - public string? Text - { - get; - set; - } + public string? Text { get; set; } [JsonPropertyName("systemData")] - public SystemData? SystemData - { - get; - set; - } + public SystemData? SystemData { get; set; } } public record MessageItems @@ -688,18 +367,10 @@ public record MessageItems public Dictionary ExtensionData { get; set; } [JsonPropertyName("stash")] - public string? Stash - { - get; - set; - } + public string? Stash { get; set; } [JsonPropertyName("data")] - public List? Data - { - get; - set; - } + public List? Data { get; set; } } public record UpdatableChatMember @@ -708,46 +379,22 @@ public record UpdatableChatMember public Dictionary ExtensionData { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("MemberCategory")] - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } [JsonPropertyName("Ignored")] - public bool? IsIgnored - { - get; - set; - } + public bool? IsIgnored { get; set; } [JsonPropertyName("Banned")] - public bool? IsBanned - { - get; - set; - } + public bool? IsBanned { get; set; } } public record Spt @@ -759,85 +406,49 @@ public record Spt /// What version of SPT was this profile made with /// [JsonPropertyName("version")] - public string? Version - { - get; - set; - } + public string? Version { get; set; } /// /// What mods has this profile loaded at any point in time /// [JsonPropertyName("mods")] - public List? Mods - { - get; - set; - } + public List? Mods { get; set; } /// /// What gifts has this profile received and how many /// [JsonPropertyName("receivedGifts")] - public List? ReceivedGifts - { - get; - set; - } + public List? ReceivedGifts { get; set; } /// /// item TPLs blacklisted from being sold on flea for this profile /// [JsonPropertyName("blacklistedItemTpls")] - public HashSet? BlacklistedItemTemplates - { - get; - set; - } + public HashSet? BlacklistedItemTemplates { get; set; } /// /// key: daily type /// [JsonPropertyName("freeRepeatableRefreshUsedCount")] - public Dictionary? FreeRepeatableRefreshUsedCount - { - get; - set; - } + public Dictionary? FreeRepeatableRefreshUsedCount { get; set; } /// /// When was a profile migrated, value is timestamp /// [JsonPropertyName("migrations")] - public Dictionary? Migrations - { - get; - set; - } + public Dictionary? Migrations { get; set; } /// /// Cultist circle rewards received that are one time use, key (md5) is a combination of sacrificed + reward items /// [JsonPropertyName("cultistRewards")] - public Dictionary? CultistRewards - { - get; - set; - } + public Dictionary? CultistRewards { get; set; } [JsonPropertyName("pendingPrestige")] - public PendingPrestige? PendingPrestige - { - get; - set; - } + public PendingPrestige? PendingPrestige { get; set; } [JsonPropertyName("extraRepeatableQuests")] - public Dictionary? ExtraRepeatableQuests - { - get; - set; - } + public Dictionary? ExtraRepeatableQuests { get; set; } } public record AcceptedCultistReward @@ -846,25 +457,13 @@ public record AcceptedCultistReward public Dictionary ExtensionData { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } [JsonPropertyName("sacrificeItems")] - public List? SacrificeItems - { - get; - set; - } + public List? SacrificeItems { get; set; } [JsonPropertyName("rewardItems")] - public List? RewardItems - { - get; - set; - } + public List? RewardItems { get; set; } } public record PendingPrestige @@ -873,18 +472,10 @@ public record PendingPrestige public Dictionary ExtensionData { get; set; } [JsonPropertyName("prestigeLevel")] - public int? PrestigeLevel - { - get; - set; - } + public int? PrestigeLevel { get; set; } [JsonPropertyName("items")] - public ObtainPrestigeRequestList? Items - { - get; - set; - } + public ObtainPrestigeRequestList? Items { get; set; } } public record ModDetails @@ -893,39 +484,19 @@ public record ModDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("version")] - public string? Version - { - get; - set; - } + public string? Version { get; set; } [JsonPropertyName("author")] - public string? Author - { - get; - set; - } + public string? Author { get; set; } [JsonPropertyName("dateAdded")] - public long? DateAdded - { - get; - set; - } + public long? DateAdded { get; set; } [JsonPropertyName("url")] - public string? Url - { - get; - set; - } + public string? Url { get; set; } } public record ReceivedGift @@ -934,25 +505,13 @@ public record ReceivedGift public Dictionary ExtensionData { get; set; } [JsonPropertyName("giftId")] - public string? GiftId - { - get; - set; - } + public string? GiftId { get; set; } [JsonPropertyName("timestampLastAccepted")] - public long? TimestampLastAccepted - { - get; - set; - } + public long? TimestampLastAccepted { get; set; } [JsonPropertyName("current")] - public int? Current - { - get; - set; - } + public int? Current { get; set; } } public record Vitality @@ -961,32 +520,16 @@ public record Vitality public Dictionary ExtensionData { get; set; } [JsonPropertyName("Hydration")] - public double? Hydration - { - get; - set; - } + public double? Hydration { get; set; } [JsonPropertyName("Energy")] - public double? Energy - { - get; - set; - } + public double? Energy { get; set; } [JsonPropertyName("Temperature")] - public double? Temperature - { - get; - set; - } + public double? Temperature { get; set; } [JsonPropertyName("Health")] // This now does health and effects to each bodypart - public Dictionary? Health - { - get; - set; - } + public Dictionary? Health { get; set; } } public record Inraid @@ -995,18 +538,10 @@ public record Inraid public Dictionary ExtensionData { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("character")] - public string? Character - { - get; - set; - } + public string? Character { get; set; } } public record Insurance @@ -1015,53 +550,25 @@ public record Insurance public Dictionary ExtensionData { get; set; } [JsonPropertyName("scheduledTime")] - public int? ScheduledTime - { - get; - set; - } + public int? ScheduledTime { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("maxStorageTime")] - public int? MaxStorageTime - { - get; - set; - } + public int? MaxStorageTime { get; set; } [JsonPropertyName("systemData")] - public SystemData? SystemData - { - get; - set; - } + public SystemData? SystemData { get; set; } [JsonPropertyName("messageType")] - public MessageType? MessageType - { - get; - set; - } + public MessageType? MessageType { get; set; } [JsonPropertyName("messageTemplateId")] - public string? MessageTemplateId - { - get; - set; - } + public string? MessageTemplateId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record BtrDelivery @@ -1070,23 +577,11 @@ public record BtrDelivery public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("scheduledTime")] - public int? ScheduledTime - { - get; - set; - } + public int? ScheduledTime { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SystemData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SystemData.cs index cd92bf58..ad186bf7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SystemData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/SystemData.cs @@ -8,44 +8,20 @@ public record SystemData public Dictionary ExtensionData { get; set; } [JsonPropertyName("date")] - public string? Date - { - get; - set; - } + public string? Date { get; set; } [JsonPropertyName("time")] - public string? Time - { - get; - set; - } + public string? Time { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("buyerNickname")] - public string? BuyerNickname - { - get; - set; - } + public string? BuyerNickname { get; set; } [JsonPropertyName("soldItem")] - public string? SoldItem - { - get; - set; - } + public string? SoldItem { get; set; } [JsonPropertyName("itemCount")] - public int? ItemCount - { - get; - set; - } + public int? ItemCount { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/UserDialogInfo.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/UserDialogInfo.cs index 374c0438..0785b237 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/UserDialogInfo.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/UserDialogInfo.cs @@ -12,25 +12,13 @@ public record UserDialogInfo /// _id /// [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Info")] - public UserDialogDetails? Info - { - get; - set; - } + public UserDialogDetails? Info { get; set; } } public record UserDialogDetails @@ -39,37 +27,17 @@ public record UserDialogDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("Side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("Level")] - public double? Level - { - get; - set; - } + public double? Level { get; set; } [JsonPropertyName("MemberCategory")] - public MemberCategory? MemberCategory - { - get; - set; - } + public MemberCategory? MemberCategory { get; set; } [JsonPropertyName("SelectedMemberCategory")] - public MemberCategory? SelectedMemberCategory - { - get; - set; - } + public MemberCategory? SelectedMemberCategory { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ValidateNicknameRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ValidateNicknameRequestData.cs index fb982e33..3a9b90ef 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ValidateNicknameRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Profile/ValidateNicknameRequestData.cs @@ -9,9 +9,5 @@ public record ValidateNicknameRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/AcceptQuestRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/AcceptQuestRequestData.cs index b7853a77..5bd2043b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/AcceptQuestRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/AcceptQuestRequestData.cs @@ -9,16 +9,8 @@ public record AcceptQuestRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("qid")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/CompleteQuestRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/CompleteQuestRequestData.cs index e18155af..a872797d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/CompleteQuestRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/CompleteQuestRequestData.cs @@ -12,16 +12,8 @@ public record CompleteQuestRequestData : InventoryBaseActionRequestData /// Quest Id /// [JsonPropertyName("qid")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } [JsonPropertyName("removeExcessItems")] - public bool? RemoveExcessItems - { - get; - set; - } + public bool? RemoveExcessItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/FailQuestRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/FailQuestRequestData.cs index 65f5e8ef..2d53addb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/FailQuestRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/FailQuestRequestData.cs @@ -9,16 +9,8 @@ public record FailQuestRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("qid")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } [JsonPropertyName("removeExcessItems")] - public bool? RemoveExcessItems - { - get; - set; - } + public bool? RemoveExcessItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/HandoverQuestRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/HandoverQuestRequestData.cs index 6d8075b3..69177634 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/HandoverQuestRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/HandoverQuestRequestData.cs @@ -10,23 +10,11 @@ public record HandoverQuestRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("qid")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } [JsonPropertyName("conditionId")] - public string? ConditionId - { - get; - set; - } + public string? ConditionId { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/ListQuestsRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/ListQuestsRequestData.cs index e38b77d5..7b051efb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/ListQuestsRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/ListQuestsRequestData.cs @@ -9,9 +9,5 @@ public record ListQuestsRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("completed")] - public bool? Completed - { - get; - set; - } + public bool? Completed { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/RepeatableQuestChangeEvent.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/RepeatableQuestChangeEvent.cs index 4cbfa8c8..b3de496a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/RepeatableQuestChangeEvent.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Quests/RepeatableQuestChangeEvent.cs @@ -9,9 +9,5 @@ public record RepeatableQuestChangeRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("qid")] - public string? QuestId - { - get; - set; - } + public string? QuestId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/AddOfferRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/AddOfferRequestData.cs index 9210d5d7..2c28a338 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/AddOfferRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/AddOfferRequestData.cs @@ -9,25 +9,13 @@ public record AddOfferRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("sellInOnePiece")] - public bool? SellInOnePiece - { - get; - set; - } + public bool? SellInOnePiece { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } } public record Requirement @@ -36,38 +24,18 @@ public record Requirement public Dictionary ExtensionData { get; set; } [JsonPropertyName("_tpl")] - public string? Template - { - get; - set; - } + public string? Template { get; set; } // Can be decimal value [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("side")] - public int? Side - { - get; - set; - } + public int? Side { get; set; } [JsonPropertyName("onlyFunctional")] - public bool? OnlyFunctional - { - get; - set; - } + public bool? OnlyFunctional { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/ExtendOfferRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/ExtendOfferRequestData.cs index 03e78f41..5821397d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/ExtendOfferRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/ExtendOfferRequestData.cs @@ -9,16 +9,8 @@ public record ExtendOfferRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("offerId")] - public string? OfferId - { - get; - set; - } + public string? OfferId { get; set; } [JsonPropertyName("renewalTime")] - public long? RenewalTime - { - get; - set; - } + public long? RenewalTime { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetItemPriceResult.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetItemPriceResult.cs index 999ba34a..5e02c07b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetItemPriceResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetItemPriceResult.cs @@ -6,9 +6,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ragfair; public record GetItemPriceResult : MinMax { [JsonPropertyName("avg")] - public double? Avg - { - get; - set; - } + public double? Avg { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetMarketPriceRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetMarketPriceRequestData.cs index ac8e6f2b..edde9641 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetMarketPriceRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetMarketPriceRequestData.cs @@ -9,9 +9,5 @@ public record GetMarketPriceRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetOffersResult.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetOffersResult.cs index 8d6aa064..72eea840 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetOffersResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetOffersResult.cs @@ -8,30 +8,14 @@ public record GetOffersResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("categories")] - public Dictionary? Categories - { - get; - set; - } + public Dictionary? Categories { get; set; } [JsonPropertyName("offers")] - public List? Offers - { - get; - set; - } + public List? Offers { get; set; } [JsonPropertyName("offersCount")] - public int? OffersCount - { - get; - set; - } + public int? OffersCount { get; set; } [JsonPropertyName("selectedCategory")] - public string? SelectedCategory - { - get; - set; - } + public string? SelectedCategory { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetRagfairOfferByIdRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetRagfairOfferByIdRequest.cs index cf4b4740..f1e3b9e2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetRagfairOfferByIdRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/GetRagfairOfferByIdRequest.cs @@ -8,9 +8,5 @@ public record GetRagfairOfferByIdRequest public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public int? Id - { - get; - set; - } + public int? Id { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RagfairOffer.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RagfairOffer.cs index feddc6ba..afbb2242 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RagfairOffer.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RagfairOffer.cs @@ -14,168 +14,88 @@ public record RagfairOffer private string? _root; [JsonPropertyName("sellResult")] - public List? SellResults - { - get; - set; - } + public List? SellResults { get; set; } [JsonPropertyName("_id")] public string? Id { - get - { - return _id; - } - set - { - _id = string.Intern(value); - } + get { return _id; } + set { _id = string.Intern(value); } } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("requirements")] - public List? Requirements - { - get; - set; - } + public List? Requirements { get; set; } [JsonPropertyName("root")] public string? Root { - get - { - return _root; - } - set - { - _root = string.Intern(value); - } + get { return _root; } + set { _root = string.Intern(value); } } [JsonPropertyName("intId")] - public int? InternalId - { - get; - set; - } + public int? InternalId { get; set; } /// /// Handbook price /// [JsonPropertyName("itemsCost")] - public double? ItemsCost - { - get; - set; - } + public double? ItemsCost { get; set; } /// /// Rouble price per item /// [JsonPropertyName("requirementsCost")] - public double? RequirementsCost - { - get; - set; - } + public double? RequirementsCost { get; set; } [JsonPropertyName("startTime")] - public long? StartTime - { - get; - set; - } + public long? StartTime { get; set; } [JsonPropertyName("endTime")] - public long? EndTime - { - get; - set; - } + public long? EndTime { get; set; } /// /// True when offer is sold as pack /// [JsonPropertyName("sellInOnePiece")] - public bool? SellInOnePiece - { - get; - set; - } + public bool? SellInOnePiece { get; set; } /// /// Rouble price - same as requirementsCost /// [JsonPropertyName("summaryCost")] - public double? SummaryCost - { - get; - set; - } + public double? SummaryCost { get; set; } [JsonPropertyName("user")] - public RagfairOfferUser? User - { - get; - set; - } + public RagfairOfferUser? User { get; set; } /// /// Trader only /// [JsonPropertyName("unlimitedCount")] - public bool? UnlimitedCount - { - get; - set; - } + public bool? UnlimitedCount { get; set; } [JsonPropertyName("loyaltyLevel")] - public int? LoyaltyLevel - { - get; - set; - } + public int? LoyaltyLevel { get; set; } [JsonPropertyName("buyRestrictionMax")] - public int? BuyRestrictionMax - { - get; - set; - } + public int? BuyRestrictionMax { get; set; } // Confirmed in client [JsonPropertyName("buyRestrictionCurrent")] - public int? BuyRestrictionCurrent - { - get; - set; - } + public int? BuyRestrictionCurrent { get; set; } [JsonPropertyName("locked")] - public bool? Locked - { - get; - set; - } + public bool? Locked { get; set; } /// /// Tightly bound to offer.items[0].upd.stackObjectsCount /// [JsonPropertyName("quantity")] - public int? Quantity - { - get; - set; - } + public int? Quantity { get; set; } } public record OfferRequirement @@ -188,43 +108,21 @@ public record OfferRequirement [JsonPropertyName("_tpl")] public string? Template { - get - { - return _tpl; - } - set - { - _tpl = string.Intern(value); - } + get { return _tpl; } + set { _tpl = string.Intern(value); } } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } [JsonPropertyName("onlyFunctional")] - public bool? OnlyFunctional - { - get; - set; - } + public bool? OnlyFunctional { get; set; } [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } [JsonPropertyName("side")] - public DogtagExchangeSide? Side - { - get; - set; - } + public DogtagExchangeSide? Side { get; set; } } public record RagfairOfferUser @@ -237,64 +135,30 @@ public record RagfairOfferUser [JsonPropertyName("id")] public string? Id { - get - { - return _id; - } - set - { - _id = string.Intern(value); - } + get { return _id; } + set { _id = string.Intern(value); } } [JsonPropertyName("nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } [JsonPropertyName("rating")] - public double? Rating - { - get; - set; - } + public double? Rating { get; set; } [JsonPropertyName("memberType")] - public MemberCategory? MemberType - { - get; - set; - } + public MemberCategory? MemberType { get; set; } [JsonPropertyName("selectedMemberCategory")] - public MemberCategory? SelectedMemberCategory - { - get; - set; - } + public MemberCategory? SelectedMemberCategory { get; set; } [JsonPropertyName("avatar")] - public string? Avatar - { - get; - set; - } + public string? Avatar { get; set; } [JsonPropertyName("isRatingGrowing")] - public bool? IsRatingGrowing - { - get; - set; - } + public bool? IsRatingGrowing { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } } public record SellResult @@ -303,16 +167,8 @@ public record SellResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("sellTime")] - public long? SellTime - { - get; - set; - } + public long? SellTime { get; set; } [JsonPropertyName("amount")] - public int? Amount - { - get; - set; - } + public int? Amount { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RemoveOfferRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RemoveOfferRequestData.cs index 06cf4b35..29718686 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RemoveOfferRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/RemoveOfferRequestData.cs @@ -9,9 +9,5 @@ public record RemoveOfferRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("offerId")] - public string? OfferId - { - get; - set; - } + public string? OfferId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SearchRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SearchRequestData.cs index 63e3beb2..15147ed6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SearchRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SearchRequestData.cs @@ -10,173 +10,81 @@ public record SearchRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("page")] - public int? Page - { - get; - set; - } + public int? Page { get; set; } [JsonPropertyName("limit")] - public int? Limit - { - get; - set; - } + public int? Limit { get; set; } [JsonPropertyName("sortType")] - public RagfairSort? SortType - { - get; - set; - } + public RagfairSort? SortType { get; set; } [JsonPropertyName("sortDirection")] - public int? SortDirection - { - get; - set; - } + public int? SortDirection { get; set; } [JsonPropertyName("currency")] - public int? Currency - { - get; - set; - } + public int? Currency { get; set; } [JsonPropertyName("priceFrom")] - public int? PriceFrom - { - get; - set; - } + public int? PriceFrom { get; set; } [JsonPropertyName("priceTo")] - public int? PriceTo - { - get; - set; - } + public int? PriceTo { get; set; } [JsonPropertyName("quantityFrom")] - public int? QuantityFrom - { - get; - set; - } + public int? QuantityFrom { get; set; } [JsonPropertyName("quantityTo")] - public int? QuantityTo - { - get; - set; - } + public int? QuantityTo { get; set; } [JsonPropertyName("conditionFrom")] - public int? ConditionFrom - { - get; - set; - } + public int? ConditionFrom { get; set; } [JsonPropertyName("conditionTo")] - public int? ConditionTo - { - get; - set; - } + public int? ConditionTo { get; set; } [JsonPropertyName("oneHourExpiration")] - public bool? OneHourExpiration - { - get; - set; - } + public bool? OneHourExpiration { get; set; } [JsonPropertyName("removeBartering")] - public bool? RemoveBartering - { - get; - set; - } + public bool? RemoveBartering { get; set; } [JsonPropertyName("offerOwnerType")] - public OfferOwnerType? OfferOwnerType - { - get; - set; - } + public OfferOwnerType? OfferOwnerType { get; set; } /// /// 'Only Operational' /// [JsonPropertyName("onlyFunctional")] - public bool? OnlyFunctional - { - get; - set; - } + public bool? OnlyFunctional { get; set; } [JsonPropertyName("updateOfferCount")] - public bool? UpdateOfferCount - { - get; - set; - } + public bool? UpdateOfferCount { get; set; } [JsonPropertyName("handbookId")] - public string? HandbookId - { - get; - set; - } + public string? HandbookId { get; set; } [JsonPropertyName("linkedSearchId")] - public string? LinkedSearchId - { - get; - set; - } + public string? LinkedSearchId { get; set; } [JsonPropertyName("neededSearchId")] - public string? NeededSearchId - { - get; - set; - } + public string? NeededSearchId { get; set; } [JsonPropertyName("buildItems")] - public Dictionary? BuildItems - { - get; - set; - } + public Dictionary? BuildItems { get; set; } [JsonPropertyName("buildCount")] - public int? BuildCount - { - get; - set; - } + public int? BuildCount { get; set; } [JsonPropertyName("tm")] - public int? Tm - { - get; - set; - } + public int? Tm { get; set; } [JsonPropertyName("reload")] - public int? Reload - { - get; - set; - } + public int? Reload { get; set; } } public enum OfferOwnerType { ANYOWNERTYPE = 0, TRADEROWNERTYPE = 1, - PLAYEROWNERTYPE = 2 + PLAYEROWNERTYPE = 2, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SendRagfairReportRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SendRagfairReportRequestData.cs index 71342cda..610e88a1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SendRagfairReportRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/SendRagfairReportRequestData.cs @@ -8,9 +8,5 @@ public record SendRagfairReportRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("offerId")] - public int? OfferId - { - get; - set; - } + public int? OfferId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/StorePlayerOfferTaxAmountRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/StorePlayerOfferTaxAmountRequestData.cs index a0761e0a..e90231fe 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/StorePlayerOfferTaxAmountRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ragfair/StorePlayerOfferTaxAmountRequestData.cs @@ -9,30 +9,14 @@ public record StorePlayerOfferTaxAmountRequestData : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("fee")] - public double? Fee - { - get; - set; - } + public double? Fee { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/BaseRepairActionDataRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/BaseRepairActionDataRequest.cs index 9e364867..8fe2bf21 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/BaseRepairActionDataRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/BaseRepairActionDataRequest.cs @@ -8,9 +8,5 @@ public record BaseRepairActionDataRequest public Dictionary ExtensionData { get; set; } [JsonPropertyName("Action")] - public string? Action - { - get; - set; - } + public string? Action { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/RepairActionDataRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/RepairActionDataRequest.cs index 5a491e8e..d90452b5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/RepairActionDataRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/RepairActionDataRequest.cs @@ -9,21 +9,13 @@ public record RepairActionDataRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("repairKitsInfo")] - public List? RepairKitsInfo - { - get; - set; - } + public List? RepairKitsInfo { get; set; } /// /// item to repair /// [JsonPropertyName("target")] - public string? Target - { - get; - set; - } + public string? Target { get; set; } } public record RepairKitsInfo @@ -35,19 +27,11 @@ public record RepairKitsInfo /// id of repair kit to use /// [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } /// /// amount of units to reduce kit by /// [JsonPropertyName("count")] - public float? Count - { - get; - set; - } + public float? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/TraderRepairActionDataRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/TraderRepairActionDataRequest.cs index 8edc05f8..a7bd2cae 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/TraderRepairActionDataRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Repair/TraderRepairActionDataRequest.cs @@ -9,18 +9,10 @@ public record TraderRepairActionDataRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("tid")] - public string? TId - { - get; - set; - } + public string? TId { get; set; } [JsonPropertyName("repairItems")] - public List? RepairItems - { - get; - set; - } + public List? RepairItems { get; set; } } public record RepairItem @@ -29,16 +21,8 @@ public record RepairItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("count")] - public double? Count - { - get; - set; - } + public double? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBaseTradeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBaseTradeRequestData.cs index b57366bd..ff926847 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBaseTradeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBaseTradeRequestData.cs @@ -9,16 +9,8 @@ public record ProcessBaseTradeRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("tid")] - public string? TransactionId - { - get; - set; - } + public string? TransactionId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBuyTradeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBuyTradeRequestData.cs index 56f9c9de..6432180e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBuyTradeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessBuyTradeRequestData.cs @@ -6,33 +6,17 @@ namespace SPTarkov.Server.Core.Models.Eft.Trade; public record ProcessBuyTradeRequestData : ProcessBaseTradeRequestData { [JsonPropertyName("item_id")] - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("scheme_id")] - public int? SchemeId - { - get; - set; - } + public int? SchemeId { get; set; } /// /// Id of stack to take money from, is money tpl when Action is `SptInsure` /// [JsonPropertyName("scheme_items")] - public List? SchemeItems - { - get; - set; - } + public List? SchemeItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessRagfairTradeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessRagfairTradeRequestData.cs index 67d3e20d..dc116bfa 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessRagfairTradeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessRagfairTradeRequestData.cs @@ -10,11 +10,7 @@ public record ProcessRagfairTradeRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("offers")] - public List? Offers - { - get; - set; - } + public List? Offers { get; set; } } public record OfferRequest @@ -23,23 +19,11 @@ public record OfferRequest public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessSellTradeRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessSellTradeRequestData.cs index 13bc59ac..cc30f7a3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessSellTradeRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/ProcessSellTradeRequestData.cs @@ -5,18 +5,10 @@ namespace SPTarkov.Server.Core.Models.Eft.Trade; public record ProcessSellTradeRequestData : ProcessBaseTradeRequestData { [JsonPropertyName("price")] - public double? Price - { - get; - set; - } + public double? Price { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } public record SoldItem @@ -25,23 +17,11 @@ public record SoldItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("scheme_id")] - public int? SchemeId - { - get; - set; - } + public int? SchemeId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/SellScavItemsToFenceRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/SellScavItemsToFenceRequestData.cs index 19a18f3e..0c10e643 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/SellScavItemsToFenceRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Trade/SellScavItemsToFenceRequestData.cs @@ -9,9 +9,5 @@ public record SellScavItemsToFenceRequestData : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("totalValue")] - public double? TotalValue - { - get; - set; - } + public double? TotalValue { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Weather/WeatherData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Weather/WeatherData.cs index 5d49a9fa..599f3d00 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Weather/WeatherData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Weather/WeatherData.cs @@ -9,39 +9,19 @@ public record WeatherData public Dictionary ExtensionData { get; set; } [JsonPropertyName("acceleration")] - public double? Acceleration - { - get; - set; - } + public double? Acceleration { get; set; } [JsonPropertyName("time")] - public string? Time - { - get; - set; - } + public string? Time { get; set; } [JsonPropertyName("date")] - public string? Date - { - get; - set; - } + public string? Date { get; set; } [JsonPropertyName("weather")] - public Weather? Weather - { - get; - set; - } + public Weather? Weather { get; set; } [JsonPropertyName("season")] - public Season? Season - { - get; - set; - } + public Season? Season { get; set; } } public record Weather @@ -50,99 +30,47 @@ public record Weather public Dictionary ExtensionData { get; set; } [JsonPropertyName("pressure")] - public double? Pressure - { - get; - set; - } + public double? Pressure { get; set; } [JsonPropertyName("temp")] - public double? Temperature - { - get; - set; - } + public double? Temperature { get; set; } [JsonPropertyName("fog")] - public double? Fog - { - get; - set; - } + public double? Fog { get; set; } [JsonPropertyName("rain_intensity")] - public double? RainIntensity - { - get; - set; - } + public double? RainIntensity { get; set; } /// /// 1 - 3 light rain, 3+ 'rain' /// [JsonPropertyName("rain")] - public double? Rain - { - get; - set; - } + public double? Rain { get; set; } [JsonPropertyName("wind_gustiness")] - public double? WindGustiness - { - get; - set; - } + public double? WindGustiness { get; set; } [JsonPropertyName("wind_direction")] - public WindDirection? WindDirection - { - get; - set; - } + public WindDirection? WindDirection { get; set; } [JsonPropertyName("wind_speed")] - public double? WindSpeed - { - get; - set; - } + public double? WindSpeed { get; set; } /// /// < -0.4 = clear day /// [JsonPropertyName("cloud")] - public double? Cloud - { - get; - set; - } + public double? Cloud { get; set; } [JsonPropertyName("time")] - public string? Time - { - get; - set; - } + public string? Time { get; set; } [JsonPropertyName("date")] - public string? Date - { - get; - set; - } + public string? Date { get; set; } [JsonPropertyName("timestamp")] - public long? Timestamp - { - get; - set; - } + public long? Timestamp { get; set; } [JsonPropertyName("sptInRaidTimestamp")] - public long? SptInRaidTimestamp - { - get; - set; - } + public long? SptInRaidTimestamp { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/AddToWishlistRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/AddToWishlistRequest.cs index 9ecfbffc..01545f55 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/AddToWishlistRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/AddToWishlistRequest.cs @@ -9,9 +9,5 @@ public record AddToWishlistRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public Dictionary? Items - { - get; - set; - } + public Dictionary? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/ChangeWishlistItemCategoryRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/ChangeWishlistItemCategoryRequest.cs index ad843550..21f96816 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/ChangeWishlistItemCategoryRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/ChangeWishlistItemCategoryRequest.cs @@ -9,16 +9,8 @@ public record ChangeWishlistItemCategoryRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public string? Item - { - get; - set; - } + public string? Item { get; set; } [JsonPropertyName("category")] - public int? Category - { - get; - set; - } + public int? Category { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/RemoveFromWishlistRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/RemoveFromWishlistRequest.cs index d1c04fc3..9f84599b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/RemoveFromWishlistRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Wishlist/RemoveFromWishlistRequest.cs @@ -9,9 +9,5 @@ public record RemoveFromWishlistRequest : InventoryBaseActionRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/NotificationEventType.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/NotificationEventType.cs index 3a3a5ad1..f6156ce4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/NotificationEventType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/NotificationEventType.cs @@ -77,5 +77,5 @@ public enum NotificationEventType arenaCustomGameCountdownCanceled, arenaCustomGameTeamNameChanged, arenaCustomGameNewOwnerAppointed, - arenaAchievementObtain + arenaAchievementObtain, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAid.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAid.cs index 6a24fc20..bb04492c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAid.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAid.cs @@ -5,9 +5,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsAid : WsNotificationEvent { [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAidNickname.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAidNickname.cs index f60ec53a..b2cd07f1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAidNickname.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsAidNickname.cs @@ -5,16 +5,8 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsAidNickname : WsNotificationEvent { [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsChatMessageReceived.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsChatMessageReceived.cs index 513bac36..798f1d6f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsChatMessageReceived.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsChatMessageReceived.cs @@ -7,23 +7,11 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsChatMessageReceived : WsNotificationEvent { [JsonPropertyName("dialogId")] - public string? DialogId - { - get; - set; - } + public string? DialogId { get; set; } [JsonPropertyName("message")] - public Message? Message - { - get; - set; - } + public Message? Message { get; set; } [JsonPropertyName("profiles")] - public List? Profiles - { - get; - set; - } + public List? Profiles { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsFriendListAccept.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsFriendListAccept.cs index 801bd8be..66e741c3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsFriendListAccept.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsFriendListAccept.cs @@ -6,9 +6,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsFriendsListAccept : WsNotificationEvent { [JsonPropertyName("profile")] - public SearchFriendResponse? Profile - { - get; - set; - } + public SearchFriendResponse? Profile { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupId.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupId.cs index d60783d1..6da4c283 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupId.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupId.cs @@ -5,9 +5,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupId : WsNotificationEvent { [JsonPropertyName("groupId")] - public string? GroupId - { - get; - set; - } + public string? GroupId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteAccept.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteAccept.cs index ab1eb93b..bb6c635c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteAccept.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteAccept.cs @@ -7,58 +7,26 @@ public record WsGroupMatchInviteAccept : WsNotificationEvent // TODO: trying to { // Copy pasted properties from GroupCharacter to resolve multitype [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Info")] - public CharacterInfo? Info - { - get; - set; - } + public CharacterInfo? Info { get; set; } [JsonPropertyName("PlayerVisualRepresentation")] - public PlayerVisualRepresentation? VisualRepresentation - { - get; - set; - } + public PlayerVisualRepresentation? VisualRepresentation { get; set; } [JsonPropertyName("isLeader")] - public bool? IsLeader - { - get; - set; - } + public bool? IsLeader { get; set; } [JsonPropertyName("isReady")] - public bool? IsReady - { - get; - set; - } + public bool? IsReady { get; set; } [JsonPropertyName("region")] - public string? Region - { - get; - set; - } + public string? Region { get; set; } [JsonPropertyName("lookingGroup")] - public bool? LookingGroup - { - get; - set; - } + public bool? LookingGroup { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteDecline.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteDecline.cs index 1198107b..97ab0287 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteDecline.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteDecline.cs @@ -5,16 +5,8 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupMatchInviteDecline : WsNotificationEvent { [JsonPropertyName("aid")] - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } [JsonPropertyName("Nickname")] - public string? Nickname - { - get; - set; - } + public string? Nickname { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteSend.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteSend.cs index 214b6c9a..4baf9462 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteSend.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchInviteSend.cs @@ -6,23 +6,11 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupMatchInviteSend : WsNotificationEvent { [JsonPropertyName("requestId")] - public string? RequestId - { - get; - set; - } + public string? RequestId { get; set; } [JsonPropertyName("from")] - public int? From - { - get; - set; - } + public int? From { get; set; } [JsonPropertyName("members")] - public List? Members - { - get; - set; - } + public List? Members { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchLeaderChanged.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchLeaderChanged.cs index 59df9f82..19202405 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchLeaderChanged.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchLeaderChanged.cs @@ -5,9 +5,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupMatchLeaderChanged : WsNotificationEvent { [JsonPropertyName("owner")] - public int? Owner - { - get; - set; - } + public int? Owner { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidReady.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidReady.cs index 31ff270c..b8dd0e02 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidReady.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidReady.cs @@ -6,9 +6,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupMatchRaidReady : WsNotificationEvent { [JsonPropertyName("extendedProfile")] - public GroupCharacter? ExtendedProfile - { - get; - set; - } + public GroupCharacter? ExtendedProfile { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidSettings.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidSettings.cs index 3227b72c..0f4190d5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidSettings.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsGroupMatchRaidSettings.cs @@ -6,9 +6,5 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsGroupMatchRaidSettings : WsNotificationEvent { [JsonPropertyName("raidSettings")] - public RaidSettings? RaidSettings - { - get; - set; - } + public RaidSettings? RaidSettings { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationEvent.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationEvent.cs index 326c905a..cd5a839e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationEvent.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationEvent.cs @@ -9,16 +9,8 @@ public record WsNotificationEvent [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public NotificationEventType? EventType - { - get; - set; - } + public NotificationEventType? EventType { get; set; } [JsonPropertyName("eventId")] - public string? EventIdentifier - { - get; - set; - } + public string? EventIdentifier { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairNewRating.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairNewRating.cs index abc61161..2867a089 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairNewRating.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairNewRating.cs @@ -5,18 +5,9 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws public record WsRagfairNewRating : WsNotificationEvent { [JsonPropertyName("rating")] - public double? Rating - { - get; - set; - } + public double? Rating { get; set; } [JsonPropertyName("isRatingGrowing")] - public bool? IsRatingGrowing - { - get; - set; - } - + public bool? IsRatingGrowing { get; set; } } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairOfferSold.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairOfferSold.cs index e7d93b3f..7631b7b0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairOfferSold.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsRagfairOfferSold.cs @@ -5,23 +5,11 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsRagfairOfferSold : WsNotificationEvent { [JsonPropertyName("offerId")] - public string? OfferId - { - get; - set; - } + public string? OfferId { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } [JsonPropertyName("handbookId")] - public string? HandbookId - { - get; - set; - } + public string? HandbookId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsUserConfirmed.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsUserConfirmed.cs index be7c9cf3..b3491f58 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsUserConfirmed.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsUserConfirmed.cs @@ -6,86 +6,38 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsUserConfirmed : WsNotificationEvent { [JsonPropertyName("profileid")] - public string? ProfileId - { - get; - set; - } + public string? ProfileId { get; set; } [JsonPropertyName("profileToken")] - public string? ProfileToken - { - get; - set; - } + public string? ProfileToken { get; set; } [JsonPropertyName("status")] - public ProfileStatus? Status - { - get; - set; - } + public ProfileStatus? Status { get; set; } [JsonPropertyName("ip")] - public string? Ip - { - get; - set; - } + public string? Ip { get; set; } [JsonPropertyName("port")] - public int? Port - { - get; - set; - } + public int? Port { get; set; } [JsonPropertyName("sid")] - public string? Sid - { - get; - set; - } + public string? Sid { get; set; } [JsonPropertyName("version")] - public string? Version - { - get; - set; - } + public string? Version { get; set; } [JsonPropertyName("location")] - public string? Location - { - get; - set; - } + public string? Location { get; set; } [JsonPropertyName("raidMode")] - public RaidMode? RaidMode - { - get; - set; - } + public RaidMode? RaidMode { get; set; } [JsonPropertyName("mode")] - public string? Mode - { - get; - set; - } + public string? Mode { get; set; } [JsonPropertyName("shortId")] - public string? ShortId - { - get; - set; - } + public string? ShortId { get; set; } [JsonPropertyName("additional_info")] - public List? AdditionalInfo - { - get; - set; - } // TODO: Was `any` in the node server. + public List? AdditionalInfo { get; set; } // TODO: Was `any` in the node server. } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/AccountTypes.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/AccountTypes.cs index 4dbdd596..de941844 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/AccountTypes.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/AccountTypes.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Enums; public record AccountTypes diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/AirdropType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/AirdropType.cs index e5400fd0..50e7c1db 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/AirdropType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/AirdropType.cs @@ -7,7 +7,7 @@ public enum AirdropTypeEnum Common, Supply, Medical, - Weapon + Weapon, } [EftEnumConverter] @@ -18,5 +18,5 @@ public enum SptAirdropTypeEnum foodMedical, weaponArmor, radar, - toiletPaper + toiletPaper, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ArmorMaterial.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ArmorMaterial.cs index c9a7dabb..61d78c0f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ArmorMaterial.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ArmorMaterial.cs @@ -12,5 +12,5 @@ public enum ArmorMaterial Aluminium, ArmoredSteel, Ceramic, - Glass + Glass, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/BackendErrorCodes.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/BackendErrorCodes.cs index 9361d621..adcc95a6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/BackendErrorCodes.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/BackendErrorCodes.cs @@ -90,5 +90,5 @@ public enum BackendErrorCodes PlayerInRaid, LimitForPresetsReached = 504001, PlayerProfileNotFound = 505001, - NoArenaSync = 507006 + NoArenaSync = 507006, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/BodyPartColliderType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/BodyPartColliderType.cs index 1bddcfe8..0d488411 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/BodyPartColliderType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/BodyPartColliderType.cs @@ -31,5 +31,5 @@ public enum BodyPartColliderType PelvisBack, RightSideChestDown, LeftSideChestDown, - RibcageLow + RibcageLow, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/BonusSkillType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/BonusSkillType.cs index 2122a5e0..1186ab95 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/BonusSkillType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/BonusSkillType.cs @@ -9,5 +9,5 @@ public enum BonusSkillType Combat, Special, Practical, - Mental + Mental, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/BonusType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/BonusType.cs index 3c5a9610..fed75166 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/BonusType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/BonusType.cs @@ -32,5 +32,5 @@ public enum BonusType MaximumEnergyReserve, TextBonus, SkillGroupLevelingBoost, - StashRows + StashRows, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/BuffType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/BuffType.cs index 3519559d..007e8892 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/BuffType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/BuffType.cs @@ -10,5 +10,5 @@ public enum BuffType MalfunctionProtections, WeaponDamage, ArmorEfficiency, - DurabilityImprovement + DurabilityImprovement, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ConfigTypes.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ConfigTypes.cs index 6cc5f2d3..4b065c1d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ConfigTypes.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ConfigTypes.cs @@ -36,7 +36,7 @@ public static class ConfigTypesExtension ConfigTypes.SEASONAL_EVENT => "spt-seasonalevents", ConfigTypes.LOST_ON_DEATH => "spt-lostondeath", ConfigTypes.GIFTS => "spt-gifts", - _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) + _ => throw new ArgumentOutOfRangeException(nameof(type), type, null), }; } @@ -72,7 +72,7 @@ public static class ConfigTypesExtension ConfigTypes.SEASONAL_EVENT => typeof(SeasonalEventConfig), ConfigTypes.LOST_ON_DEATH => typeof(LostOnDeathConfig), ConfigTypes.GIFTS => typeof(GiftsConfig), - _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) + _ => throw new ArgumentOutOfRangeException(nameof(type), type, null), }; } } @@ -106,5 +106,5 @@ public enum ConfigTypes WEATHER, SEASONAL_EVENT, LOST_ON_DEATH, - GIFTS + GIFTS, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/CurrencyType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/CurrencyType.cs index d093381b..82e457ca 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/CurrencyType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/CurrencyType.cs @@ -8,5 +8,5 @@ public enum CurrencyType RUB, USD, EUR, - GP + GP, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/DamageEffectType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/DamageEffectType.cs index e8b18b1e..4db22db0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/DamageEffectType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/DamageEffectType.cs @@ -13,5 +13,5 @@ public enum DamageEffectType LethalIntoxication, RadExposure, Pain, - DestroyedPart + DestroyedPart, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/DamageType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/DamageType.cs index efab4467..5d7ab242 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/DamageType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/DamageType.cs @@ -29,5 +29,5 @@ public enum DamageType LethalToxin = 2097152, Btr = 4194304, Artillery = 8388608, - Environment = 16777216 + Environment = 16777216, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/DateTimeEnum.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/DateTimeEnum.cs index 4efebd98..856a22e4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/DateTimeEnum.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/DateTimeEnum.cs @@ -6,5 +6,5 @@ namespace SPTarkov.Server.Core.Models.Enums; public enum DateTimeEnum { CURR, - PAST + PAST, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagExchangeSide.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagExchangeSide.cs index 71e8342c..e54a91a2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagExchangeSide.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagExchangeSide.cs @@ -4,5 +4,5 @@ public enum DogtagExchangeSide { Usec, Bear, - Any + Any, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagSide.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagSide.cs index d94e0717..c5246d74 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagSide.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/DogtagSide.cs @@ -8,5 +8,5 @@ public enum DogtagSide NotApplicable, Usec, - Bear + Bear, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ELocationName.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ELocationName.cs index c9b53df7..210cebd9 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ELocationName.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ELocationName.cs @@ -14,5 +14,5 @@ public enum ELocationName RezervBase, TarkovStreets, Labyrinth, - any + any, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/EntryType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/EntryType.cs index da7a8b5d..49e9b723 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/EntryType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/EntryType.cs @@ -6,5 +6,5 @@ public enum EntryType DEBUG, RELEASE, BLEEDING_EDGE, - BLEEDING_EDGE_MODS + BLEEDING_EDGE_MODS, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentBuildType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentBuildType.cs index 7f509d4c..20da03e7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentBuildType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentBuildType.cs @@ -4,5 +4,5 @@ public enum EquipmentBuildType { Custom, Standard, - Storage + Storage, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentSlots.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentSlots.cs index 2d3edff2..6f90cfd3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentSlots.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/EquipmentSlots.cs @@ -19,5 +19,5 @@ public enum EquipmentSlots FirstPrimaryWeapon, SecondPrimaryWeapon, Holster, - Scabbard + Scabbard, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/EventType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/EventType.cs index 01f8a990..6dc712ae 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/EventType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/EventType.cs @@ -8,5 +8,5 @@ public enum EventType None, Halloween, Christmas, - HalloweenIllumination + HalloweenIllumination, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ExfiltrationType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ExfiltrationType.cs index 50d98214..6a49a4e1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ExfiltrationType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ExfiltrationType.cs @@ -7,5 +7,5 @@ public enum ExfiltrationType { Individual, SharedTimer, - Manual + Manual, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ExitStatus.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ExitStatus.cs index f084521c..e02b0e86 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ExitStatus.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ExitStatus.cs @@ -10,5 +10,5 @@ public enum ExitStatus LEFT, RUNNER, MISSINGINACTION, - TRANSIT + TRANSIT, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/FleaOfferType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/FleaOfferType.cs index f524d44c..d4ef99ce 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/FleaOfferType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/FleaOfferType.cs @@ -5,5 +5,5 @@ public enum FleaOfferType SINGLE = 0, MULTI = 1, PACK = 2, - UNKNOWN = 3 + UNKNOWN = 3, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/GameEditions.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/GameEditions.cs index 0e0d93ab..2b671811 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/GameEditions.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/GameEditions.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Enums; public record GameEditions diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSenderType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSenderType.cs index 93bf8cfa..4abb4117 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSenderType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSenderType.cs @@ -7,5 +7,5 @@ public enum GiftSenderType { System, Trader, - User + User, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSentResult.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSentResult.cs index f1be3ae2..19aa7578 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSentResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/GiftSentResult.cs @@ -5,5 +5,5 @@ public enum GiftSentResult FAILED_UNKNOWN = 1, FAILED_GIFT_ALREADY_RECEIVED = 2, FAILED_GIFT_DOESNT_EXIST = 3, - SUCCESS = 4 + SUCCESS = 4, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/HealthFactor.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/HealthFactor.cs index 44398910..d57109aa 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/HealthFactor.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/HealthFactor.cs @@ -9,5 +9,5 @@ public enum HealthFactor Radiation, Temperature, Poisoning, - Effect + Effect, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/CircleRewardType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/CircleRewardType.cs index 5c39a1c4..7b5c2fac 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/CircleRewardType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/CircleRewardType.cs @@ -3,5 +3,5 @@ namespace SPTarkov.Server.Core.Models.Enums.Hideout; public enum CircleRewardType { RANDOM = 0, - HIDEOUT_TASK = 1 + HIDEOUT_TASK = 1, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteActivityType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteActivityType.cs index 1756afa4..a56e04c1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteActivityType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteActivityType.cs @@ -2,5 +2,5 @@ namespace SPTarkov.Server.Core.Models.Enums.Hideout; public enum QteActivityType { - GYM = 0 + GYM = 0, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteEffectType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteEffectType.cs index 5709d4d3..d0362c05 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteEffectType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteEffectType.cs @@ -4,5 +4,5 @@ public enum QteEffectType { finishEffect, singleSuccessEffect, - singleFailEffect + singleFailEffect, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteResultType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteResultType.cs index 3926c8fe..61bbf12b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteResultType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteResultType.cs @@ -3,5 +3,5 @@ namespace SPTarkov.Server.Core.Models.Enums.Hideout; public enum QteResultType { None, - Exit + Exit, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteRewardType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteRewardType.cs index 479a43c7..a481436c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteRewardType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteRewardType.cs @@ -5,5 +5,5 @@ public enum QteRewardType Skill, HealthEffect, MusclePain, - GymArmTrauma + GymArmTrauma, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteType.cs index ad8574ca..20391017 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/QteType.cs @@ -2,5 +2,5 @@ namespace SPTarkov.Server.Core.Models.Enums.Hideout; public enum QteType { - ShrinkingCircle + ShrinkingCircle, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/RequirementType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/RequirementType.cs index 10f0b42b..7b265f30 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/RequirementType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Hideout/RequirementType.cs @@ -11,5 +11,5 @@ public enum RequirementType Tool, QuestComplete, Health, - BodyPartBuff + BodyPartBuff, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutAreas.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutAreas.cs index 86c5aa2b..a3a259cc 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutAreas.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutAreas.cs @@ -30,5 +30,5 @@ public enum HideoutAreas WeaponStand, WeaponStandSecondary, EquipmentPresetsStand, - CircleOfCultists + CircleOfCultists, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutEventActions.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutEventActions.cs index 7b2912fd..ec172d8a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutEventActions.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/HideoutEventActions.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Enums; public record HideoutEventActions @@ -18,8 +19,10 @@ public record HideoutEventActions public const string HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints"; public const string HIDEOUT_IMPROVE_AREA = "HideoutImproveArea"; public const string HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand"; - public const string HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = "HideoutCircleOfCultistProductionStart"; + public const string HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = + "HideoutCircleOfCultistProductionStart"; public const string HIDEOUT_DELETE_PRODUCTION_COMMAND = "HideoutDeleteProductionCommand"; public const string HIDEOUT_CUSTOMIZATION_APPLY_COMMAND = "HideoutCustomizationApply"; - public const string HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE = "HideoutCustomizationSetMannequinPose"; + public const string HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE = + "HideoutCustomizationSetMannequinPose"; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemAddedResult.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemAddedResult.cs index 045db3c5..5a546c7e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemAddedResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemAddedResult.cs @@ -6,5 +6,5 @@ public enum ItemAddedResult SUCCESS = 1, NO_SPACE = 2, NO_CONTAINERS = 3, - INCOMPATIBLE_ITEM = 4 + INCOMPATIBLE_ITEM = 4, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemDropSoundType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemDropSoundType.cs index 35142248..0af260e7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemDropSoundType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemDropSoundType.cs @@ -5,5 +5,5 @@ public enum ItemDropSoundType None, Pistol, SubMachineGun, - Rifle + Rifle, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemEventActions.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemEventActions.cs index f89f8170..dfe7dd5e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemEventActions.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemEventActions.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Enums; public record ItemEventActions diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemTpl.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemTpl.cs index 0f128f8a..9cd1c6c3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ItemTpl.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ItemTpl.cs @@ -457,14 +457,18 @@ public static class ItemTpl public const string ARMOR_HIGHCOM_TROOPER_TFO_BODY_ARMOR_COYOTE = "67ab2f94dafe3b22670c912c"; public const string ARMOR_HIGHCOM_TROOPER_TFO_BODY_ARMOR_MULTICAM = "5c0e655586f774045612eeb2"; public const string ARMOR_INTERCEPTOR_OTV_BODY_ARMOR_UCP = "64abd93857958b4249003418"; - public const string ARMOR_IOTV_GEN4_BODY_ARMOR_ASSAULT_KIT_MULTICAM = "5b44cf1486f77431723e3d05"; - public const string ARMOR_IOTV_GEN4_BODY_ARMOR_FULL_PROTECTION_KIT_MULTICAM = "5b44cd8b86f774503d30cba2"; - public const string ARMOR_IOTV_GEN4_BODY_ARMOR_HIGH_MOBILITY_KIT_MULTICAM = "5b44d0de86f774503d30cba8"; + public const string ARMOR_IOTV_GEN4_BODY_ARMOR_ASSAULT_KIT_MULTICAM = + "5b44cf1486f77431723e3d05"; + public const string ARMOR_IOTV_GEN4_BODY_ARMOR_FULL_PROTECTION_KIT_MULTICAM = + "5b44cd8b86f774503d30cba2"; + public const string ARMOR_IOTV_GEN4_BODY_ARMOR_HIGH_MOBILITY_KIT_MULTICAM = + "5b44d0de86f774503d30cba8"; public const string ARMOR_LBT6094A_SLICK_PLATE_CARRIER_BLACK = "5e4abb5086f77406975c9342"; public const string ARMOR_LBT6094A_SLICK_PLATE_CARRIER_COYOTE_TAN = "6038b4b292ec1c3103795a0b"; public const string ARMOR_LBT6094A_SLICK_PLATE_CARRIER_OLIVE_DRAB = "6038b4ca92ec1c3103795a0d"; public const string ARMOR_MFUNTAR_BODY = "5ab8e4ed86f7742d8e50c7fa"; - public const string ARMOR_NFM_THOR_CONCEALABLE_REINFORCED_VEST_BODY = "609e8540d5c319764c2bc2e9"; + public const string ARMOR_NFM_THOR_CONCEALABLE_REINFORCED_VEST_BODY = + "609e8540d5c319764c2bc2e9"; public const string ARMOR_NFM_THOR_INTEGRATED_CARRIER_BODY = "60a283193cb70855c43a381d"; public const string ARMOR_NPP_KLASS_KORAKULON_BODY_ARMOR_BLACK = "64be79c487d1510151095552"; public const string ARMOR_NPP_KLASS_KORAKULON_BODY_ARMOR_EMR = "64be79e2bf8412471d0d9bcc"; @@ -474,30 +478,46 @@ public static class ItemTpl public const string ARMOREDEQUIPMENT_ALTYN_HELMET_FACE_SHIELD = "5aa7e373e5b5b000137b76f0"; public const string ARMOREDEQUIPMENT_CRYE_PRECISION_AIRFRAME_CHOPS = "5c178a942e22164bef5ceca3"; public const string ARMOREDEQUIPMENT_CRYE_PRECISION_AIRFRAME_EARS = "5c1793902e221602b21d3de2"; - public const string ARMOREDEQUIPMENT_DIAMOND_AGE_BASTION_HELMET_ARMOR_PLATE = "5ea18c84ecf1982c7712d9a2"; - public const string ARMOREDEQUIPMENT_DIAMOND_AGE_NEOSTEEL_HELMET_BALLISTIC_MANDIBLE = "6570a88c8f221f3b210353b7"; - public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_FIXED_ARM_VISOR = "5f60bf4558eff926626a60f2"; - public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_HYBRID_BALLISTIC_APPLIQUE = "5f60b85bbdb8e27dee3dc985"; - public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_HYBRID_BALLISTIC_MANDIBLE_GUARD = "5f60c076f2bcbb675b00dac2"; + public const string ARMOREDEQUIPMENT_DIAMOND_AGE_BASTION_HELMET_ARMOR_PLATE = + "5ea18c84ecf1982c7712d9a2"; + public const string ARMOREDEQUIPMENT_DIAMOND_AGE_NEOSTEEL_HELMET_BALLISTIC_MANDIBLE = + "6570a88c8f221f3b210353b7"; + public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_FIXED_ARM_VISOR = + "5f60bf4558eff926626a60f2"; + public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_HYBRID_BALLISTIC_APPLIQUE = + "5f60b85bbdb8e27dee3dc985"; + public const string ARMOREDEQUIPMENT_GALVION_CAIMAN_HYBRID_BALLISTIC_MANDIBLE_GUARD = + "5f60c076f2bcbb675b00dac2"; public const string ARMOREDEQUIPMENT_KIVERM_FACE_SHIELD = "5b46238386f7741a693bcf9c"; public const string ARMOREDEQUIPMENT_KOLPAK1S_FACE_SHIELD = "5ac4c50d5acfc40019262e87"; public const string ARMOREDEQUIPMENT_LSHZ2DTM_AVENTAIL = "5d6d3be5a4b9361bc73bc763"; public const string ARMOREDEQUIPMENT_LSHZ2DTM_COVER_BLACK = "5d6d3943a4b9360dbc46d0cc"; public const string ARMOREDEQUIPMENT_LSHZ2DTM_FACE_SHIELD = "5d6d3829a4b9361bc8618943"; - public const string ARMOREDEQUIPMENT_MASKA1SCH_FACE_SHIELD_KILLA_EDITION = "5c0e842486f77443a74d2976"; - public const string ARMOREDEQUIPMENT_MASKA1SCH_FACE_SHIELD_OLIVE_DRAB = "5c0919b50db834001b7ce3b9"; - public const string ARMOREDEQUIPMENT_NPP_KLASS_TOR2_HELMET_FACE_SHIELD = "65719f9ef392ad76c50a2ec8"; - public const string ARMOREDEQUIPMENT_OPSCORE_FAST_GUNSIGHT_MANDIBLE = "5a16ba61fcdbcb098008728a"; - public const string ARMOREDEQUIPMENT_OPSCORE_FAST_MULTIHIT_BALLISTIC_FACE_SHIELD = "5a16b7e1fcdbcb00165aa6c9"; + public const string ARMOREDEQUIPMENT_MASKA1SCH_FACE_SHIELD_KILLA_EDITION = + "5c0e842486f77443a74d2976"; + public const string ARMOREDEQUIPMENT_MASKA1SCH_FACE_SHIELD_OLIVE_DRAB = + "5c0919b50db834001b7ce3b9"; + public const string ARMOREDEQUIPMENT_NPP_KLASS_TOR2_HELMET_FACE_SHIELD = + "65719f9ef392ad76c50a2ec8"; + public const string ARMOREDEQUIPMENT_OPSCORE_FAST_GUNSIGHT_MANDIBLE = + "5a16ba61fcdbcb098008728a"; + public const string ARMOREDEQUIPMENT_OPSCORE_FAST_MULTIHIT_BALLISTIC_FACE_SHIELD = + "5a16b7e1fcdbcb00165aa6c9"; public const string ARMOREDEQUIPMENT_OPSCORE_FAST_SIDE_ARMOR = "5a16badafcdbcb001865f72d"; public const string ARMOREDEQUIPMENT_OPSCORE_FAST_VISOR = "5a16b672fcdbcb001912fa83"; - public const string ARMOREDEQUIPMENT_OPSCORE_SLAAP_ARMOR_HELMET_PLATE_TAN = "5c0e66e2d174af02a96252f4"; + public const string ARMOREDEQUIPMENT_OPSCORE_SLAAP_ARMOR_HELMET_PLATE_TAN = + "5c0e66e2d174af02a96252f4"; public const string ARMOREDEQUIPMENT_RYST_FACE_SHIELD = "5f60c85b58eff926626a60f7"; - public const string ARMOREDEQUIPMENT_TACKEK_HEAVY_TROOPER_MASK_FOR_OPSCORETYPE_HELMETS = "5ea058e01dbce517f324b3e2"; - public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_BALLISTIC_FACE_SHIELD_BLACK = "5e00cdd986f7747473332240"; - public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_BALLISTIC_FACE_SHIELD_COYOTE_BROWN = "5e01f37686f774773c6f6c15"; - public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_EAR_COVERS_BLACK = "5e00cfa786f77469dc6e5685"; - public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_EAR_COVERS_COYOTE_BROWN = "5e01f31d86f77465cf261343"; + public const string ARMOREDEQUIPMENT_TACKEK_HEAVY_TROOPER_MASK_FOR_OPSCORETYPE_HELMETS = + "5ea058e01dbce517f324b3e2"; + public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_BALLISTIC_FACE_SHIELD_BLACK = + "5e00cdd986f7747473332240"; + public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_BALLISTIC_FACE_SHIELD_COYOTE_BROWN = + "5e01f37686f774773c6f6c15"; + public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_EAR_COVERS_BLACK = + "5e00cfa786f77469dc6e5685"; + public const string ARMOREDEQUIPMENT_TEAM_WENDY_EXFIL_EAR_COVERS_COYOTE_BROWN = + "5e01f31d86f77465cf261343"; public const string ARMOREDEQUIPMENT_VULKAN5_HELMET_FACE_SHIELD = "5ca2113f86f7740b2547e1d2"; public const string ARMOREDEQUIPMENT_ZSH12M_FACE_SHIELD = "5aa7e3abe5b5b000171d064d"; public const string ARMORPLATE_6B12_BALLISTIC_PLATES_FRONT = "654a4dea7c17dec2f50cc86a"; @@ -529,32 +549,44 @@ public static class ItemTpl public const string ARMORPLATE_KORUNDVM_BALLISTIC_PLATES_FRONT = "656f664200d62bcd2e024077"; public const string ARMORPLATE_KORUNDVMK_BALLISTIC_PLATE_BACK = "657b28d25f444d6dff0c6c77"; public const string ARMORPLATE_KORUNDVMK_BALLISTIC_PLATES_FRONT = "656f66b5c6baea13cd07e108"; - public const string ARMORPLATE_MONOCLETE_LEVEL_III_PE_BALLISTIC_PLATE = "656fad8c498d1b7e3e071da0"; + public const string ARMORPLATE_MONOCLETE_LEVEL_III_PE_BALLISTIC_PLATE = + "656fad8c498d1b7e3e071da0"; public const string ARMORPLATE_NESCO_4400SAMC_BALLISTIC_PLATE = "656fa61e94b480b8a500c0e8"; - public const string ARMORPLATE_NEWSPHERETECH_LEVEL_III_BALLISTIC_PLATE = "656fb21fa0dce000a2020f7c"; + public const string ARMORPLATE_NEWSPHERETECH_LEVEL_III_BALLISTIC_PLATE = + "656fb21fa0dce000a2020f7c"; public const string ARMORPLATE_PRTCTR_LIGHTWEIGHT_BALLISTIC_PLATE = "656fac30c6baea13cd07e10c"; public const string ARMORPLATE_SAPI_LEVEL_III_BALLISTIC_PLATE = "655746010177119f4a097ff7"; public const string ARMORPLATE_SPRTN_ELAPHROS_BALLISTIC_PLATE = "656fb0bd7c2d57afe200c0dc"; public const string ARMORPLATE_SPRTN_OMEGA_BALLISTIC_PLATE = "656f9fa0498d1b7e3e071d98"; - public const string ARMORPLATE_SSAPI_LEVEL_III_BALLISTIC_PLATE_SIDE = "6557458f83942d705f0c4962"; + public const string ARMORPLATE_SSAPI_LEVEL_III_BALLISTIC_PLATE_SIDE = + "6557458f83942d705f0c4962"; public const string ARMORPLATE_TALLCOM_GUARDIAN_BALLISTIC_PLATE = "656fa53d94b480b8a500c0e4"; public const string ARMORPLATE_ZHUK3_BALLISTIC_PLATE_FRONT = "656f57dc27aed95beb08f628"; - public const string ASSAULTCARBINE_AS_VAL_9X39_SPECIAL_ASSAULT_RIFLE = "57c44b372459772d2b39b8ce"; - public const string ASSAULTCARBINE_KBP_9A91_9X39_COMPACT_ASSAULT_RIFLE = "644674a13d52156624001fbc"; + public const string ASSAULTCARBINE_AS_VAL_9X39_SPECIAL_ASSAULT_RIFLE = + "57c44b372459772d2b39b8ce"; + public const string ASSAULTCARBINE_KBP_9A91_9X39_COMPACT_ASSAULT_RIFLE = + "644674a13d52156624001fbc"; public const string ASSAULTCARBINE_KBP_VSK94_9X39_RIFLE = "645e0c6b3b381ede770e1cc9"; - public const string ASSAULTCARBINE_MOLOT_ARMS_SIMONOV_OPSKS_762X39_CARBINE = "587e02ff24597743df3deaeb"; - public const string ASSAULTCARBINE_MOLOT_ARMS_VPO101_VEPRHUNTER_762X51_CARBINE = "5c501a4d2e221602b412b540"; + public const string ASSAULTCARBINE_MOLOT_ARMS_SIMONOV_OPSKS_762X39_CARBINE = + "587e02ff24597743df3deaeb"; + public const string ASSAULTCARBINE_MOLOT_ARMS_VPO101_VEPRHUNTER_762X51_CARBINE = + "5c501a4d2e221602b412b540"; public const string ASSAULTCARBINE_SR3M_9X39_COMPACT_ASSAULT_RIFLE = "651450ce0e00edc794068371"; - public const string ASSAULTCARBINE_TOKAREV_AVT40_762X54R_AUTOMATIC_RIFLE = "6410733d5dd49d77bd07847e"; + public const string ASSAULTCARBINE_TOKAREV_AVT40_762X54R_AUTOMATIC_RIFLE = + "6410733d5dd49d77bd07847e"; public const string ASSAULTCARBINE_TOKAREV_SVT40_762X54R_RIFLE = "643ea5b23db6f9f57107d9fd"; public const string ASSAULTCARBINE_TOZ_SIMONOV_SKS_762X39_CARBINE = "574d967124597745970e7c94"; public const string ASSAULTRIFLE_ADAR_215_556X45_CARBINE = "5c07c60e0db834002330051f"; - public const string ASSAULTRIFLE_AKLYS_DEFENSE_VELOCIRAPTOR_300_BLACKOUT_ASSAULT_RIFLE = "674d6121c09f69dfb201a888"; + public const string ASSAULTRIFLE_AKLYS_DEFENSE_VELOCIRAPTOR_300_BLACKOUT_ASSAULT_RIFLE = + "674d6121c09f69dfb201a888"; public const string ASSAULTRIFLE_ASH12_127X55_ASSAULT_RIFLE = "5cadfbf7ae92152ac412eeef"; - public const string ASSAULTRIFLE_CMMG_MK47_MUTANT_762X39_ASSAULT_RIFLE = "606587252535c57a13424cfd"; + public const string ASSAULTRIFLE_CMMG_MK47_MUTANT_762X39_ASSAULT_RIFLE = + "606587252535c57a13424cfd"; public const string ASSAULTRIFLE_COLT_M4A1_556X45_ASSAULT_RIFLE = "5447a9cd4bdc2dbd208b4567"; - public const string ASSAULTRIFLE_DESERT_TECH_MDR_556X45_ASSAULT_RIFLE = "5c488a752e221602b412af63"; - public const string ASSAULTRIFLE_DESERT_TECH_MDR_762X51_ASSAULT_RIFLE = "5dcbd56fdbd3d91b3e5468d5"; + public const string ASSAULTRIFLE_DESERT_TECH_MDR_556X45_ASSAULT_RIFLE = + "5c488a752e221602b412af63"; + public const string ASSAULTRIFLE_DESERT_TECH_MDR_762X51_ASSAULT_RIFLE = + "5dcbd56fdbd3d91b3e5468d5"; public const string ASSAULTRIFLE_DS_ARMS_SA58_762X51_ASSAULT_RIFLE = "5b0bbe4e5acfc40dc528a72d"; public const string ASSAULTRIFLE_FN_SCARH_762X51_ASSAULT_RIFLE = "6183afd850224f204c1da514"; public const string ASSAULTRIFLE_FN_SCARH_762X51_ASSAULT_RIFLE_FDE = "6165ac306ef05c2ce828ef74"; @@ -563,57 +595,87 @@ public static class ItemTpl public const string ASSAULTRIFLE_FN_SCARL_556X45_ASSAULT_RIFLE_FDE = "618428466ef05c2ce828f218"; public const string ASSAULTRIFLE_HK_416A5_556X45_ASSAULT_RIFLE = "5bb2475ed4351e00853264e3"; public const string ASSAULTRIFLE_HK_G36_556X45_ASSAULT_RIFLE = "623063e994fc3f7b302a9696"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK101_556X45_ASSAULT_RIFLE = "5ac66cb05acfc40198510a10"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK102_556X45_ASSAULT_RIFLE = "5ac66d015acfc400180ae6e4"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK103_762X39_ASSAULT_RIFLE = "5ac66d2e5acfc43b321d4b53"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK104_762X39_ASSAULT_RIFLE = "5ac66d725acfc43b321d4b60"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK105_545X39_ASSAULT_RIFLE = "5ac66d9b5acfc4001633997a"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK12_545X39_ASSAULT_RIFLE = "6499849fc93611967b034949"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK74_545X39_ASSAULT_RIFLE = "5bf3e03b0db834001d2c4a9c"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK74M_545X39_ASSAULT_RIFLE = "5ac4cd105acfc40016339859"; - public const string ASSAULTRIFLE_KALASHNIKOV_AK74N_545X39_ASSAULT_RIFLE = "5644bd2b4bdc2d3b4c8b4572"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKM_762X39_ASSAULT_RIFLE = "59d6088586f774275f37482f"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKMN_762X39_ASSAULT_RIFLE = "5a0ec13bfcdbcb00165aa685"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKMS_762X39_ASSAULT_RIFLE = "59ff346386f77477562ff5e2"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKMSN_762X39_ASSAULT_RIFLE = "5abcbc27d8ce8700182eceeb"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKS74_545X39_ASSAULT_RIFLE = "5bf3e0490db83400196199af"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKS74N_545X39_ASSAULT_RIFLE = "5ab8e9fcd8ce870019439434"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKS74U_545X39_ASSAULT_RIFLE = "57dc2fa62459775949412633"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKS74UB_545X39_ASSAULT_RIFLE = "5839a40f24597726f856b511"; - public const string ASSAULTRIFLE_KALASHNIKOV_AKS74UN_545X39_ASSAULT_RIFLE = "583990e32459771419544dd2"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK101_556X45_ASSAULT_RIFLE = + "5ac66cb05acfc40198510a10"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK102_556X45_ASSAULT_RIFLE = + "5ac66d015acfc400180ae6e4"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK103_762X39_ASSAULT_RIFLE = + "5ac66d2e5acfc43b321d4b53"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK104_762X39_ASSAULT_RIFLE = + "5ac66d725acfc43b321d4b60"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK105_545X39_ASSAULT_RIFLE = + "5ac66d9b5acfc4001633997a"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK12_545X39_ASSAULT_RIFLE = + "6499849fc93611967b034949"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK74_545X39_ASSAULT_RIFLE = + "5bf3e03b0db834001d2c4a9c"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK74M_545X39_ASSAULT_RIFLE = + "5ac4cd105acfc40016339859"; + public const string ASSAULTRIFLE_KALASHNIKOV_AK74N_545X39_ASSAULT_RIFLE = + "5644bd2b4bdc2d3b4c8b4572"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKM_762X39_ASSAULT_RIFLE = + "59d6088586f774275f37482f"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKMN_762X39_ASSAULT_RIFLE = + "5a0ec13bfcdbcb00165aa685"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKMS_762X39_ASSAULT_RIFLE = + "59ff346386f77477562ff5e2"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKMSN_762X39_ASSAULT_RIFLE = + "5abcbc27d8ce8700182eceeb"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKS74_545X39_ASSAULT_RIFLE = + "5bf3e0490db83400196199af"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKS74N_545X39_ASSAULT_RIFLE = + "5ab8e9fcd8ce870019439434"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKS74U_545X39_ASSAULT_RIFLE = + "57dc2fa62459775949412633"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKS74UB_545X39_ASSAULT_RIFLE = + "5839a40f24597726f856b511"; + public const string ASSAULTRIFLE_KALASHNIKOV_AKS74UN_545X39_ASSAULT_RIFLE = + "583990e32459771419544dd2"; public const string ASSAULTRIFLE_LONE_STAR_TX15_DML_556X45_CARBINE = "5d43021ca4b9362eab4b5e25"; public const string ASSAULTRIFLE_MASTER_HAND = "5ae083b25acfc4001a5fc702"; - public const string ASSAULTRIFLE_MOLOT_ARMS_VPO136_VEPRKM_762X39_CARBINE = "59e6152586f77473dc057aa1"; + public const string ASSAULTRIFLE_MOLOT_ARMS_VPO136_VEPRKM_762X39_CARBINE = + "59e6152586f77473dc057aa1"; public const string ASSAULTRIFLE_MOLOT_ARMS_VPO209_366_TKM_CARBINE = "59e6687d86f77411d949b251"; - public const string ASSAULTRIFLE_RIFLE_DYNAMICS_RD704_762X39_ASSAULT_RIFLE = "628a60ae6b1d481ff772e9c8"; + public const string ASSAULTRIFLE_RIFLE_DYNAMICS_RD704_762X39_ASSAULT_RIFLE = + "628a60ae6b1d481ff772e9c8"; public const string ASSAULTRIFLE_SAG_AK545_545X39_CARBINE = "628b5638ad252a16da6dd245"; public const string ASSAULTRIFLE_SAG_AK545_SHORT_545X39_CARBINE = "628b9c37a733087d0d7fe84b"; - public const string ASSAULTRIFLE_SIG_MCX_300_BLACKOUT_ASSAULT_RIFLE = "5fbcc1d9016cce60e8341ab3"; + public const string ASSAULTRIFLE_SIG_MCX_300_BLACKOUT_ASSAULT_RIFLE = + "5fbcc1d9016cce60e8341ab3"; public const string ASSAULTRIFLE_SIG_MCXSPEAR_68X51_ASSAULT_RIFLE = "65290f395ae2ae97b80fdf2d"; public const string ASSAULTRIFLE_STEYR_AUG_A1_556X45_ASSAULT_RIFLE = "62e7c4fba689e8c9c50dfc38"; public const string ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE = "63171672192e68c5460cebc5"; - public const string ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE_BLACK = "6718817435e3cfd9550d2c27"; + public const string ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE_BLACK = + "6718817435e3cfd9550d2c27"; public const string ASSAULTSCOPE_ELCAN_SPECTER_OS4X_ASSAULT_SCOPE = "544a3f024bdc2d1d388b4568"; public const string ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE = "57ac965c24597706be5f975c"; public const string ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE_FDE = "57aca93d2459771f2c7e26db"; - public const string ASSAULTSCOPE_HK_G36_HENSOLDT_HKV_3X_CARRY_HANDLE = "622b4d7df9cfc87d675d2ded"; - public const string ASSAULTSCOPE_HK_G36_HENSOLDT_HKV_ZF_15X_CARRY_HANDLE = "622b4f54dc8dcc0ba8742f85"; + public const string ASSAULTSCOPE_HK_G36_HENSOLDT_HKV_3X_CARRY_HANDLE = + "622b4d7df9cfc87d675d2ded"; + public const string ASSAULTSCOPE_HK_G36_HENSOLDT_HKV_ZF_15X_CARRY_HANDLE = + "622b4f54dc8dcc0ba8742f85"; public const string ASSAULTSCOPE_KIBA_ARMS_SHORT_PRISM_25X_SCOPE = "5c1cdd512e22161b267d91ae"; - public const string ASSAULTSCOPE_LEUPOLD_MARK_4_HAMR_4X24_DELTAPOINT_HYBRID_ASSAULT_SCOPE = "544a3a774bdc2d3a388b4567"; - public const string ASSAULTSCOPE_MONSTRUM_TACTICAL_COMPACT_PRISM_SCOPE_2X32 = "5d2dc3e548f035404a1a4798"; + public const string ASSAULTSCOPE_LEUPOLD_MARK_4_HAMR_4X24_DELTAPOINT_HYBRID_ASSAULT_SCOPE = + "544a3a774bdc2d3a388b4567"; + public const string ASSAULTSCOPE_MONSTRUM_TACTICAL_COMPACT_PRISM_SCOPE_2X32 = + "5d2dc3e548f035404a1a4798"; public const string ASSAULTSCOPE_SIG_SAUER_BRAVO4_4X30_SCOPE = "57adff4f24597737f373b6e6"; - public const string ASSAULTSCOPE_STEYR_AUG_A1_STG77_15X_OPTIC_SIGHT = "62ea7c793043d74a0306e19f"; + public const string ASSAULTSCOPE_STEYR_AUG_A1_STG77_15X_OPTIC_SIGHT = + "62ea7c793043d74a0306e19f"; public const string ASSAULTSCOPE_STEYR_AUG_A3_M1_15X_OPTIC_SIGHT = "62ebd290c427473eff0baafb"; public const string ASSAULTSCOPE_SWAMPFOX_TRIHAWK_PRISM_SCOPE_3X30 = "626bb8532c923541184624b4"; - public const string ASSAULTSCOPE_TRIJICON_ACOG_TA01NSN_4X32_SCOPE_BLACK = "5c05293e0db83400232fff80"; - public const string ASSAULTSCOPE_TRIJICON_ACOG_TA01NSN_4X32_SCOPE_TAN = "5c052a900db834001a66acbd"; + public const string ASSAULTSCOPE_TRIJICON_ACOG_TA01NSN_4X32_SCOPE_BLACK = + "5c05293e0db83400232fff80"; + public const string ASSAULTSCOPE_TRIJICON_ACOG_TA01NSN_4X32_SCOPE_TAN = + "5c052a900db834001a66acbd"; public const string ASSAULTSCOPE_TRIJICON_ACOG_TA11D_35X35_SCOPE = "59db7e1086f77448be30ddf3"; public const string ASSAULTSCOPE_VALDAY_PS320_16X_SCOPE = "5c0517910db83400232ffee5"; public const string AUXILIARYMOD_ARMASIGHT_VULCAN_MG_SCOPE_EYECUP = "5b3cbc235acfc4001863ac44"; public const string AUXILIARYMOD_ARMASIGHT_ZEUSPRO_SCOPE_EYECUP = "63fc4533b10b17385349b565"; public const string AUXILIARYMOD_AXION_KOBRA_SIGHT_SHADE = "591c4e1186f77410354b316e"; public const string AUXILIARYMOD_CYCLONE_SHAKHIN_SCOPE_EYECUP = "67641bec4ad898aa100c1079"; - public const string AUXILIARYMOD_FAB_DEFENSE_PROTECTION_CAP_FOR_AGR870 = "5bfe86bd0db83400232fe959"; + public const string AUXILIARYMOD_FAB_DEFENSE_PROTECTION_CAP_FOR_AGR870 = + "5bfe86bd0db83400232fe959"; public const string AUXILIARYMOD_GLOCK_ZEV_TECH_SIGHT_MOUNT_CAP = "5a71e1868dc32e00094b97f3"; public const string AUXILIARYMOD_HK_G36_HAND_STOP = "622f16a1a5958f63c67f1737"; public const string AUXILIARYMOD_HK_USP_HAMMER = "6193d3be7c6c7b169525f0da"; @@ -632,13 +694,17 @@ public static class ItemTpl public const string AUXILIARYMOD_M1911A1_SLIDE_STOP = "5e81c539cb2b95385c177553"; public const string AUXILIARYMOD_M1911A1_STI_HEX_HAMMER = "5ef35f46382a846010715a96"; public const string AUXILIARYMOD_M1911A1_TRIGGER = "5e81c6a2ac2bb513793cdc7f"; - public const string AUXILIARYMOD_M1911A1_WILSON_EXTENDED_SLIDE_STOP = "5ef3553c43cb350a955a7ccb"; - public const string AUXILIARYMOD_M1911A1_WILSON_RETRO_COMMANDER_HAMMER = "5ef35d2ac64c5d0dfc0571b0"; - public const string AUXILIARYMOD_M1911A1_WILSON_ULTRALIGHT_SKELETONIZED_HAMMER = "5ef35bc243cb350a955a7ccd"; + public const string AUXILIARYMOD_M1911A1_WILSON_EXTENDED_SLIDE_STOP = + "5ef3553c43cb350a955a7ccb"; + public const string AUXILIARYMOD_M1911A1_WILSON_RETRO_COMMANDER_HAMMER = + "5ef35d2ac64c5d0dfc0571b0"; + public const string AUXILIARYMOD_M1911A1_WILSON_ULTRALIGHT_SKELETONIZED_HAMMER = + "5ef35bc243cb350a955a7ccd"; public const string AUXILIARYMOD_M45A1_HAMMER = "5f3e76d86cda304dcc634054"; public const string AUXILIARYMOD_M45A1_SLIDE_LOCK = "5f3e777688ca2d00ad199d25"; public const string AUXILIARYMOD_M45A1_TRIGGER = "5f3e772a670e2a7b01739a52"; - public const string AUXILIARYMOD_MP155_ULTIMA_PISTOL_GRIP_RUBBER_PAD = "60785c0d232e5a31c233d51c"; + public const string AUXILIARYMOD_MP155_ULTIMA_PISTOL_GRIP_RUBBER_PAD = + "60785c0d232e5a31c233d51c"; public const string AUXILIARYMOD_MP155_ULTIMA_UNDERBARREL_MOUNT = "606f26752535c57a13424d22"; public const string AUXILIARYMOD_NPZ_1P78_SCOPE_EYECUP = "618a760e526131765025aae3"; public const string AUXILIARYMOD_NPZ_USP1_SCOPE_EYECUP = "5cf639aad7f00c065703d455"; @@ -651,38 +717,56 @@ public static class ItemTpl public const string AUXILIARYMOD_SV98_SOUND_SUPPRESSOR_HEAT_SHIELD = "5c4eecde2e221602b3140418"; public const string AUXILIARYMOD_TRIJICON_REAPIR_SCOPE_EYECUP = "5a1eacb3fcdbcb09800872be"; public const string AUXILIARYMOD_TROPHY = "5ae089fb5acfc408fb13989b"; - public const string BACKPACK_3V_GEAR_PARATUS_3DAY_OPERATORS_TACTICAL_BACKPACK_FOLIAGE_GREY = "5c0e805e86f774683f3dd637"; + public const string BACKPACK_3V_GEAR_PARATUS_3DAY_OPERATORS_TACTICAL_BACKPACK_FOLIAGE_GREY = + "5c0e805e86f774683f3dd637"; public const string BACKPACK_511_TACTICAL_RUSH_100_BACKPACK_BLACK = "67458730df3c1da90b0b052b"; public const string BACKPACK_6SH118_RAID_BACKPACK_EMR = "5df8a4d786f77412672a1e3b"; - public const string BACKPACK_ANA_TACTICAL_BETA_2_BATTLE_BACKPACK_OLIVE_DRAB = "5b44c6ae86f7742d1627baea"; - public const string BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_FOLIAGE = "545cdae64bdc2d39198b4568"; - public const string BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_MULTICAM = "66b5f22b78bbc0200425f904"; - public const string BACKPACK_DIRECT_ACTION_DRAGON_EGG_MARK_II_BACKPACK_BLACK = "656f198fb27298d6fd005466"; + public const string BACKPACK_ANA_TACTICAL_BETA_2_BATTLE_BACKPACK_OLIVE_DRAB = + "5b44c6ae86f7742d1627baea"; + public const string BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_FOLIAGE = + "545cdae64bdc2d39198b4568"; + public const string BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_MULTICAM = + "66b5f22b78bbc0200425f904"; + public const string BACKPACK_DIRECT_ACTION_DRAGON_EGG_MARK_II_BACKPACK_BLACK = + "656f198fb27298d6fd005466"; public const string BACKPACK_DUFFLE_BAG = "56e33634d2720bd8058b456b"; - public const string BACKPACK_EBERLESTOCK_F4_TERMINATOR_LOAD_BEARING_BACKPACK_TIGER_STRIPE = "5f5e46b96bdad616ad46d613"; - public const string BACKPACK_EBERLESTOCK_F5_SWITCHBLADE_BACKPACK_DRY_EARTH = "5f5e467b0bc58666c37e7821"; - public const string BACKPACK_EBERLESTOCK_G2_GUNSLINGER_II_BACKPACK_DRY_EARTH = "6034d2d697633951dc245ea6"; + public const string BACKPACK_EBERLESTOCK_F4_TERMINATOR_LOAD_BEARING_BACKPACK_TIGER_STRIPE = + "5f5e46b96bdad616ad46d613"; + public const string BACKPACK_EBERLESTOCK_F5_SWITCHBLADE_BACKPACK_DRY_EARTH = + "5f5e467b0bc58666c37e7821"; + public const string BACKPACK_EBERLESTOCK_G2_GUNSLINGER_II_BACKPACK_DRY_EARTH = + "6034d2d697633951dc245ea6"; public const string BACKPACK_FLYYE_MBSS_BACKPACK_UCP = "544a5cde4bdc2d39388b456b"; public const string BACKPACK_GRUPPA_99_T20_BACKPACK_MULTICAM = "619cf0335771dd3c390269ae"; public const string BACKPACK_GRUPPA_99_T20_BACKPACK_UMBER_BROWN = "618bb76513f5097c8d5aa2d5"; public const string BACKPACK_GRUPPA_99_T30_BACKPACK_BLACK = "628e1ffc83ec92260c0f437f"; public const string BACKPACK_GRUPPA_99_T30_BACKPACK_MULTICAM = "62a1b7fbc30cfa1d366af586"; - public const string BACKPACK_HAZARD_4_DRAWBRIDGE_BACKPACK_COYOTE_TAN = "60a272cc93ef783291411d8e"; + public const string BACKPACK_HAZARD_4_DRAWBRIDGE_BACKPACK_COYOTE_TAN = + "60a272cc93ef783291411d8e"; public const string BACKPACK_HAZARD_4_PILLBOX_BACKPACK_BLACK = "60a2828e8689911a226117f9"; - public const string BACKPACK_HAZARD_4_TAKEDOWN_SLING_BACKPACK_BLACK = "6034d103ca006d2dca39b3f0"; - public const string BACKPACK_HAZARD_4_TAKEDOWN_SLING_BACKPACK_MULTICAM = "6038d614d10cbf667352dd44"; + public const string BACKPACK_HAZARD_4_TAKEDOWN_SLING_BACKPACK_BLACK = + "6034d103ca006d2dca39b3f0"; + public const string BACKPACK_HAZARD_4_TAKEDOWN_SLING_BACKPACK_MULTICAM = + "6038d614d10cbf667352dd44"; public const string BACKPACK_LBT1476A_3DAY_PACK_MULTICAM_ALPINE = "67458794e21e5d724e066976"; public const string BACKPACK_LBT1476A_3DAY_PACK_WOODLAND = "618cfae774bb2d036a049e7c"; public const string BACKPACK_LBT2670_SLIM_FIELD_MED_PACK_BLACK = "5e4abc6786f77406812bd572"; - public const string BACKPACK_LBT8005A_DAY_PACK_BACKPACK_MULTICAM_BLACK = "5e9dcf5986f7746c417435b3"; + public const string BACKPACK_LBT8005A_DAY_PACK_BACKPACK_MULTICAM_BLACK = + "5e9dcf5986f7746c417435b3"; public const string BACKPACK_LOLKEK_3F_TRANSFER_TOURIST = "5f5e45cc5021ce62144be7aa"; - public const string BACKPACK_MYSTERY_RANCH_BLACKJACK_50_BACKPACK_MULTICAM = "5c0e774286f77468413cc5b2"; - public const string BACKPACK_MYSTERY_RANCH_NICE_COMM_3_BVS_FRAME_SYSTEM_COYOTE = "628bc7fb408e2b2e9c0801b1"; - public const string BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = "656e0436d44a1bb4220303a0"; - public const string BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_CHRISTMAS_EDITION = "674da9cf0cb4bcde7103c07b"; - public const string BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_OLIVE_DRAB = "674da107c512807d1a0e7436"; + public const string BACKPACK_MYSTERY_RANCH_BLACKJACK_50_BACKPACK_MULTICAM = + "5c0e774286f77468413cc5b2"; + public const string BACKPACK_MYSTERY_RANCH_NICE_COMM_3_BVS_FRAME_SYSTEM_COYOTE = + "628bc7fb408e2b2e9c0801b1"; + public const string BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = + "656e0436d44a1bb4220303a0"; + public const string BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_CHRISTMAS_EDITION = + "674da9cf0cb4bcde7103c07b"; + public const string BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_OLIVE_DRAB = + "674da107c512807d1a0e7436"; public const string BACKPACK_MYSTERY_RANCH_TERRAPLANE = "56e294cdd2720b603a8b4575"; - public const string BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = "5d5d940f86f7742797262046"; + public const string BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = + "5d5d940f86f7742797262046"; public const string BACKPACK_PARTISANS_BAG = "66a9f98f3bd5a41b162030f4"; public const string BACKPACK_PILGRIM_TOURIST = "59e763f286f7742ee57895da"; public const string BACKPACK_SANITARS_BAG = "5e997f0b86f7741ac73993e2"; @@ -690,12 +774,14 @@ public static class ItemTpl public const string BACKPACK_SCAV = "56e335e4d2720b6c058b456d"; public const string BACKPACK_SSO_ATTACK_2_RAID_BACKPACK_KHAKI = "5ab8ebf186f7742d8b372e80"; public const string BACKPACK_TACTICAL_SLING_BAG_KHAKI = "5ab8f04f86f774585f4237d8"; - public const string BACKPACK_TASMANIAN_TIGER_TROOPER_35_BACKPACK_KHAKI = "639346cc1c8f182ad90c8972"; + public const string BACKPACK_TASMANIAN_TIGER_TROOPER_35_BACKPACK_KHAKI = + "639346cc1c8f182ad90c8972"; public const string BACKPACK_TEHINKOM_RKPT25_PATROL_BACKPACK_EMR = "656ddcf0f02d7bcea90bf395"; public const string BACKPACK_TRANSFORMER_BAG = "56e33680d2720be2748b4576"; public const string BACKPACK_VERTX_READY_PACK_BACKPACK_RED = "66b5f247af44ca0014063c02"; public const string BACKPACK_VKBO_ARMY_BAG = "5ab8ee7786f7742d8f33f0b9"; - public const string BACKPACK_WARTECH_BERKUT_BB102_BACKPACK_ATACS_FG = "5ca20d5986f774331e7c9602"; + public const string BACKPACK_WARTECH_BERKUT_BB102_BACKPACK_ATACS_FG = + "5ca20d5986f774331e7c9602"; public const string BARREL_9A91_9X39 = "645122f6d4928d46d30be3ff"; public const string BARREL_AA12_12GA_330MM = "66ffac601f7492c901027bbb"; public const string BARREL_AA12_12GA_342MM_THREADED = "670fd03dc424cf758f006946"; @@ -708,8 +794,10 @@ public static class ItemTpl public const string BARREL_AR15_556X45_145_INCH = "55d3632e4bdc2d972f8b4569"; public const string BARREL_AR15_556X45_18_INCH = "5d440b93a4b9364276578d4b"; public const string BARREL_AR15_556X45_20_INCH = "5d440b9fa4b93601354d480c"; - public const string BARREL_AR15_556X45_BALLISTIC_ADVANTAGE_HANSON_CARBINE_PRO_137_INCH = "63d3ce0446bd475bcb50f55f"; - public const string BARREL_AR15_556X45_BALLISTIC_ADVANTAGE_HANSON_CARBINE_PRO_16_INCH = "63d3d44a2a49307baf09386d"; + public const string BARREL_AR15_556X45_BALLISTIC_ADVANTAGE_HANSON_CARBINE_PRO_137_INCH = + "63d3ce0446bd475bcb50f55f"; + public const string BARREL_AR15_556X45_BALLISTIC_ADVANTAGE_HANSON_CARBINE_PRO_16_INCH = + "63d3d44a2a49307baf09386d"; public const string BARREL_AR15_556X45_MOLOT_ARMS_16_INCH = "5c0e2f94d174af029f650d56"; public const string BARREL_BENELLI_M3_SUPER_90_12GA_500MM = "6259c2c1d714855d182bad85"; public const string BARREL_DESERT_EAGLE_L5_357_127MM = "669fa4c61bd4416eaa09b3ca"; @@ -736,14 +824,19 @@ public static class ItemTpl public const string BARREL_GLOCK_17_9X19_114MM_COMPENSATED = "5a6b60158dc32e000a31138b"; public const string BARREL_GLOCK_18C_9X19_114MM_COMPENSATED = "5b1fa9ea5acfc40018633c0a"; public const string BARREL_GLOCK_19X_9X19_102MM = "630764fea987397c0816d219"; - public const string BARREL_GLOCK_9X19_DOUBLE_DIAMOND_114MM_THREADED = "5a6b5e468dc32e001207faf5"; - public const string BARREL_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_114MM_THREADED = "5a6b5b8a8dc32e001207faf3"; + public const string BARREL_GLOCK_9X19_DOUBLE_DIAMOND_114MM_THREADED = + "5a6b5e468dc32e001207faf5"; + public const string BARREL_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_114MM_THREADED = + "5a6b5b8a8dc32e001207faf3"; public const string BARREL_GLOCK_9X19_SAI_114MM_THREADED = "5a6b5ed88dc32e000c52ec86"; public const string BARREL_HK_416_556X45_106_INCH = "5c6d85e02e22165df16b81f4"; public const string BARREL_HK_416_556X45_11_INCH = "5bb20d92d4351e00853263eb"; - public const string BARREL_HK_416_556X45_145_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = "5bb20d9cd4351e00334c9d8a"; - public const string BARREL_HK_416_556X45_165_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = "5bb20da5d4351e0035629dbf"; - public const string BARREL_HK_416_556X45_20_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = "5bb20dadd4351e00367faeff"; + public const string BARREL_HK_416_556X45_145_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = + "5bb20d9cd4351e00334c9d8a"; + public const string BARREL_HK_416_556X45_165_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = + "5bb20da5d4351e0035629dbf"; + public const string BARREL_HK_416_556X45_20_INCH_BARREL_WITH_FLIPUP_FRONT_SIGHT = + "5bb20dadd4351e00367faeff"; public const string BARREL_HK_G36_556X45_228MM = "622b379bf9cfc87d675d2de5"; public const string BARREL_HK_G36_556X45_318MM = "622b3858034a3e17ad0b81f5"; public const string BARREL_HK_G36_556X45_480MM = "622b38c56762c718e457e246"; @@ -770,13 +863,15 @@ public static class ItemTpl public const string BARREL_M60E4_762X51_458MM = "660126f7c752a02bbe05e688"; public const string BARREL_M60E4_762X51_475MM_HEAVY = "66012788c752a02bbe05e68e"; public const string BARREL_M60E6_762X51_458MM = "66225d88a1c7e3b81600c76f"; - public const string BARREL_M700_762X51_20_INCH_STAINLESS_STEEL_THREADED = "5d2703038abbc3105103d94c"; + public const string BARREL_M700_762X51_20_INCH_STAINLESS_STEEL_THREADED = + "5d2703038abbc3105103d94c"; public const string BARREL_M700_762X51_20_INCH_THREADED = "5bfebc320db8340019668d79"; public const string BARREL_M700_762X51_26_INCH = "5bfebc250db834001a6694e1"; public const string BARREL_M700_762X51_26_INCH_STAINLESS_STEEL = "5d2702e88abbc31ed91efc44"; public const string BARREL_M870_12GA_355MM = "5a787f25c5856700186c4ab9"; public const string BARREL_M870_12GA_508MM = "5a787f7ac5856700177af660"; - public const string BARREL_M870_12GA_508MM_BARREL_WITH_A_FIXED_SIGHT = "5a787ebcc5856700142fdd98"; + public const string BARREL_M870_12GA_508MM_BARREL_WITH_A_FIXED_SIGHT = + "5a787ebcc5856700142fdd98"; public const string BARREL_M870_12GA_660MM_VENT_RIB = "5a787fadc5856700155a6ca1"; public const string BARREL_M870_12GA_SAWEDOFF_325MM = "5a787fdfc5856700142fdd9a"; public const string BARREL_M9A3_9X19_127MM_THREADED = "5cadc1c6ae9215000f2775a4"; @@ -791,7 +886,8 @@ public static class ItemTpl public const string BARREL_MOSIN_CARBINE_762X54R_514MM = "5bfd4cbe0db834001b73449f"; public const string BARREL_MOSIN_RIFLE_762X54R_730MM_REGULAR = "5ae09bff5acfc4001562219d"; public const string BARREL_MOSIN_RIFLE_762X54R_SAWEDOFF_200MM = "5bfd4cc90db834001d23e846"; - public const string BARREL_MOSIN_RIFLE_762X54R_SAWEDOFF_220MM_THREADED = "5bfd4cd60db834001c38f095"; + public const string BARREL_MOSIN_RIFLE_762X54R_SAWEDOFF_220MM_THREADED = + "5bfd4cd60db834001c38f095"; public const string BARREL_MOSSBERG_590A1_12GA_20_INCH = "5e87071478f43e51ca2de5e1"; public const string BARREL_MP133_12GA_510MM = "55d4491a4bdc2d882f8b456e"; public const string BARREL_MP133_12GA_510MM_BARREL_WITH_RIB = "560835c74bdc2dc8488b456f"; @@ -952,7 +1048,8 @@ public static class ItemTpl public const string BARTER_FLEECE_FABRIC = "5e2af47786f7746d404f3aaa"; public const string BARTER_FP100_FILTER_ABSORBER = "5d1b2f3f86f774252167a52c"; public const string BARTER_FUEL_CONDITIONER = "5b43575a86f77424f443fe62"; - public const string BARTER_GARY_ZONT_PORTABLE_ELECTRONIC_WARFARE_DEVICE = "66d9f8744827a77e870ecaf1"; + public const string BARTER_GARY_ZONT_PORTABLE_ELECTRONIC_WARFARE_DEVICE = + "66d9f8744827a77e870ecaf1"; public const string BARTER_GAS_ANALYZER = "590a3efd86f77437d351a25b"; public const string BARTER_GAS_MASK_AIR_FILTER = "590c595c86f7747884343ad7"; public const string BARTER_GEIGERMULLER_COUNTER = "5672cb724bdc2dc2088b456b"; @@ -1005,7 +1102,8 @@ public static class ItemTpl public const string BARTER_MICROCONTROLLER_BOARD = "6389c7750ef44505c87f5996"; public const string BARTER_MILITARY_CABLE = "5d0375ff86f774186372f685"; public const string BARTER_MILITARY_CIRCUIT_BOARD = "5d0376a486f7747d8050965c"; - public const string BARTER_MILITARY_COFDM_WIRELESS_SIGNAL_TRANSMITTER = "5c052f6886f7746b1e3db148"; + public const string BARTER_MILITARY_COFDM_WIRELESS_SIGNAL_TRANSMITTER = + "5c052f6886f7746b1e3db148"; public const string BARTER_MILITARY_CORRUGATED_TUBE = "619cbf476b8a1b37a54eebf8"; public const string BARTER_MILITARY_GYROTACHOMETER = "5d03784a86f774203e7e0c4d"; public const string BARTER_MILITARY_POWER_FILTER = "5d0378d486f77420421a5ff4"; @@ -1115,46 +1213,68 @@ public static class ItemTpl public const string BIPOD_PK = "6464d870bb2c580352070cc4"; public const string BIPOD_RPD = "6513f037e06849f06c0957d7"; public const string BIPOD_SV98 = "56ea8222d2720b69698b4567"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_BACK = "6575ea4cf6a13a7b7100adc4"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_COLLAR = "6575ea719c7cad336508e418"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_FRONT = "6575ea3060703324250610da"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575ea7c60703324250610e2"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575ea5cf6a13a7b7100adc8"; - public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575ea6760703324250610de"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_BACK = + "6575ea4cf6a13a7b7100adc4"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_COLLAR = + "6575ea719c7cad336508e418"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_FRONT = + "6575ea3060703324250610da"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575ea7c60703324250610e2"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575ea5cf6a13a7b7100adc8"; + public const string BUILTININSERTS_6B13_KILLA_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575ea6760703324250610de"; public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_BACK = "654a8976f414fcea4004d78b"; public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_COLLAR = "654a8ae00337d53f9102c2aa"; public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_FRONT = "654a8b0b0337d53f9102c2ae"; public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_GROIN = "654a8bc5f414fcea4004d79b"; - public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "654a8b3df414fcea4004d78f"; - public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "654a8b80f414fcea4004d797"; + public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "654a8b3df414fcea4004d78f"; + public const string BUILTININSERTS_6B13_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "654a8b80f414fcea4004d797"; public const string BUILTININSERTS_6B2_LEVEL2_SOFT_ARMOR_BACK = "656fd89bf5a9631d4e042575"; public const string BUILTININSERTS_6B2_LEVEL2_SOFT_ARMOR_FRONT = "656fd7c32668ef0402028fb9"; public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_BACK = "6571baa74cb80d995d0a1490"; public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_COLLAR = "6571babb4076795e5e07383f"; public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_FRONT = "6571b27a6d84a2b8b6007f92"; - public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_GROIN_BACK = "6571babf4cb80d995d0a1494"; - public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "6571bac34076795e5e073843"; - public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6571baac6d84a2b8b6007fa3"; - public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "6571bab0f41985531a038091"; + public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_GROIN_BACK = + "6571babf4cb80d995d0a1494"; + public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "6571bac34076795e5e073843"; + public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6571baac6d84a2b8b6007fa3"; + public const string BUILTININSERTS_6B231_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "6571bab0f41985531a038091"; public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_BACK = "6570800612755ae0d907acf8"; public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_COLLAR = "657080ca12755ae0d907ad5e"; public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_FRONT = "65707fc348c7a887f2010432"; - public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_GROIN_BACK = "65708165696fe382cf073255"; - public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "65708122f65e2491bf009755"; + public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_GROIN_BACK = + "65708165696fe382cf073255"; + public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "65708122f65e2491bf009755"; public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_LEFT = "65708070f65e2491bf00972c"; public const string BUILTININSERTS_6B232_LEVEL2_SOFT_ARMOR_RIGHT = "657080a212755ae0d907ad04"; public const string BUILTININSERTS_6B3TM_LEVEL2_SOFT_ARMOR_BACK = "65764fae2bc38ef78e07648d"; - public const string BUILTININSERTS_6B3TM_LEVEL2_SOFT_ARMOR_GROIN_BACK = "6576500f526e320fbe03577f"; + public const string BUILTININSERTS_6B3TM_LEVEL2_SOFT_ARMOR_GROIN_BACK = + "6576500f526e320fbe03577f"; public const string BUILTININSERTS_6B3TM_LEVEL4_SOFT_ARMOR_FRONT = "65764e1e2bc38ef78e076489"; - public const string BUILTININSERTS_6B3TM_LEVEL4_SOFT_ARMOR_GROIN_FRONT = "6576504b526e320fbe035783"; + public const string BUILTININSERTS_6B3TM_LEVEL4_SOFT_ARMOR_GROIN_FRONT = + "6576504b526e320fbe035783"; public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_BACK = "6575ce45dc9932aed601c616"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_COLLAR = "6575ce6f16c2762fba005806"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_COLLAR = + "6575ce6f16c2762fba005806"; public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_FRONT = "6575ce3716c2762fba0057fd"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575ce8bdc9932aed601c61e"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_LEFT_ARM = "6575ce9db15fef3dd4051628"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575ce5016c2762fba005802"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575cea8b15fef3dd405162c"; - public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575ce5befc786cd9101a671"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575ce8bdc9932aed601c61e"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "6575ce9db15fef3dd4051628"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575ce5016c2762fba005802"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6575cea8b15fef3dd405162c"; + public const string BUILTININSERTS_6B43_6A_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575ce5befc786cd9101a671"; public const string BUILTININSERTS_6B515_LEVEL2_SOFT_ARMOR_COLLAR = "65708afe4a747dbb63005eee"; public const string BUILTININSERTS_6B515_LEVEL4_SOFT_ARMOR_BACK = "6570880f4a747dbb63005ee5"; public const string BUILTININSERTS_6B515_LEVEL4_SOFT_ARMOR_FRONT = "657087577f6d4590ac0d2109"; @@ -1163,148 +1283,262 @@ public static class ItemTpl public const string BUILTININSERTS_6B516_LEVEL2_SOFT_ARMOR_COLLAR = "65764c39526e320fbe035777"; public const string BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_FRONT = "65764a4cd8537eb26a0355ee"; public const string BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_GROIN = "65764c6b526e320fbe03577b"; - public const string BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_NAPE = "657f9ef6c6679fefb3051e1f"; - public const string BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_TOP = "657f9eb7e9433140ad0baf86"; + public const string BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_NAPE = + "657f9ef6c6679fefb3051e1f"; + public const string BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_TOP = + "657f9eb7e9433140ad0baf86"; public const string BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_EARS = "657bc107aab96fccee08be9f"; public const string BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_NAPE = "657bc0d8a1c61ee0c303632f"; public const string BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_TOP = "657bc06daab96fccee08be9b"; public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_BACK = "65730c2213a2f660f60bea96"; public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_FRONT = "65730c0e292ecadbfa09ad49"; - public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65730c2b292ecadbfa09ad50"; - public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "65730c35292ecadbfa09ad54"; - public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_BACK = "6570f71dd67d0309980a7af8"; - public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_FRONT = "6570f6e774d84423df065f21"; - public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_LEFT = "6570f74774d84423df065f25"; - public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_RIGHT = "6570f79c4c65ab77a6015121"; + public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "65730c2b292ecadbfa09ad50"; + public const string BUILTININSERTS_ANA_M1_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "65730c35292ecadbfa09ad54"; + public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_BACK = + "6570f71dd67d0309980a7af8"; + public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_FRONT = + "6570f6e774d84423df065f21"; + public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_LEFT = + "6570f74774d84423df065f25"; + public const string BUILTININSERTS_ANA_TACT_M2_LEVEL3_SOFT_ARMOR_RIGHT = + "6570f79c4c65ab77a6015121"; public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_BACK = "6575ef6bf6a13a7b7100b093"; public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_FRONT = "6575ef599c7cad336508e453"; - public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575ef78da698a4e980677eb"; - public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575ef7f9c7cad336508e457"; - public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_BACK = "6570e479a6560e4ee50c2b02"; - public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_FRONT = "6570e5100b57c03ec90b970a"; - public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_LEFT = "6570e5674cc0d2ab1e05edbb"; - public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_RIGHT = "6570e59b0b57c03ec90b970e"; + public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575ef78da698a4e980677eb"; + public const string BUILTININSERTS_ARS_CPC_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575ef7f9c7cad336508e457"; + public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_BACK = + "6570e479a6560e4ee50c2b02"; + public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_FRONT = + "6570e5100b57c03ec90b970a"; + public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_LEFT = + "6570e5674cc0d2ab1e05edbb"; + public const string BUILTININSERTS_ARSARMA_A18_LEVEL2_SOFT_ARMOR_RIGHT = + "6570e59b0b57c03ec90b970e"; public const string BUILTININSERTS_AVS_MBAV_LEVEL3_SOFT_ARMOR_BACK = "6575f5e1da698a4e98067869"; - public const string BUILTININSERTS_AVS_MBAV_LEVEL3_SOFT_ARMOR_FRONT = "6575f5cbf6a13a7b7100b0bf"; + public const string BUILTININSERTS_AVS_MBAV_LEVEL3_SOFT_ARMOR_FRONT = + "6575f5cbf6a13a7b7100b0bf"; public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_BACK = "657322a4cea9255e21023651"; public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_FRONT = "657322988c1cc6dcd9098b2d"; - public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657322acd9d89ff7ac0d961b"; - public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "657322b7d9d89ff7ac0d961f"; - public const string BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_NAPE = "66b61ce0c5d72b027748867e"; - public const string BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_TOP = "66b61cfae98be930d701c029"; + public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "657322acd9d89ff7ac0d961b"; + public const string BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "657322b7d9d89ff7ac0d961f"; + public const string BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_NAPE = + "66b61ce0c5d72b027748867e"; + public const string BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_TOP = + "66b61cfae98be930d701c029"; public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_BACK = "6573102b292ecadbfa09b38d"; public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_FRONT = "6573101e292ecadbfa09b389"; - public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65731038292ecadbfa09b391"; - public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "65731045f31d5be00e08a75a"; - public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_EARS = "657fa07387e11c61f70bface"; - public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_NAPE = "657fa04ac6679fefb3051e24"; - public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_TOP = "657fa009d4caf976440afe3a"; - public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_EARS = "657fa186d4caf976440afe42"; - public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_NAPE = "657fa168e9433140ad0baf8e"; - public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_TOP = "657fa0fcd4caf976440afe3e"; + public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "65731038292ecadbfa09b391"; + public const string BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "65731045f31d5be00e08a75a"; + public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_EARS = + "657fa07387e11c61f70bface"; + public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_NAPE = + "657fa04ac6679fefb3051e24"; + public const string BUILTININSERTS_BNTI_LSHZ_2DTM_LEVEL4_HELMET_ARMOR_TOP = + "657fa009d4caf976440afe3a"; + public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_EARS = + "657fa186d4caf976440afe42"; + public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_NAPE = + "657fa168e9433140ad0baf8e"; + public const string BUILTININSERTS_CLASS_TOR2_LEVEL3_HELMET_ARMOR_TOP = + "657fa0fcd4caf976440afe3e"; public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_BACK = "6570fa1f4c65ab77a601512f"; - public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_COLLAR = "6570fb8f4c65ab77a601514d"; - public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_FRONT = "6570fae34c65ab77a6015146"; + public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_COLLAR = + "6570fb8f4c65ab77a601514d"; + public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_FRONT = + "6570fae34c65ab77a6015146"; public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_LEFT = "6570fb22584a51c23e03251f"; - public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_LEFT_ARM = "6570fbdd74d84423df065f60"; - public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_RIGHT = "6570fb6ad3eefd23430f8c7c"; - public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_RIGHT_ARM = "6570fc41d3eefd23430f8c83"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_BACK = "657333232cc8dfad2c0a3d97"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_COLLAR = "6573334aca0ca984940a2d5b"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_FRONT = "65733312ca0ca984940a2d53"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_LEFT_ARM = "65733375b7a8d286530e3dd7"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657333302cc8dfad2c0a3d9b"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6573337f2cc8dfad2c0a3da7"; - public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6573333eca0ca984940a2d57"; + public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_LEFT_ARM = + "6570fbdd74d84423df065f60"; + public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_RIGHT = + "6570fb6ad3eefd23430f8c7c"; + public const string BUILTININSERTS_CQC_MK4A_LEVEL2_SOFT_ARMOR_RIGHT_ARM = + "6570fc41d3eefd23430f8c83"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_BACK = + "657333232cc8dfad2c0a3d97"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_COLLAR = + "6573334aca0ca984940a2d5b"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_FRONT = + "65733312ca0ca984940a2d53"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "65733375b7a8d286530e3dd7"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "657333302cc8dfad2c0a3d9b"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6573337f2cc8dfad2c0a3da7"; + public const string BUILTININSERTS_CQC_MK4A_P_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6573333eca0ca984940a2d57"; public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_BACK = "6570e87c23c1f638ef0b0ee2"; - public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_FRONT = "6570e83223c1f638ef0b0ede"; - public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_GROIN = "6570e90b3a5689d85f08db97"; + public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_FRONT = + "6570e83223c1f638ef0b0ede"; + public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_GROIN = + "6570e90b3a5689d85f08db97"; public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_LEFT = "6570e8a623c1f638ef0b0ee6"; - public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_RIGHT = "6570e8e7ab49e964120b4563"; + public const string BUILTININSERTS_CRYE_AVS_LEVEL3_SOFT_ARMOR_RIGHT = + "6570e8e7ab49e964120b4563"; public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_BACK = "6575f25ada698a4e98067836"; - public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_FRONT = "6575f24ff6a13a7b7100b09e"; - public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575f2649cfdfe416f0399b8"; - public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575f26d9c7cad336508e480"; - public const string BUILTININSERTS_CRYE_PRECISION_AIRFRAME_LEVEL4_HELMET_ARMOR_NAPE = "657f98fbada5fadd1f07a585"; - public const string BUILTININSERTS_CRYE_PRECISION_AIRFRAME_LEVEL4_HELMET_ARMOR_TOP = "657f9897f4c82973640b235e"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_BACK = "65732df4d0acf75aea06c87b"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_COLLAR = "65732e215d3a3129fb05f3e1"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_FRONT = "65732de75d3a3129fb05f3dd"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "65732e30dd8739f6440ef383"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "65732e05d0acf75aea06c87f"; - public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "65732e0f6784ca384b0167ad"; - public const string BUILTININSERTS_DIAMOND_AGE_BASTION_LEVEL4_HELMET_ARMOR_NAPE = "657f9a94ada5fadd1f07a589"; - public const string BUILTININSERTS_DIAMOND_AGE_BASTION_LEVEL4_HELMET_ARMOR_TOP = "657f9a55c6679fefb3051e19"; - public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_EARS = "657ba75e23918923cb0df573"; - public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_NAPE = "657ba737b7e9ca9a02045bf6"; - public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_SHIELD = "658188edf026a90c1708c827"; - public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_TOP = "657ba6c3c6f689d3a205b857"; + public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_FRONT = + "6575f24ff6a13a7b7100b09e"; + public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575f2649cfdfe416f0399b8"; + public const string BUILTININSERTS_CRYE_CPC_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575f26d9c7cad336508e480"; + public const string BUILTININSERTS_CRYE_PRECISION_AIRFRAME_LEVEL4_HELMET_ARMOR_NAPE = + "657f98fbada5fadd1f07a585"; + public const string BUILTININSERTS_CRYE_PRECISION_AIRFRAME_LEVEL4_HELMET_ARMOR_TOP = + "657f9897f4c82973640b235e"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_BACK = + "65732df4d0acf75aea06c87b"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_COLLAR = + "65732e215d3a3129fb05f3e1"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_FRONT = + "65732de75d3a3129fb05f3dd"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "65732e30dd8739f6440ef383"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "65732e05d0acf75aea06c87f"; + public const string BUILTININSERTS_DEFENDER2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "65732e0f6784ca384b0167ad"; + public const string BUILTININSERTS_DIAMOND_AGE_BASTION_LEVEL4_HELMET_ARMOR_NAPE = + "657f9a94ada5fadd1f07a589"; + public const string BUILTININSERTS_DIAMOND_AGE_BASTION_LEVEL4_HELMET_ARMOR_TOP = + "657f9a55c6679fefb3051e19"; + public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_EARS = + "657ba75e23918923cb0df573"; + public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_NAPE = + "657ba737b7e9ca9a02045bf6"; + public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_SHIELD = + "658188edf026a90c1708c827"; + public const string BUILTININSERTS_DJETA_PSH97_LEVEL2_HELMET_ARMOR_TOP = + "657ba6c3c6f689d3a205b857"; public const string BUILTININSERTS_DRD_LEVEL3_SOFT_ARMOR_BACK = "6572e059371fccfbf909d5dc"; public const string BUILTININSERTS_DRD_LEVEL3_SOFT_ARMOR_FRONT = "6572e048371fccfbf909d5d8"; public const string BUILTININSERTS_DRD_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6572e06219b4b511af012f89"; - public const string BUILTININSERTS_DRD_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6572e06819b4b511af012f8d"; + public const string BUILTININSERTS_DRD_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6572e06819b4b511af012f8d"; public const string BUILTININSERTS_EXFIL_LEVEL4_HELMET_ARMOR_NAPE = "655200ba0ef76cf7be09d528"; public const string BUILTININSERTS_EXFIL_LEVEL4_HELMET_ARMOR_TOP = "6551fec55d0cf82e51014288"; - public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_EARS = "657ba8eab7e9ca9a02045bfd"; - public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_NAPE = "657ba8bccfcf63c951052dab"; - public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_SHIELD = "65818e4e566d2de69901b1b1"; - public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_TOP = "657ba85ecfcf63c951052da7"; - public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_EARS = "657baecbc6f689d3a205b863"; - public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_NAPE = "657baeaacfcf63c951052db3"; - public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_TOP = "657bae18b7e9ca9a02045c0a"; - public const string BUILTININSERTS_GALVION_CAIMAN_LEVEL3_HELMET_ARMOR_NAPE = "657bbb31b30eca9763051183"; - public const string BUILTININSERTS_GALVION_CAIMAN_LEVEL3_HELMET_ARMOR_TOP = "657bbad7a1c61ee0c3036323"; + public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_EARS = + "657ba8eab7e9ca9a02045bfd"; + public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_NAPE = + "657ba8bccfcf63c951052dab"; + public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_SHIELD = + "65818e4e566d2de69901b1b1"; + public const string BUILTININSERTS_FIREFIGHTER_SHPM_LEVEL2_HELMET_ARMOR_TOP = + "657ba85ecfcf63c951052da7"; + public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_EARS = + "657baecbc6f689d3a205b863"; + public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_NAPE = + "657baeaacfcf63c951052db3"; + public const string BUILTININSERTS_FORT_KIVER_M_LEVEL3_HELMET_ARMOR_TOP = + "657bae18b7e9ca9a02045c0a"; + public const string BUILTININSERTS_GALVION_CAIMAN_LEVEL3_HELMET_ARMOR_NAPE = + "657bbb31b30eca9763051183"; + public const string BUILTININSERTS_GALVION_CAIMAN_LEVEL3_HELMET_ARMOR_TOP = + "657bbad7a1c61ee0c3036323"; public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_BACK = "657326978c1cc6dcd9098b56"; public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_COLLAR = "657326bc5d3a3129fb05f36b"; public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_FRONT = "65732688d9d89ff7ac0d9c4c"; - public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657326a28c1cc6dcd9098b5a"; - public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "657326b08c1cc6dcd9098b5e"; - public const string BUILTININSERTS_HIGHCOM_STRIKER_ACHHC_LEVEL4_HELMET_ARMOR_NAPE = "657f9605f4c82973640b2358"; - public const string BUILTININSERTS_HIGHCOM_STRIKER_ACHHC_LEVEL4_HELMET_ARMOR_TOP = "657f95bff92cd718b701550c"; - public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_BACK = "6570f35cd67d0309980a7acb"; - public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_FRONT = "6570f30b0921c914bf07964c"; - public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_LEFT = "6570f3890b4ae5847f060dad"; - public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_RIGHT = "6570f3bb0b4ae5847f060db2"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_BACK = "6575c3beefc786cd9101a5ed"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_COLLAR = "6575c3ec52b7f8c76a05ee39"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_FRONT = "6575c3b3dc9932aed601c5f4"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_LEFT_ARM = "6575c3fd52b7f8c76a05ee3d"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575c3cdc6700bd6b40e8a90"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575c40c52b7f8c76a05ee41"; - public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575c3dfdc9932aed601c5f8"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_BACK = "6575c2be52b7f8c76a05ee25"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_COLLAR = "6575c2e4efc786cd9101a5dd"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_FRONT = "6575c2adefc786cd9101a5d9"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_GROIN_BACK = "6575c326c6700bd6b40e8a80"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575c31b52b7f8c76a05ee35"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_LEFT_ARM = "6575c2f7efc786cd9101a5e1"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575c2cd52b7f8c76a05ee29"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575c30352b7f8c76a05ee31"; - public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575c2d852b7f8c76a05ee2d"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_BACK = "6575c34bc6700bd6b40e8a84"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_COLLAR = "6575c373dc9932aed601c5ec"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_FRONT = "6575c342efc786cd9101a5e5"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_GROIN_BACK = "6575c390efc786cd9101a5e9"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575c385dc9932aed601c5f0"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575c35bc6700bd6b40e8a88"; - public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575c366c6700bd6b40e8a8c"; + public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "657326a28c1cc6dcd9098b5a"; + public const string BUILTININSERTS_GJEL_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "657326b08c1cc6dcd9098b5e"; + public const string BUILTININSERTS_HIGHCOM_STRIKER_ACHHC_LEVEL4_HELMET_ARMOR_NAPE = + "657f9605f4c82973640b2358"; + public const string BUILTININSERTS_HIGHCOM_STRIKER_ACHHC_LEVEL4_HELMET_ARMOR_TOP = + "657f95bff92cd718b701550c"; + public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_BACK = + "6570f35cd67d0309980a7acb"; + public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_FRONT = + "6570f30b0921c914bf07964c"; + public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_LEFT = + "6570f3890b4ae5847f060dad"; + public const string BUILTININSERTS_INTERCEPTOR_LEVEL2_SOFT_ARMOR_RIGHT = + "6570f3bb0b4ae5847f060db2"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_BACK = + "6575c3beefc786cd9101a5ed"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_COLLAR = + "6575c3ec52b7f8c76a05ee39"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_FRONT = + "6575c3b3dc9932aed601c5f4"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "6575c3fd52b7f8c76a05ee3d"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575c3cdc6700bd6b40e8a90"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6575c40c52b7f8c76a05ee41"; + public const string BUILTININSERTS_IOTV_GEN4_A_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575c3dfdc9932aed601c5f8"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_BACK = + "6575c2be52b7f8c76a05ee25"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_COLLAR = + "6575c2e4efc786cd9101a5dd"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_FRONT = + "6575c2adefc786cd9101a5d9"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_GROIN_BACK = + "6575c326c6700bd6b40e8a80"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575c31b52b7f8c76a05ee35"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "6575c2f7efc786cd9101a5e1"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575c2cd52b7f8c76a05ee29"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6575c30352b7f8c76a05ee31"; + public const string BUILTININSERTS_IOTV_GEN4_F_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575c2d852b7f8c76a05ee2d"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_BACK = + "6575c34bc6700bd6b40e8a84"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_COLLAR = + "6575c373dc9932aed601c5ec"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_FRONT = + "6575c342efc786cd9101a5e5"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_GROIN_BACK = + "6575c390efc786cd9101a5e9"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575c385dc9932aed601c5f0"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575c35bc6700bd6b40e8a88"; + public const string BUILTININSERTS_IOTV_GEN4_M_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575c366c6700bd6b40e8a8c"; public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_BACK = "65705c3c14f2ed6d7d0b7738"; - public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_COLLAR = "65705cea4916448ae1050897"; + public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_COLLAR = + "65705cea4916448ae1050897"; public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_FRONT = "65704de13e7bba58ea0285c8"; - public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65705c777260e1139e091408"; - public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "65705cb314f2ed6d7d0b773c"; - public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_EARS = "657ba57af58ba5a62501079e"; - public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_NAPE = "657ba5439ba22f103e08139f"; - public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_TOP = "657ba50c23918923cb0df56c"; - public const string BUILTININSERTS_KORA_KULON_LEVEL3_SOFT_ARMOR_BACK = "657049d23425b19bbc0502f0"; - public const string BUILTININSERTS_KORA_KULON_LEVEL3_SOFT_ARMOR_FRONT = "6570495b45d573133d0d6adb"; + public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "65705c777260e1139e091408"; + public const string BUILTININSERTS_KIRASAN_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "65705cb314f2ed6d7d0b773c"; + public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_EARS = + "657ba57af58ba5a62501079e"; + public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_NAPE = + "657ba5439ba22f103e08139f"; + public const string BUILTININSERTS_KOLPAK_1S_4ML_LEVEL2_HELMET_ARMOR_TOP = + "657ba50c23918923cb0df56c"; + public const string BUILTININSERTS_KORA_KULON_LEVEL3_SOFT_ARMOR_BACK = + "657049d23425b19bbc0502f0"; + public const string BUILTININSERTS_KORA_KULON_LEVEL3_SOFT_ARMOR_FRONT = + "6570495b45d573133d0d6adb"; public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_BACK = "65731b4fcea9255e2102360e"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_COLLAR = "65731b666e709cddd001ec43"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_FRONT = "65731b46cea9255e2102360a"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_GROIN_BACK = "65731b6b6042b0f210020ef6"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "65731b716e709cddd001ec47"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65731b576e709cddd001ec3f"; - public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "65731b60ff6dc44a7d068c4a"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_COLLAR = + "65731b666e709cddd001ec43"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_FRONT = + "65731b46cea9255e2102360a"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_GROIN_BACK = + "65731b6b6042b0f210020ef6"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "65731b716e709cddd001ec47"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "65731b576e709cddd001ec3f"; + public const string BUILTININSERTS_KORUNDVM_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "65731b60ff6dc44a7d068c4a"; public const string BUILTININSERTS_LEVEL2_SOFT_ARMOR_LEFT_ARM = "654a8b60f414fcea4004d793"; public const string BUILTININSERTS_LEVEL2_SOFT_ARMOR_PLATE_BACK = "655751db58aa1b6dbd0cc295"; public const string BUILTININSERTS_LEVEL2_SOFT_ARMOR_PLATE_FRONT = "6557519ac9b1d9bdcb0777e1"; @@ -1319,62 +1553,107 @@ public static class ItemTpl public const string BUILTININSERTS_LEVEL3_SOFT_ARMOR_STOMACH = "64afef49977493a0ee026217"; public const string BUILTININSERTS_LSHZ_LEVEL3_HELMET_ARMOR_NAPE = "657bb99db30eca976305117f"; public const string BUILTININSERTS_LSHZ_LEVEL3_HELMET_ARMOR_TOP = "657bb92fa1c61ee0c303631f"; - public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_EARS = "657bbefeb30eca9763051189"; - public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_NAPE = "657bbed0aab96fccee08be96"; - public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_TOP = "657bbe73a1c61ee0c303632b"; - public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_EARS = "657112fa818110db4600aa6b"; - public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_NAPE = "6571138e818110db4600aa71"; - public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_TOP = "6571133d22996eaf11088200"; + public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_EARS = + "657bbefeb30eca9763051189"; + public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_NAPE = + "657bbed0aab96fccee08be96"; + public const string BUILTININSERTS_LSHZ5_VULKAN5_LEVEL6_HELMET_ARMOR_TOP = + "657bbe73a1c61ee0c303632b"; + public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_EARS = + "657112fa818110db4600aa6b"; + public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_NAPE = + "6571138e818110db4600aa71"; + public const string BUILTININSERTS_MASKA1SHA_LEVEL4_HELMET_ARMOR_TOP = + "6571133d22996eaf11088200"; public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_BACK = "6572fc8c9a866b80ab07eb5d"; public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_FRONT = "6572fc809a866b80ab07eb59"; - public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6572fc989a866b80ab07eb61"; - public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "6572fca39a866b80ab07eb65"; + public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6572fc989a866b80ab07eb61"; + public const string BUILTININSERTS_MMAC_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "6572fca39a866b80ab07eb65"; public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_BACK = "65702fe593b7ea9c330f4ce8"; - public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_FRONT = "65702f87722744627e05cdb8"; - public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6570305d93b7ea9c330f4ced"; - public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "65703472c9030b928a0a8a78"; - public const string BUILTININSERTS_MSA_GALLET_TC800_LEVEL4_HELMET_ARMOR_NAPE = "657f9cb587e11c61f70bfaca"; - public const string BUILTININSERTS_MSA_GALLET_TC800_LEVEL4_HELMET_ARMOR_TOP = "657f9c78ada5fadd1f07a58d"; - public const string BUILTININSERTS_MSA_TC2001_LEVEL4_HELMET_ARMOR_NAPE = "657f8b05f4c82973640b2348"; - public const string BUILTININSERTS_MSA_TC2001_LEVEL4_HELMET_ARMOR_TOP = "657f8a8d7db258e5600fe33d"; - public const string BUILTININSERTS_MSA_TC2002_LEVEL4_HELMET_ARMOR_NAPE = "657f8b43f92cd718b70154fb"; - public const string BUILTININSERTS_MSA_TC2002_LEVEL4_HELMET_ARMOR_TOP = "657f8b94f92cd718b70154ff"; - public const string BUILTININSERTS_MTEK_FLUX_LEVEL4_HELMET_ARMOR_NAPE = "676307b4d9ec0af3d9001fa8"; - public const string BUILTININSERTS_MTEK_FLUX_LEVEL4_HELMET_ARMOR_TOP = "676307c004856a0b3c0dfffd"; - public const string BUILTININSERTS_MTEK_STRIKE_LEVEL4_HELMET_ARMOR_NAPE = "676307d3d9ec0af3d9001fac"; - public const string BUILTININSERTS_MTEK_STRIKE_LEVEL4_HELMET_ARMOR_TOP = "676307ded8b241b4f703a3e8"; - public const string BUILTININSERTS_NFM_HJELM_LEVEL3_HELMET_ARMOR_NAPE = "657bbcffbbd440df880b2dd5"; - public const string BUILTININSERTS_NFM_HJELM_LEVEL3_HELMET_ARMOR_TOP = "657bbcc9a1c61ee0c3036327"; - public const string BUILTININSERTS_OPS_CORE_FASTMT_LEVEL4_HELMET_ARMOR_NAPE = "657f8f10f4c82973640b2350"; - public const string BUILTININSERTS_OPS_CORE_FASTMT_LEVEL4_HELMET_ARMOR_TOP = "657f8ec5f4c82973640b234c"; + public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_FRONT = + "65702f87722744627e05cdb8"; + public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6570305d93b7ea9c330f4ced"; + public const string BUILTININSERTS_MODULE3M_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "65703472c9030b928a0a8a78"; + public const string BUILTININSERTS_MSA_GALLET_TC800_LEVEL4_HELMET_ARMOR_NAPE = + "657f9cb587e11c61f70bfaca"; + public const string BUILTININSERTS_MSA_GALLET_TC800_LEVEL4_HELMET_ARMOR_TOP = + "657f9c78ada5fadd1f07a58d"; + public const string BUILTININSERTS_MSA_TC2001_LEVEL4_HELMET_ARMOR_NAPE = + "657f8b05f4c82973640b2348"; + public const string BUILTININSERTS_MSA_TC2001_LEVEL4_HELMET_ARMOR_TOP = + "657f8a8d7db258e5600fe33d"; + public const string BUILTININSERTS_MSA_TC2002_LEVEL4_HELMET_ARMOR_NAPE = + "657f8b43f92cd718b70154fb"; + public const string BUILTININSERTS_MSA_TC2002_LEVEL4_HELMET_ARMOR_TOP = + "657f8b94f92cd718b70154ff"; + public const string BUILTININSERTS_MTEK_FLUX_LEVEL4_HELMET_ARMOR_NAPE = + "676307b4d9ec0af3d9001fa8"; + public const string BUILTININSERTS_MTEK_FLUX_LEVEL4_HELMET_ARMOR_TOP = + "676307c004856a0b3c0dfffd"; + public const string BUILTININSERTS_MTEK_STRIKE_LEVEL4_HELMET_ARMOR_NAPE = + "676307d3d9ec0af3d9001fac"; + public const string BUILTININSERTS_MTEK_STRIKE_LEVEL4_HELMET_ARMOR_TOP = + "676307ded8b241b4f703a3e8"; + public const string BUILTININSERTS_NFM_HJELM_LEVEL3_HELMET_ARMOR_NAPE = + "657bbcffbbd440df880b2dd5"; + public const string BUILTININSERTS_NFM_HJELM_LEVEL3_HELMET_ARMOR_TOP = + "657bbcc9a1c61ee0c3036327"; + public const string BUILTININSERTS_OPS_CORE_FASTMT_LEVEL4_HELMET_ARMOR_NAPE = + "657f8f10f4c82973640b2350"; + public const string BUILTININSERTS_OPS_CORE_FASTMT_LEVEL4_HELMET_ARMOR_TOP = + "657f8ec5f4c82973640b234c"; public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_BACK = "65703fa06584602f7d057a8e"; public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_FRONT = "65703d866584602f7d057a8a"; - public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65703fe46a912c8b5c03468b"; - public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "657040374e67e8ec7a0d261c"; - public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_EARS = "657babc6f58ba5a6250107a2"; - public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_NAPE = "657bab6ec6f689d3a205b85f"; - public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_TOP = "657baaf0b7e9ca9a02045c02"; + public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "65703fe46a912c8b5c03468b"; + public const string BUILTININSERTS_PACA_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "657040374e67e8ec7a0d261c"; + public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_EARS = + "657babc6f58ba5a6250107a2"; + public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_NAPE = + "657bab6ec6f689d3a205b85f"; + public const string BUILTININSERTS_RATNIK_6B47_LEVEL3_HELMET_ARMOR_TOP = + "657baaf0b7e9ca9a02045c02"; public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_BACK = "6572f1d60103b4a3270332db"; public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_FRONT = "6572f1ca4c8d903cc60c874e"; - public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "6572f1f7ea457732140ce879"; - public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6572f1e10103b4a3270332df"; - public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "6572f1edea457732140ce875"; + public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "6572f1f7ea457732140ce879"; + public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6572f1e10103b4a3270332df"; + public const string BUILTININSERTS_RBAV_AF_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "6572f1edea457732140ce875"; public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_BACK = "6575dd519e27f4a85e081146"; - public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_COLLAR = "6575dd769d3a0ddf660b904b"; + public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_COLLAR = + "6575dd769d3a0ddf660b904b"; public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_FRONT = "6575dd3e9e27f4a85e081142"; - public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_GROIN_BACK = "6575dd94945bf78edd04c43c"; - public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575dd800546f8b1de093df6"; - public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575dd64945bf78edd04c438"; - public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575dd6e9d3a0ddf660b9047"; + public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_GROIN_BACK = + "6575dd94945bf78edd04c43c"; + public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575dd800546f8b1de093df6"; + public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575dd64945bf78edd04c438"; + public const string BUILTININSERTS_REDUT_M_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575dd6e9d3a0ddf660b9047"; public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_BACK = "6575d9b8945bf78edd04c427"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_COLLAR = "6575d9d8945bf78edd04c42b"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_COLLAR = + "6575d9d8945bf78edd04c42b"; public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_FRONT = "6575d9a79e27f4a85e08112d"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_GROIN_BACK = "6575d9f816c2762fba00588d"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575d9e7945bf78edd04c42f"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_ARM = "6575da07945bf78edd04c433"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575d9c40546f8b1de093dee"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575da159e27f4a85e081131"; - public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575d9cf0546f8b1de093df2"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_GROIN_BACK = + "6575d9f816c2762fba00588d"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575d9e7945bf78edd04c42f"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "6575da07945bf78edd04c433"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575d9c40546f8b1de093dee"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6575da159e27f4a85e081131"; + public const string BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575d9cf0546f8b1de093df2"; public const string BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EARS = "66bdc2c90b603c26902b2018"; public const string BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EYES = "66bdc2d051aa8c345646d03f"; public const string BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_JAW = "66bdc2d9408f1e66eb4fd957"; @@ -1388,47 +1667,81 @@ public static class ItemTpl public const string BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_EARS = "657bc2e7b30eca976305118d"; public const string BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_NAPE = "657bc2c5a1c61ee0c3036333"; public const string BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_TOP = "657bc285aab96fccee08bea3"; - public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_EARS = "657bb7d7b30eca9763051176"; - public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_NAPE = "657bb79ba1c61ee0c303631a"; - public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_TOP = "657bb70486c7f9ef7a009936"; - public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_EARS = "657ba18923918923cb0df568"; - public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_NAPE = "657ba145e57570b7f80a17ff"; - public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_TOP = "657ba096e57570b7f80a17fb"; - public const string BUILTININSERTS_SLICK_BLACK_LEVEL3_SOFT_ARMOR_BACK = "6575e72660703324250610c7"; - public const string BUILTININSERTS_SLICK_BLACK_LEVEL3_SOFT_ARMOR_FRONT = "6575e71760703324250610c3"; + public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_EARS = + "657bb7d7b30eca9763051176"; + public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_NAPE = + "657bb79ba1c61ee0c303631a"; + public const string BUILTININSERTS_SFERAS_SSSH94_LEVEL3_HELMET_ARMOR_TOP = + "657bb70486c7f9ef7a009936"; + public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_EARS = + "657ba18923918923cb0df568"; + public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_NAPE = + "657ba145e57570b7f80a17ff"; + public const string BUILTININSERTS_SHLEMOFON_TSH_4ML_LEVEL1_HELMET_ARMOR_TOP = + "657ba096e57570b7f80a17fb"; + public const string BUILTININSERTS_SLICK_BLACK_LEVEL3_SOFT_ARMOR_BACK = + "6575e72660703324250610c7"; + public const string BUILTININSERTS_SLICK_BLACK_LEVEL3_SOFT_ARMOR_FRONT = + "6575e71760703324250610c3"; public const string BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_EARS = "657119fea330b8c9060f7afc"; public const string BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_NAPE = "657119d49eb8c145180dbb95"; public const string BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_TOP = "6571199565daf6aa960c9b10"; - public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_BACK = "66b8b20c5891c84aab75cb96"; - public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_FRONT = "66b8b217c5d72b02774887b4"; - public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "66b8b223a7f72d197e70bed3"; - public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "66b8b22b78bbc0200425fb20"; - public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_BACK = "66b884eaacff495a29492849"; - public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_FRONT = "66b884f4c5d72b02774886eb"; - public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "66b884fd7994640992013b37"; - public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "66b8851678bbc0200425fa03"; - public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "66b88521a7f72d197e70be3b"; - public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_BACK = "6572eb1b04ee6483ef039882"; - public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_FRONT = "6572eb0e55beba16bc04079f"; - public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "6572eb865b5eac12f10a03ee"; - public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6572eb3004ee6483ef039886"; - public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "6572eb3b04ee6483ef03988a"; - public const string BUILTININSERTS_TAC_KEK_FAST_MT_LEVEL1_HELMET_ARMOR_NAPE = "657ba34b9ba22f103e08139b"; - public const string BUILTININSERTS_TAC_KEK_FAST_MT_LEVEL1_HELMET_ARMOR_TOP = "657ba2eef58ba5a625010798"; + public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_BACK = + "66b8b20c5891c84aab75cb96"; + public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_FRONT = + "66b8b217c5d72b02774887b4"; + public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "66b8b223a7f72d197e70bed3"; + public const string BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "66b8b22b78bbc0200425fb20"; + public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_BACK = + "66b884eaacff495a29492849"; + public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_FRONT = + "66b884f4c5d72b02774886eb"; + public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "66b884fd7994640992013b37"; + public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "66b8851678bbc0200425fa03"; + public const string BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "66b88521a7f72d197e70be3b"; + public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_BACK = + "6572eb1b04ee6483ef039882"; + public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_FRONT = + "6572eb0e55beba16bc04079f"; + public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_GROIN_FRONT = + "6572eb865b5eac12f10a03ee"; + public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6572eb3004ee6483ef039886"; + public const string BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "6572eb3b04ee6483ef03988a"; + public const string BUILTININSERTS_TAC_KEK_FAST_MT_LEVEL1_HELMET_ARMOR_NAPE = + "657ba34b9ba22f103e08139b"; + public const string BUILTININSERTS_TAC_KEK_FAST_MT_LEVEL1_HELMET_ARMOR_TOP = + "657ba2eef58ba5a625010798"; public const string BUILTININSERTS_TACTEC_LEVEL3_SOFT_ARMOR_BACK = "6575bca0dc9932aed601c5d7"; public const string BUILTININSERTS_TACTEC_LEVEL3_SOFT_ARMOR_FRONT = "6575bc88c6700bd6b40e8a57"; public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_BACK = "6572e52f73c0eabb700109a0"; public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_FRONT = "6572e5221b5bc1185508c24f"; - public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6572e53c73c0eabb700109a4"; - public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6572e54873c0eabb700109a8"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_BACK = "6575d56b16c2762fba005818"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_COLLAR = "6575d598b15fef3dd4051678"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_FRONT = "6575d561b15fef3dd4051670"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_GROIN_FRONT = "6575d5a616c2762fba005820"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_LEFT_ARM = "6575d5b316c2762fba005824"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575d57a16c2762fba00581c"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575d5bd16c2762fba005828"; - public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575d589b15fef3dd4051674"; + public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6572e53c73c0eabb700109a4"; + public const string BUILTININSERTS_THORCRV_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6572e54873c0eabb700109a8"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_BACK = + "6575d56b16c2762fba005818"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_COLLAR = + "6575d598b15fef3dd4051678"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_FRONT = + "6575d561b15fef3dd4051670"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_GROIN_FRONT = + "6575d5a616c2762fba005820"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_LEFT_ARM = + "6575d5b316c2762fba005824"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6575d57a16c2762fba00581c"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_RIGHT_ARM = + "6575d5bd16c2762fba005828"; + public const string BUILTININSERTS_THORINTCAR_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6575d589b15fef3dd4051674"; public const string BUILTININSERTS_TROOPER_LEVEL3_SOFT_ARMOR_BACK = "6570e0610b57c03ec90b96ef"; public const string BUILTININSERTS_TROOPER_LEVEL3_SOFT_ARMOR_FRONT = "6570e025615f54368b04fcb0"; public const string BUILTININSERTS_TV110_LEVEL2_SOFT_ARMOR_BACK = "6570df9c615f54368b04fca9"; @@ -1443,39 +1756,55 @@ public static class ItemTpl public const string BUILTININSERTS_UNTAR_LEVEL3_HELMET_ARMOR_TOP = "654a90aff4f81a421b0a7c86"; public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_BACK = "657045741bd9beedc40b7299"; public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_FRONT = "657044e971369562b300ce9b"; - public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657045b97e80617cee095bda"; - public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6570460471369562b300ce9f"; + public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "657045b97e80617cee095bda"; + public const string BUILTININSERTS_UNTAR_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "6570460471369562b300ce9f"; public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_BACK = "6571dbda88ead79fcf091d75"; public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_COLLAR = "6571dbef88ead79fcf091d79"; public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_FRONT = "6571dbd388ead79fcf091d71"; - public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "6571dbe07c02ae206002502e"; - public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "6571dbeaee8ec43d520cf89e"; + public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_LEFT_SIDE = + "6571dbe07c02ae206002502e"; + public const string BUILTININSERTS_ZHUK3_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = + "6571dbeaee8ec43d520cf89e"; public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_BACK = "657642b0e6d5dd75f40688a5"; public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_COLLAR = "657643a220cc24d17102b14c"; public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_FRONT = "65764275d8537eb26a0355e9"; - public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6576434820cc24d17102b148"; - public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "657643732bc38ef78e076477"; - public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_EARS = "657f92e7f4c82973640b2354"; - public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_NAPE = "657f92acada5fadd1f07a57e"; - public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_TOP = "657f925dada5fadd1f07a57a"; + public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_LEFT_SIDE = + "6576434820cc24d17102b148"; + public const string BUILTININSERTS_ZHUK6_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = + "657643732bc38ef78e076477"; + public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_EARS = + "657f92e7f4c82973640b2354"; + public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_NAPE = + "657f92acada5fadd1f07a57e"; + public const string BUILTININSERTS_ZSH_1_2M_LEVEL4_HELMET_ARMOR_TOP = + "657f925dada5fadd1f07a57a"; public const string CHARGE_AI_AXMC_338_LM_BOLT_ASSEMBLY = "62811cd7308cb521f87a8f99"; public const string CHARGE_AK_CSS_KNURLED_CHARGING_HANDLE = "6130ca3fd92c473c77020dbd"; public const string CHARGE_AK_ZENIT_RP1_CHARGING_HANDLE = "5648ac824bdc2ded0b8b457d"; public const string CHARGE_AR10_KAC_AMBIDEXTROUS_CHARGING_HANDLE = "5df8e085bb49d91fb446d6a8"; public const string CHARGE_AR10_KAC_CHARGING_HANDLE = "5df8e053bb49d91fb446d6a6"; public const string CHARGE_AR15_ADAR_215_CHARGING_HANDLE = "5c0faf68d174af02a96260b8"; - public const string CHARGE_AR15_BADGER_ORDNANCE_TACTICAL_CHARGING_HANDLE_LATCH = "56ea7165d2720b6e518b4583"; + public const string CHARGE_AR15_BADGER_ORDNANCE_TACTICAL_CHARGING_HANDLE_LATCH = + "56ea7165d2720b6e518b4583"; public const string CHARGE_AR15_COLT_CHARGING_HANDLE = "55d44fd14bdc2d962f8b456e"; - public const string CHARGE_AR15_DANIEL_DEFENSE_GRIPNRIP_CHARGING_HANDLE = "651bf5617b3b552ef6712cb7"; + public const string CHARGE_AR15_DANIEL_DEFENSE_GRIPNRIP_CHARGING_HANDLE = + "651bf5617b3b552ef6712cb7"; public const string CHARGE_AR15_GEISSELE_ACH_CHARGING_HANDLE_DDC = "5ea16d4d5aad6446a939753d"; public const string CHARGE_AR15_HK_EXTENDED_LATCH_CHARGING_HANDLE = "5bb20dbcd4351e44f824c04e"; public const string CHARGE_AR15_MAGPUL_BAD_LEVER_BOLT_RELEASE = "675307301f7c19a9780f2668"; - public const string CHARGE_AR15_MASP_INDUSTRIES_AMBIDEXTROUS_BATTLE_CHARGING_HANDLE = "6033749e88382f4fab3fd2c5"; - public const string CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_FDE = "5b2240bf5acfc40dc528af69"; - public const string CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_TUNGSTEN_GREY = "5d44334ba4b9362b346d1948"; - public const string CHARGE_AR15_RAINIER_ARMS_AVALANCHE_MOD2_CHARGING_HANDLE = "5f633ff5c444ce7e3c30a006"; + public const string CHARGE_AR15_MASP_INDUSTRIES_AMBIDEXTROUS_BATTLE_CHARGING_HANDLE = + "6033749e88382f4fab3fd2c5"; + public const string CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_FDE = + "5b2240bf5acfc40dc528af69"; + public const string CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_TUNGSTEN_GREY = + "5d44334ba4b9362b346d1948"; + public const string CHARGE_AR15_RAINIER_ARMS_AVALANCHE_MOD2_CHARGING_HANDLE = + "5f633ff5c444ce7e3c30a006"; public const string CHARGE_BENELLI_M3_SUPER_90_CHARGING_HANDLE = "625ec45bb14d7326ac20f572"; - public const string CHARGE_DO_NOT_USEAI_AXMC_762X51MM_BOLT_ASSEMBLY = "62811d61578c54356d6d67ea"; + public const string CHARGE_DO_NOT_USEAI_AXMC_762X51MM_BOLT_ASSEMBLY = + "62811d61578c54356d6d67ea"; public const string CHARGE_FN_P90_CHARGING_HANDLE = "5cc6ea78e4a949000e1ea3c1"; public const string CHARGE_FN_P90_KM_THE_HANDLER_CHARGING_HANDLE = "5cc6ea85e4a949000e1ea3c3"; public const string CHARGE_FN_SCAR_CHARGING_HANDLE = "6181688c6c780c1e710c9b04"; @@ -1495,8 +1824,10 @@ public static class ItemTpl public const string CHARGE_STEYR_AUG_A3_CHARGING_HANDLE = "62ebbc53e3c1e1ec7c02c44f"; public const string COLLIMATOR_AIMPOINT_COMPM4_REFLEX_SIGHT = "5c7d55de2e221644f31bff68"; public const string COLLIMATOR_AIMPOINT_PRO_REFLEX_SIGHT = "61659f79d92c473c770213ee"; - public const string COLLIMATOR_AXION_KOBRA_EKP1S03_REFLEX_SIGHT_DOVETAIL = "6544d4187c5457729210d277"; - public const string COLLIMATOR_AXION_KOBRA_EKP802_REFLEX_SIGHT_DOVETAIL = "5947db3f86f77447880cf76f"; + public const string COLLIMATOR_AXION_KOBRA_EKP1S03_REFLEX_SIGHT_DOVETAIL = + "6544d4187c5457729210d277"; + public const string COLLIMATOR_AXION_KOBRA_EKP802_REFLEX_SIGHT_DOVETAIL = + "5947db3f86f77447880cf76f"; public const string COLLIMATOR_AXION_KOBRA_EKP818_REFLEX_SIGHT = "591c4efa86f7741030027726"; public const string COLLIMATOR_BELOMO_PKAA_DOVETAIL_REFLEX_SIGHT = "6113d6c3290d254f5e6b27db"; public const string COLLIMATOR_ELCAN_SPECTER_HCO_HOLOGRAPHIC_SIGHT = "64785e7c19d732620e045e15"; @@ -1511,28 +1842,38 @@ public static class ItemTpl public const string COLLIMATOR_HOLOSUN_HS401G5_REFLEX_SIGHT = "5b30b0dc5acfc400153b7124"; public const string COLLIMATOR_KOMZ_RUSAK_REFLEX_SIGHT = "65f05b9d39dab9e9ec049cfd"; public const string COLLIMATOR_LEAPERS_UTG_REFLEX_SIGHT = "6165ac8c290d254f5e6b2f6c"; - public const string COLLIMATOR_MILKOR_M2A1_GRENADE_LAUNCHER_REFLEX_SIGHT = "6284bd5f95250a29bc628a30"; + public const string COLLIMATOR_MILKOR_M2A1_GRENADE_LAUNCHER_REFLEX_SIGHT = + "6284bd5f95250a29bc628a30"; public const string COLLIMATOR_NPZ_PK1_OBZOR_DOVETAIL_REFLEX_SIGHT = "618a5d5852ecee1505530b2a"; public const string COLLIMATOR_OKP7_REFLEX_SIGHT = "570fd79bd2720bc7458b4583"; public const string COLLIMATOR_OKP7_REFLEX_SIGHT_DOVETAIL = "57486e672459770abd687134"; - public const string COLLIMATOR_SIG_SAUER_ROMEO7_1X30_REFLEX_SIGHT_PROTOTYPE = "6477772ea8a38bb2050ed4db"; + public const string COLLIMATOR_SIG_SAUER_ROMEO7_1X30_REFLEX_SIGHT_PROTOTYPE = + "6477772ea8a38bb2050ed4db"; public const string COLLIMATOR_SIG_SAUER_ROMEO8T_REFLEX_SIGHT = "60a23797a37c940de7062d02"; public const string COLLIMATOR_SR2M_KPSR2_REFLEX_SIGHT = "62ff9920fe938a24c90c10d2"; public const string COLLIMATOR_TRIJICON_SRS02_REFLEX_SIGHT = "5d2da1e948f035477b1ce2ba"; public const string COLLIMATOR_VALDAY_KRECHET_REFLEX_SIGHT = "609a63b6e2ff132951242d09"; public const string COLLIMATOR_VALDAY_PK120_1P87_HOLOGRAPHIC_SIGHT = "5c0505e00db834001b735073"; - public const string COLLIMATOR_VOMZ_PILAD_P1X42_WEAVER_REFLEX_SIGHT = "584984812459776a704a82a6"; + public const string COLLIMATOR_VOMZ_PILAD_P1X42_WEAVER_REFLEX_SIGHT = + "584984812459776a704a82a6"; public const string COLLIMATOR_VOMZ_PILAD_TARGETRING_REFLEX_SIGHT = "609b9e31506cf869cf3eaf41"; - public const string COLLIMATOR_VORTEX_RAZOR_AMG_UH1_HOLOGRAPHIC_SIGHT = "59f9d81586f7744c7506ee62"; + public const string COLLIMATOR_VORTEX_RAZOR_AMG_UH1_HOLOGRAPHIC_SIGHT = + "59f9d81586f7744c7506ee62"; public const string COLLIMATOR_WALTHER_MRS_REFLEX_SIGHT = "570fd721d2720bc5458b4596"; public const string COLLIMATOR_WILCOX_BOSS_XE_REFLEX_SIGHT = "655f13e0a246670fb0373245"; - public const string COMPACTCOLLIMATOR_AIMPOINT_ACRO_P1_REFLEX_SIGHT = "616442e4faa1272e43152193"; - public const string COMPACTCOLLIMATOR_AIMPOINT_MICRO_H2_REFLEX_SIGHT = "61657230d92c473c770213d7"; - public const string COMPACTCOLLIMATOR_AIMPOINT_MICRO_T1_REFLEX_SIGHT = "58d399e486f77442e0016fe7"; + public const string COMPACTCOLLIMATOR_AIMPOINT_ACRO_P1_REFLEX_SIGHT = + "616442e4faa1272e43152193"; + public const string COMPACTCOLLIMATOR_AIMPOINT_MICRO_H2_REFLEX_SIGHT = + "61657230d92c473c770213d7"; + public const string COMPACTCOLLIMATOR_AIMPOINT_MICRO_T1_REFLEX_SIGHT = + "58d399e486f77442e0016fe7"; public const string COMPACTCOLLIMATOR_BELOMO_PK06_REFLEX_SIGHT = "57ae0171245977343c27bfcf"; - public const string COMPACTCOLLIMATOR_BURRIS_FASTFIRE_3_REFLEX_SIGHT = "577d141e24597739c5255e01"; - public const string COMPACTCOLLIMATOR_LEUPOLD_DELTAPOINT_REFLEX_SIGHT = "58d268fc86f774111273f8c2"; - public const string COMPACTCOLLIMATOR_SIG_SAUER_ROMEO4_REFLEX_SIGHT = "5b3116595acfc40019476364"; + public const string COMPACTCOLLIMATOR_BURRIS_FASTFIRE_3_REFLEX_SIGHT = + "577d141e24597739c5255e01"; + public const string COMPACTCOLLIMATOR_LEUPOLD_DELTAPOINT_REFLEX_SIGHT = + "58d268fc86f774111273f8c2"; + public const string COMPACTCOLLIMATOR_SIG_SAUER_ROMEO4_REFLEX_SIGHT = + "5b3116595acfc40019476364"; public const string COMPACTCOLLIMATOR_TRIJICON_RMR_REFLEX_SIGHT = "5a32aa8bc4a2826c6e06d737"; public const string COMPASS_EYE_MK2_PROFESSIONAL_HANDHELD = "5f4f9eb969cdc30ff33f09db"; public const string CONTAINER_AMMUNITION_CASE = "5aafbde786f774389d0cbc0f"; @@ -1563,7 +1904,8 @@ public static class ItemTpl public const string DRINK_AQUAMARI_WATER_BOTTLE_WITH_FILTER = "5c0fa877d174af02a012e1cf"; public const string DRINK_BOTTLE_OF_DAN_JACKIEL_WHISKEY = "5d403f9186f7743cac3f229b"; public const string DRINK_BOTTLE_OF_FIERCE_HATCHLING_MOONSHINE = "5d1b376e86f774252519444e"; - public const string DRINK_BOTTLE_OF_NORVINSKY_YADRENIY_PREMIUM_KVASS_06L = "5e8f3423fd7471236e6e3b64"; + public const string DRINK_BOTTLE_OF_NORVINSKY_YADRENIY_PREMIUM_KVASS_06L = + "5e8f3423fd7471236e6e3b64"; public const string DRINK_BOTTLE_OF_PEVKO_LIGHT_BEER = "62a09f32621468534a797acb"; public const string DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA = "5d40407c86f774318526545a"; public const string DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA_BAD = "614451b71e5874611e2c7ae5"; @@ -1588,14 +1930,22 @@ public static class ItemTpl public const string DRUGS_VASELINE_BALM = "5755383e24597772cb798966"; public const string FACECOVER_ARENA_CUP_SERIES_BALACLAVA = "67f90180f07898267b0a4ed7"; public const string FACECOVER_ASTRONOMER_MASK = "67602a39c8e72a73250de739"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_DEMON = "67a5c61c7f52620c5b05b4d8"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_EL_DA_DE_MUERTOS = "67a5c657782ce4655104db16"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SCARS = "67a5c5df782ce4655104db14"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SKULL = "67a5c6068fcd9fb73f0752cf"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SMILE = "67a4b71ad3228756b6088ee2"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_STOP_ME = "67a5c5b6dfdf568c9009af66"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_TARGET = "67a5c5f37f52620c5b05b4d6"; - public const string FACECOVER_ATOMIC_DEFENSE_CQCM_UP_ARMORED_BALLISTIC_MASK_BLACK = "657089638db3adca1009f4ca"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_DEMON = + "67a5c61c7f52620c5b05b4d8"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_EL_DA_DE_MUERTOS = + "67a5c657782ce4655104db16"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SCARS = + "67a5c5df782ce4655104db14"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SKULL = + "67a5c6068fcd9fb73f0752cf"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_SMILE = + "67a4b71ad3228756b6088ee2"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_STOP_ME = + "67a5c5b6dfdf568c9009af66"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_BALLISTIC_MASK_TARGET = + "67a5c5f37f52620c5b05b4d6"; + public const string FACECOVER_ATOMIC_DEFENSE_CQCM_UP_ARMORED_BALLISTIC_MASK_BLACK = + "657089638db3adca1009f4ca"; public const string FACECOVER_AYBOLIT_MASK = "676029e22749de558a0b7e69"; public const string FACECOVER_BADDIES_RED_BEARD = "62a09dd4621468534a797ac7"; public const string FACECOVER_BALACLAVA = "572b7f1624597762ae139822"; @@ -1620,16 +1970,20 @@ public static class ItemTpl public const string FACECOVER_BIG_PIPES_SMOKING_PIPE = "62a61bbf8ec41a51b34758d2"; public const string FACECOVER_CIPOLLINO_MASK = "676029ca2749de558a0b7e67"; public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA = "5ab8f39486f7745cd93a1cca"; - public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_DPM_DESERT = "67a9dccf9de6826a650ee06a"; + public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_DPM_DESERT = + "67a9dccf9de6826a650ee06a"; public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_GREEN = "67a9dc769de6826a650ee066"; - public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_MULTICAM_TROPIC = "67a9dce47faa4210bb0807c8"; + public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_MULTICAM_TROPIC = + "67a9dce47faa4210bb0807c8"; public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_OAK = "67a9dca99de6826a650ee068"; public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_SBEU = "67a9dc997faa4210bb0807c6"; public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_SURPAT = "67a9dcbac185de5a4d0c2a06"; - public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_TIGER_STRIPE = "67a9dd619de6826a650ee06c"; + public const string FACECOVER_COLD_FEAR_INFRARED_BALACLAVA_TIGER_STRIPE = + "67a9dd619de6826a650ee06c"; public const string FACECOVER_DEADLY_SKULL_MASK = "5b432b6c5acfc4001a599bf0"; public const string FACECOVER_DEATH_KNIGHT_MASK = "62963c18dbc8ab5f0d382d0b"; - public const string FACECOVER_DEATH_SHADOW_LIGHTWEIGHT_ARMORED_MASK = "6570aead4d84f81fd002a033"; + public const string FACECOVER_DEATH_SHADOW_LIGHTWEIGHT_ARMORED_MASK = + "6570aead4d84f81fd002a033"; public const string FACECOVER_FACELESS_MASK = "6176a48d732a664031271438"; public const string FACECOVER_FAKE_MUSTACHE = "5bd073a586f7747e6f135799"; public const string FACECOVER_FAKE_WHITE_BEARD = "5c1a1e3f2e221602b66cc4c2"; @@ -1687,154 +2041,252 @@ public static class ItemTpl public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_FIREWORK = "675ea3d6312c0a5c4e04e317"; public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_GREEN = "6217726288ed9f0845317459"; public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_RED = "62178c4d4ecf221597654e3d"; - public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_SPECIAL_YELLOW = "66d9f1abb16d9aacf5068468"; + public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_SPECIAL_YELLOW = + "66d9f1abb16d9aacf5068468"; public const string FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_YELLOW = "624c0b3340357b5f566e8766"; public const string FLASHHIDER_AI_338_LM_TACTICAL_MUZZLE_BRAKE = "62812081d23f207deb0ab216"; - public const string FLASHHIDER_AK_HEXAGON_REACTOR_545X39_MUZZLE_BRAKE = "615d8f5dd92c473c770212ef"; - public const string FLASHHIDER_AK_LANTAC_DRAKON_762X39_MUZZLE_BRAKE = "5c878ebb2e2216001219d48a"; - public const string FLASHHIDER_AK_SPIKES_TACTICAL_DYNACOMP_762X39_MUZZLE_BRAKECOMPENSATOR = "5a9ea27ca2750c00137fa672"; - public const string FLASHHIDER_AK_SRVV_762X39_MUZZLE_BRAKECOMPENSATOR = "5cc9ad73d7f00c000e2579d4"; + public const string FLASHHIDER_AK_HEXAGON_REACTOR_545X39_MUZZLE_BRAKE = + "615d8f5dd92c473c770212ef"; + public const string FLASHHIDER_AK_LANTAC_DRAKON_762X39_MUZZLE_BRAKE = + "5c878ebb2e2216001219d48a"; + public const string FLASHHIDER_AK_SPIKES_TACTICAL_DYNACOMP_762X39_MUZZLE_BRAKECOMPENSATOR = + "5a9ea27ca2750c00137fa672"; + public const string FLASHHIDER_AK_SRVV_762X39_MUZZLE_BRAKECOMPENSATOR = + "5cc9ad73d7f00c000e2579d4"; public const string FLASHHIDER_AK_VECTOR_VR05T_762X39_MUZZLE_BRAKE = "64942bfc6ee699f6890dff95"; - public const string FLASHHIDER_AK_VENOM_TACTICAL_ANTIDOTE_762X39_MUZZLE_BRAKECOMPENSATOR = "5c7951452e221644f31bfd5c"; - public const string FLASHHIDER_AK_ZENIT_DTK1_762X39545X39_MUZZLE_BRAKECOMPENSATOR = "5649ab884bdc2ded0b8b457f"; - public const string FLASHHIDER_AK101_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e615acfc43f67248aa0"; - public const string FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e725acfc400180ae701"; - public const string FLASHHIDER_AK103_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e7d5acfc40016339a02"; - public const string FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e895acfc43b321d4bd5"; - public const string FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e945acfc43f3b691116"; + public const string FLASHHIDER_AK_VENOM_TACTICAL_ANTIDOTE_762X39_MUZZLE_BRAKECOMPENSATOR = + "5c7951452e221644f31bfd5c"; + public const string FLASHHIDER_AK_ZENIT_DTK1_762X39545X39_MUZZLE_BRAKECOMPENSATOR = + "5649ab884bdc2ded0b8b457f"; + public const string FLASHHIDER_AK101_556X45_MUZZLE_BRAKECOMPENSATOR = + "5ac72e615acfc43f67248aa0"; + public const string FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR = + "5ac72e725acfc400180ae701"; + public const string FLASHHIDER_AK103_762X39_MUZZLE_BRAKECOMPENSATOR = + "5ac72e7d5acfc40016339a02"; + public const string FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR = + "5ac72e895acfc43b321d4bd5"; + public const string FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR = + "5ac72e945acfc43f3b691116"; public const string FLASHHIDER_AK12_545X39_MUZZLE_BRAKE = "649ec2af961514b22506b10f"; public const string FLASHHIDER_AK74_545X39_MUZZLE_BRAKECOMPENSATOR = "5649aa744bdc2ded0b8b457e"; public const string FLASHHIDER_AK74_PWS_CQB_74_545X39_MUZZLE_BRAKE = "5943eeeb86f77412d6384f6b"; - public const string FLASHHIDER_AK74_SRVV_MBR_JET_545X39_MUZZLE_BRAKE = "5cc9a96cd7f00c011c04e04a"; - public const string FLASHHIDER_AK74_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_MULTICALIBER_MUZZLE_BRAKE = "5f633f791b231926f2329f13"; - public const string FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac7655e5acfc40016339a19"; + public const string FLASHHIDER_AK74_SRVV_MBR_JET_545X39_MUZZLE_BRAKE = + "5cc9a96cd7f00c011c04e04a"; + public const string FLASHHIDER_AK74_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_MULTICALIBER_MUZZLE_BRAKE = + "5f633f791b231926f2329f13"; + public const string FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR = + "5ac7655e5acfc40016339a19"; public const string FLASHHIDER_AKM_762X39_MUZZLE_BRAKECOMPENSATOR = "59d64fc686f774171b243fe2"; - public const string FLASHHIDER_AKM_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_762X39_MUZZLE_BRAKE = "5f633f68f5750b524b45f112"; + public const string FLASHHIDER_AKM_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_762X39_MUZZLE_BRAKE = + "5f633f68f5750b524b45f112"; public const string FLASHHIDER_AKML_SYSTEM_762X39_FLASH_HIDER = "5a0d716f1526d8000d26b1e2"; public const string FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE = "57dc324a24597759501edc20"; - public const string FLASHHIDER_AR10_2A_ARMANENT_X3_762X51_COMPENSATOR = "5b7d693d5acfc43bca706a3d"; - public const string FLASHHIDER_AR10_AAC_BLACKOUT_51T_762X51_FLASH_HIDER = "5a34fd2bc4a282329a73b4c5"; - public const string FLASHHIDER_AR10_AAC_SCARSD_51T_762X51_FLASH_HIDER = "618178aa1cb55961fa0fdc80"; + public const string FLASHHIDER_AR10_2A_ARMANENT_X3_762X51_COMPENSATOR = + "5b7d693d5acfc43bca706a3d"; + public const string FLASHHIDER_AR10_AAC_BLACKOUT_51T_762X51_FLASH_HIDER = + "5a34fd2bc4a282329a73b4c5"; + public const string FLASHHIDER_AR10_AAC_SCARSD_51T_762X51_FLASH_HIDER = + "618178aa1cb55961fa0fdc80"; public const string FLASHHIDER_AR10_AWC_PSR_762X51_MUZZLE_BRAKE = "612e0d3767085e45ef14057f"; - public const string FLASHHIDER_AR10_CMMG_SV_BRAKE_762X51_MUZZLE_BRAKE = "6065c6e7132d4d12c81fd8e1"; - public const string FLASHHIDER_AR10_DANIEL_DEFENSE_WAVE_762X51_MUZZLE_BRAKE = "5d1f819086f7744b355c219b"; - public const string FLASHHIDER_AR10_DEAD_AIR_KEYMOUNT_762X51_MUZZLE_BRAKE = "628a66b41d5e41750e314f34"; - public const string FLASHHIDER_AR10_DELTATEK_DTKAR10_762X51_MUZZLE_BRAKE = "6642f63667f5cb56a00662eb"; + public const string FLASHHIDER_AR10_CMMG_SV_BRAKE_762X51_MUZZLE_BRAKE = + "6065c6e7132d4d12c81fd8e1"; + public const string FLASHHIDER_AR10_DANIEL_DEFENSE_WAVE_762X51_MUZZLE_BRAKE = + "5d1f819086f7744b355c219b"; + public const string FLASHHIDER_AR10_DEAD_AIR_KEYMOUNT_762X51_MUZZLE_BRAKE = + "628a66b41d5e41750e314f34"; + public const string FLASHHIDER_AR10_DELTATEK_DTKAR10_762X51_MUZZLE_BRAKE = + "6642f63667f5cb56a00662eb"; public const string FLASHHIDER_AR10_DESERT_TECH_762X51_FLASH_HIDER = "5dcbe965e4ed22586443a79d"; - public const string FLASHHIDER_AR10_FORTIS_RED_BRAKE_762X51_MUZZLE_BRAKE = "5d026791d7ad1a04a067ea63"; - public const string FLASHHIDER_AR10_KAC_QDC_762X51_FLASH_SUPPRESSOR_KIT = "5dfa3cd1b33c0951220c079b"; - public const string FLASHHIDER_AR10_KAC_QDC_762X51_MUZZLE_BRAKE_KIT = "6130c43c67085e45ef1405a1"; - public const string FLASHHIDER_AR10_KEENO_ARMS_SHREWD_762X51_MUZZLE_BRAKE = "5cdd7685d7f00c000f260ed2"; - public const string FLASHHIDER_AR10_LANTAC_DRAGON_762X51_MUZZLE_BRAKECOMPENSATOR = "5c878e9d2e2216000f201903"; - public const string FLASHHIDER_AR10_NORDIC_COMPONENTS_CORVETTE_762X51_COMPENSATOR = "5d02677ad7ad1a04a15c0f95"; - public const string FLASHHIDER_AR10_ODIN_WORKS_ATLAS7_762X51_MUZZLE_BRAKE = "5bbdb8bdd4351e4502011460"; - public const string FLASHHIDER_AR10_PRECISION_ARMANENT_M11_SEVEREDUTY_762X51_MUZZLE_BRAKE = "5cdd7693d7f00c0010373aa5"; - public const string FLASHHIDER_AR10_SUREFIRE_PROCOMP_762X51_MUZZLE_BRAKE = "607ffb988900dc2d9a55b6e4"; - public const string FLASHHIDER_AR10_SUREFIRE_WARDEN_762X51_BLAST_REGULATOR = "615d8eb350224f204c1da1cf"; + public const string FLASHHIDER_AR10_FORTIS_RED_BRAKE_762X51_MUZZLE_BRAKE = + "5d026791d7ad1a04a067ea63"; + public const string FLASHHIDER_AR10_KAC_QDC_762X51_FLASH_SUPPRESSOR_KIT = + "5dfa3cd1b33c0951220c079b"; + public const string FLASHHIDER_AR10_KAC_QDC_762X51_MUZZLE_BRAKE_KIT = + "6130c43c67085e45ef1405a1"; + public const string FLASHHIDER_AR10_KEENO_ARMS_SHREWD_762X51_MUZZLE_BRAKE = + "5cdd7685d7f00c000f260ed2"; + public const string FLASHHIDER_AR10_LANTAC_DRAGON_762X51_MUZZLE_BRAKECOMPENSATOR = + "5c878e9d2e2216000f201903"; + public const string FLASHHIDER_AR10_NORDIC_COMPONENTS_CORVETTE_762X51_COMPENSATOR = + "5d02677ad7ad1a04a15c0f95"; + public const string FLASHHIDER_AR10_ODIN_WORKS_ATLAS7_762X51_MUZZLE_BRAKE = + "5bbdb8bdd4351e4502011460"; + public const string FLASHHIDER_AR10_PRECISION_ARMANENT_M11_SEVEREDUTY_762X51_MUZZLE_BRAKE = + "5cdd7693d7f00c0010373aa5"; + public const string FLASHHIDER_AR10_SUREFIRE_PROCOMP_762X51_MUZZLE_BRAKE = + "607ffb988900dc2d9a55b6e4"; + public const string FLASHHIDER_AR10_SUREFIRE_WARDEN_762X51_BLAST_REGULATOR = + "615d8eb350224f204c1da1cf"; public const string FLASHHIDER_AR10_TAA_ZK38_762X51_MUZZLE_BRAKE = "612e0e3c290d254f5e6b291d"; - public const string FLASHHIDER_AR10_THUNDER_BEAST_ARMS_30CB_762X51_MUZZLE_BRAKE = "5d443f8fa4b93678dd4a01aa"; - public const string FLASHHIDER_AR15_AAC_BLACKOUT_51T_556X45_FLASH_HIDER = "5c7e5f112e221600106f4ede"; + public const string FLASHHIDER_AR10_THUNDER_BEAST_ARMS_30CB_762X51_MUZZLE_BRAKE = + "5d443f8fa4b93678dd4a01aa"; + public const string FLASHHIDER_AR15_AAC_BLACKOUT_51T_556X45_FLASH_HIDER = + "5c7e5f112e221600106f4ede"; public const string FLASHHIDER_AR15_ADAR_215_556X45_FLASH_HIDER = "5c0fafb6d174af02a96260ba"; - public const string FLASHHIDER_AR15_AEROKNOX_BUTTERFLY_556X45_MUZZLE_BRAKE = "6405ff6bd4578826ec3e377a"; + public const string FLASHHIDER_AR15_AEROKNOX_BUTTERFLY_556X45_MUZZLE_BRAKE = + "6405ff6bd4578826ec3e377a"; public const string FLASHHIDER_AR15_ALIENTECH_556X45_MUZZLE_BRAKE = "63ac5c9658d0485fc039f0b8"; public const string FLASHHIDER_AR15_AWC_PSR_556X45_MUZZLE_BRAKE = "612e0cfc8004cc50514c2d9e"; - public const string FLASHHIDER_AR15_BULLETEC_ST6012_556X45_MUZZLE_BRAKE = "5cf6937cd7f00c056c53fb39"; - public const string FLASHHIDER_AR15_COLT_USGI_A2_556X45_FLASH_HIDER = "544a38634bdc2d58388b4568"; - public const string FLASHHIDER_AR15_DANIEL_DEFENSE_WAVE_556X45_MUZZLE_BRAKE = "5cff9e5ed7ad1a09407397d4"; - public const string FLASHHIDER_AR15_DELTATEK_DTKM16_556X45_MUZZLE_BRAKE = "664301213dd83ddae20dda18"; + public const string FLASHHIDER_AR15_BULLETEC_ST6012_556X45_MUZZLE_BRAKE = + "5cf6937cd7f00c056c53fb39"; + public const string FLASHHIDER_AR15_COLT_USGI_A2_556X45_FLASH_HIDER = + "544a38634bdc2d58388b4568"; + public const string FLASHHIDER_AR15_DANIEL_DEFENSE_WAVE_556X45_MUZZLE_BRAKE = + "5cff9e5ed7ad1a09407397d4"; + public const string FLASHHIDER_AR15_DELTATEK_DTKM16_556X45_MUZZLE_BRAKE = + "664301213dd83ddae20dda18"; public const string FLASHHIDER_AR15_DESERT_TECH_556X45_FLASH_HIDER = "5c48a2a42e221602b66d1e07"; - public const string FLASHHIDER_AR15_DOUBLESTAR_CARLSON_TAC_COMP_556X45_COMPENSATOR = "6621455e3aceea9e2b0b01e7"; - public const string FLASHHIDER_AR15_FERFRANS_CQB_556X45_MUZZLE_BRAKE = "5f6372e2865db925d54f3869"; - public const string FLASHHIDER_AR15_GRIFFIN_ARMAMENT_GATELOK_HAMMER_556X45_FLASH_HIDER = "6386120cd6baa055ad1e201c"; + public const string FLASHHIDER_AR15_DOUBLESTAR_CARLSON_TAC_COMP_556X45_COMPENSATOR = + "6621455e3aceea9e2b0b01e7"; + public const string FLASHHIDER_AR15_FERFRANS_CQB_556X45_MUZZLE_BRAKE = + "5f6372e2865db925d54f3869"; + public const string FLASHHIDER_AR15_GRIFFIN_ARMAMENT_GATELOK_HAMMER_556X45_FLASH_HIDER = + "6386120cd6baa055ad1e201c"; public const string FLASHHIDER_AR15_HK_BLITZ_556X45_FLASH_HIDER = "615d8e2f1cb55961fa0fd9a4"; - public const string FLASHHIDER_AR15_KAC_QDC_556X45_3PRONG_FLASH_ELIMINATOR = "626667e87379c44d557b7550"; - public const string FLASHHIDER_AR15_KAC_QDC_556X45_FLASH_SUPPRESSOR_KIT = "56ea8180d2720bf2698b456a"; - public const string FLASHHIDER_AR15_NORDIC_COMPONENTS_CORVETTE_556X45_COMPENSATOR = "5d02676dd7ad1a049e54f6dc"; + public const string FLASHHIDER_AR15_KAC_QDC_556X45_3PRONG_FLASH_ELIMINATOR = + "626667e87379c44d557b7550"; + public const string FLASHHIDER_AR15_KAC_QDC_556X45_FLASH_SUPPRESSOR_KIT = + "56ea8180d2720bf2698b456a"; + public const string FLASHHIDER_AR15_NORDIC_COMPONENTS_CORVETTE_556X45_COMPENSATOR = + "5d02676dd7ad1a049e54f6dc"; public const string FLASHHIDER_AR15_NOVESKE_KX3_556X45_FLASH_HIDER = "56ea6fafd2720b844b8b4593"; public const string FLASHHIDER_AR15_PWS_CQB_556X45_MUZZLE_BRAKE = "5943ee5a86f77413872d25ec"; - public const string FLASHHIDER_AR15_SAI_JAILBRAKE_556X45_MUZZLE_DEVICE = "5c78f2882e22165df16b832e"; - public const string FLASHHIDER_AR15_SILENCERCO_ASR_556X45_FLASH_HIDER = "609269c3b0e443224b421cc1"; - public const string FLASHHIDER_AR15_SUREFIRE_SF3P_556X45_FLASH_HIDER = "5c7fb51d2e2216001219ce11"; - public const string FLASHHIDER_AR15_SUREFIRE_SF4P_556X45_FLASH_HIDER = "5ea172e498dacb342978818e"; - public const string FLASHHIDER_AR15_SUREFIRE_WARCOMP_556X45_FLASH_HIDER = "5c6d710d2e22165df16b81e7"; - public const string FLASHHIDER_AR15_SUREFIRE_WARDEN_556X45_BLAST_REGULATOR = "62669bccdb9ebb4daa44cd14"; + public const string FLASHHIDER_AR15_SAI_JAILBRAKE_556X45_MUZZLE_DEVICE = + "5c78f2882e22165df16b832e"; + public const string FLASHHIDER_AR15_SILENCERCO_ASR_556X45_FLASH_HIDER = + "609269c3b0e443224b421cc1"; + public const string FLASHHIDER_AR15_SUREFIRE_SF3P_556X45_FLASH_HIDER = + "5c7fb51d2e2216001219ce11"; + public const string FLASHHIDER_AR15_SUREFIRE_SF4P_556X45_FLASH_HIDER = + "5ea172e498dacb342978818e"; + public const string FLASHHIDER_AR15_SUREFIRE_WARCOMP_556X45_FLASH_HIDER = + "5c6d710d2e22165df16b81e7"; + public const string FLASHHIDER_AR15_SUREFIRE_WARDEN_556X45_BLAST_REGULATOR = + "62669bccdb9ebb4daa44cd14"; public const string FLASHHIDER_AR15_TAA_ZK23_556X45_MUZZLE_BRAKE = "612e0e55a112697a4b3a66e7"; - public const string FLASHHIDER_AR15_THUNDER_BEAST_ARMS_223CB_556X45_MUZZLE_BRAKE = "5d440625a4b9361eec4ae6c5"; - public const string FLASHHIDER_AR15_TROY_CLAYMORE_556X45_MUZZLE_BRAKE = "5cc9b815d7f00c000e2579d6"; - public const string FLASHHIDER_AR15_VENDETTA_PRECISION_VP09_INTERCEPTOR_556X45_MUZZLE_BRAKE = "5a7c147ce899ef00150bd8b8"; - public const string FLASHHIDER_AR15_WDR_NERO_556_556X45_MUZZLE_BRAKE = "64943b74e9998d641b0412ed"; - public const string FLASHHIDER_AR15_YANKEE_HILL_PHANTOM_556X45_FLASH_HIDER = "626a74340be03179a165e30c"; - public const string FLASHHIDER_ASE_UTRA_BORELOCK_338_LM_MUZZLE_BRAKE = "673f3ef1259f5945d70e43a8"; - public const string FLASHHIDER_ASH12_127X55_MUZZLE_BRAKECOMPENSATOR = "5caf17c9ae92150b30006be1"; + public const string FLASHHIDER_AR15_THUNDER_BEAST_ARMS_223CB_556X45_MUZZLE_BRAKE = + "5d440625a4b9361eec4ae6c5"; + public const string FLASHHIDER_AR15_TROY_CLAYMORE_556X45_MUZZLE_BRAKE = + "5cc9b815d7f00c000e2579d6"; + public const string FLASHHIDER_AR15_VENDETTA_PRECISION_VP09_INTERCEPTOR_556X45_MUZZLE_BRAKE = + "5a7c147ce899ef00150bd8b8"; + public const string FLASHHIDER_AR15_WDR_NERO_556_556X45_MUZZLE_BRAKE = + "64943b74e9998d641b0412ed"; + public const string FLASHHIDER_AR15_YANKEE_HILL_PHANTOM_556X45_FLASH_HIDER = + "626a74340be03179a165e30c"; + public const string FLASHHIDER_ASE_UTRA_BORELOCK_338_LM_MUZZLE_BRAKE = + "673f3ef1259f5945d70e43a8"; + public const string FLASHHIDER_ASH12_127X55_MUZZLE_BRAKECOMPENSATOR = + "5caf17c9ae92150b30006be1"; public const string FLASHHIDER_AWC_PSR_338_LM_MUZZLE_BRAKE = "612e0d81290d254f5e6b291a"; public const string FLASHHIDER_DVL10_762X51_MUZZLE_DEVICE = "58889c7324597754281f9439"; public const string FLASHHIDER_DVL10_M2_762X51_MUZZLE_BRAKE = "5888996c24597754281f9419"; - public const string FLASHHIDER_FERFRANS_CRD_556X45_CONCUSSION_REDUCTION_DEVICE = "5f6339d53ada5942720e2dc3"; + public const string FLASHHIDER_FERFRANS_CRD_556X45_CONCUSSION_REDUCTION_DEVICE = + "5f6339d53ada5942720e2dc3"; public const string FLASHHIDER_FN_P90_57X28_FLASH_HIDER = "5cc82796e24e8d000f5859a8"; public const string FLASHHIDER_FN_SCARL_556X45_FLASH_HIDER = "618407a850224f204c1da549"; - public const string FLASHHIDER_GLOCK_9X19_CARVER_CUSTOM_4_PORT_COMPENSATOR = "5a7ad0c451dfba0013379712"; - public const string FLASHHIDER_GLOCK_9X19_CARVER_CUSTOM_DECELERATOR_3_PORT_COMPENSATOR = "5a7037338dc32e000d46d257"; - public const string FLASHHIDER_GLOCK_9X19_DOUBLE_DIAMOND_FLASH_HIDER = "5a70366c8dc32e001207fb06"; - public const string FLASHHIDER_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_BULLNOSE_COMPENSATOR = "5a705e128dc32e000d46d258"; - public const string FLASHHIDER_GLOCK_9X19_LONE_WOLF_LWDCOMP9_COMPENSATOR = "5a7ad1fb51dfba0013379715"; - public const string FLASHHIDER_GLOCK_9X19_STRIKE_INDUSTRIES_G4_SLIDECOMP_COMPENSATOR = "5a7b32a2e899ef00135e345a"; + public const string FLASHHIDER_GLOCK_9X19_CARVER_CUSTOM_4_PORT_COMPENSATOR = + "5a7ad0c451dfba0013379712"; + public const string FLASHHIDER_GLOCK_9X19_CARVER_CUSTOM_DECELERATOR_3_PORT_COMPENSATOR = + "5a7037338dc32e000d46d257"; + public const string FLASHHIDER_GLOCK_9X19_DOUBLE_DIAMOND_FLASH_HIDER = + "5a70366c8dc32e001207fb06"; + public const string FLASHHIDER_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_BULLNOSE_COMPENSATOR = + "5a705e128dc32e000d46d258"; + public const string FLASHHIDER_GLOCK_9X19_LONE_WOLF_LWDCOMP9_COMPENSATOR = + "5a7ad1fb51dfba0013379715"; + public const string FLASHHIDER_GLOCK_9X19_STRIKE_INDUSTRIES_G4_SLIDECOMP_COMPENSATOR = + "5a7b32a2e899ef00135e345a"; public const string FLASHHIDER_HK_G36_556X45_4PRONG_FLASH_HIDER = "622f128cec80d870d349b4e8"; public const string FLASHHIDER_HK_G36_556X45_FLASH_HIDER = "622f07cfae33bc505b2c4dd5"; public const string FLASHHIDER_HK_G36C_556X45_4PRONG_FLASH_HIDER = "622f0ee47762f55aaa68ac87"; public const string FLASHHIDER_HK_MP5_BT_QD_9X19_MUZZLE_BRAKE = "615d8df08004cc50514c3236"; - public const string FLASHHIDER_HK_MP5_NOVESKESTYLE_9X19_MUZZLE_BRAKECOMPENSATOR = "5c07c5ed0db834001b73571c"; + public const string FLASHHIDER_HK_MP5_NOVESKESTYLE_9X19_MUZZLE_BRAKECOMPENSATOR = + "5c07c5ed0db834001b73571c"; public const string FLASHHIDER_HK_MP7A1_46X30_FLASH_HIDER = "5ba26acdd4351e003562908e"; public const string FLASHHIDER_HK_PROLONGED_762X51_FLASH_HIDER = "61713308d92c473c770214a0"; public const string FLASHHIDER_KRISS_VECTOR_45_ACP_FLASH_HIDER = "5fb65424956329274326f316"; public const string FLASHHIDER_KRISS_VECTOR_9X19_FLASH_HIDER = "5fbbc3324e8a554c40648348"; - public const string FLASHHIDER_LANTAC_BMD_762X51_BLAST_MITIGATION_DEVICE = "5cf78720d7f00c06595bc93e"; - public const string FLASHHIDER_M14_JP_ENTERPRISES_762X51_TACTICAL_COMPENSATOR = "5addbb825acfc408fb139400"; - public const string FLASHHIDER_M14_SMITH_ENTERPRISE_GOOD_IRON_762X51_MUZZLE_BRAKE = "5addbb945acfc4001a5fc44e"; - public const string FLASHHIDER_M14_SMITH_ENTERPRISE_VORTEX_762X51_MUZZLE_BRAKE = "5addbba15acfc400185c2854"; - public const string FLASHHIDER_M14_YANKEE_HILL_PHANTOM_762X51_FLASH_HIDER = "5addbbb25acfc40015621bd9"; - public const string FLASHHIDER_M1911_ANARCHY_OUTDOORS_45_ACP_MUZZLE_BRAKE = "5ef61964ec7f42238c31e0c1"; - public const string FLASHHIDER_M1A_NATIONAL_MATCH_762X51_FLASH_SUPPRESSOR = "5addbb6e5acfc408fb1393fd"; - public const string FLASHHIDER_M1A_SMITH_ENTERPRISE_SOCOM_16_762X51_THREADED_MUZZLE_BRAKE_GAS_BLOCK = "5ab3afb2d8ce87001660304d"; - public const string FLASHHIDER_M1A_SOCOM_16_762X51_MUZZLE_BRAKECOMPENSATOR = "5aafa1c2e5b5b00015042a56"; + public const string FLASHHIDER_LANTAC_BMD_762X51_BLAST_MITIGATION_DEVICE = + "5cf78720d7f00c06595bc93e"; + public const string FLASHHIDER_M14_JP_ENTERPRISES_762X51_TACTICAL_COMPENSATOR = + "5addbb825acfc408fb139400"; + public const string FLASHHIDER_M14_SMITH_ENTERPRISE_GOOD_IRON_762X51_MUZZLE_BRAKE = + "5addbb945acfc4001a5fc44e"; + public const string FLASHHIDER_M14_SMITH_ENTERPRISE_VORTEX_762X51_MUZZLE_BRAKE = + "5addbba15acfc400185c2854"; + public const string FLASHHIDER_M14_YANKEE_HILL_PHANTOM_762X51_FLASH_HIDER = + "5addbbb25acfc40015621bd9"; + public const string FLASHHIDER_M1911_ANARCHY_OUTDOORS_45_ACP_MUZZLE_BRAKE = + "5ef61964ec7f42238c31e0c1"; + public const string FLASHHIDER_M1A_NATIONAL_MATCH_762X51_FLASH_SUPPRESSOR = + "5addbb6e5acfc408fb1393fd"; + public const string FLASHHIDER_M1A_SMITH_ENTERPRISE_SOCOM_16_762X51_THREADED_MUZZLE_BRAKE_GAS_BLOCK = + "5ab3afb2d8ce87001660304d"; + public const string FLASHHIDER_M1A_SOCOM_16_762X51_MUZZLE_BRAKECOMPENSATOR = + "5aafa1c2e5b5b00015042a56"; public const string FLASHHIDER_M60E3_762X51_FLASH_HIDER = "6601281fc752a02bbe05e696"; public const string FLASHHIDER_M60E6_762X51_FLASH_HIDER = "66012a1d3dff5074ed002e2a"; - public const string FLASHHIDER_MCXSPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39"; - public const string FLASHHIDER_MOSIN_RIFLE_TACFIRE_TANKER_STYLE_762X54R_MUZZLE_BRAKE = "5bbdb83fd4351e44f824c44b"; - public const string FLASHHIDER_MOSIN_RIFLE_TEXAS_PRECISION_PRODUCTS_762X54R_MUZZLE_BRAKE = "5bc5a351d4351e003477a414"; - public const string FLASHHIDER_MOSIN_RIFLE_WITT_MACHINE_762X54R_MUZZLE_BRAKE = "5bc5a35cd4351e450201232f"; + public const string FLASHHIDER_MCXSPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = + "6529113b5ae2ae97b80fdf39"; + public const string FLASHHIDER_MOSIN_RIFLE_TACFIRE_TANKER_STYLE_762X54R_MUZZLE_BRAKE = + "5bbdb83fd4351e44f824c44b"; + public const string FLASHHIDER_MOSIN_RIFLE_TEXAS_PRECISION_PRODUCTS_762X54R_MUZZLE_BRAKE = + "5bc5a351d4351e003477a414"; + public const string FLASHHIDER_MOSIN_RIFLE_WITT_MACHINE_762X54R_MUZZLE_BRAKE = + "5bc5a35cd4351e450201232f"; public const string FLASHHIDER_MPX_A2_9X19_FLASH_HIDER = "58949dea86f77409483e16a8"; - public const string FLASHHIDER_ORSIS_T5000M_762X51_MUZZLE_BRAKECOMPENSATOR = "5df35e7f2a78646d96665dd4"; + public const string FLASHHIDER_ORSIS_T5000M_762X51_MUZZLE_BRAKECOMPENSATOR = + "5df35e7f2a78646d96665dd4"; public const string FLASHHIDER_P226_TJS_CUSTOM_9X19_COMPENSATOR = "5c6beec32e221601da3578f2"; public const string FLASHHIDER_PK_ZENIT_DTK1P_762X54R_MUZZLE_BRAKE = "6492ef63cfcf7c89e701abf1"; public const string FLASHHIDER_PKM_762X54R_MUZZLE_BRAKE = "6492efe46cc7e29a6f03b2a0"; public const string FLASHHIDER_PKM_762X54R_SLOTTED_FLASH_HIDER = "6492efb8cfcf7c89e701abf3"; - public const string FLASHHIDER_PP1901_VITYAZ_9X19_MUZZLE_BRAKECOMPENSATOR = "5998597786f77414ea6da093"; + public const string FLASHHIDER_PP1901_VITYAZ_9X19_MUZZLE_BRAKECOMPENSATOR = + "5998597786f77414ea6da093"; public const string FLASHHIDER_RFB_762X51_FLASH_HIDER = "5f2aa4559b44de6b1b4e68d1"; - public const string FLASHHIDER_RPK16_545X39_MUZZLE_BRAKECOMPENSATOR = "5beec3420db834001b095429"; - public const string FLASHHIDER_SA58_3PRONG_TRIDENT_762X51_FLASH_HIDER = "5b099b7d5acfc400186331e4"; - public const string FLASHHIDER_SA58_AUSTRIAN_STYLE_762X51_MUZZLE_BRAKE = "5b7d68af5acfc400170e30c3"; + public const string FLASHHIDER_RPK16_545X39_MUZZLE_BRAKECOMPENSATOR = + "5beec3420db834001b095429"; + public const string FLASHHIDER_SA58_3PRONG_TRIDENT_762X51_FLASH_HIDER = + "5b099b7d5acfc400186331e4"; + public const string FLASHHIDER_SA58_AUSTRIAN_STYLE_762X51_MUZZLE_BRAKE = + "5b7d68af5acfc400170e30c3"; public const string FLASHHIDER_SAIGA9_9X19_MUZZLE_BRAKECOMPENSATOR = "5998598e86f7740b3f498a86"; - public const string FLASHHIDER_SAKO_TRG_2242M10_338_LM_MUZZLE_BRAKE = "673f4046259f5945d70e43ab"; - public const string FLASHHIDER_SAKO_TRG_CORETAC_COREBRAKE_338_LM_MUZZLE_BRAKE = "673f3f9840aeca974e0b5c68"; + public const string FLASHHIDER_SAKO_TRG_2242M10_338_LM_MUZZLE_BRAKE = + "673f4046259f5945d70e43ab"; + public const string FLASHHIDER_SAKO_TRG_CORETAC_COREBRAKE_338_LM_MUZZLE_BRAKE = + "673f3f9840aeca974e0b5c68"; public const string FLASHHIDER_SIG_SAUER_762X51_3PRONG_FLASH_HIDER = "5fbcbcf593164a5b6278efb2"; - public const string FLASHHIDER_SIG_SAUER_MICRO_BRAKE_762X51_MUZZLE_BRAKE = "5fbcbd02900b1d5091531dd3"; - public const string FLASHHIDER_SIG_SAUER_TWO_PORT_BRAKE_762X51_MUZZLE_BRAKE = "5fbcbd10ab884124df0cd563"; - public const string FLASHHIDER_SILENCERCO_AC858_ASR_338_LM_MUZZLE_BRAKE = "5fc23636016cce60e8341b05"; - public const string FLASHHIDER_STEYR_AUG_A1_556X45_CLOSED_FLASH_HIDER = "630f2872911356c17d06abc5"; - public const string FLASHHIDER_STEYR_AUG_A3_556X45_CLOSED_FLASH_HIDER = "630f28f0cadb1fe05e06f004"; + public const string FLASHHIDER_SIG_SAUER_MICRO_BRAKE_762X51_MUZZLE_BRAKE = + "5fbcbd02900b1d5091531dd3"; + public const string FLASHHIDER_SIG_SAUER_TWO_PORT_BRAKE_762X51_MUZZLE_BRAKE = + "5fbcbd10ab884124df0cd563"; + public const string FLASHHIDER_SILENCERCO_AC858_ASR_338_LM_MUZZLE_BRAKE = + "5fc23636016cce60e8341b05"; + public const string FLASHHIDER_STEYR_AUG_A1_556X45_CLOSED_FLASH_HIDER = + "630f2872911356c17d06abc5"; + public const string FLASHHIDER_STEYR_AUG_A3_556X45_CLOSED_FLASH_HIDER = + "630f28f0cadb1fe05e06f004"; public const string FLASHHIDER_STEYR_AUG_A3_556X45_MUZZLE_BRAKE = "630f291b9f66a28b37094bb8"; public const string FLASHHIDER_STM9_9X19_MUZZLE_BRAKE = "60337f5dce399e10262255d1"; public const string FLASHHIDER_SV98_762X54R_MUZZLE_DEVICE = "560e620e4bdc2d724b8b456b"; public const string FLASHHIDER_SV98_762X54R_THREAD_ADAPTER = "5c4eec9b2e2216398b5aaba2"; - public const string FLASHHIDER_SV98_SRVV_MK20_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c4ee3d62e2216152006f302"; - public const string FLASHHIDER_SVDS_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c471bfc2e221602b21d4e17"; + public const string FLASHHIDER_SV98_SRVV_MK20_762X54R_MUZZLE_BRAKECOMPENSATOR = + "5c4ee3d62e2216152006f302"; + public const string FLASHHIDER_SVDS_762X54R_MUZZLE_BRAKECOMPENSATOR = + "5c471bfc2e221602b21d4e17"; public const string FLASHHIDER_SVT40_762X54R_MUZZLE_BRAKE = "64119d1f2c6d6f921a0929f8"; - public const string FLASHHIDER_TACCOM_CARBINE_BRAKE_9X19_MUZZLE_BRAKE = "5cf6935bd7f00c06585fb791"; - public const string FLASHHIDER_TT_PMLASER_DTKTT_MUZZLE_BRAKECOMPENSATOR = "5bffd7ed0db834001d23ebf9"; + public const string FLASHHIDER_TACCOM_CARBINE_BRAKE_9X19_MUZZLE_BRAKE = + "5cf6935bd7f00c06585fb791"; + public const string FLASHHIDER_TT_PMLASER_DTKTT_MUZZLE_BRAKECOMPENSATOR = + "5bffd7ed0db834001d23ebf9"; public const string FLASHHIDER_UZI_VENTED_BARREL_SHROUD = "6699370c57df3e2b4e0a0dab"; - public const string FLASHHIDER_VPO136_VEPRKM_762X39_MUZZLE_BRAKECOMPENSATOR = "59e61eb386f77440d64f5daf"; + public const string FLASHHIDER_VPO136_VEPRKM_762X39_MUZZLE_BRAKECOMPENSATOR = + "59e61eb386f77440d64f5daf"; public const string FLASHHIDER_VPO209_THREAD_PROTECTOR = "59e8a00d86f7742ad93b569c"; - public const string FLASHHIDER_YANKEE_HILL_ANNIHILATOR_MULTICALIBER_FLASH_HIDER = "5b3a16655acfc40016387a2a"; + public const string FLASHHIDER_YANKEE_HILL_ANNIHILATOR_MULTICALIBER_FLASH_HIDER = + "5b3a16655acfc40016387a2a"; public const string FLASHLIGHT_ARMYTEK_PREDATOR_PRO_V3_XHP35_HI = "59d790f486f77403cb06aec6"; public const string FLASHLIGHT_ULTRAFIRE_WF501B = "57d17c5e2459775a5c57d17d"; public const string FLASHLIGHT_ZENIT_2D = "646f62fee779812413011ab7"; @@ -1895,67 +2347,91 @@ public static class ItemTpl public const string FOOD_RYE_CROUTONS = "57347d3d245977448f7b7f61"; public const string FOOD_SALTY_DOG_BEEF_SAUSAGE = "635a758bfefc88a93f021b8a"; public const string FOOD_SLICKERS_CHOCOLATE_BAR = "544fb6cc4bdc2d34748b456e"; - public const string FOREGRIP_A3_TACTICAL_MVF001_KEYMOD_VERTICAL_FOREGRIP_BLACK = "5fc0f9b5d724d907e2077d82"; + public const string FOREGRIP_A3_TACTICAL_MVF001_KEYMOD_VERTICAL_FOREGRIP_BLACK = + "5fc0f9b5d724d907e2077d82"; public const string FOREGRIP_AI_AXMC_PADDED_HANDGUARD_GRIP = "6281212a09427b40ab14e770"; public const string FOREGRIP_ASH12_VERTICAL = "5cda9bcfd7f00c0c0b53e900"; - public const string FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_BLACK = "665d5d9e338229cfd6078da1"; - public const string FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_FDE = "665edce564fb556f940ab32a"; + public const string FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_BLACK = + "665d5d9e338229cfd6078da1"; + public const string FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_FDE = + "665edce564fb556f940ab32a"; public const string FOREGRIP_BCM_GUNFIGHTER_MOD_3_VERTICAL = "5c7fc87d2e221644f31c0298"; - public const string FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_BLACK = "651a8bf3a8520e48047bf708"; - public const string FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_COYOTE_BROWN = "651a8e529829226ceb67c319"; + public const string FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_BLACK = + "651a8bf3a8520e48047bf708"; + public const string FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_COYOTE_BROWN = + "651a8e529829226ceb67c319"; public const string FOREGRIP_FORTIS_SHIFT_TACTICAL = "59f8a37386f7747af3328f06"; public const string FOREGRIP_HERA_ARMS_CQR_TACTICAL = "5a7dbfc1159bd40016548fde"; public const string FOREGRIP_HK_STURMGRIFF = "619386379fb0c665d5490dbe"; public const string FOREGRIP_KAC_VERTICAL = "5c87ca002e221600114cb150"; public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_BLACK = "588226d124597767ad33f787"; public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_FDE = "588226dd24597767ad33f789"; - public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_FOREST_GREEN = "588226e62459776e3e094af7"; - public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_OLIVE_DRAB = "588226ef24597767af46e39c"; - public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_BLACK = "57cffb66245977632f391a99"; + public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_FOREST_GREEN = + "588226e62459776e3e094af7"; + public const string FOREGRIP_MAGPUL_AFG_TACTICAL_FOREGRIP_OLIVE_DRAB = + "588226ef24597767af46e39c"; + public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_BLACK = + "57cffb66245977632f391a99"; public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_FDE = "57cffcd624597763133760c5"; - public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_OLIVE_DRAB = "57cffcdd24597763f5110006"; - public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_STEALTH_GREY = "57cffce524597763b31685d8"; + public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_OLIVE_DRAB = + "57cffcdd24597763f5110006"; + public const string FOREGRIP_MAGPUL_MLOK_AFG_TACTICAL_FOREGRIP_STEALTH_GREY = + "57cffce524597763b31685d8"; public const string FOREGRIP_MAGPUL_RVG_FOREGRIP_BLACK = "59fc48e086f77463b1118392"; public const string FOREGRIP_MAGPUL_RVG_FOREGRIP_FDE = "5fce0cf655375d18a253eff0"; - public const string FOREGRIP_MONSTRUM_TACTICAL_VERTICAL_FORE_GRIP_KEYMOD = "615d8fd3290d254f5e6b2edc"; + public const string FOREGRIP_MONSTRUM_TACTICAL_VERTICAL_FORE_GRIP_KEYMOD = + "615d8fd3290d254f5e6b2edc"; public const string FOREGRIP_MP9N_VERTICAL = "5de8fbad2fbe23140d3ee9c4"; public const string FOREGRIP_ORSIS_T5000M_PADDED_HANDGUARD_GRIP = "5df36948bb49d91fb446d5ad"; public const string FOREGRIP_RTM_OSOVETS_P2_TACTICAL = "64806bdd26c80811d408d37a"; - public const string FOREGRIP_RTM_OSOVETS_P2_TACTICAL_FOREGRIP_KHAKI = "64807a29e5ffe165600abc97"; + public const string FOREGRIP_RTM_OSOVETS_P2_TACTICAL_FOREGRIP_KHAKI = + "64807a29e5ffe165600abc97"; public const string FOREGRIP_RTM_PILLAU_P2_TACTICAL_FOREGRIP_RED = "65169d5b30425317755f8e25"; public const string FOREGRIP_RTM_PILLAU_TACTICAL = "5cf4fb76d7f00c065703d3ac"; public const string FOREGRIP_RTM_PILLAU_TACTICAL_FOREGRIP_SAND = "648067db042be0705c0b3009"; public const string FOREGRIP_SAKO_TRG_M10_GRIP_PAD = "673cb81f5b1511adb10cd326"; - public const string FOREGRIP_SIG_SAUER_VERTICAL_FOREGRIP_KEYMOD_BLACK = "5fc0f9cbd6fa9c00c571bb90"; + public const string FOREGRIP_SIG_SAUER_VERTICAL_FOREGRIP_KEYMOD_BLACK = + "5fc0f9cbd6fa9c00c571bb90"; public const string FOREGRIP_SR3M_POLYMER_FOREGRIP_BLACK = "65329ebcc0d50d0c9204ace1"; public const string FOREGRIP_SR3M_POLYMER_FOREGRIP_PLUM = "6565c0c2ff7eb7070409084c"; public const string FOREGRIP_STARK_SE5_EXPRESS_FORWARD = "5b057b4f5acfc4771e1bd3e9"; - public const string FOREGRIP_STARK_SE5_EXPRESS_FORWARD_FOREGRIP_FDE = "655df24fdf80b12750626d0a"; + public const string FOREGRIP_STARK_SE5_EXPRESS_FORWARD_FOREGRIP_FDE = + "655df24fdf80b12750626d0a"; public const string FOREGRIP_STEYR_AUG_VERTICAL = "634e61b0767cb15c4601a877"; public const string FOREGRIP_STEYR_AUG_VERTICAL_FOREGRIP_BLACK = "671883292e2eeb98d406f3b8"; public const string FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL = "5c791e872e2216001219c40a"; - public const string FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL_FOREGRIP_FDE = "655dccfdbdcc6b5df71382b6"; + public const string FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL_FOREGRIP_FDE = + "655dccfdbdcc6b5df71382b6"; public const string FOREGRIP_TACTICAL_DYNAMICS_SKELETONIZED = "5f6340d3ca442212f4047eb2"; public const string FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_BLACK = "661e52e29c8b4dadef008577"; public const string FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_FDE = "661e53149c8b4dadef008579"; - public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_BLACK = "558032614bdc2de7118b4585"; - public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_FDE = "58c157be86f77403c74b2bb6"; - public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_STEALTH_GREY = "58c157c886f774032749fb06"; - public const string FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_BLACK = "661e52415be02310ed07a07a"; + public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_BLACK = + "558032614bdc2de7118b4585"; + public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_FDE = + "58c157be86f77403c74b2bb6"; + public const string FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_STEALTH_GREY = + "58c157c886f774032749fb06"; + public const string FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_BLACK = + "661e52415be02310ed07a07a"; public const string FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_FDE = "661e52b5b099f32c28003586"; public const string FOREGRIP_VIKING_TACTICS_UVG_TACTICAL = "591af28e86f77414a27a9e1d"; public const string FOREGRIP_ZENIT_RK0_TACTICAL = "5c1bc4812e22164bef5cfde7"; public const string FOREGRIP_ZENIT_RK1_TACTICAL = "5c1bc5612e221602b5429350"; - public const string FOREGRIP_ZENIT_RK1_TACTICAL_FOREGRIP_ON_B25U_MOUNT = "5c1cd46f2e22164bef5cfedb"; + public const string FOREGRIP_ZENIT_RK1_TACTICAL_FOREGRIP_ON_B25U_MOUNT = + "5c1cd46f2e22164bef5cfedb"; public const string FOREGRIP_ZENIT_RK2_TACTICAL = "5c1bc5af2e221602b412949b"; public const string FOREGRIP_ZENIT_RK4_TACTICAL = "5c1bc5fb2e221602b1779b32"; public const string FOREGRIP_ZENIT_RK5_TACTICAL = "5c1bc7432e221602b412949d"; public const string FOREGRIP_ZENIT_RK6_TACTICAL = "5c1bc7752e221602b1779b34"; public const string GASBLOCK_AK_KIBA_ARMS_VDM_CS_GAS_TUBE = "5a01ad4786f77450561fda02"; - public const string GASBLOCK_AK_TROY_FULL_LENGTH_RAIL_HANDGUARD_WITH_GAS_TUBE = "5b237e425acfc4771e1be0b6"; - public const string GASBLOCK_AK_ULTIMAK_M1B_HANDGUARD_WITH_GAS_TUBE = "59ccfdba86f7747f2109a587"; - public const string GASBLOCK_AK_VEZHLIVYY_STRELOK_VS24_VS33C_HANDGUARD_WITH_GAS_TUBE = "5cf656f2d7f00c06585fb6eb"; - public const string GASBLOCK_AK_VEZHLIVYY_STRELOK_VS24_VS33C_HANDGUARD_WITH_GAS_TUBE_WHITE = "5d4aab30a4b9365435358c55"; + public const string GASBLOCK_AK_TROY_FULL_LENGTH_RAIL_HANDGUARD_WITH_GAS_TUBE = + "5b237e425acfc4771e1be0b6"; + public const string GASBLOCK_AK_ULTIMAK_M1B_HANDGUARD_WITH_GAS_TUBE = + "59ccfdba86f7747f2109a587"; + public const string GASBLOCK_AK_VEZHLIVYY_STRELOK_VS24_VS33C_HANDGUARD_WITH_GAS_TUBE = + "5cf656f2d7f00c06585fb6eb"; + public const string GASBLOCK_AK_VEZHLIVYY_STRELOK_VS24_VS33C_HANDGUARD_WITH_GAS_TUBE_WHITE = + "5d4aab30a4b9365435358c55"; public const string GASBLOCK_AK12_GAS_TUBE = "649ec107961514b22506b10c"; public const string GASBLOCK_AK545_MK_21_GAS_TUBE = "628b8d83717774443b15e248"; public const string GASBLOCK_AK74_GAS_TUBE = "59c6633186f7740cf0493bb9"; @@ -1964,8 +2440,10 @@ public static class ItemTpl public const string GASBLOCK_AR10_CMMG_LOW_PROFILE_GAS_BLOCK = "6065dc8a132d4d12c81fd8e3"; public const string GASBLOCK_AR10_JP_ENTERPRISES_GAS_SYSTEM6 = "5a34fbadc4a28200741e230a"; public const string GASBLOCK_AR10_KAC_LOW_PROFILE_GAS_BLOCK = "5dfa3d45dfc58d14537c20b0"; - public const string GASBLOCK_AR15_BALLISTIC_ADVANTAGE_LOPRO_GAS_BLOCK = "63d3ce281fe77d0f2801859e"; - public const string GASBLOCK_AR15_DANIEL_DEFENSE_MK12_LOW_PROFILE_GAS_BLOCK = "56eabcd4d2720b66698b4574"; + public const string GASBLOCK_AR15_BALLISTIC_ADVANTAGE_LOPRO_GAS_BLOCK = + "63d3ce281fe77d0f2801859e"; + public const string GASBLOCK_AR15_DANIEL_DEFENSE_MK12_LOW_PROFILE_GAS_BLOCK = + "56eabcd4d2720b66698b4574"; public const string GASBLOCK_AR15_JP_ENTERPRISES_GAS_SYSTEM5B = "5d00ec68d7ad1a04a067e5be"; public const string GASBLOCK_AR15_WINDHAM_WEAPONRY_RAIL_GAS_BLOCK = "56ea8d2fd2720b7c698b4570"; public const string GASBLOCK_HK_416A5_LOW_PROFILE_GAS_BLOCK = "5bb20dcad4351e3bac1212da"; @@ -1978,9 +2456,12 @@ public static class ItemTpl public const string GASBLOCK_MOLOT_ARMS_AKMTYPE_GAS_TUBE = "59e649f986f77411d949b246"; public const string GASBLOCK_OPSKS_GAS_TUBE = "634f036a517ccc8a960fc746"; public const string GASBLOCK_PP1901_VITYAZ_GAS_TUBE = "59ccd11386f77428f24a488f"; - public const string GASBLOCK_PP1901_VITYAZ_SAG_MK1_MLOK_HANDGUARD_WITH_GAS_TUBE = "676177df1f08ed5e8800b7ae"; - public const string GASBLOCK_PP1901_VITYAZ_VECTOR_VRLPS_LEFTSIDE_CHARGING_HANDLE = "65ae4f57e343f0acc00824da"; - public const string GASBLOCK_RD704_SLR_ION_LITE_RAILED_GAS_TUBE_HANDGUARD_WITH_GAS_TUBE = "628a83c29179c324ed269508"; + public const string GASBLOCK_PP1901_VITYAZ_SAG_MK1_MLOK_HANDGUARD_WITH_GAS_TUBE = + "676177df1f08ed5e8800b7ae"; + public const string GASBLOCK_PP1901_VITYAZ_VECTOR_VRLPS_LEFTSIDE_CHARGING_HANDLE = + "65ae4f57e343f0acc00824da"; + public const string GASBLOCK_RD704_SLR_ION_LITE_RAILED_GAS_TUBE_HANDGUARD_WITH_GAS_TUBE = + "628a83c29179c324ed269508"; public const string GASBLOCK_SKS_GAS_TUBE = "634f02d7517ccc8a960fc744"; public const string GASBLOCK_SVDS_GAS_TUBE = "5c471c842e221615214259b5"; public const string GASBLOCK_VPO101_GAS_TUBE = "5c5039be2e221602b177c9ff"; @@ -2009,26 +2490,34 @@ public static class ItemTpl public const string HANDGUARD_AK_CAA_RS47 = "5648ae314bdc2d3d1c8b457f"; public const string HANDGUARD_AK_CNC_GUNS_OV_GP = "6389f1dfc879ce63f72fc43e"; public const string HANDGUARD_AK_HEXAGON_TUBULAR = "5b800e9286f7747a8b04f3ff"; - public const string HANDGUARD_AK_HEXAGON_TUBULAR_HANDGUARD_ANODIZED_RED = "5b80242286f77429445e0b47"; + public const string HANDGUARD_AK_HEXAGON_TUBULAR_HANDGUARD_ANODIZED_RED = + "5b80242286f77429445e0b47"; public const string HANDGUARD_AK_KREBS_CUSTOM_UFM_KEYMOD = "59fb375986f7741b681b81a6"; public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_BLACK = "57cff947245977638e6f2a19"; public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_FDE = "57cffd8224597763b03fc609"; - public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_OLIVE_DRAB = "57cffddc24597763133760c6"; + public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_OLIVE_DRAB = + "57cffddc24597763133760c6"; public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_PLUM = "57cffe0024597763b03fc60b"; - public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_STEALTH_GREY = "57cffe20245977632f391a9d"; + public const string HANDGUARD_AK_MAGPUL_MOE_AKM_HANDGUARD_STEALTH_GREY = + "57cffe20245977632f391a9d"; public const string HANDGUARD_AK_MAGPUL_ZHUKOVU_HANDGUARD_BLACK = "5c9a07572e221644f31c4b32"; public const string HANDGUARD_AK_MAGPUL_ZHUKOVU_HANDGUARD_FDE = "5c9a1c3a2e2216000e69fb6a"; public const string HANDGUARD_AK_MAGPUL_ZHUKOVU_HANDGUARD_PLUM = "5c9a1c422e221600106f69f0"; public const string HANDGUARD_AK_STRIKE_INDUSTRIES_TRAX_1 = "5a9d56c8a2750c0032157146"; - public const string HANDGUARD_AK_STRIKE_INDUSTRIES_TRAX_2_HANDGUARD_EXTENSION = "5a9d6d34a2750c00141e07da"; + public const string HANDGUARD_AK_STRIKE_INDUSTRIES_TRAX_2_HANDGUARD_EXTENSION = + "5a9d6d34a2750c00141e07da"; public const string HANDGUARD_AK_TDI_AKML = "5d1b198cd7ad1a604869ad72"; - public const string HANDGUARD_AK_TDI_AKML_HANDGUARD_ANODIZED_BRONZE = "5d4aaa73a4b9365392071175"; + public const string HANDGUARD_AK_TDI_AKML_HANDGUARD_ANODIZED_BRONZE = + "5d4aaa73a4b9365392071175"; public const string HANDGUARD_AK_TDI_AKML_HANDGUARD_ANODIZED_RED = "5d4aaa54a4b9365392071170"; - public const string HANDGUARD_AK_TDI_X47_TACTICAL_HANDGUARD_RAIL_SYSTEM = "5f6331e097199b7db2128dc2"; + public const string HANDGUARD_AK_TDI_X47_TACTICAL_HANDGUARD_RAIL_SYSTEM = + "5f6331e097199b7db2128dc2"; public const string HANDGUARD_AK_VLTOR_CMRD_KEYMOD = "5c17664f2e2216398b5a7e3c"; public const string HANDGUARD_AK_ZENIT_B10 = "5c617a5f2e2216000f1e81b3"; - public const string HANDGUARD_AK_ZENIT_B10M_HANDGUARD_WITH_B19_UPPER_MOUNT = "5648b4534bdc2d3d1c8b4580"; - public const string HANDGUARD_AK_ZENIT_B30_HANDGUARD_WITH_B31S_UPPER_HANDGUARD_RAIL = "5efaf417aeb21837e749c7f2"; + public const string HANDGUARD_AK_ZENIT_B10M_HANDGUARD_WITH_B19_UPPER_MOUNT = + "5648b4534bdc2d3d1c8b4580"; + public const string HANDGUARD_AK_ZENIT_B30_HANDGUARD_WITH_B31S_UPPER_HANDGUARD_RAIL = + "5efaf417aeb21837e749c7f2"; public const string HANDGUARD_AK12 = "649ec127c93611967b034957"; public const string HANDGUARD_AK545_MK3 = "628b916469015a4e1711ed8d"; public const string HANDGUARD_AK74_POLYMER_HANDGUARD_PLUM = "5cbda9f4ae9215000e5b9bfc"; @@ -2052,18 +2541,28 @@ public static class ItemTpl public const string HANDGUARD_AR15_AEROKNOX_AX15_105_INCH_MLOK = "619b5db699fb192e7430664f"; public const string HANDGUARD_AR15_AEROKNOX_AX15_158_INCH_MLOK = "640b20359ab20e15ee445fa9"; public const string HANDGUARD_AR15_AEROKNOX_AX15_4_INCH_MLOK = "63f4ba71f31d4a33b87bd046"; - public const string HANDGUARD_AR15_ALEXANDER_ARMS_MK10_RIFLE_LENGTH = "5b2cfa535acfc432ff4db7a0"; + public const string HANDGUARD_AR15_ALEXANDER_ARMS_MK10_RIFLE_LENGTH = + "5b2cfa535acfc432ff4db7a0"; public const string HANDGUARD_AR15_COLT_M4_CARBINE_LENGTH = "5ae30db85acfc408fb139a05"; public const string HANDGUARD_AR15_COLT_M4_CARBINE_LENGTH_LOWER = "637f57a68d137b27f70c4968"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_1225_HANDGUARD_COYOTE_BROWN = "5c9a25172e2216000f20314e"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_1225_LOWER_HANDGUARD_COYOTE_BROWN = "638f2003bbd47aeb9e0ff637"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_HANDGUARD_BLACK = "588b56d02459771481110ae2"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_HANDGUARD_COYOTE_BROWN = "55f84c3c4bdc2d5f408b4576"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_LOWER_HANDGUARD_BLACK = "6396aaa9a52ace83df0840ab"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_LOWER_HANDGUARD_COYOTE_BROWN = "638f1ff84822287cad04be9d"; - public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_FSP_95_HANDGUARD_COYOTE_BROWN = "5c9a26332e2216001219ea70"; - public const string HANDGUARD_AR15_GEISSELE_SMR_MK16_135_INCH_MLOK_HANDGUARD_DDC = "5ea16ada09aa976f2e7a51be"; - public const string HANDGUARD_AR15_GEISSELE_SMR_MK16_95_INCH_MLOK_HANDGUARD_DDC = "5ea16acdfadf1d18c87b0784"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_1225_HANDGUARD_COYOTE_BROWN = + "5c9a25172e2216000f20314e"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_1225_LOWER_HANDGUARD_COYOTE_BROWN = + "638f2003bbd47aeb9e0ff637"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_HANDGUARD_BLACK = + "588b56d02459771481110ae2"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_HANDGUARD_COYOTE_BROWN = + "55f84c3c4bdc2d5f408b4576"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_LOWER_HANDGUARD_BLACK = + "6396aaa9a52ace83df0840ab"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_95_LOWER_HANDGUARD_COYOTE_BROWN = + "638f1ff84822287cad04be9d"; + public const string HANDGUARD_AR15_DANIEL_DEFENSE_RIS_II_FSP_95_HANDGUARD_COYOTE_BROWN = + "5c9a26332e2216001219ea70"; + public const string HANDGUARD_AR15_GEISSELE_SMR_MK16_135_INCH_MLOK_HANDGUARD_DDC = + "5ea16ada09aa976f2e7a51be"; + public const string HANDGUARD_AR15_GEISSELE_SMR_MK16_95_INCH_MLOK_HANDGUARD_DDC = + "5ea16acdfadf1d18c87b0784"; public const string HANDGUARD_AR15_KAC_RIS = "55d459824bdc2d892f8b4573"; public const string HANDGUARD_AR15_KAC_RIS_LOWER = "637f57b78d137b27f70c496a"; public const string HANDGUARD_AR15_KAC_URX_3_8_INCH = "5d123102d7ad1a004e475fe5"; @@ -2071,19 +2570,26 @@ public static class ItemTpl public const string HANDGUARD_AR15_KAC_URX_31_1075_INCH = "5d122e7bd7ad1a07102d6d7f"; public const string HANDGUARD_AR15_KAC_URX_31_1075_INCH_LOWER = "637f57c532b66e7e320a6676"; public const string HANDGUARD_AR15_LONE_STAR_ION_LITE = "5d4405f0a4b9361e6a4e6bd9"; - public const string HANDGUARD_AR15_MAGPUL_MOE_SL_CARBINE_LENGTH_MLOK = "5c78f2792e221600106f4683"; - public const string HANDGUARD_AR15_MAGPUL_MOE_SL_MEDIUM_LENGTH_MLOK = "5c78f26f2e221601da3581d1"; - public const string HANDGUARD_AR15_PRECISION_REFLEX_GEN_III_DELTA_CARBON = "63888bbd28e5cc32cc09d2b6"; + public const string HANDGUARD_AR15_MAGPUL_MOE_SL_CARBINE_LENGTH_MLOK = + "5c78f2792e221600106f4683"; + public const string HANDGUARD_AR15_MAGPUL_MOE_SL_MEDIUM_LENGTH_MLOK = + "5c78f26f2e221601da3581d1"; + public const string HANDGUARD_AR15_PRECISION_REFLEX_GEN_III_DELTA_CARBON = + "63888bbd28e5cc32cc09d2b6"; public const string HANDGUARD_AR15_SAI_10_INCH_QD_RAIL = "5c78f2612e221600114c9f0d"; public const string HANDGUARD_AR15_SAI_145_INCH_QD_RAIL = "5c78f2492e221600114c9f04"; public const string HANDGUARD_AR15_SOYUZTM_12_INCH_MLOK = "6034e3e20ddce744014cb878"; public const string HANDGUARD_AR15_SOYUZTM_15_INCH_MLOK = "6034e3d953a60014f970617b"; public const string HANDGUARD_AR15_SOYUZTM_9_INCH_MLOK = "6034e3cb0ddce744014cb870"; public const string HANDGUARD_AR15_STNGR_VYPR_10_INCH_MLOK = "5c6d5d8b2e221644fc630b39"; - public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK = "5d00e0cbd7ad1a6c6566a42d"; - public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_HANDGUARD_FDE = "5d00f63bd7ad1a59283b1c1e"; - public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_LOWER = "637f589af5ef8c33840d36d3"; - public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_LOWER_HANDGUARD_FDE = "63969c9019971040b005049b"; + public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK = + "5d00e0cbd7ad1a6c6566a42d"; + public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_HANDGUARD_FDE = + "5d00f63bd7ad1a59283b1c1e"; + public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_LOWER = + "637f589af5ef8c33840d36d3"; + public const string HANDGUARD_AR15_STRIKE_INDUSTRIES_VIPER_CARBINE_LENGTH_MLOK_LOWER_HANDGUARD_FDE = + "63969c9019971040b005049b"; public const string HANDGUARD_AR15_UNIQUEARS_WING_SKULL_12_INCH = "6087e0336d0bd7580617bb7a"; public const string HANDGUARD_AR15_WAR_SPORT_LVOAC_HANDGUARD_BLACK = "595cfa8b86f77427437e845b"; public const string HANDGUARD_AR15_WAR_SPORT_LVOAS_HANDGUARD_BLACK = "595cf16b86f77427440c32e2"; @@ -2091,13 +2597,17 @@ public static class ItemTpl public const string HANDGUARD_BENELLI_M3_FOREND = "6259c4347d6aab70bc23a190"; public const string HANDGUARD_DVL10_M2 = "5888976c24597754281f93f5"; public const string HANDGUARD_FAL_ORIGINAL = "5b7bed205acfc400161d08cc"; - public const string HANDGUARD_HK_416_MIDWEST_INDUSTRIES_135_INCH_MLOK = "5c6d11072e2216000e69d2e4"; - public const string HANDGUARD_HK_416_MIDWEST_INDUSTRIES_9_INCH_MLOK = "5c6d10fa2e221600106f3f23"; + public const string HANDGUARD_HK_416_MIDWEST_INDUSTRIES_135_INCH_MLOK = + "5c6d11072e2216000e69d2e4"; + public const string HANDGUARD_HK_416_MIDWEST_INDUSTRIES_9_INCH_MLOK = + "5c6d10fa2e221600106f3f23"; public const string HANDGUARD_HK_416_MRS_KEYMOD_14_INCH = "5c6d10e82e221601da357b07"; public const string HANDGUARD_HK_416_QUAD_RAIL = "5bb20de5d4351e0035629e59"; public const string HANDGUARD_HK_416_QUAD_RAIL_EXTENDED = "5bb20dfcd4351e00334c9e24"; - public const string HANDGUARD_HK_416_QUAD_RAIL_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = "5bb20df1d4351e00347787d5"; - public const string HANDGUARD_HK_416_STRIKE_INDUSTRIES_CRUX_15_INCH_MLOK = "5c6d11152e2216000f2003e7"; + public const string HANDGUARD_HK_416_QUAD_RAIL_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = + "5bb20df1d4351e00347787d5"; + public const string HANDGUARD_HK_416_STRIKE_INDUSTRIES_CRUX_15_INCH_MLOK = + "5c6d11152e2216000f2003e7"; public const string HANDGUARD_HK_416_TROY_MLOK_13_INCH = "5c6c2c9c2e2216000f2002e4"; public const string HANDGUARD_HK_G36_2VENT = "62386b2adf47d66e835094b2"; public const string HANDGUARD_HK_G36_4VENT = "62386b7153757417e93a4e9f"; @@ -2110,8 +2620,10 @@ public static class ItemTpl public const string HANDGUARD_HK_MP5_WIDE_TROPICAL_POLYMER = "5926c36d86f77467a92a8629"; public const string HANDGUARD_HK_MP5K_POLYMER = "5d2f259b48f0355a844acd74"; public const string HANDGUARD_HK_MP5SD_POLYMER = "5926f34786f77469195bfe92"; - public const string HANDGUARD_HK417_EXTENDED_FREE_FLOAT_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = "61703001d92c473c77021497"; - public const string HANDGUARD_HK417_PATROL_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = "61712eae6c780c1e710c9a1d"; + public const string HANDGUARD_HK417_EXTENDED_FREE_FLOAT_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = + "61703001d92c473c77021497"; + public const string HANDGUARD_HK417_PATROL_HANDGUARD_WITH_FLIPUP_FRONT_SIGHT = + "61712eae6c780c1e710c9a1d"; public const string HANDGUARD_KS23M_FORESTOCK = "5e848d51e4dbc5266a4ec63b"; public const string HANDGUARD_M60E4_MOD_1 = "66012d64c752a02bbe05e69b"; public const string HANDGUARD_M60E4_MOD_1_HANDGUARD_FDE = "661fbe066751ee51930b01f2"; @@ -2129,7 +2641,8 @@ public static class ItemTpl public const string HANDGUARD_MOSSBERG_590A1_MAGPUL_MOE_FORESTOCK = "5eea21647547d6330471b3c9"; public const string HANDGUARD_MOSSBERG_590A1_SPEEDFEED_SHORT = "5e87076ce2db31558c75a11d"; public const string HANDGUARD_MP133_BEECHWOOD_FORESTOCK = "55d45d3f4bdc2d972f8b456c"; - public const string HANDGUARD_MP133_CUSTOM_PLASTIC_FORESTOCK_WITH_RAILS = "55d45f484bdc2d972f8b456d"; + public const string HANDGUARD_MP133_CUSTOM_PLASTIC_FORESTOCK_WITH_RAILS = + "55d45f484bdc2d972f8b456d"; public const string HANDGUARD_MP153_POLYMER_FORESTOCK = "56deed6ed2720b4c698b4583"; public const string HANDGUARD_MP155_ULTIMA_POLYMER_FORESTOCK = "606ee5c81246154cad35d65e"; public const string HANDGUARD_MP155_WALNUT_FORESTOCK = "607d5aa50494a626335e12ed"; @@ -2162,9 +2675,12 @@ public static class ItemTpl public const string HANDGUARD_SA58FAL_VLTOR_CASVFAL = "5b7bedd75acfc43d825283f9"; public const string HANDGUARD_SA58FAL_VLTOR_CASVFAS = "5b7bee755acfc400196d5383"; public const string HANDGUARD_SAIGA9_HARTMAN_GYURZA = "651bfe4d1065f87f082e7209"; - public const string HANDGUARD_SAKO_TRG_M10_11_INCH_HANDGUARD_ASSEMBLY = "67405ef125beb509e8070276"; - public const string HANDGUARD_SAKO_TRG_M10_15_INCH_HANDGUARD_ASSEMBLY = "673cb5d1280680de5e02ff3b"; - public const string HANDGUARD_SAKO_TRG_M10_MLOK_15_INCH_HANDGUARD_ASSEMBLY = "67405fd0812f476fb2020066"; + public const string HANDGUARD_SAKO_TRG_M10_11_INCH_HANDGUARD_ASSEMBLY = + "67405ef125beb509e8070276"; + public const string HANDGUARD_SAKO_TRG_M10_15_INCH_HANDGUARD_ASSEMBLY = + "673cb5d1280680de5e02ff3b"; + public const string HANDGUARD_SAKO_TRG_M10_MLOK_15_INCH_HANDGUARD_ASSEMBLY = + "67405fd0812f476fb2020066"; public const string HANDGUARD_SKS_ATI_MONTE_CARLO_GAS_TUBE_COVER = "653ecc425a1690d9d90491e4"; public const string HANDGUARD_SKS_FAB_DEFENSE_UAS_GAS_TUBE_COVER = "653ece125a1690d9d90491e8"; public const string HANDGUARD_SKS_GAS_TUBE_COVER = "634f08a21f9f536910079b5a"; @@ -2172,8 +2688,10 @@ public static class ItemTpl public const string HANDGUARD_SOK12_BRAVO18_ALUMINIUM = "5f63418ef5750b524b45f116"; public const string HANDGUARD_SOK12_CHAOS_TITAN_QUAD_RAIL = "674fe57721a9aa6be6045b96"; public const string HANDGUARD_SOK12_CUSTOM_GUNS_TYPE340 = "6086b5731246154cad35d6c7"; - public const string HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_LONG_TOP_ALUMINUM = "5827272a24597748c74bdeea"; - public const string HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_SHORT_TOP_ALUMINUM = "58272b392459774b4c7b3ccd"; + public const string HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_LONG_TOP_ALUMINUM = + "5827272a24597748c74bdeea"; + public const string HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_SHORT_TOP_ALUMINUM = + "58272b392459774b4c7b3ccd"; public const string HANDGUARD_SOK12_POLYMER = "576169e62459773c69055191"; public const string HANDGUARD_SR2M_POLYMER_HANDGUARD_BLACK = "637ba19df7ca6372bf2613d7"; public const string HANDGUARD_SR2M_POLYMER_HANDGUARD_PLUM = "62e15547db1a5c41971c1b5e"; @@ -2201,16 +2719,22 @@ public static class ItemTpl public const string HEADPHONES_OPSCORE_FAST_RAC_HEADSET = "5a16b9fffcdbcb0176308b34"; public const string HEADPHONES_OPSMEN_EARMOR_M32_HEADSET = "6033fa48ffd42c541047f728"; public const string HEADPHONES_PELTOR_COMTAC_II_HEADSET_OD_GREEN = "5645bcc04bdc2d363b8b4572"; - public const string HEADPHONES_PELTOR_COMTAC_IV_HYBRID_HEADSET_COYOTE_BROWN = "628e4e576d783146b124c64d"; + public const string HEADPHONES_PELTOR_COMTAC_IV_HYBRID_HEADSET_COYOTE_BROWN = + "628e4e576d783146b124c64d"; public const string HEADPHONES_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f693acff495a294927e3"; - public const string HEADPHONES_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6985891c84aab75ca76"; + public const string HEADPHONES_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = + "66b5f6985891c84aab75ca76"; public const string HEADPHONES_PELTOR_TACTICAL_SPORT_HEADSET = "5c165d832e2216398b5a7e36"; - public const string HEADPHONES_SAFARILAND_LIBERATOR_HP_20_HEARING_PROTECTION_HEADSET_FDE = "66b5f68de98be930d701c00e"; - public const string HEADPHONES_TW_EXFIL_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f69ea7f72d197e70bcdb"; - public const string HEADPHONES_TW_EXFIL_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6a28ca68c6461709ed8"; + public const string HEADPHONES_SAFARILAND_LIBERATOR_HP_20_HEARING_PROTECTION_HEADSET_FDE = + "66b5f68de98be930d701c00e"; + public const string HEADPHONES_TW_EXFIL_PELTOR_COMTAC_V_HEADSET_OD_GREEN = + "66b5f69ea7f72d197e70bcdb"; + public const string HEADPHONES_TW_EXFIL_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = + "66b5f6a28ca68c6461709ed8"; public const string HEADPHONES_WALKERS_RAZOR_DIGITAL_HEADSET = "5e4d34ca86f774264f758330"; public const string HEADPHONES_WALKERS_XCEL_500BT_DIGITAL_HEADSET = "5f60cd6cf2bcbb675b00dac6"; - public const string HEADWEAR_6B47_RATNIKBSH_HELMET_EMR_ARCTIC_COVER = "6745895717824b1ec20570a6"; + public const string HEADWEAR_6B47_RATNIKBSH_HELMET_EMR_ARCTIC_COVER = + "6745895717824b1ec20570a6"; public const string HEADWEAR_6B47_RATNIKBSH_HELMET_EMR_COVER = "5aa7cfc0e5b5b00015693143"; public const string HEADWEAR_6B47_RATNIKBSH_HELMET_OLIVE_DRAB = "5a7c4850e899ef00150be885"; public const string HEADWEAR_ALTYN_BULLETPROOF_HELMET_OLIVE_DRAB = "5aa7e276e5b5b000171d0647"; @@ -2222,9 +2746,12 @@ public static class ItemTpl public const string HEADWEAR_ARMY_CAP_DESERT = "60361b0b5a45383c122086a1"; public const string HEADWEAR_ARMY_CAP_FLORA = "60361a7497633951dc245eb4"; public const string HEADWEAR_ARMY_CAP_UCP = "60361b5a9a15b10d96792291"; - public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_ARMOR_BLACK = "66b5f65ca7f72d197e70bcd6"; - public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_MULTICAM = "66b5f666cad6f002ab7214c2"; - public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_OD_GREEN = "66b5f661af44ca0014063c05"; + public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_ARMOR_BLACK = + "66b5f65ca7f72d197e70bcd6"; + public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_MULTICAM = + "66b5f666cad6f002ab7214c2"; + public const string HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_OD_GREEN = + "66b5f661af44ca0014063c05"; public const string HEADWEAR_BANDANA = "5b43271c5acfc432ff4dce65"; public const string HEADWEAR_BASEBALL_CAP = "572b7d8524597762b472f9d1"; public const string HEADWEAR_BASMACH_LEATHER_CAP = "65749ccf33fdc9c0cf06d3ca"; @@ -2243,7 +2770,8 @@ public static class ItemTpl public const string HEADWEAR_DEVTAC_RONIN_BALLISTIC_HELMET = "66bdc28a0b603c26902b2011"; public const string HEADWEAR_DEVTAC_RONIN_RESPIRATOR = "5b4329f05acfc47a86086aa1"; public const string HEADWEAR_DIAMOND_AGE_BASTION_HELMET_BLACK = "5ea17ca01412a1425304d1c0"; - public const string HEADWEAR_DIAMOND_AGE_NEOSTEEL_HIGH_CUT_HELMET_BLACK = "65709d2d21b9f815e208ff95"; + public const string HEADWEAR_DIAMOND_AGE_NEOSTEEL_HIGH_CUT_HELMET_BLACK = + "65709d2d21b9f815e208ff95"; public const string HEADWEAR_DOOR_KICKER_BOONIE_HAT = "5d96141523f0ea1b7f2aacab"; public const string HEADWEAR_ELF_HAT = "675aadf3003bb2e826030996"; public const string HEADWEAR_EMERCOM_CAP = "5aa2b89be5b5b0001569311f"; @@ -2251,10 +2779,14 @@ public static class ItemTpl public const string HEADWEAR_GALVION_CAIMAN_HYBRID_HELMET_GREY = "5f60b34a41e30a4ab12a6947"; public const string HEADWEAR_GUS_BASEBALL_CAP = "65749cb8e0423b9ebe0c79c9"; public const string HEADWEAR_HAT_WITH_HORNS = "675aae1c26dc64e17800fee6"; - public const string HEADWEAR_HIGHCOM_STRIKER_ACHHC_IIIA_HELMET_BLACK = "5b40e3f35acfc40016388218"; - public const string HEADWEAR_HIGHCOM_STRIKER_ACHHC_IIIA_HELMET_OLIVE_DRAB = "5b40e4035acfc47a87740943"; - public const string HEADWEAR_HIGHCOM_STRIKER_ULACH_IIIA_HELMET_BLACK = "5b40e1525acfc4771e1c6611"; - public const string HEADWEAR_HIGHCOM_STRIKER_ULACH_IIIA_HELMET_DESERT_TAN = "5b40e2bc5acfc40016388216"; + public const string HEADWEAR_HIGHCOM_STRIKER_ACHHC_IIIA_HELMET_BLACK = + "5b40e3f35acfc40016388218"; + public const string HEADWEAR_HIGHCOM_STRIKER_ACHHC_IIIA_HELMET_OLIVE_DRAB = + "5b40e4035acfc47a87740943"; + public const string HEADWEAR_HIGHCOM_STRIKER_ULACH_IIIA_HELMET_BLACK = + "5b40e1525acfc4771e1c6611"; + public const string HEADWEAR_HIGHCOM_STRIKER_ULACH_IIIA_HELMET_DESERT_TAN = + "5b40e2bc5acfc40016388216"; public const string HEADWEAR_JACK_PYKE_HUNTING_LLCS_BOONIE_HAT = "618aef6d0a5a59657e5f55ee"; public const string HEADWEAR_JACKOLANTERN_TACTICAL_PUMPKIN_HELMET = "59ef13ca86f77445fd0e2483"; public const string HEADWEAR_KINDA_COWBOY_HAT = "5aa2b9ede5b5b000137b758b"; @@ -2262,21 +2794,31 @@ public static class ItemTpl public const string HEADWEAR_KOTTON_BEANIE = "5bd073c986f7747f627e796c"; public const string HEADWEAR_LEATHER_CAP = "61c18db6dfd64163ea78fbb4"; public const string HEADWEAR_LSHZ_LIGHTWEIGHT_HELMET_OLIVE_DRAB = "5b432d215acfc4771e1c6624"; - public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_CHRISTMAS_EDITION = "6759af0f9c8a538dd70bfae6"; - public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_KILLA_EDITION = "5c0e874186f7745dc7616606"; - public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_OLIVE_DRAB = "5c091a4e0db834001d5addc8"; + public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_CHRISTMAS_EDITION = + "6759af0f9c8a538dd70bfae6"; + public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_KILLA_EDITION = + "5c0e874186f7745dc7616606"; + public const string HEADWEAR_MASKA1SCH_BULLETPROOF_HELMET_OLIVE_DRAB = + "5c091a4e0db834001d5addc8"; public const string HEADWEAR_MILTEC_BOONIE_HAT = "5b4327aa5acfc400175496e0"; - public const string HEADWEAR_MSA_ACH_TC2001_MICH_SERIES_HELMET_OLIVE_DRAB = "5d5e7d28a4b936645d161203"; - public const string HEADWEAR_MSA_ACH_TC2002_MICH_SERIES_HELMET_OLIVE_DRAB = "5d5e9c74a4b9364855191c40"; - public const string HEADWEAR_MSA_GALLET_TC_800_HIGH_CUT_COMBAT_HELMET_BLACK = "5e4bfc1586f774264f7582d3"; - public const string HEADWEAR_MTEK_FLUX_BALLISTIC_HELMET_MULTICAM_ALPINE = "675956062f6ddfe8ff0e2806"; + public const string HEADWEAR_MSA_ACH_TC2001_MICH_SERIES_HELMET_OLIVE_DRAB = + "5d5e7d28a4b936645d161203"; + public const string HEADWEAR_MSA_ACH_TC2002_MICH_SERIES_HELMET_OLIVE_DRAB = + "5d5e9c74a4b9364855191c40"; + public const string HEADWEAR_MSA_GALLET_TC_800_HIGH_CUT_COMBAT_HELMET_BLACK = + "5e4bfc1586f774264f7582d3"; + public const string HEADWEAR_MTEK_FLUX_BALLISTIC_HELMET_MULTICAM_ALPINE = + "675956062f6ddfe8ff0e2806"; public const string HEADWEAR_MTEK_FLUX_BALLISTIC_HELMET_OLIVE_DRAB = "6759655674aa5e0825040d62"; public const string HEADWEAR_MTEK_STRIKE_BALLISTIC_HELMET_COYOTE = "67597ceea35600b4c10cea86"; - public const string HEADWEAR_MTEK_STRIKE_BALLISTIC_HELMET_COYOTEMULTICAM_ARID = "67597d241d5a44f2f605df06"; + public const string HEADWEAR_MTEK_STRIKE_BALLISTIC_HELMET_COYOTEMULTICAM_ARID = + "67597d241d5a44f2f605df06"; public const string HEADWEAR_NFM_HJELM_HELMET_HELLHOUND_GREY = "61bca7cda0eae612383adf57"; public const string HEADWEAR_NPP_KLASS_TOR2_HELMET_OLIVE_DRAB = "65719f0775149d62ce0a670b"; - public const string HEADWEAR_OPSCORE_FAST_MT_SUPER_HIGH_CUT_HELMET_BLACK = "5a154d5cfcdbcb001a3b00da"; - public const string HEADWEAR_OPSCORE_FAST_MT_SUPER_HIGH_CUT_HELMET_URBAN_TAN = "5ac8d6885acfc400180ae7b0"; + public const string HEADWEAR_OPSCORE_FAST_MT_SUPER_HIGH_CUT_HELMET_BLACK = + "5a154d5cfcdbcb001a3b00da"; + public const string HEADWEAR_OPSCORE_FAST_MT_SUPER_HIGH_CUT_HELMET_URBAN_TAN = + "5ac8d6885acfc400180ae7b0"; public const string HEADWEAR_POLICE_CAP = "5aa2b8d7e5b5b00014028f4a"; public const string HEADWEAR_POMPON_HAT = "5b4329075acfc400153b78ff"; public const string HEADWEAR_PSH97_DJETA_RIOT_HELMET = "5c0d2727d174af02a012cf58"; @@ -2291,8 +2833,10 @@ public static class ItemTpl public const string HEADWEAR_STICH_PROFI_CHIMERA_BOONIE_HAT = "60b52e5bc7d8103275739d67"; public const string HEADWEAR_TACKEK_FAST_MT_HELMET_REPLICA = "5ea05cf85ad9772e6624305d"; public const string HEADWEAR_TACTICAL_FLEECE_BEANIE_TAN = "5aa2ba19e5b5b00014028f4e"; - public const string HEADWEAR_TEAM_WENDY_EXFIL_BALLISTIC_HELMET_BLACK = "5e00c1ad86f774747333222c"; - public const string HEADWEAR_TEAM_WENDY_EXFIL_BALLISTIC_HELMET_COYOTE_BROWN = "5e01ef6886f77445f643baa4"; + public const string HEADWEAR_TEAM_WENDY_EXFIL_BALLISTIC_HELMET_BLACK = + "5e00c1ad86f774747333222c"; + public const string HEADWEAR_TEAM_WENDY_EXFIL_BALLISTIC_HELMET_COYOTE_BROWN = + "5e01ef6886f77445f643baa4"; public const string HEADWEAR_TSH4ML_SOFT_TANK_CREW_HELMET = "5df8a58286f77412631087ed"; public const string HEADWEAR_UNTAR_HELMET = "5aa7d03ae5b5b00016327db5"; public const string HEADWEAR_USEC_BASEBALL_CAP_BLACK = "5b40e61f5acfc4001a599bec"; @@ -2300,16 +2844,20 @@ public static class ItemTpl public const string HEADWEAR_USHANKA_EAR_FLAP_HAT = "59e7708286f7742cbd762753"; public const string HEADWEAR_UX_PRO_BEANIE = "5aa2ba46e5b5b000137b758d"; public const string HEADWEAR_VENGEFUL_ZRYACHIYS_BALACLAVA_FOLDED = "6531119b9afebff7ff0a1769"; - public const string HEADWEAR_VULKAN5_LSHZ5_BULLETPROOF_HELMET_BLACK = "5ca20ee186f774799474abc2"; + public const string HEADWEAR_VULKAN5_LSHZ5_BULLETPROOF_HELMET_BLACK = + "5ca20ee186f774799474abc2"; public const string HEADWEAR_WILCOX_SKULL_LOCK_HEAD_MOUNT = "5a16bb52fcdbcb001a3b00dc"; public const string HEADWEAR_ZRYACHIYS_BALACLAVA_FOLDED = "636270263f2495c26f00b007"; public const string HEADWEAR_ZSH12M_HELMET_BLACK_COVER = "5aa7e4a4e5b5b000137b76f2"; public const string HEADWEAR_ZSH12M_HELMET_OLIVE_DRAB = "5aa7e454e5b5b0214e506fa2"; public const string HIDEOUTAREACONTAINER_CIRCLEOFCULTISTS_STASH_1 = "66740c3739b9da6ce402ee65"; public const string HIDEOUTAREACONTAINER_CUSTOMIZATION = "673c7b00cbf4b984b5099181"; - public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_1 = "65e5957613227bb7690ce9f6"; - public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_2 = "65e597266017f07a3204b775"; - public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_3 = "65e5972a13227bb7690cea07"; + public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_1 = + "65e5957613227bb7690ce9f6"; + public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_2 = + "65e597266017f07a3204b775"; + public const string HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_3 = + "65e5972a13227bb7690cea07"; public const string HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_1 = "63dbd45917fff4dee40fe16e"; public const string HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_2 = "65424185a57eea37ed6562e9"; public const string HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_3 = "6542435ea57eea37ed6562f0"; @@ -2338,7 +2886,8 @@ public static class ItemTpl public const string INFO_SECURE_FLASH_DRIVE = "590c621186f774138d11ea29"; public const string INFO_SECURE_FLASH_DRIVE_V2 = "6331ba83f2ab4f3f09502983"; public const string INFO_SECURE_MAGNETIC_TAPE_CASSETTE = "61bf7c024770ee6f9c6b8b53"; - public const string INFO_SILICON_OPTOELECTRONIC_INTEGRATED_CIRCUITS_TEXTBOOK = "6389c8fb46b54c634724d847"; + public const string INFO_SILICON_OPTOELECTRONIC_INTEGRATED_CIRCUITS_TEXTBOOK = + "6389c8fb46b54c634724d847"; public const string INFO_SLIM_DIARY = "590c651286f7741e566b6461"; public const string INFO_SSD_DRIVE = "590c392f86f77444754deb29"; public const string INFO_TECH_MANUAL = "590c639286f774151567fa95"; @@ -2346,7 +2895,8 @@ public static class ItemTpl public const string INFO_TGVI24_LETHAL_VACCINE = "6707d0804e617ec94f0e562f"; public const string INFO_TGVI24_TRUE_VACCINE = "6707d0bdaab679420007e01a"; public const string INFO_TOPOGRAPHIC_SURVEY_MAPS = "62a0a124de7ac81993580542"; - public const string INFO_VIDEO_CASSETTE_WITH_THE_CYBORG_KILLER_MOVIE = "62a09e974f842e1bd12da3f0"; + public const string INFO_VIDEO_CASSETTE_WITH_THE_CYBORG_KILLER_MOVIE = + "62a09e974f842e1bd12da3f0"; public const string INVENTORY_DEFAULT = "55d7217a4bdc2d86028b456d"; public const string IRONSIGHT_AK_RD_ENHANCED_V2_REAR_SIGHT = "628a7b23b0f75035732dd565"; public const string IRONSIGHT_AK_TAKTIKA_TULA_TT01_REAR_SIGHT_RAIL = "5649d9a14bdc2d79388b4580"; @@ -2364,7 +2914,8 @@ public static class ItemTpl public const string IRONSIGHT_APS_FRONT_SIGHT = "5aba62f8d8ce87001943946b"; public const string IRONSIGHT_APS_REAR_SIGHT = "5aba637ad8ce87001773e17f"; public const string IRONSIGHT_AR15_COLT_A2_REAR_SIGHT = "55d5f46a4bdc2d1b198b4567"; - public const string IRONSIGHT_AR15_LEAPERS_UTG_LOW_PROFILE_A2_FRONT_SIGHT = "55d4af3a4bdc2d972f8b456f"; + public const string IRONSIGHT_AR15_LEAPERS_UTG_LOW_PROFILE_A2_FRONT_SIGHT = + "55d4af3a4bdc2d972f8b456f"; public const string IRONSIGHT_AR15_REAR_SIGHT_CARRY_HANDLE = "5ae30bad5acfc400185c2dc4"; public const string IRONSIGHT_AS_VAL_REAR_SIGHT = "57c44e7b2459772d28133248"; public const string IRONSIGHT_ASH12_FOLDING_FRONT_SIGHT = "5caf16a2ae92152ac412efbc"; @@ -2374,8 +2925,10 @@ public static class ItemTpl public const string IRONSIGHT_CHAOS_HK_STYLE_REAR_SIGHT = "674fe8cf4472d471fb0f07df"; public const string IRONSIGHT_CHIAPPA_RHINO_FRONT_SIGHT = "619f4d304c58466fe1228437"; public const string IRONSIGHT_CHIAPPA_RHINO_REAR_SIGHT = "619f4cee4c58466fe1228435"; - public const string IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_FRONT_SIGHT = "619f52454c58466fe122843b"; - public const string IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_REAR_SIGHT = "619f4f8c4c58466fe1228439"; + public const string IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_FRONT_SIGHT = + "619f52454c58466fe122843b"; + public const string IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_REAR_SIGHT = + "619f4f8c4c58466fe1228439"; public const string IRONSIGHT_DESERT_EAGLE_FRONT_SIGHT = "668fe5ec4315934ba10c6f96"; public const string IRONSIGHT_DESERT_EAGLE_REAR_SIGHT = "668fe5e1800f0244f9036e46"; public const string IRONSIGHT_FN_FIVESEVEN_MK2_FRONT_SIGHT = "5d3eb536a4b9363b1f22f8e2"; @@ -2384,8 +2937,10 @@ public static class ItemTpl public const string IRONSIGHT_FN_SCAR_FLIPUP_REAR_SIGHT = "61817865d3a39d50044c13a4"; public const string IRONSIGHT_GLOCK_19X_FRONT_SIGHT = "630765777d50ff5e8a1ea718"; public const string IRONSIGHT_GLOCK_19X_REAR_SIGHT = "630765cb962d0247b029dc45"; - public const string IRONSIGHT_GLOCK_DEAD_RINGER_SNAKE_EYE_FRONT_SIGHT = "5a7d90eb159bd400165484f1"; - public const string IRONSIGHT_GLOCK_DEAD_RINGER_SNAKE_EYE_REAR_SIGHT = "5a7d9122159bd4001438dbf4"; + public const string IRONSIGHT_GLOCK_DEAD_RINGER_SNAKE_EYE_FRONT_SIGHT = + "5a7d90eb159bd400165484f1"; + public const string IRONSIGHT_GLOCK_DEAD_RINGER_SNAKE_EYE_REAR_SIGHT = + "5a7d9122159bd4001438dbf4"; public const string IRONSIGHT_GLOCK_FRONT_SIGHT = "5a6f58f68dc32e000a311390"; public const string IRONSIGHT_GLOCK_REAR_SIGHT = "5a6f5d528dc32e00094b97d9"; public const string IRONSIGHT_GLOCK_TRUGLO_TFX_FRONT_SIGHT = "5a7d9104159bd400134c8c21"; @@ -2407,12 +2962,16 @@ public static class ItemTpl public const string IRONSIGHT_KAC_FOLDING_MICRO_FRONT_SIGHT = "5dfa3d950dee1b22f862eae0"; public const string IRONSIGHT_KAC_FOLDING_MICRO_REAR_SIGHT = "5dfa3d7ac41b2312ea33362a"; public const string IRONSIGHT_KAC_FOLDING_REAR_SIGHT = "5c1780312e221602b66cc189"; - public const string IRONSIGHT_KRISS_DEFIANCE_LOW_PROFILE_FLIPUP_FRONT_SIGHT = "5fb6567747ce63734e3fa1dc"; - public const string IRONSIGHT_KRISS_DEFIANCE_LOW_PROFILE_FLIPUP_REAR_SIGHT = "5fb6564947ce63734e3fa1da"; - public const string IRONSIGHT_M14_SA_ENLARGED_MILITARY_APERTURE_REAR_SIGHT = "5abcbb20d8ce87001773e258"; + public const string IRONSIGHT_KRISS_DEFIANCE_LOW_PROFILE_FLIPUP_FRONT_SIGHT = + "5fb6567747ce63734e3fa1dc"; + public const string IRONSIGHT_KRISS_DEFIANCE_LOW_PROFILE_FLIPUP_REAR_SIGHT = + "5fb6564947ce63734e3fa1da"; + public const string IRONSIGHT_M14_SA_ENLARGED_MILITARY_APERTURE_REAR_SIGHT = + "5abcbb20d8ce87001773e258"; public const string IRONSIGHT_M1911A1_FRONT_SIGHT = "5e81ee213397a21db957f6a6"; public const string IRONSIGHT_M1911A1_REAR_SIGHT = "5e81ee4dcb2b95385c177582"; - public const string IRONSIGHT_M1A_SA_NATIONAL_MATCH_062_BLADE_FRONT_SIGHT = "5addba3e5acfc4001669f0ab"; + public const string IRONSIGHT_M1A_SA_NATIONAL_MATCH_062_BLADE_FRONT_SIGHT = + "5addba3e5acfc4001669f0ab"; public const string IRONSIGHT_M1A_SA_XS_POST_125_BLADE_FRONT_SIGHT = "5aafa49ae5b5b00015042a58"; public const string IRONSIGHT_M45A1_NOVAK_LOMOUNT_FRONT_SIGHT = "5f3e78a7fbf956000b716b8e"; public const string IRONSIGHT_M45A1_NOVAK_LOMOUNT_REAR_SIGHT = "5f3e7897ddc4f03b010e204a"; @@ -2423,9 +2982,11 @@ public static class ItemTpl public const string IRONSIGHT_M9A3_REAR_SIGHT = "5cadd940ae9215051e1c2316"; public const string IRONSIGHT_M9A3_SIGHT_MOUNT_REAR_SIGHT_RAIL = "5cadd954ae921500103bb3c2"; public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_FRONT_SIGHT = "5bc09a30d4351e00367fb7c8"; - public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_FRONT_SIGHT_FDE = "5c18b90d2e2216152142466b"; + public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_FRONT_SIGHT_FDE = + "5c18b90d2e2216152142466b"; public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_REAR_SIGHT = "5bc09a18d4351e003562b68e"; - public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_REAR_SIGHT_FDE = "5c18b9192e2216398b5a8104"; + public const string IRONSIGHT_MAGPUL_MBUS_GEN2_FLIPUP_REAR_SIGHT_FDE = + "5c18b9192e2216398b5a8104"; public const string IRONSIGHT_MCX_FLIPUP_FRONT_SIGHT = "5fc0fa362770a0045c59c677"; public const string IRONSIGHT_MCX_FLIPUP_REAR_SIGHT = "5fc0fa957283c4046c58147e"; public const string IRONSIGHT_MOSIN_RIFLE_CARBINE_REAR_SIGHT = "5bfd4c980db834001b73449d"; @@ -2437,10 +2998,13 @@ public static class ItemTpl public const string IRONSIGHT_MPX_FLIPUP_FRONT_SIGHT = "5894a73486f77426d259076c"; public const string IRONSIGHT_MPX_FLIPUP_REAR_SIGHT = "5894a81786f77427140b8347"; public const string IRONSIGHT_P226_FRONT_SIGHT = "56d5a661d2720bd8418b456b"; - public const string IRONSIGHT_P226_MEPROLIGHT_TRUDOT_NIGHT_FRONT_SIGHT = "5c07b36c0db834002a1259e9"; - public const string IRONSIGHT_P226_MEPROLIGHT_TRUDOT_NIGHT_REAR_SIGHT = "5c07b3850db834002330045b"; + public const string IRONSIGHT_P226_MEPROLIGHT_TRUDOT_NIGHT_FRONT_SIGHT = + "5c07b36c0db834002a1259e9"; + public const string IRONSIGHT_P226_MEPROLIGHT_TRUDOT_NIGHT_REAR_SIGHT = + "5c07b3850db834002330045b"; public const string IRONSIGHT_P226_REAR_SIGHT = "56d5a77ed2720b90418b4568"; - public const string IRONSIGHT_P226_SIGHT_MOUNT_220239_REAR_SIGHT_BEARING = "56ea7293d2720b8d4b8b45ba"; + public const string IRONSIGHT_P226_SIGHT_MOUNT_220239_REAR_SIGHT_BEARING = + "56ea7293d2720b8d4b8b45ba"; public const string IRONSIGHT_PK_REAR_SIGHT = "6492fb8253acae0af00a29b6"; public const string IRONSIGHT_PL15_EXTENDED_FRONT_SIGHT = "60228a850ddce744014caf69"; public const string IRONSIGHT_PL15_EXTENDED_REAR_SIGHT = "602293f023506e50807090cb"; @@ -2734,9 +3298,12 @@ public static class ItemTpl public const string LOOTCONTAINER_AIRDROP_MEDICAL_CRATE = "622334c873090231d904a9fc"; public const string LOOTCONTAINER_AIRDROP_SUPPLY_CRATE = "622334fa3136504a544d160c"; public const string LOOTCONTAINER_AIRDROP_SUPPLY_CRATE_2 = "61a89e812cc17d60cc5f9879"; - public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1 = "66da1b49099cf6adcc07a36b"; - public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_2 = "66da1b546916142b3b022777"; - public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_3 = "61a89e5445a2672acf66c877"; + public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1 = + "66da1b49099cf6adcc07a36b"; + public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_2 = + "66da1b546916142b3b022777"; + public const string LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_3 = + "61a89e5445a2672acf66c877"; public const string LOOTCONTAINER_AIRDROP_WEAPON_CRATE = "6223351bb5d97a7b2c635ca7"; public const string LOOTCONTAINER_BANK_CASH_REGISTER = "64d116f41a9c6143a956127d"; public const string LOOTCONTAINER_BANK_SAFE_3X3 = "66acff0a1d8e1083b303f5af"; @@ -2778,17 +3345,23 @@ public static class ItemTpl public const string LOOTCONTAINER_WEAPON_BOX_6X3 = "5909d76c86f77471e53d2adf"; public const string LOOTCONTAINER_WOODEN_AMMO_BOX_3X3 = "67adf4b81c58bd68b2002fec"; public const string LOOTCONTAINER_WOODEN_CRATE_5X2 = "67adf4db515e3dd542077a1d"; - public const string MACHINEGUN_AGS30_30X29MM_AUTOMATIC_GRENADE_LAUNCHER = "5d52cc5ba4b9367408500062"; + public const string MACHINEGUN_AGS30_30X29MM_AUTOMATIC_GRENADE_LAUNCHER = + "5d52cc5ba4b9367408500062"; public const string MACHINEGUN_DEGTYAREV_RPD_762X39_MACHINE_GUN = "6513ef33e06849f06c0957ca"; public const string MACHINEGUN_DEGTYAREV_RPDN_762X39_MACHINE_GUN = "65268d8ecb944ff1e90ea385"; public const string MACHINEGUN_KALASHNIKOV_PKM_762X54R_MACHINE_GUN = "64637076203536ad5600c990"; - public const string MACHINEGUN_KALASHNIKOV_PKP_762X54R_INFANTRY_MACHINE_GUN = "64ca3d3954fc657e230529cc"; - public const string MACHINEGUN_KALASHNIKOV_PKTM_762X54R_MODERNIZED_TANK_MACHINE_GUN = "657857faeff4c850222dff1b"; + public const string MACHINEGUN_KALASHNIKOV_PKP_762X54R_INFANTRY_MACHINE_GUN = + "64ca3d3954fc657e230529cc"; + public const string MACHINEGUN_KALASHNIKOV_PKTM_762X54R_MODERNIZED_TANK_MACHINE_GUN = + "657857faeff4c850222dff1b"; public const string MACHINEGUN_NSV_UTYOS_127X108_HEAVY_MACHINE_GUN = "5cdeb229d7f00c000e7ce174"; public const string MACHINEGUN_RPK16_545X39_LIGHT_MACHINE_GUN = "5beed0f50db834001c062b12"; - public const string MACHINEGUN_US_ORDNANCE_M60E4_762X51_LIGHT_MACHINE_GUN = "65fb023261d5829b2d090755"; - public const string MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN = "661ceb1b9311543c7104149b"; - public const string MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN_FDE = "661cec09b2c6356b4d0c7a36"; + public const string MACHINEGUN_US_ORDNANCE_M60E4_762X51_LIGHT_MACHINE_GUN = + "65fb023261d5829b2d090755"; + public const string MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN = + "661ceb1b9311543c7104149b"; + public const string MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN_FDE = + "661cec09b2c6356b4d0c7a36"; public const string MAGAZINE_127X108_100_100RND = "5cffa483d7ad1a049e54ef1c"; public const string MAGAZINE_127X33_DE_7RND = "668fe5c5f35310705d02b696"; public const string MAGAZINE_127X55_ASH12_10RND = "5caf1041ae92157c28402e3f"; @@ -3021,12 +3594,17 @@ public static class ItemTpl public const string MARKOFUNKNOWN_MARK_OF_THE_UNHEARD = "65ddcc9cfa85b9f17d0dfb07"; public const string MARKSMANRIFLE_HK_G28_762X51_MARKSMAN_RIFLE = "6176aca650224f204c1da3fb"; public const string MARKSMANRIFLE_KELTEC_RFB_762X51_RIFLE = "5f2a9575926fd9352339381f"; - public const string MARKSMANRIFLE_KNIGHTS_ARMAMENT_COMPANY_SR25_762X51_MARKSMAN_RIFLE = "5df8ce05b11454561e39243b"; - public const string MARKSMANRIFLE_REMINGTON_R11_RSASS_762X51_MARKSMAN_RIFLE = "5a367e5dc4a282000e49738f"; - public const string MARKSMANRIFLE_SPRINGFIELD_ARMORY_M1A_762X51_RIFLE = "5aafa857e5b5b00018480968"; + public const string MARKSMANRIFLE_KNIGHTS_ARMAMENT_COMPANY_SR25_762X51_MARKSMAN_RIFLE = + "5df8ce05b11454561e39243b"; + public const string MARKSMANRIFLE_REMINGTON_R11_RSASS_762X51_MARKSMAN_RIFLE = + "5a367e5dc4a282000e49738f"; + public const string MARKSMANRIFLE_SPRINGFIELD_ARMORY_M1A_762X51_RIFLE = + "5aafa857e5b5b00018480968"; public const string MARKSMANRIFLE_SVDS_762X54R_SNIPER_RIFLE = "5c46fbd72e2216398b5a8c9c"; - public const string MARKSMANRIFLE_SWORD_INTERNATIONAL_MK18_338_LM_MARKSMAN_RIFLE = "5fc22d7c187fea44d52eda44"; - public const string MARKSMANRIFLE_VSS_VINTOREZ_9X39_SPECIAL_SNIPER_RIFLE = "57838ad32459774a17445cd2"; + public const string MARKSMANRIFLE_SWORD_INTERNATIONAL_MK18_338_LM_MARKSMAN_RIFLE = + "5fc22d7c187fea44d52eda44"; + public const string MARKSMANRIFLE_VSS_VINTOREZ_9X39_SPECIAL_SNIPER_RIFLE = + "57838ad32459774a17445cd2"; public const string MEDICAL_ALUMINUM_SPLINT = "5af0454c86f7746bf20992e8"; public const string MEDICAL_ARMY_BANDAGE = "5751a25924597722c463c472"; public const string MEDICAL_ASEPTIC_BANDAGE = "544fb25a4bdc2dfb738b4567"; @@ -3067,19 +3645,23 @@ public static class ItemTpl public const string MOUNT_ARMASIGHT_VULCAN_UNIVERSAL_BASE = "5b3b6dc75acfc47a8773fb1e"; public const string MOUNT_ARMASIGHT_ZEUS_UNIVERSAL_BASE = "63fc449f5bd61c6cf3784a88"; public const string MOUNT_AXION_KOBRA_DOVETAIL = "591ee00d86f774592f7b841e"; - public const string MOUNT_BENELLI_M3_SUPER_90_UPPER_RECEIVER_TOP_RAIL = "625ed7c64d9b6612df732146"; + public const string MOUNT_BENELLI_M3_SUPER_90_UPPER_RECEIVER_TOP_RAIL = + "625ed7c64d9b6612df732146"; public const string MOUNT_BT_QD_NAR_MOUNT_FOR_AIMPOINT_ACRO = "615d8d878004cc50514c3233"; public const string MOUNT_BURRIS_ARPEPR_30MM_RING_SCOPE = "5b2389515acfc4771e1be0c0"; public const string MOUNT_BURRIS_FASTFIRE_WEAVER_BASE = "577d128124597739d65d0e56"; public const string MOUNT_CNC_GUNS_KEYMOD_2_INCH_RAIL = "623c2f652febb22c2777d8d7"; public const string MOUNT_CNC_GUNS_KEYMOD_4_INCH_RAIL = "623c2f4242aee3103f1c44b7"; - public const string MOUNT_CORVUS_DEFENSIO_KEYMOD_18_INCH_RAIL_SECTION = "67111094d1758189fc0bd223"; - public const string MOUNT_CORVUS_DEFENSIO_KEYMOD_68_INCH_RAIL_SECTION = "6711109e723c2733410161eb"; + public const string MOUNT_CORVUS_DEFENSIO_KEYMOD_18_INCH_RAIL_SECTION = + "67111094d1758189fc0bd223"; + public const string MOUNT_CORVUS_DEFENSIO_KEYMOD_68_INCH_RAIL_SECTION = + "6711109e723c2733410161eb"; public const string MOUNT_CUSTOM_GUNS_HANDGUARD_RAIL = "6086b5392535c57a13424d70"; public const string MOUNT_CYCLONE_SHAKHIN = "67641a851b2899700609901a"; public const string MOUNT_DANIEL_DEFENSE_25MM_ACCESSORY_RING = "6267c6396b642f77f56f5c1c"; public const string MOUNT_DELTAPOINT_CROSS_SLOT_MOUNT_BASE = "58d2664f86f7747fec5834f6"; - public const string MOUNT_DELTATEK_SPRUT_MOUNT_FOR_PUMPACTION_SHOTGUNS = "55d48ebc4bdc2d8c2f8b456c"; + public const string MOUNT_DELTATEK_SPRUT_MOUNT_FOR_PUMPACTION_SHOTGUNS = + "55d48ebc4bdc2d8c2f8b456c"; public const string MOUNT_ETMI019_SHOTGUN_RAIL = "5dfe14f30b92095fd441edaf"; public const string MOUNT_FN_FIVESEVEN_MK2_RMR = "5d7b6bafa4b93652786f4c76"; public const string MOUNT_FN_P90_EFFEN_90_RECEIVER_RAIL = "5cc7012ae4a949001252b43e"; @@ -3099,15 +3681,20 @@ public static class ItemTpl public const string MOUNT_FN_SCAR_PWS_SRX_RAIL_EXTENSION = "61965d9058ef8c428c287e0d"; public const string MOUNT_FN_SCAR_SIDE_RAILS = "61816dfa6ef05c2ce828f1ad"; public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD = "66ffe811f5d758d71101e89a"; - public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER = "66ffea456be19fd81e0ef742"; - public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER_PATRIOT_BROWN = "66ffeab4ab3336cc01063833"; - public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_PATRIOT_BROWN = "66ffea06132225f0fe061394"; + public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER = + "66ffea456be19fd81e0ef742"; + public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER_PATRIOT_BROWN = + "66ffeab4ab3336cc01063833"; + public const string MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_PATRIOT_BROWN = + "66ffea06132225f0fe061394"; public const string MOUNT_GBRS_AIMPOINT_HYDRA_MOUNT_KIT_BLACK = "65392f611406374f82152ba5"; public const string MOUNT_GBRS_AIMPOINT_HYDRA_MOUNT_KIT_FDE = "653931da5db71d30ab1d6296"; public const string MOUNT_GEISSELE_SUPER_PRECISION_30MM_RING_SCOPE = "618b9643526131765025ab35"; - public const string MOUNT_GEISSELE_SUPER_PRECISION_30MM_RING_SCOPE_MOUNT_DDC = "618bab21526131765025ab3f"; + public const string MOUNT_GEISSELE_SUPER_PRECISION_30MM_RING_SCOPE_MOUNT_DDC = + "618bab21526131765025ab3f"; public const string MOUNT_GEISSELE_SUPER_PRECISION_TOP_RING_CAP = "618b9671d14d6d5ab879c5ea"; - public const string MOUNT_GEISSELE_SUPER_PRECISION_TOP_RING_CAP_DDC = "618ba91477b82356f91ae0e8"; + public const string MOUNT_GEISSELE_SUPER_PRECISION_TOP_RING_CAP_DDC = + "618ba91477b82356f91ae0e8"; public const string MOUNT_GLOCK_AIMTECH_MOUNT_BASE = "5a7ad4af51dfba0013379717"; public const string MOUNT_GLOCK_AIMTECH_TIGER_SHARK_SIGHT = "5a7ad55551dfba0015068f42"; public const string MOUNT_GLOCK_TANGODOWN_AAM01_ACRO_MOUNT_BASE = "615d8da4d3a39d50044c10e8"; @@ -3125,7 +3712,8 @@ public static class ItemTpl public const string MOUNT_HK_G36_STANAG_MAGWELL = "622f039199f4ea1a4d6c9a17"; public const string MOUNT_HK_HKEY_3_INCH_RAIL = "67069d3bb29a2cd338033390"; public const string MOUNT_HK_MP5_BT_TRIRAIL_RECEIVER = "5a966ec8a2750c00171b3f36"; - public const string MOUNT_HK_MP5_MFI_HK_UNIVERSAL_LOW_PROFILE_SCOPE = "5926dad986f7741f82604363"; + public const string MOUNT_HK_MP5_MFI_HK_UNIVERSAL_LOW_PROFILE_SCOPE = + "5926dad986f7741f82604363"; public const string MOUNT_HK_MP5SD_BT_TRIRAIL_RING = "59c63b4486f7747afb151c1c"; public const string MOUNT_HK_UMP_BOTTOM_HANDGUARD_RAIL = "5fc53954f8b6a877a729eaeb"; public const string MOUNT_HK_UMP_SIDE_HANDGUARD_RAIL = "5fc5396e900b1d5091531e72"; @@ -3138,7 +3726,8 @@ public static class ItemTpl public const string MOUNT_KAC_URX_3_3_INCH_RAIL = "5d133067d7ad1a33013f95b4"; public const string MOUNT_KIBA_ARMS_25MM_ACCESSORY_RING = "57d17e212459775a1179a0f5"; public const string MOUNT_KIBA_ARMS_SHORT_MOUNT_SIGHT_ADAPTER = "5c1cdd302e221602b3137250"; - public const string MOUNT_KIBA_ARMS_SPRM_RAIL_MOUNT_FOR_PUMPACTION_SHOTGUNS = "55d48a634bdc2d8b2f8b456a"; + public const string MOUNT_KIBA_ARMS_SPRM_RAIL_MOUNT_FOR_PUMPACTION_SHOTGUNS = + "55d48a634bdc2d8b2f8b456a"; public const string MOUNT_KMZ_1P59_DOVETAIL = "5d0a29ead7ad1a0026013f27"; public const string MOUNT_KMZ_1P69_WEAVER = "5d0a29fed7ad1a002769ad08"; public const string MOUNT_KRISS_VECTOR_BOTTOM_RAIL = "5fbb976df9986c4cff3fe5f2"; @@ -3165,7 +3754,8 @@ public static class ItemTpl public const string MOUNT_M700_MAGPUL_PRO_700_CHASSIS_INLINE = "5cdeaca5d7f00c00b61c4b70"; public const string MOUNT_M870_LEAPERS_UTG_PRO_MTU028SG_RAIL = "5a7893c1c585673f2b5c374d"; public const string MOUNT_M870_MESA_TACTICAL_MAGAZINE_CLAMP = "5a789261c5856700186c65d3"; - public const string MOUNT_M870_XS_SHOTRAIL_RAIL_WITH_GHOST_RING_REAR_SIGHT = "5a78948ec5856700177b1124"; + public const string MOUNT_M870_XS_SHOTRAIL_RAIL_WITH_GHOST_RING_REAR_SIGHT = + "5a78948ec5856700177b1124"; public const string MOUNT_MAGPUL_MLOK_093_INCH_RAIL = "669a6a4a525be1d2d004b8eb"; public const string MOUNT_MAGPUL_MLOK_25_INCH_RAIL = "5b7be47f5acfc400170e2dd2"; public const string MOUNT_MAGPUL_MLOK_41_INCH_RAIL = "5b7be4895acfc400170e2dd5"; @@ -3177,7 +3767,8 @@ public static class ItemTpl public const string MOUNT_MOSIN_RIFLE_ARBALET_PATRIOT_KW_RAIL = "5d024f5cd7ad1a04a067e91a"; public const string MOUNT_MOSIN_RIFLE_KOCHETOV = "5b3f7bf05acfc433000ecf6b"; public const string MOUNT_MOSSBERG_590A1_TACTICAL_RAIL = "5eeb2ff5ea4f8b73c827350b"; - public const string MOUNT_MP133153_TAKTIKA_TULA_12003_STOCK_ADAPTER = "5bfe7fb30db8340018089fed"; + public const string MOUNT_MP133153_TAKTIKA_TULA_12003_STOCK_ADAPTER = + "5bfe7fb30db8340018089fed"; public const string MOUNT_MP155_ULTIMA_SHORT_RAIL = "607ea812232e5a31c233d53c"; public const string MOUNT_MP155_ULTIMA_TOP_RAIL = "60785ce5132d4d12c81fd918"; public const string MOUNT_MP18_SIGHT = "61f804acfcba9556ea304cb8"; @@ -3189,7 +3780,8 @@ public static class ItemTpl public const string MOUNT_NCSTAR_MPR45_BACKUP = "5649a2464bdc2d91118b45a8"; public const string MOUNT_NIGHTFORCE_MAGMOUNT_30MM_RING_SCOPE = "5b3b99265acfc4704b4a1afb"; public const string MOUNT_NIGHTFORCE_MAGMOUNT_34MM_RING_SCOPE = "5aa66a9be5b5b0214e506e89"; - public const string MOUNT_NIGHTFORCE_MAGMOUNT_34MM_RING_SCOPE_MOUNT_WITH_RUGGEDIZED_ACCESSORY_PLATFORM = "5aa66c72e5b5b00016327c93"; + public const string MOUNT_NIGHTFORCE_MAGMOUNT_34MM_RING_SCOPE_MOUNT_WITH_RUGGEDIZED_ACCESSORY_PLATFORM = + "5aa66c72e5b5b00016327c93"; public const string MOUNT_NOROTOS_TITANIUM_ADVANCED_TACTICAL = "5a16b8a9fcdbcb00165aa6ca"; public const string MOUNT_NPZ_1P781_DOVETAIL = "618a75c9a3884f56c957ca1b"; public const string MOUNT_ODIN_WORKS_KPOD_KEYMOD_BIPOD_ADAPTER = "67112695fe5c8bf33f02476d"; @@ -3208,21 +3800,26 @@ public static class ItemTpl public const string MOUNT_PP91_KEDR_ROTOR_43_RIS = "57ee59b42459771c7b045da5"; public const string MOUNT_PRECISION_REFLEX_HANDGUARD_BOTTOM_RAIL = "6388c4ac8d895f557a0c6515"; public const string MOUNT_PRECISION_REFLEX_HANDGUARD_LONG_TOP_RAIL = "6388c5d19c00405f4717c0f0"; - public const string MOUNT_PRECISION_REFLEX_HANDGUARD_SHORT_SIDE_RAIL = "6388c4478d895f557a0c6512"; + public const string MOUNT_PRECISION_REFLEX_HANDGUARD_SHORT_SIDE_RAIL = + "6388c4478d895f557a0c6512"; public const string MOUNT_PU_35X_RING_SCOPE = "5b3f7c005acfc4704b4a1de8"; public const string MOUNT_PVS7_WILCOX_ADAPTER = "5c11046cd174af02a012e42b"; public const string MOUNT_RECKNAGEL_ERATAC_30MM_RING_SCOPE = "6171407e50224f204c1da3c5"; public const string MOUNT_RECKNAGEL_ERATAC_34MM_RING_SCOPE = "61713cc4d8e3106d9806c109"; - public const string MOUNT_RECKNAGEL_ERATAC_SUNSHADE_MOUNT_FOR_AIMPOINT_T1_SIGHTS = "61714b2467085e45ef140b2c"; + public const string MOUNT_RECKNAGEL_ERATAC_SUNSHADE_MOUNT_FOR_AIMPOINT_T1_SIGHTS = + "61714b2467085e45ef140b2c"; public const string MOUNT_REMINGTON_RAHG_2_INCH_RAIL = "5c0102aa0db834001b734ba1"; public const string MOUNT_REMINGTON_RAHG_4_INCH_RAIL = "5c0102b20db834001d23eebc"; - public const string MOUNT_REPTILIA_ROF90_RMR_MOUNT_FOR_GEISSELE_SCOPE_MOUNTS = "618b9682a3884f56c957ca78"; - public const string MOUNT_REPTILIA_ROF90_RMR_MOUNT_FOR_GEISSELE_SCOPE_MOUNTS_DDC = "618ba92152ecee1505530bd3"; + public const string MOUNT_REPTILIA_ROF90_RMR_MOUNT_FOR_GEISSELE_SCOPE_MOUNTS = + "618b9682a3884f56c957ca78"; + public const string MOUNT_REPTILIA_ROF90_RMR_MOUNT_FOR_GEISSELE_SCOPE_MOUNTS_DDC = + "618ba92152ecee1505530bd3"; public const string MOUNT_RFB_HANDGUARD_RAIL = "5f2aa493cd375f14e15eea72"; public const string MOUNT_RFB_QUAD_RAIL_3_INCH = "676177591f08ed5e8800b7a9"; public const string MOUNT_RFB_SCOPE_RAIL = "5f2aa49f9b44de6b1b4e68d4"; public const string MOUNT_RPK16_HANDGUARD_RAIL = "5beecbb80db834001d2c465e"; - public const string MOUNT_RS_REGULATE_AK303M_FULL_LENGTH_LOWER_DOVETAIL = "65f1b1176dbd6c5ba2082eed"; + public const string MOUNT_RS_REGULATE_AK303M_FULL_LENGTH_LOWER_DOVETAIL = + "65f1b1176dbd6c5ba2082eed"; public const string MOUNT_RS_REGULATE_AKR_TOP = "65f1b2a5c14a07890801fc70"; public const string MOUNT_SAG_AK_DOVETAIL_SIDE = "63d114019e35b334d82302f7"; public const string MOUNT_SAG_BIT_LOW_PROFILE_DOVETAIL_SIDE = "638db77630c4240f9e06f8b6"; @@ -3235,7 +3832,8 @@ public static class ItemTpl public const string MOUNT_SKS_LEAPERS_UTG_SOCOM_RAIL = "593d1fa786f7746da62d61ac"; public const string MOUNT_SKS_TAPCO_INTRAFUSE_CHASSIS_LOWER_RAIL = "653ed19d22e1ef3d9002c328"; public const string MOUNT_SKS_UPPER_BAND = "634f04d82e5def262d0b30c6"; - public const string MOUNT_SOK12_CHAOS_TITAN_QUAD_RAIL_HANDGUARD_TOP_COVER = "674fe89a4472d471fb0f07d8"; + public const string MOUNT_SOK12_CHAOS_TITAN_QUAD_RAIL_HANDGUARD_TOP_COVER = + "674fe89a4472d471fb0f07d8"; public const string MOUNT_SOK12_CHAOS_TITAN_RECEIVER_TOP_RAIL = "674fe8b9362ea1f88b0e278d"; public const string MOUNT_SR1MP_QUAD_RAIL = "5a27bad7c4a282000b15184b"; public const string MOUNT_SR1MP_SINGLE_RAIL = "5a27b281c4a28200741e1e52"; @@ -3247,10 +3845,12 @@ public static class ItemTpl public const string MOUNT_SR3MP_DOVETAIL_SIDE_RAIL_PLUM = "67069cbbb29a2cd33803338c"; public const string MOUNT_SR3MP_SIDE_RAILS_BLACK = "67069cf1af4890b09f0006e8"; public const string MOUNT_SR3MP_SIDE_RAILS_PLUM = "67069d02ad91f3a63c0bc2b0"; - public const string MOUNT_STEYR_AUG_A3_CORVUS_DEFENSIO_RECEIVER_RAIL_MOI_30_SLOTS = "67110dd41ad01bb88705347b"; + public const string MOUNT_STEYR_AUG_A3_CORVUS_DEFENSIO_RECEIVER_RAIL_MOI_30_SLOTS = + "67110dd41ad01bb88705347b"; public const string MOUNT_STEYR_AUG_A3_M1_HIGH_SIGHT = "62e7c8f91cd3fde4d503d690"; public const string MOUNT_STEYR_AUG_A3_M1_LOW_SIGHT = "62ebba1fb658e07ef9082b5a"; - public const string MOUNT_STEYR_AUG_CORVUS_DEFENSIO_KEYMOD_FORWARD_ACCESSORY_RAIL = "6711107e1ad01bb88705347e"; + public const string MOUNT_STEYR_AUG_CORVUS_DEFENSIO_KEYMOD_FORWARD_ACCESSORY_RAIL = + "6711107e1ad01bb88705347e"; public const string MOUNT_STRIKE_INDUSTRIES_KEYMOD_4_INCH_RAIL = "5a9d6d00a2750c5c985b5305"; public const string MOUNT_STRIKE_INDUSTRIES_KEYMOD_6_INCH_RAIL = "5a9d6d13a2750c00164f6b03"; public const string MOUNT_STRIKE_INDUSTRIES_TRAX_BRIDGE_RAIL = "5a9d6d21a2750c00137fa649"; @@ -3287,94 +3887,132 @@ public static class ItemTpl public const string MOUNT_VSSVAL_TOZ_6P29M = "59eb7ebe86f7740b373438ce"; public const string MOUNT_VSSVAL_ZENIT_B3_MOUNT_COMBO = "5a9fc7e6a2750c0032157184"; public const string MOUNT_VSSVAL_ZENIT_B3_RING = "57a3459f245977764a01f703"; - public const string MOUNT_ZENIT_B13_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c61a40d2e2216001403158d"; - public const string MOUNT_ZENIT_B13V_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c90c3622e221601da359851"; + public const string MOUNT_ZENIT_B13_KLASSIKA_DOVETAIL_RAIL_PLATFORM = + "5c61a40d2e2216001403158d"; + public const string MOUNT_ZENIT_B13V_KLASSIKA_DOVETAIL_RAIL_PLATFORM = + "5c90c3622e221601da359851"; public const string MOUNT_ZENIT_KR2_OLD_GEN = "646f6322f43d0c5d62063715"; public const string MULTITOOLS_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a"; public const string MUZZLECOMBO_9A91_HANDGUARD_RETAINER = "64527a263d52156624001fd7"; public const string MUZZLECOMBO_AA12_12GA_CHOKE = "670fd1cc95c92bfc8e0bea39"; public const string MUZZLECOMBO_AA12_THREAD_PROTECTOR = "670fd0eed8d4eae4790c818a"; public const string MUZZLECOMBO_AI_AXMC_THREAD_PROTECTOR = "628120621d5df4475f46a335"; - public const string MUZZLECOMBO_AK_762X39_TAKTIKA_TULA_MUZZLE_ADAPTER = "5a0abb6e1526d8000a025282"; - public const string MUZZLECOMBO_AK_CNC_WARRIOR_556X45_MUZZLE_DEVICE_ADAPTER = "5e21ca18e4d47f0da15e77dd"; - public const string MUZZLECOMBO_AKM_762X39_KIBA_ARMS_308_MUZZLE_DEVICE_ADAPTER = "615d8e9867085e45ef1409c6"; + public const string MUZZLECOMBO_AK_762X39_TAKTIKA_TULA_MUZZLE_ADAPTER = + "5a0abb6e1526d8000a025282"; + public const string MUZZLECOMBO_AK_CNC_WARRIOR_556X45_MUZZLE_DEVICE_ADAPTER = + "5e21ca18e4d47f0da15e77dd"; + public const string MUZZLECOMBO_AKM_762X39_KIBA_ARMS_308_MUZZLE_DEVICE_ADAPTER = + "615d8e9867085e45ef1409c6"; public const string MUZZLECOMBO_ASE_UTRA_BORELOCK_THREAD_PROTECTOR = "673f3f2f40aeca974e0b5c66"; public const string MUZZLECOMBO_AWC_PSR_MUZZLE_BRAKE_PROTECTOR = "612e0e04568c120fdd294258"; - public const string MUZZLECOMBO_GEMTECH_ONE_DIRECT_THREAD_MOUNT_ADAPTER = "5c7954d52e221600106f4cc7"; + public const string MUZZLECOMBO_GEMTECH_ONE_DIRECT_THREAD_MOUNT_ADAPTER = + "5c7954d52e221600106f4cc7"; public const string MUZZLECOMBO_GK01_12GA_COMPENSATOR = "5580239d4bdc2de7118b4583"; public const string MUZZLECOMBO_GK02_12GA_MUZZLE_BRAKE = "58272d7f2459774f6311ddfd"; - public const string MUZZLECOMBO_GLOCK_9X19_DOUBLE_DIAMOND_THREAD_PROTECTOR = "5a6b592c8dc32e00094b97bf"; - public const string MUZZLECOMBO_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_THREAD_PROTECTOR = "5a6b585a8dc32e5a9c28b4f1"; + public const string MUZZLECOMBO_GLOCK_9X19_DOUBLE_DIAMOND_THREAD_PROTECTOR = + "5a6b592c8dc32e00094b97bf"; + public const string MUZZLECOMBO_GLOCK_9X19_LONE_WOLF_ALPHAWOLF_THREAD_PROTECTOR = + "5a6b585a8dc32e5a9c28b4f1"; public const string MUZZLECOMBO_GLOCK_SAI_9X19_THREAD_PROTECTOR = "5a6b59a08dc32e000b452fb7"; public const string MUZZLECOMBO_HK_MP5_3LUG_MUZZLE_ADAPTER = "5926e16e86f7742f5a0f7ecb"; - public const string MUZZLECOMBO_HK_MP5_NAVY_STYLE_3LUG_SUPPRESSOR_ADAPTER = "5c0000c00db834001a6697fc"; + public const string MUZZLECOMBO_HK_MP5_NAVY_STYLE_3LUG_SUPPRESSOR_ADAPTER = + "5c0000c00db834001a6697fc"; public const string MUZZLECOMBO_HK_USP_TACTICAL_THREAD_PROTECTOR = "6194f1f918a3974e5e7421e4"; - public const string MUZZLECOMBO_KRISS_VECTOR_45_ACP_THREAD_PROTECTOR = "5fb6548dd1409e5ca04b54f9"; + public const string MUZZLECOMBO_KRISS_VECTOR_45_ACP_THREAD_PROTECTOR = + "5fb6548dd1409e5ca04b54f9"; public const string MUZZLECOMBO_KRISS_VECTOR_9X19_THREAD_PROTECTOR = "5fbbc34106bde7524f03cbe9"; - public const string MUZZLECOMBO_LANTAC_BMD_BLAST_MITIGATION_DEVICE_A3_DIRECT_THREAD_ADAPTER = "5cf78496d7f00c065703d6ca"; - public const string MUZZLECOMBO_M700_STAINLESS_STEEL_THREAD_PROTECTOR = "5d270ca28abbc31ee25ee821"; + public const string MUZZLECOMBO_LANTAC_BMD_BLAST_MITIGATION_DEVICE_A3_DIRECT_THREAD_ADAPTER = + "5cf78496d7f00c065703d6ca"; + public const string MUZZLECOMBO_M700_STAINLESS_STEEL_THREAD_PROTECTOR = + "5d270ca28abbc31ee25ee821"; public const string MUZZLECOMBO_M700_THREAD_PROTECTOR = "5d270b3c8abbc3105335cfb8"; public const string MUZZLECOMBO_M9A3_THREAD_PROTECTOR = "5cadc390ae921500126a77f1"; public const string MUZZLECOMBO_ME_CYLINDER_12GA_MUZZLE_ADAPTER = "5c0111ab0db834001966914d"; - public const string MUZZLECOMBO_MOSIN_RIFLE_KIBA_ARMS_762X54R_CUSTOM_THREAD_ADAPTER = "5cf79389d7f00c10941a0c4d"; - public const string MUZZLECOMBO_MOSIN_RIFLE_TIGER_ROCK_762X51_THREAD_ADAPTER = "5cf79599d7f00c10875d9212"; - public const string MUZZLECOMBO_MOSIN_RIFLE_WEAPON_TUNING_762X39_THREAD_ADAPTER = "5cf67a1bd7f00c06585fb6f3"; + public const string MUZZLECOMBO_MOSIN_RIFLE_KIBA_ARMS_762X54R_CUSTOM_THREAD_ADAPTER = + "5cf79389d7f00c10941a0c4d"; + public const string MUZZLECOMBO_MOSIN_RIFLE_TIGER_ROCK_762X51_THREAD_ADAPTER = + "5cf79599d7f00c10875d9212"; + public const string MUZZLECOMBO_MOSIN_RIFLE_WEAPON_TUNING_762X39_THREAD_ADAPTER = + "5cf67a1bd7f00c06585fb6f3"; public const string MUZZLECOMBO_MP9_9X19_SOUND_SUPPRESSOR_MOUNT = "5de8f237bbaf010b10528a70"; public const string MUZZLECOMBO_MTS25512_12GA_CHOKE = "619d36da53b4d42ee724fae4"; public const string MUZZLECOMBO_P226_THREAD_PROTECTOR = "587de5ba2459771c0f1e8a58"; - public const string MUZZLECOMBO_PP9101_KEDRB_THREADED_SUPPRESSOR_ADAPTER = "57f3c7e024597738ea4ba286"; + public const string MUZZLECOMBO_PP9101_KEDRB_THREADED_SUPPRESSOR_ADAPTER = + "57f3c7e024597738ea4ba286"; public const string MUZZLECOMBO_REMINGTON_TACTICAL_CHOKE_12GA = "560838c94bdc2d77798b4569"; public const string MUZZLECOMBO_RFB_THREAD_PROTECTOR = "5f2aa4464b50c14bcf07acdb"; public const string MUZZLECOMBO_RFB_THREAD_SPACER = "5f2aa43ba9b91d26f20ae6d2"; public const string MUZZLECOMBO_RPD_BARREL_THREAD_PROTECTOR = "6513f0f5e63f29908d0ffab8"; public const string MUZZLECOMBO_SAKO_TRG_338_LM_THREAD_PROTECTOR = "673f3f5eef7545280c00f026"; - public const string MUZZLECOMBO_SIG_SAUER_TAPERLOK_762X51300_BLK_MUZZLE_ADAPTER = "5fbc22ccf24b94483f726483"; - public const string MUZZLECOMBO_SILENCERCO_HYBRID_46_DIRECT_THREAD_MOUNT_ADAPTER = "59bffc1f86f77435b128b872"; - public const string MUZZLECOMBO_SILENCERCO_OMEGA_45K_DIRECT_THREAD_MOUNT_ADAPTER = "5fc4b992187fea44d52edaa9"; - public const string MUZZLECOMBO_SILENCERCO_OMEGA_45K_PISTON_MOUNT_ADAPTER = "5fc4b97bab884124df0cd5e3"; + public const string MUZZLECOMBO_SIG_SAUER_TAPERLOK_762X51300_BLK_MUZZLE_ADAPTER = + "5fbc22ccf24b94483f726483"; + public const string MUZZLECOMBO_SILENCERCO_HYBRID_46_DIRECT_THREAD_MOUNT_ADAPTER = + "59bffc1f86f77435b128b872"; + public const string MUZZLECOMBO_SILENCERCO_OMEGA_45K_DIRECT_THREAD_MOUNT_ADAPTER = + "5fc4b992187fea44d52edaa9"; + public const string MUZZLECOMBO_SILENCERCO_OMEGA_45K_PISTON_MOUNT_ADAPTER = + "5fc4b97bab884124df0cd5e3"; public const string MUZZLECOMBO_SILENCERCO_SALVO_12_CHOKE_ADAPTER = "5b363dea5acfc4771e1c5e7e"; public const string MUZZLECOMBO_SILENCERCO_SALVO_12_THREAD_ADAPTER = "5b363e1b5acfc4771e1c5e80"; - public const string MUZZLECOMBO_SKS_WEAPON_TUNING_762X39_THREAD_ADAPTER = "5cf67cadd7f00c065a5abab7"; + public const string MUZZLECOMBO_SKS_WEAPON_TUNING_762X39_THREAD_ADAPTER = + "5cf67cadd7f00c065a5abab7"; public const string MUZZLECOMBO_SOK12_THREAD_PROTECTOR = "576167ab2459773cad038c43"; public const string MUZZLECOMBO_SR2M_9X21_HAND_STOPPER = "62e2a754b6c0ee2f230cee0f"; - public const string MUZZLECOMBO_STEYR_AUG_RAT_WORX_556X45_MUZZLE_DEVICE_ADAPTER = "630f27f04f3f6281050b94d7"; + public const string MUZZLECOMBO_STEYR_AUG_RAT_WORX_556X45_MUZZLE_DEVICE_ADAPTER = + "630f27f04f3f6281050b94d7"; public const string MUZZLECOMBO_SVDS_ROTOR_43_THREAD_ADAPTER = "5e01e9e273d8eb11426f5bc3"; - public const string MUZZLECOMBO_TROMIX_MONSTER_CLAW_12GA_MUZZLE_BRAKE = "59fb137a86f7740adb646af1"; + public const string MUZZLECOMBO_TROMIX_MONSTER_CLAW_12GA_MUZZLE_BRAKE = + "59fb137a86f7740adb646af1"; public const string MUZZLECOMBO_UZI_9X19_3LUG_BARREL_RETAINING_NUT = "6698c9ba29e062525d0ad8b1"; - public const string MUZZLECOMBO_UZI_9X19_3LUG_BARREL_THREAD_PROTECTOR = "6698c9c636ba38d291017711"; + public const string MUZZLECOMBO_UZI_9X19_3LUG_BARREL_THREAD_PROTECTOR = + "6698c9c636ba38d291017711"; public const string MUZZLECOMBO_UZI_9X19_BARREL_RETAINING_NUT = "6698c9aa36ba38d29101770f"; public const string MUZZLECOMBO_UZI_PRO_9X19_BARREL_RETAINING_NUT = "668670e3fb75ee4a5e02eb16"; - public const string MUZZLECOMBO_UZI_PRO_9X19_MASADA_THREAD_PROTECTOR = "668670f52a2296a8d909963c"; + public const string MUZZLECOMBO_UZI_PRO_9X19_MASADA_THREAD_PROTECTOR = + "668670f52a2296a8d909963c"; public const string MUZZLECOMBO_VPO215_THREAD_PROTECTOR = "5de6556a205ddc616a6bc4f7"; public const string NIGHTVISION_ARMASIGHT_N15_NIGHT_VISION_GOGGLES = "5c066e3a0db834001b7353f0"; - public const string NIGHTVISION_L3HARRIS_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1"; - public const string NIGHTVISION_L3HARRIS_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271"; + public const string NIGHTVISION_L3HARRIS_ANPVS14_NIGHT_VISION_MONOCULAR = + "57235b6f24597759bf5a30f1"; + public const string NIGHTVISION_L3HARRIS_GPNVG18_NIGHT_VISION_GOGGLES = + "5c0558060db834001b735271"; public const string NIGHTVISION_PNV10T_NIGHT_VISION_GOGGLES = "5c0696830db834001d23f5da"; public const string NIGHTVISION_PNV57E_NIGHT_VISION_GOGGLES = "67506ca81f18589016006aa6"; public const string OPTICSCOPE_BELOMO_PSO1_4X24_SCOPE = "5c82342f2e221644f31c060e"; public const string OPTICSCOPE_BELOMO_PSO1M2_4X24_SCOPE = "5c82343a2e221644f31c0611"; public const string OPTICSCOPE_BELOMO_PSO1M21_4X24_SCOPE = "576fd4ec2459777f0b518431"; - public const string OPTICSCOPE_BURRIS_FULLFIELD_TAC30_14X24_30MM_RIFLESCOPE = "5b2388675acfc4771e1be0be"; + public const string OPTICSCOPE_BURRIS_FULLFIELD_TAC30_14X24_30MM_RIFLESCOPE = + "5b2388675acfc4771e1be0be"; public const string OPTICSCOPE_EOTECH_VUDU_16X24_30MM_RIFLESCOPE = "5b3b99475acfc432ff4dcbee"; public const string OPTICSCOPE_HENSOLDT_FF_416X56_34MM_RIFLESCOPE = "56ea70acd2720b844b8b4594"; public const string OPTICSCOPE_KMZ_1P59_310X_RIFLESCOPE = "5d0a3a58d7ad1a669c15ca14"; public const string OPTICSCOPE_KMZ_1P69_310X_RIFLESCOPE = "5d0a3e8cd7ad1a6f6a3d35bd"; - public const string OPTICSCOPE_LEUPOLD_MARK_4_LR_6520X50_30MM_RIFLESCOPE = "5a37cb10c4a282329a73b4e7"; - public const string OPTICSCOPE_LEUPOLD_MARK_5HD_525X56MM_35MM_RIFLESCOPE_FDE = "676175789dcee773150c6925"; - public const string OPTICSCOPE_MARCH_TACTICAL_324X42_FFP_30MM_RIFLESCOPE = "57c5ac0824597754771e88a9"; - public const string OPTICSCOPE_NCSTAR_ADO_P4_SNIPER_39X42_RIFLESCOPE = "5dfe6104585a0c3e995c7b82"; - public const string OPTICSCOPE_NIGHTFORCE_ATACR_735X56_34MM_RIFLESCOPE = "5aa66be6e5b5b0214e506e97"; + public const string OPTICSCOPE_LEUPOLD_MARK_4_LR_6520X50_30MM_RIFLESCOPE = + "5a37cb10c4a282329a73b4e7"; + public const string OPTICSCOPE_LEUPOLD_MARK_5HD_525X56MM_35MM_RIFLESCOPE_FDE = + "676175789dcee773150c6925"; + public const string OPTICSCOPE_MARCH_TACTICAL_324X42_FFP_30MM_RIFLESCOPE = + "57c5ac0824597754771e88a9"; + public const string OPTICSCOPE_NCSTAR_ADO_P4_SNIPER_39X42_RIFLESCOPE = + "5dfe6104585a0c3e995c7b82"; + public const string OPTICSCOPE_NIGHTFORCE_ATACR_735X56_34MM_RIFLESCOPE = + "5aa66be6e5b5b0214e506e97"; public const string OPTICSCOPE_NIGHTFORCE_NXS_2510X24_SCOPE = "544a3d0a4bdc2d1b388b4567"; public const string OPTICSCOPE_NPZ_1P781_28X_SCOPE = "618a75f0bd321d49084cd399"; public const string OPTICSCOPE_NPZ_USP1_TYULPAN_4X_SCOPE = "5cf638cbd7f00c06595bc936"; public const string OPTICSCOPE_PAG17_SCOPE = "5d53f4b7a4b936793d58c780"; public const string OPTICSCOPE_PU_35X_RIFLESCOPE = "5b3f7c1c5acfc40dc5296b1d"; - public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_18X24_30MM_RIFLESCOPE = "617151c1d92c473c770214ab"; - public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_320X50_34MM_RIFLESCOPE = "61714eec290d254f5e6b2ffc"; - public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_525X56_34MM_RIFLESCOPE = "62850c28da09541f43158cca"; - public const string OPTICSCOPE_SIG_SAUER_TANGO6T_16X24_30MM_RIFLESCOPE = "6567e7681265c8a131069b0f"; + public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_18X24_30MM_RIFLESCOPE = + "617151c1d92c473c770214ab"; + public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_320X50_34MM_RIFLESCOPE = + "61714eec290d254f5e6b2ffc"; + public const string OPTICSCOPE_SCHMIDT_BENDER_PM_II_525X56_34MM_RIFLESCOPE = + "62850c28da09541f43158cca"; + public const string OPTICSCOPE_SIG_SAUER_TANGO6T_16X24_30MM_RIFLESCOPE = + "6567e7681265c8a131069b0f"; public const string OPTICSCOPE_VOMZ_PILAD_4X32_254MM_RIFLESCOPE = "5dff772da3651922b360bf91"; - public const string OPTICSCOPE_VORTEX_RAZOR_HD_GEN2_16X24_30MM_RIFLESCOPE = "618ba27d9008e4636a67f61d"; + public const string OPTICSCOPE_VORTEX_RAZOR_HD_GEN2_16X24_30MM_RIFLESCOPE = + "618ba27d9008e4636a67f61d"; public const string PISTOL_20X1MM_TOY_GUN = "66015072e9f84d5680039678"; public const string PISTOL_BERETTA_M9A3_9X19 = "5cadc190ae921500103bb3b6"; public const string PISTOL_COLT_M1911A1_45_ACP = "5e81c3cbac2bb513793cdc75"; @@ -3389,8 +4027,10 @@ public static class ItemTpl public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_357 = "669fa409933e898cce0c2166"; public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_50_AE = "669fa3f88abd2662d80eee77"; public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE = "669fa39b48fc9f8db6035a0c"; - public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE_PISTOL_WTS = "669fa3d876116c89840b1217"; - public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_MK_XIX_50_AE = "668fe5a998b5ad715703ddd6"; + public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE_PISTOL_WTS = + "669fa3d876116c89840b1217"; + public const string PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_MK_XIX_50_AE = + "668fe5a998b5ad715703ddd6"; public const string PISTOL_MAKAROV_PM_9X18PM = "5448bd6b4bdc2dfc2f8b4569"; public const string PISTOL_MAKAROV_PM_T_9X18PM = "579204f224597773d619e051"; public const string PISTOL_PB_9X18PM_SILENCED = "56e0598dd2720bb5668b45a6"; @@ -3403,19 +4043,28 @@ public static class ItemTpl public const string PISTOL_YARYGIN_MP443_GRACH_9X19 = "576a581d2459771e7b1bc4f1"; public const string PISTOLGRIP_9A91_PISTOL_GRIP = "6450f21a3d52156624001fcf"; public const string PISTOLGRIP_AK_AEROKNOX_SCORPIUS_PISTOL_GRIP = "5f6341043ada5942720e2dc5"; - public const string PISTOLGRIP_AK_CUSTOM_ARMS_AGS74_PRO_SNIPER_KIT_PISTOL_GRIP = "6087e663132d4d12c81fd96b"; - public const string PISTOLGRIP_AK_CUSTOM_GUNS_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = "648ae3e356c6310a830fc291"; - public const string PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP_FDE = "623c3be0484b5003161840dc"; + public const string PISTOLGRIP_AK_CUSTOM_ARMS_AGS74_PRO_SNIPER_KIT_PISTOL_GRIP = + "6087e663132d4d12c81fd96b"; + public const string PISTOLGRIP_AK_CUSTOM_GUNS_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = + "648ae3e356c6310a830fc291"; + public const string PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP_FDE = + "623c3be0484b5003161840dc"; public const string PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP = "5cf54404d7f00c108840b2ef"; - public const string PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP_ANODIZED_RED = "5e2192a498a36665e8337386"; + public const string PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP_ANODIZED_RED = + "5e2192a498a36665e8337386"; public const string PISTOLGRIP_AK_MAGPUL_MOE_PISTOL_GRIP_BLACK = "5b30ac585acfc433000eb79c"; - public const string PISTOLGRIP_AK_MISSION_FIRST_TACTICAL_ENGAGE_AK47_PISTOL_GRIP = "63f4da90f31d4a33b87bd054"; + public const string PISTOLGRIP_AK_MISSION_FIRST_TACTICAL_ENGAGE_AK47_PISTOL_GRIP = + "63f4da90f31d4a33b87bd054"; public const string PISTOLGRIP_AK_MOLOT_BAKELITE_PISTOL_GRIP = "59e6318286f77444dd62c4cc"; public const string PISTOLGRIP_AK_PUFGUN_SGM2_PISTOL_GRIP = "651580dc71a4f10aec4b6056"; - public const string PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_BLACK = "5cf50850d7f00c056e24104c"; - public const string PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_FDE = "5cf508bfd7f00c056e24104e"; - public const string PISTOLGRIP_AK_TANGODOWN_BATTLE_GRIP_PISTOL_GRIP = "628a664bccaab13006640e47"; - public const string PISTOLGRIP_AK_TANGODOWN_BATTLE_GRIP_PISTOL_GRIP_FDE = "628c9ab845c59e5b80768a81"; + public const string PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_BLACK = + "5cf50850d7f00c056e24104c"; + public const string PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_FDE = + "5cf508bfd7f00c056e24104e"; + public const string PISTOLGRIP_AK_TANGODOWN_BATTLE_GRIP_PISTOL_GRIP = + "628a664bccaab13006640e47"; + public const string PISTOLGRIP_AK_TANGODOWN_BATTLE_GRIP_PISTOL_GRIP_FDE = + "628c9ab845c59e5b80768a81"; public const string PISTOLGRIP_AK_TAPCO_SAWSTYLE_PISTOL_GRIP_BLACK = "5947f92f86f77427344a76b1"; public const string PISTOLGRIP_AK_TAPCO_SAWSTYLE_PISTOL_GRIP_FDE = "5947fa2486f77425b47c1a9b"; public const string PISTOLGRIP_AK_US_PALM_PISTOL_GRIP = "5c6bf4aa2e2216001219b0ae"; @@ -3429,14 +4078,21 @@ public static class ItemTpl public const string PISTOLGRIP_APS_BAKELITE_SIDEPIECES = "5a17fc70fcdbcb0176308b3d"; public const string PISTOLGRIP_AR15_AEROKNOX_ORION_PISTOL_GRIP = "63f5feead259b42f0b4d6d0f"; public const string PISTOLGRIP_AR15_COLT_A2_PISTOL_GRIP = "55d4b9964bdc2d1d4e8b456e"; - public const string PISTOLGRIP_AR15_DAMAGE_INDUSTRIES_ECS_PISTOL_GRIP_FDE = "571659bb2459771fb2755a12"; - public const string PISTOLGRIP_AR15_DLG_TACTICAL_DLG123_PISTOL_GRIP = "602e71bd53a60014f9705bfa"; - public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_1_PISTOL_GRIP = "6113c3586c780c1e710c90bc"; - public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_2_PC_PISTOL_GRIP = "6113cc78d3a39d50044c065a"; - public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_2_PISTOL_GRIP = "6113cce3d92c473c770200c7"; + public const string PISTOLGRIP_AR15_DAMAGE_INDUSTRIES_ECS_PISTOL_GRIP_FDE = + "571659bb2459771fb2755a12"; + public const string PISTOLGRIP_AR15_DLG_TACTICAL_DLG123_PISTOL_GRIP = + "602e71bd53a60014f9705bfa"; + public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_1_PISTOL_GRIP = + "6113c3586c780c1e710c90bc"; + public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_2_PC_PISTOL_GRIP = + "6113cc78d3a39d50044c065a"; + public const string PISTOLGRIP_AR15_F1_FIREARMS_SKELETONIZED_STYLE_2_PISTOL_GRIP = + "6113cce3d92c473c770200c7"; public const string PISTOLGRIP_AR15_HERA_ARMS_HG15_PISTOL_GRIP = "5cc9bcaed7f00c011c04e179"; - public const string PISTOLGRIP_AR15_HK_BATTLE_GRIP_BEAVERTAIL_PISTOL_GRIP = "5bb20e0ed4351e3bac1212dc"; - public const string PISTOLGRIP_AR15_HK_BATTLE_GRIP_BEAVERTAIL_PISTOL_GRIP_RAL_8000 = "6193dcd0f8ee7e52e4210a28"; + public const string PISTOLGRIP_AR15_HK_BATTLE_GRIP_BEAVERTAIL_PISTOL_GRIP = + "5bb20e0ed4351e3bac1212dc"; + public const string PISTOLGRIP_AR15_HK_BATTLE_GRIP_BEAVERTAIL_PISTOL_GRIP_RAL_8000 = + "6193dcd0f8ee7e52e4210a28"; public const string PISTOLGRIP_AR15_HK_BATTLE_GRIP_PISTOL_GRIP = "5bb20e18d4351e00320205d5"; public const string PISTOLGRIP_AR15_HK_ERGO_PSG1_STYLE_PISTOL_GRIP = "5d025cc1d7ad1a53845279ef"; public const string PISTOLGRIP_AR15_HK_V2_PISTOL_GRIP = "5c6d7b3d2e221600114c9b7d"; @@ -3444,29 +4100,41 @@ public static class ItemTpl public const string PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_BLACK = "55802f5d4bdc2dac148b458f"; public const string PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_FDE = "5d15cf3bd7ad1a67e71518b2"; public const string PISTOLGRIP_AR15_NAROH_ARMS_GRALS_PISTOL_GRIP = "59db3a1d86f77429e05b4e92"; - public const string PISTOLGRIP_AR15_SIG_SAUER_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = "652911675ae2ae97b80fdf3c"; + public const string PISTOLGRIP_AR15_SIG_SAUER_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = + "652911675ae2ae97b80fdf3c"; public const string PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_BLACK = "59db3acc86f7742a2c4ab912"; public const string PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_FDE = "59db3b0886f77429d72fb895"; - public const string PISTOLGRIP_AR15_TACTICAL_DYNAMICS_HEXGRIP_PISTOL_GRIP = "615d8faecabb9b7ad90f4d5d"; - public const string PISTOLGRIP_AR15_TACTICAL_DYNAMICS_SKELETONIZED_PISTOL_GRIP = "5b07db875acfc40dc528a5f6"; + public const string PISTOLGRIP_AR15_TACTICAL_DYNAMICS_HEXGRIP_PISTOL_GRIP = + "615d8faecabb9b7ad90f4d5d"; + public const string PISTOLGRIP_AR15_TACTICAL_DYNAMICS_SKELETONIZED_PISTOL_GRIP = + "5b07db875acfc40dc528a5f6"; public const string PISTOLGRIP_AS_VAL_PISTOL_GRIP_BLACK = "6565b91666492762f5029c0b"; public const string PISTOLGRIP_AS_VAL_PISTOL_GRIP_PLUM = "57c44fa82459772d2d75e415"; - public const string PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_WITH_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1"; - public const string PISTOLGRIP_BENELLI_M3_TELESCOPIC_STOCK_PISTOL_GRIP = "6259c3d8012d6678ec38eeb8"; + public const string PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_WITH_BUFFER_TUBE = + "5a69a2ed8dc32e000d46d1f1"; + public const string PISTOLGRIP_BENELLI_M3_TELESCOPIC_STOCK_PISTOL_GRIP = + "6259c3d8012d6678ec38eeb8"; public const string PISTOLGRIP_CHIAPPA_RHINO_PLASTIC_PISTOL_GRIP = "619f4ab2d25cbd424731fb95"; public const string PISTOLGRIP_CHIAPPA_RHINO_WOODEN_PISTOL_GRIP = "619f4bffd25cbd424731fb97"; public const string PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP = "668fe5d42a0f85eea407cc16"; - public const string PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP_WITH_FINGER_GROOVES = "66a0da76b6f47fcfeb025e96"; + public const string PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP_WITH_FINGER_GROOVES = + "66a0da76b6f47fcfeb025e96"; public const string PISTOLGRIP_GLOCK_PACHMAYR_TACTICAL_GRIP_GLOVE = "5a7b4960e899ef197b331a2d"; public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_BLACK = "57c55efc2459772d2c6271e7"; public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_FDE = "57af48872459771f0b2ebf11"; - public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_GHILLIE_EARTH = "57c55f092459772d291a8463"; - public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_GHILLIE_GREEN = "57c55f112459772d28133310"; - public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_OLIVE_DRAB = "57c55f172459772d27602381"; + public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_GHILLIE_EARTH = + "57c55f092459772d291a8463"; + public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_GHILLIE_GREEN = + "57c55f112459772d28133310"; + public const string PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_OLIVE_DRAB = + "57c55f172459772d27602381"; public const string PISTOLGRIP_KS23M_PISTOL_GRIP = "5e848d99865c0f329958c83b"; - public const string PISTOLGRIP_M14_SAGE_INTERNATIONAL_M14ALCS_MOD0_PISTOL_GRIP = "5addc7db5acfc4001669f279"; - public const string PISTOLGRIP_M1911_KIBA_ARMS_GENEBURN_CUSTOM_SIDE_GRIPS = "626a9cb151cb5849f6002890"; - public const string PISTOLGRIP_M1911_PACHMAYR_AMERICAN_LEGEND_GRIP_423 = "5ef366938cef260c0642acad"; + public const string PISTOLGRIP_M14_SAGE_INTERNATIONAL_M14ALCS_MOD0_PISTOL_GRIP = + "5addc7db5acfc4001669f279"; + public const string PISTOLGRIP_M1911_KIBA_ARMS_GENEBURN_CUSTOM_SIDE_GRIPS = + "626a9cb151cb5849f6002890"; + public const string PISTOLGRIP_M1911_PACHMAYR_AMERICAN_LEGEND_GRIP_423 = + "5ef366938cef260c0642acad"; public const string PISTOLGRIP_M1911A1_SIDE_GRIPS = "5e81c6bf763d9f754677beff"; public const string PISTOLGRIP_M45A1_MILTAC_GVT_G10_SIDE_GRIPS = "5f3e778efcd9b651187d7201"; public const string PISTOLGRIP_M60E4_PISTOL_GRIP = "660125bf1d087a96c60a54db"; @@ -3486,19 +4154,23 @@ public static class ItemTpl public const string PISTOLGRIP_MP443_GRACH_POLYMER_PISTOL_GRIP = "576a63cd2459771e796e0e11"; public const string PISTOLGRIP_MPX_PISTOL_GRIP = "5894a51286f77426d13baf02"; public const string PISTOLGRIP_ORSIS_T5000M_PISTOL_GRIP = "5df38a5fb74cd90030650cb6"; - public const string PISTOLGRIP_P226_AXELSON_TACTICAL_MK25_PISTOL_GRIP = "5bffec120db834001c38f5fa"; + public const string PISTOLGRIP_P226_AXELSON_TACTICAL_MK25_PISTOL_GRIP = + "5bffec120db834001c38f5fa"; public const string PISTOLGRIP_P226_COMBAT_PISTOL_GRIP_FDE = "57c9a89124597704ee6faec1"; public const string PISTOLGRIP_P226_EMPEROR_SCORPION_PISTOL_GRIP = "5c0006470db834001a6697fe"; - public const string PISTOLGRIP_P226_HOGUE_G10_CHAIN_LINK_PISTOL_GRIP = "5bffef760db8340019668fe4"; + public const string PISTOLGRIP_P226_HOGUE_G10_CHAIN_LINK_PISTOL_GRIP = + "5bffef760db8340019668fe4"; public const string PISTOLGRIP_P226_HOGUE_RUBBERIZED_PISTOL_GRIP = "5b39ffbd5acfc47a8773fb06"; public const string PISTOLGRIP_P226_POLYMER_PISTOL_GRIP_BLACK = "56d5a2bbd2720bb8418b456a"; - public const string PISTOLGRIP_P226_STAINLESS_ELITE_WOODEN_PISTOL_GRIP = "5c00076d0db834001d23ee1f"; + public const string PISTOLGRIP_P226_STAINLESS_ELITE_WOODEN_PISTOL_GRIP = + "5c00076d0db834001d23ee1f"; public const string PISTOLGRIP_PB_BAKELITE_SIDE_GRIPS = "56e05a6ed2720bd0748b4567"; public const string PISTOLGRIP_PK_PISTOL_GRIP = "646371779f5f0ea59a04c204"; public const string PISTOLGRIP_PK_PISTOL_GRIP_BLACK = "64cbad529f7cf7f75c077fd5"; public const string PISTOLGRIP_PM_BAKELITE_GRIP = "6374a7e7417239a7bf00f042"; public const string PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP = "637784c5f7b3f4ac1a0d1a9a"; - public const string PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP_OLIVE_DRAB = "648afce7ec6bb25b2608defb"; + public const string PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP_OLIVE_DRAB = + "648afce7ec6bb25b2608defb"; public const string PISTOLGRIP_PM_PMLASER_GRIP_WITH_LASER_SIGHT = "661f8995c341ea101e0d33e8"; public const string PISTOLGRIP_PM_TACTIC_KIT_PISTOL_GRIP = "637b6d610aef6cfc5e02dd14"; public const string PISTOLGRIP_PP1901_VITYAZ_PISTOL_GRIP = "5998517986f7746017232f7e"; @@ -3508,16 +4180,20 @@ public static class ItemTpl public const string PISTOLGRIP_SA58_FAB_DEFENSE_AGFAL_PISTOL_GRIP = "5b7d679f5acfc4001a5c4024"; public const string PISTOLGRIP_SA58_PISTOL_GRIP = "5b7d678a5acfc4001a5c4022"; public const string PISTOLGRIP_SA58_SAWSTYLE_PISTOL_GRIP_BLACK = "5b099b965acfc400186331e6"; - public const string PISTOLGRIP_SKS_TAPCO_INTRAFUSE_SAWSTYLE_PISTOL_GRIP = "5afd7e445acfc4001637e35a"; - public const string PISTOLGRIP_SKSVZ58_FAB_DEFENSE_AG58_PISTOL_GRIP = "5d023784d7ad1a049d4aa7f2"; + public const string PISTOLGRIP_SKS_TAPCO_INTRAFUSE_SAWSTYLE_PISTOL_GRIP = + "5afd7e445acfc4001637e35a"; + public const string PISTOLGRIP_SKSVZ58_FAB_DEFENSE_AG58_PISTOL_GRIP = + "5d023784d7ad1a049d4aa7f2"; public const string PISTOLGRIP_SR2M_PISTOL_GRIP_BLACK = "637ba29bf7ca6372bf2613db"; public const string PISTOLGRIP_SR2M_PISTOL_GRIP_PLUM = "637b9c37b7e3bc41b21ce71a"; - public const string PISTOLGRIP_SVDS_LYNX_ARMS_AKSERIES_PISTOL_GRIP_ADAPTER = "6516b129609aaf354b34b3a8"; + public const string PISTOLGRIP_SVDS_LYNX_ARMS_AKSERIES_PISTOL_GRIP_ADAPTER = + "6516b129609aaf354b34b3a8"; public const string PISTOLGRIP_SVDS_PISTOL_GRIP = "5c471be12e221602b66cd9ac"; public const string PISTOLGRIP_TOZ106_002_PISTOL_GRIP = "5a38eecdc4a282329a73b512"; public const string PISTOLGRIP_TT_HOGUELIKE_RUBBER_GRIP = "5c0684e50db834002a12585a"; public const string PISTOLGRIP_TT_ORNATED_SIDE_GRIPS = "5b3cadf35acfc400194776a0"; - public const string PISTOLGRIP_TT_PMLASER_TT206_SIDE_GRIPS_WITH_LASER_SIGHT = "5bffcf7a0db83400232fea79"; + public const string PISTOLGRIP_TT_PMLASER_TT206_SIDE_GRIPS_WITH_LASER_SIGHT = + "5bffcf7a0db83400232fea79"; public const string PISTOLGRIP_TT_RAZOR_ARMS_RUBBER_GRIP = "5c079ec50db834001966a706"; public const string PISTOLGRIP_TT_SIDE_GRIPS = "571a282c2459771fb2755a69"; public const string PISTOLGRIP_UZI_PISTOL_GRIP_COVER = "669946c157df3e2b4e0a0dc5"; @@ -3579,7 +4255,8 @@ public static class ItemTpl public const string QUEST_INFECTED_BLOOD_SAMPLE = "6707cc67cc1667e49e0f7232"; public const string QUEST_INFORMANT_JOURNAL = "63989ced706b793c7d60cfef"; public const string QUEST_JOURNAL = "64f07f7726cfa02c506f8ac0"; - public const string QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = "5a0448bc86f774736f14efa8"; + public const string QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = + "5a0448bc86f774736f14efa8"; public const string QUEST_KNOSSOS_SENIOR_MANAGERS_DIARY = "679b9a1a4e4ed4b3b40ae5c2"; public const string QUEST_KOSA_UAV_ELECTRONIC_JAMMING_DEVICE = "67499b9b909d2013670a5029"; public const string QUEST_LAB_JOURNAL = "66c0b39ca1f68fcc1d0c0cc3"; @@ -3670,20 +4347,30 @@ public static class ItemTpl public const string QUEST_WATCH_GOLD = "590de92486f77423d9312a33"; public const string QUEST_WATCH_SILVER = "5937fc6786f7742cab753590"; public const string QUEST_WATER_PUMP_OPERATION_DATA = "619268de2be33f2604340159"; - public const string RADIOTRANSMITTER_DIGITAL_SECURE_DSP_RADIO_TRANSMITTER = "62e910aaf957f2915e0a5e36"; + public const string RADIOTRANSMITTER_DIGITAL_SECURE_DSP_RADIO_TRANSMITTER = + "62e910aaf957f2915e0a5e36"; public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_BLUE_OPEN = "665730fa4de4820934746c48"; - public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_BP_SEASON0_OPEN = "67cad3226bf74131800752b7"; + public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_BP_SEASON0_OPEN = + "67cad3226bf74131800752b7"; public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_GREEN_OPEN = "6658876e146af22739040fad"; - public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_VIOLET_OPEN = "6658291eefd94e2d665b14a4"; - public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_BLUE_OPEN = "66573310a1657263d816a139"; - public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_GREEN_OPEN = "665886abdaadd1069736c539"; - public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_VIOLET_OPEN = "665829a6efd94e2d665b14a8"; + public const string RANDOMLOOTCONTAINER_ARENA_GEARCRATE_VIOLET_OPEN = + "6658291eefd94e2d665b14a4"; + public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_BLUE_OPEN = + "66573310a1657263d816a139"; + public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_GREEN_OPEN = + "665886abdaadd1069736c539"; + public const string RANDOMLOOTCONTAINER_ARENA_JEWELRYCRATE_VIOLET_OPEN = + "665829a6efd94e2d665b14a8"; public const string RANDOMLOOTCONTAINER_ARENA_JUNKCRATE_BLUE_OPEN = "665732f4464c4b4ba4670fa9"; public const string RANDOMLOOTCONTAINER_ARENA_JUNKCRATE_GREEN_OPEN = "6658892e6e007c6f33662002"; - public const string RANDOMLOOTCONTAINER_ARENA_JUNKCRATE_VIOLET_OPEN = "66582972ac60f009f270d2aa"; - public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_BLUE_OPEN = "665732e7ac60f009f270d1ef"; - public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_GREEN_OPEN = "665888282c4a1b73af576b77"; - public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_VIOLET_OPEN = "665829424de4820934746ce6"; + public const string RANDOMLOOTCONTAINER_ARENA_JUNKCRATE_VIOLET_OPEN = + "66582972ac60f009f270d2aa"; + public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_BLUE_OPEN = + "665732e7ac60f009f270d1ef"; + public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_GREEN_OPEN = + "665888282c4a1b73af576b77"; + public const string RANDOMLOOTCONTAINER_ARENA_WEAPONCRATE_VIOLET_OPEN = + "665829424de4820934746ce6"; public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_01 = "64897ffc3656831810043165"; public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_02 = "64898e9db18e646e992aba47"; public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_03 = "648990314b4d2b31b63a46fc"; @@ -3734,50 +4421,90 @@ public static class ItemTpl public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_48 = "6489cca131a2135f0d7d0fdd"; public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_49 = "6489d812cf0cd80b7e749071"; public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_50 = "6489d89debac5a4a1b73caf7"; - public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_CONTRABAND_FAKE = "674098588466ebb03408b210"; - public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_CONTRABAND_MAIN = "674078c4a9c9adf0450d59f9"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_COMMON = "67b70e43f753cf9f7a0a07a6"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_EPIC = "67b72c64f753cf9f7a0a07aa"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_RARE = "67b72271e5673725070b0456"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON = "6694f4101ae1778e310f4f8e"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_1 = "66a3896972c8e72507028806"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_2 = "66a3896de45f71bf1009e45a"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC = "6694f423909d2322a8073151"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_1 = "66a389c0705adefa710cdeaa"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_2 = "66a389c60982fc7e4c091c51"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE = "6694f418c74d8a180f0f78c0"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_1 = "66a3898c1df2a447cc0d3c35"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_2 = "66a3898f0982fc7e4c091c4d"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY0 = "676a93c51888885b4e008b18"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY1 = "676a95041888885b4e008b36"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY2 = "676a98d7b4ba2f4afa04c704"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY3 = "676a9a5c744595610f0ed501"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY4 = "676a9b15b4ba2f4afa04c7ad"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY5 = "676a9b1afe1fc45172014d32"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY6 = "676a9bc6744595610f0ed52e"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY0 = "676aa104fe1fc45172014da3"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY1 = "676aa29243000db5340061b5"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY2 = "676aa30ffe1fc45172014dce"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY3 = "676aa37ff90b6f429601afb5"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY4 = "676aa3cf7a232aa5c70bda8d"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY5 = "676aa3fc20a7cc6f4309e078"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY6 = "676aa450fe1fc45172014df2"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY0 = "676a9da81888885b4e008c51"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY1 = "676a9e46744595610f0ed53f"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY2 = "676a9f03744595610f0ed55f"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY3 = "676a9fc7a65670a58c084c9e"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY4 = "676aa016744595610f0ed563"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY5 = "676aa025fe1fc45172014d9f"; - public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY6 = "676aa0f11888885b4e008c8b"; + public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_CONTRABAND_FAKE = + "674098588466ebb03408b210"; + public const string RANDOMLOOTCONTAINER_EVENT_CONTAINER_CONTRABAND_MAIN = + "674078c4a9c9adf0450d59f9"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_COMMON = + "67b70e43f753cf9f7a0a07a6"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_EPIC = + "67b72c64f753cf9f7a0a07aa"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_LATAM_DROPS_2025_RARE = + "67b72271e5673725070b0456"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON = + "6694f4101ae1778e310f4f8e"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_1 = + "66a3896972c8e72507028806"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_2 = + "66a3896de45f71bf1009e45a"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC = + "6694f423909d2322a8073151"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_1 = + "66a389c0705adefa710cdeaa"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_2 = + "66a389c60982fc7e4c091c51"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE = + "6694f418c74d8a180f0f78c0"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_1 = + "66a3898c1df2a447cc0d3c35"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_2 = + "66a3898f0982fc7e4c091c4d"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY0 = + "676a93c51888885b4e008b18"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY1 = + "676a95041888885b4e008b36"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY2 = + "676a98d7b4ba2f4afa04c704"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY3 = + "676a9a5c744595610f0ed501"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY4 = + "676a9b15b4ba2f4afa04c7ad"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY5 = + "676a9b1afe1fc45172014d32"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_COMMON_DAY6 = + "676a9bc6744595610f0ed52e"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY0 = + "676aa104fe1fc45172014da3"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY1 = + "676aa29243000db5340061b5"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY2 = + "676aa30ffe1fc45172014dce"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY3 = + "676aa37ff90b6f429601afb5"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY4 = + "676aa3cf7a232aa5c70bda8d"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY5 = + "676aa3fc20a7cc6f4309e078"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_EPIC_DAY6 = + "676aa450fe1fc45172014df2"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY0 = + "676a9da81888885b4e008c51"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY1 = + "676a9e46744595610f0ed53f"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY2 = + "676a9f03744595610f0ed55f"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY3 = + "676a9fc7a65670a58c084c9e"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY4 = + "676aa016744595610f0ed563"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY5 = + "676aa025fe1fc45172014d9f"; + public const string RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_WINTER_DROPS_2025_RARE_DAY6 = + "676aa0f11888885b4e008c8b"; public const string RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_BIG = "63a897c6b1ff6e29734fcc95"; public const string RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_MEDIUM = "63a898a328e385334e0640a5"; public const string RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_SMALL = "63a8970d7108f713591149f5"; - public const string RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER = "634959225289190e5e773b3b"; - public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT = "66aa3a180d6ecb50a21a4e1a"; - public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_1 = "66aa3a31efb1b8119f0196c7"; - public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_2 = "66aa3a3800b2c42adb07d13e"; + public const string RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER = + "634959225289190e5e773b3b"; + public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT = + "66aa3a180d6ecb50a21a4e1a"; + public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_1 = + "66aa3a31efb1b8119f0196c7"; + public const string RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_2 = + "66aa3a3800b2c42adb07d13e"; public const string RANDOMLOOTCONTAINER_RANDOM_LOOT_CONTAINER = "62f10b79e7ee985f386b2f47"; - public const string RANDOMLOOTCONTAINER_RANDOM_LOOT_QUEST_CONTAINER = "633ffb5d419dbf4bea7004c6"; + public const string RANDOMLOOTCONTAINER_RANDOM_LOOT_QUEST_CONTAINER = + "633ffb5d419dbf4bea7004c6"; public const string RANGEFINDER_VORTEX_RANGER_1500 = "61605e13ffa6e502ac5e7eef"; public const string RECEIVER_AI_AXMC_338_LM_CHASSIS = "6281204f308cb521f87a8f9b"; public const string RECEIVER_AI_AXMC_UPPER = "62811fbf09427b40ab14e767"; @@ -3791,7 +4518,8 @@ public static class ItemTpl public const string RECEIVER_AK74M_DUST_COVER = "5ac50da15acfc4001718d287"; public const string RECEIVER_AKM_DUST_COVER = "59d6507c86f7741b846413a2"; public const string RECEIVER_AKS74U_DUST_COVER = "57dc334d245977597164366f"; - public const string RECEIVER_AKS74U_LEGAL_ARSENAL_PILGRIM_RAILED_DUST_COVER = "655cb6b5d680a544f30607fa"; + public const string RECEIVER_AKS74U_LEGAL_ARSENAL_PILGRIM_RAILED_DUST_COVER = + "655cb6b5d680a544f30607fa"; public const string RECEIVER_AKS74UB_DUST_COVER = "5839a7742459773cf9693481"; public const string RECEIVER_AR15_ADAR_215_556X45_UPPER = "5c0e2f26d174af02a9625114"; public const string RECEIVER_AR15_AEROKNOX_AX15_556X45_UPPER = "63f5ed14534b2c3d5479a677"; @@ -3817,13 +4545,17 @@ public static class ItemTpl public const string RECEIVER_GLOCK_17_PISTOL_SLIDE = "5a6f5e048dc32e00094b97da"; public const string RECEIVER_GLOCK_18C_PISTOL_SLIDE = "5b1faa0f5acfc40dc528aeb5"; public const string RECEIVER_GLOCK_19X_PISTOL_SLIDE = "63075cc5962d0247b029dc2a"; - public const string RECEIVER_GLOCK_LONE_WOLF_ALPHAWOLF_CUSTOM_PISTOL_SLIDE = "5a7033908dc32e000a311392"; - public const string RECEIVER_GLOCK_LONE_WOLF_ALPHAWOLF_PISTOL_SLIDE = "5a702d198dc32e000b452fc3"; + public const string RECEIVER_GLOCK_LONE_WOLF_ALPHAWOLF_CUSTOM_PISTOL_SLIDE = + "5a7033908dc32e000a311392"; + public const string RECEIVER_GLOCK_LONE_WOLF_ALPHAWOLF_PISTOL_SLIDE = + "5a702d198dc32e000b452fc3"; public const string RECEIVER_GLOCK_MOTO_CUT_PISTOL_SLIDE = "5a9685b1a2750c0032157104"; public const string RECEIVER_GLOCK_POLYMER80_PS9_PISTOL_SLIDE = "5a7afa25e899ef00135e31b0"; public const string RECEIVER_GLOCK_VIPER_CUT_PISTOL_SLIDE = "5a6f5f078dc32e00094b97dd"; - public const string RECEIVER_GLOCK_ZEV_TECH_HEX_GEN3_RMR_PISTOL_SLIDE = "5a71e22f8dc32e00094b97f4"; - public const string RECEIVER_GLOCK_ZEV_TECH_HEX_SPARTAN_RMR_PISTOL_SLIDE = "5a71e4f48dc32e001207fb26"; + public const string RECEIVER_GLOCK_ZEV_TECH_HEX_GEN3_RMR_PISTOL_SLIDE = + "5a71e22f8dc32e00094b97f4"; + public const string RECEIVER_GLOCK_ZEV_TECH_HEX_SPARTAN_RMR_PISTOL_SLIDE = + "5a71e4f48dc32e001207fb26"; public const string RECEIVER_HK_416A5_556X45_UPPER = "5bb20d53d4351e4502010a69"; public const string RECEIVER_HK_G28_762X51_UPPER = "61713a8fd92c473c770214a4"; public const string RECEIVER_HK_MP5_9X19_UPPER = "5926c0df86f77462f647f764"; @@ -3847,7 +4579,8 @@ public static class ItemTpl public const string RECEIVER_MP9N_9X19_UPPER = "5de8e67c4a9f347bc92edbd7"; public const string RECEIVER_MPX_GEN1_9X19_UPPER = "5894a5b586f77426d2590767"; public const string RECEIVER_OPSKS_DUST_COVER = "634f06262e5def262d0b30ca"; - public const string RECEIVER_P226_AXELSON_TACTICAL_MK25_PISTOL_SLIDE = "5bffe7c50db834001d23ece1"; + public const string RECEIVER_P226_AXELSON_TACTICAL_MK25_PISTOL_SLIDE = + "5bffe7c50db834001d23ece1"; public const string RECEIVER_P226_EMPEROR_SCORPION_PISTOL_SLIDE = "5c010a700db834001d23ef5d"; public const string RECEIVER_P226_LEGION_FULL_SIZE_PISTOL_SLIDE = "5c0125fc0db834001a669aa3"; public const string RECEIVER_P226_STAINLESS_ELITE_PISTOL_SLIDE = "5c0009510db834001966907f"; @@ -3862,9 +4595,11 @@ public static class ItemTpl public const string RECEIVER_SA58_EXTREME_DUTY_DUST_COVER = "5b099bb25acfc400186331e8"; public const string RECEIVER_SAKO_TRG_M10_338_LM = "673cb491280680de5e02ff36"; public const string RECEIVER_SKS_DUST_COVER = "634f05ca517ccc8a960fc748"; - public const string RECEIVER_SKS_LEAPERS_UTG_PRO_MTU017_RECEIVER_COVER_MOUNT = "6415c694da439c6a97048b56"; + public const string RECEIVER_SKS_LEAPERS_UTG_PRO_MTU017_RECEIVER_COVER_MOUNT = + "6415c694da439c6a97048b56"; public const string RECEIVER_SOK12_DUST_COVER = "57616c112459773cce774d66"; - public const string RECEIVER_SOK12_KIBA_ARMS_ZOMBIE_CUSTOM_DUST_COVER = "676017fe8cfeeba9f707c8d6"; + public const string RECEIVER_SOK12_KIBA_ARMS_ZOMBIE_CUSTOM_DUST_COVER = + "676017fe8cfeeba9f707c8d6"; public const string RECEIVER_SR25_762X51_UPPER = "5df8e4080b92095fd441e594"; public const string RECEIVER_SR2M_DUST_COVER = "62e27a7865f0b1592a49e17b"; public const string RECEIVER_STEYR_AUG_A3_556X45 = "62e7c72df68e7a0676050c77"; @@ -3881,7 +4616,8 @@ public static class ItemTpl public const string REPAIRKITS_WEAPON_REPAIR_KIT = "5910968f86f77425cf569c32"; public const string REVOLVER_CHIAPPA_RHINO_200DS_9X19 = "624c2e8614da335f1e034d8c"; public const string REVOLVER_CHIAPPA_RHINO_50DS_357 = "61a4c8884f95bc3b2c5dc96f"; - public const string REVOLVER_MILKOR_M32A1_MSGL_40MM_GRENADE_LAUNCHER = "6275303a9f372d6ea97f9ec7"; + public const string REVOLVER_MILKOR_M32A1_MSGL_40MM_GRENADE_LAUNCHER = + "6275303a9f372d6ea97f9ec7"; public const string REVOLVER_MTS25512_12GA_SHOTGUN = "60db29ce99594040e04c4a27"; public const string REVOLVER_RSH12_127X55 = "633ec7c2a6918cb895019c6c"; public const string ROCKET_725_SHG2 = "67446fdd752be02c220f27b3"; @@ -3906,8 +4642,10 @@ public static class ItemTpl public const string SHOTGUN_MP18_762X54R_SINGLESHOT_RIFLE = "61f7c9e189e6fb1a5e3ea78d"; public const string SHOTGUN_MP43_12GA_SAWEDOFF_DOUBLEBARREL = "64748cb8de82c85eaf0a273a"; public const string SHOTGUN_MP431C_12GA_DOUBLEBARREL = "5580223e4bdc2d1c128b457f"; - public const string SHOTGUN_MPS_AUTO_ASSAULT12_GEN_1_12GA_AUTOMATIC = "66ffa9b66e19cc902401c5e8"; - public const string SHOTGUN_MPS_AUTO_ASSAULT12_GEN_2_12GA_AUTOMATIC = "67124dcfa3541f2a1f0e788b"; + public const string SHOTGUN_MPS_AUTO_ASSAULT12_GEN_1_12GA_AUTOMATIC = + "66ffa9b66e19cc902401c5e8"; + public const string SHOTGUN_MPS_AUTO_ASSAULT12_GEN_2_12GA_AUTOMATIC = + "67124dcfa3541f2a1f0e788b"; public const string SHOTGUN_REMINGTON_MODEL_870_12GA_PUMPACTION = "5a7828548dc32e5a9c28b516"; public const string SHOTGUN_SAIGA12K_12GA_AUTOMATIC = "674fe9a75e51f1c47c04ec23"; public const string SHOTGUN_SAIGA12K_VER10_12GA_SEMIAUTOMATIC = "576165642459773c7a400233"; @@ -3915,53 +4653,75 @@ public static class ItemTpl public const string SHOTGUN_TOZ106_20GA_BOLTACTION = "5a38e6bac4a2826c6e06d79b"; public const string SIGNALPISTOL_ZID_SP81_26X75_SIGNAL_PISTOL = "620109578d82e67e7911abf2"; public const string SILENCER_9A91_9X39_SOUND_SUPPRESSOR = "64527a3a7da7133e5a09ca99"; - public const string SILENCER_AAC_762SDN6_MULTICALIBER_SOUND_SUPPRESSOR = "5a34fe59c4a282000b1521a2"; + public const string SILENCER_AAC_762SDN6_MULTICALIBER_SOUND_SUPPRESSOR = + "5a34fe59c4a282000b1521a2"; public const string SILENCER_AAC_ILLUSION_9_9X19_SOUND_SUPPRESSOR = "5c7e8fab2e22165df16b889b"; public const string SILENCER_AI_338_LM_TACTICAL_SOUND_MODERATOR = "62811fa609427b40ab14e765"; - public const string SILENCER_AK_HEXAGON_DTKP_MK2_762X39_SOUND_SUPPRESSOR = "5e208b9842457a4a7a33d074"; + public const string SILENCER_AK_HEXAGON_DTKP_MK2_762X39_SOUND_SUPPRESSOR = + "5e208b9842457a4a7a33d074"; public const string SILENCER_AK12_545X39_SOUND_SUPPRESSOR = "64c196ad26a15b84aa07132f"; public const string SILENCER_AK74_HEXAGON_545X39_SOUND_SUPPRESSOR = "593d493f86f7745e6b2ceb22"; - public const string SILENCER_AK74_HEXAGON_WAFFLEMAKER_545X39_SOUND_SUPPRESSOR = "615d8f8567085e45ef1409ca"; + public const string SILENCER_AK74_HEXAGON_WAFFLEMAKER_545X39_SOUND_SUPPRESSOR = + "615d8f8567085e45ef1409ca"; public const string SILENCER_AK74_TGPA_545X39_SOUND_SUPPRESSOR = "564caa3d4bdc2d17108b458e"; public const string SILENCER_AKM_HEXAGON_762X39_SOUND_SUPPRESSOR = "593d489686f7745c6255d58a"; public const string SILENCER_AKM_PBS1_762X39_SOUND_SUPPRESSOR = "5a0d63621526d8dba31fe3bf"; - public const string SILENCER_AKM_ZENIT_DTK4M_762X39_SOUND_SUPPRESSOR = "59fb257e86f7742981561852"; + public const string SILENCER_AKM_ZENIT_DTK4M_762X39_SOUND_SUPPRESSOR = + "59fb257e86f7742981561852"; public const string SILENCER_AKS74U_PBS4_545X39_SOUND_SUPPRESSOR = "57ffb0e42459777d047111c5"; - public const string SILENCER_ALPHA_DOG_ALPHA_9_9X19_SOUND_SUPPRESSOR = "5a33a8ebc4a282000c5a950d"; + public const string SILENCER_ALPHA_DOG_ALPHA_9_9X19_SOUND_SUPPRESSOR = + "5a33a8ebc4a282000c5a950d"; public const string SILENCER_APB_9X18PM_SOUND_SUPPRESSOR = "5abcc328d8ce8700194394f3"; - public const string SILENCER_AR15_GRIFFIN_ARMAMENT_M4SDK_556X45_SOUND_SUPPRESSOR = "638612b607dfed1ccb7206ba"; + public const string SILENCER_AR15_GRIFFIN_ARMAMENT_M4SDK_556X45_SOUND_SUPPRESSOR = + "638612b607dfed1ccb7206ba"; public const string SILENCER_AS_VAL_9X39_INTEGRAL_BARRELSUPPRESSOR = "57c44dd02459772d2e0ae249"; - public const string SILENCER_ASE_UTRA_SL7IBL_BORELOCK_338_LM_SOUND_SUPPRESSOR = "673f0a38259f5945d70e43a6"; + public const string SILENCER_ASE_UTRA_SL7IBL_BORELOCK_338_LM_SOUND_SUPPRESSOR = + "673f0a38259f5945d70e43a6"; public const string SILENCER_ASH12_127X55_SOUND_SUPPRESSOR = "5caf187cae92157c28402e43"; - public const string SILENCER_AWC_THOR_PSR_XL_MULTICALIBER_SOUND_SUPPRESSOR = "63877c99e785640d436458ea"; + public const string SILENCER_AWC_THOR_PSR_XL_MULTICALIBER_SOUND_SUPPRESSOR = + "63877c99e785640d436458ea"; public const string SILENCER_CGS_HEKATE_DT_338_LM_SOUND_SUPPRESSOR = "673f0b36536d64240f01acd6"; - public const string SILENCER_CO_HYBRID_46_MULTICALIBER_SOUND_SUPPRESSOR = "59bffbb386f77435b379b9c2"; + public const string SILENCER_CO_HYBRID_46_MULTICALIBER_SOUND_SUPPRESSOR = + "59bffbb386f77435b379b9c2"; public const string SILENCER_CO_OMEGA_45K_45_ACP_SOUND_SUPPRESSOR = "5fc4b9b17283c4046c5814d7"; public const string SILENCER_CO_OSPREY_9_9X19_SOUND_SUPPRESSOR = "5a32a064c4a28200741e22de"; - public const string SILENCER_CO_SAKER_ASR_556_556X45_SOUND_SUPPRESSOR = "60926df0132d4d12c81fd9df"; + public const string SILENCER_CO_SAKER_ASR_556_556X45_SOUND_SUPPRESSOR = + "60926df0132d4d12c81fd9df"; public const string SILENCER_CO_SALVO_12_12GA_SOUND_SUPPRESSOR = "5b363dd25acfc4001a598fd2"; public const string SILENCER_CO_SPARROW_22_SOUND_SUPPRESSOR = "54490a4d4bdc2dbc018b4573"; - public const string SILENCER_DANIEL_DEFENSE_WAVE_QD_SOUND_SUPPRESSOR = "5cff9e84d7ad1a049e54ed55"; - public const string SILENCER_FN_P90_ATTENUATOR_57X28_SOUND_SUPPRESSOR = "5cebec00d7f00c065c53522a"; - public const string SILENCER_GEMTECH_ONE_MULTICALIBER_SOUND_SUPPRESSOR = "5c7955c22e221644f31bfd5e"; + public const string SILENCER_DANIEL_DEFENSE_WAVE_QD_SOUND_SUPPRESSOR = + "5cff9e84d7ad1a049e54ed55"; + public const string SILENCER_FN_P90_ATTENUATOR_57X28_SOUND_SUPPRESSOR = + "5cebec00d7f00c065c53522a"; + public const string SILENCER_GEMTECH_ONE_MULTICALIBER_SOUND_SUPPRESSOR = + "5c7955c22e221644f31bfd5e"; public const string SILENCER_GEMTECH_SFN57_57X28_SOUND_SUPPRESSOR = "5d3ef698a4b9361182109872"; - public const string SILENCER_GLOCK_9X19_FISCHER_DEVELOPMENT_FD917_SOUND_SUPPRESSOR = "5a7ad74e51dfba0015068f45"; + public const string SILENCER_GLOCK_9X19_FISCHER_DEVELOPMENT_FD917_SOUND_SUPPRESSOR = + "5a7ad74e51dfba0015068f45"; public const string SILENCER_HEXAGON_12K_12GA_SOUND_SUPPRESSOR = "59c0ec5b86f77435b128bfca"; public const string SILENCER_HK_G28_BT_QD_762X51_SOUND_SUPPRESSOR = "6171367e1cb55961fa0fdb36"; public const string SILENCER_HK_MP5SD_9X19_SOUND_SUPPRESSOR = "5926d33d86f77410de68ebc0"; - public const string SILENCER_HK_MP7_BT_ROTEX_2_46X30_SOUND_SUPPRESSOR = "5ba26ae8d4351e00367f9bdb"; + public const string SILENCER_HK_MP7_BT_ROTEX_2_46X30_SOUND_SUPPRESSOR = + "5ba26ae8d4351e00367f9bdb"; public const string SILENCER_HK_UMP_BT_OEM_45_ACP_SOUND_SUPPRESSOR = "6130c4d51cb55961fa0fd49f"; public const string SILENCER_KAC_PRSQDC_762X51_SOUND_SUPPRESSOR = "5dfa3d2b0dee1b22f862eade"; public const string SILENCER_KAC_QDC_556X45_SOUND_SUPPRESSOR = "626673016f1edc06f30cf6d5"; public const string SILENCER_KAC_QDC_65X35_SOUND_SUPPRESSOR = "55d617094bdc2d89028b4568"; - public const string SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_BLACK = "57da93632459771cb65bf83f"; - public const string SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_FDE = "57dbb57e2459774673234890"; - public const string SILENCER_MCXSPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = "652911e650dc782999054b9d"; - public const string SILENCER_MOSIN_RIFLE_BRAMIT_762X54R_SOUND_SUPPRESSOR = "5b86a0e586f7745b600ccb23"; + public const string SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_BLACK = + "57da93632459771cb65bf83f"; + public const string SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_FDE = + "57dbb57e2459774673234890"; + public const string SILENCER_MCXSPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = + "652911e650dc782999054b9d"; + public const string SILENCER_MOSIN_RIFLE_BRAMIT_762X54R_SOUND_SUPPRESSOR = + "5b86a0e586f7745b600ccb23"; public const string SILENCER_MP9_9X19_SOUND_SUPPRESSOR = "5de8f2d5b74cd90030650c72"; - public const string SILENCER_MPX_9X19_RONIN_ARMS_12_INCH_SD_SUPPRESSOR = "676149d8e889e1972605d6be"; - public const string SILENCER_MPX_9X19_RONIN_ARMS_8_INCH_SD_SUPPRESSOR = "676149c5062e6212f5058c36"; - public const string SILENCER_MPXSD_9X19_INTEGRATED_SOUND_SUPPRESSOR = "58aeac1b86f77457c419f475"; + public const string SILENCER_MPX_9X19_RONIN_ARMS_12_INCH_SD_SUPPRESSOR = + "676149d8e889e1972605d6be"; + public const string SILENCER_MPX_9X19_RONIN_ARMS_8_INCH_SD_SUPPRESSOR = + "676149c5062e6212f5058c36"; + public const string SILENCER_MPXSD_9X19_INTEGRATED_SOUND_SUPPRESSOR = + "58aeac1b86f77457c419f475"; public const string SILENCER_PB_9X18PM_SOUND_SUPPRESSOR = "56e05b06d2720bb2668b4586"; public const string SILENCER_PL15_9X19_SOUND_SUPPRESSOR = "602a97060ddce744014caf6f"; public const string SILENCER_PP1901_VITYAZ_9X19_SOUND_SUPPRESSOR = "59bfc5c886f7743bf6794e62"; @@ -3971,29 +4731,40 @@ public static class ItemTpl public const string SILENCER_ROTOR_43_762X39_SOUND_SUPPRESSOR = "5a9fbacda2750c00141e080f"; public const string SILENCER_ROTOR_43_762X54R_SOUND_SUPPRESSOR = "5e01ea19e9dc277128008c0b"; public const string SILENCER_ROTOR_43_9X19_SOUND_SUPPRESSOR = "5a9fb739a2750c003215717f"; - public const string SILENCER_SAKO_TRG_PGM_PRECISION_338_LM_SOUND_SUPPRESSOR = "673f0a9370a3ddcf0d0ee0b8"; - public const string SILENCER_SIG_SAUER_SRD762QD_762X51_SOUND_SUPPRESSOR = "5fbe760793164a5b6278efc8"; - public const string SILENCER_SIG_SAUER_SRD762TI_762X51_SOUND_SUPPRESSOR = "5fbe7618d6fa9c00c571bb6c"; + public const string SILENCER_SAKO_TRG_PGM_PRECISION_338_LM_SOUND_SUPPRESSOR = + "673f0a9370a3ddcf0d0ee0b8"; + public const string SILENCER_SIG_SAUER_SRD762QD_762X51_SOUND_SUPPRESSOR = + "5fbe760793164a5b6278efc8"; + public const string SILENCER_SIG_SAUER_SRD762TI_762X51_SOUND_SUPPRESSOR = + "5fbe7618d6fa9c00c571bb6c"; public const string SILENCER_SIG_SAUER_SRD9_9X19_SOUND_SUPPRESSOR = "5c6165902e22160010261b28"; public const string SILENCER_SKS_HEXAGON_762X39_SOUND_SUPPRESSOR = "593d490386f7745ee97a1555"; public const string SILENCER_SR1MP_9X21_SOUND_SUPPRESSOR = "5a27b6bec4a282000e496f78"; public const string SILENCER_SR2M_9X21_SV1381_SOUND_SUPPRESSOR = "62e2a7138e1ac9380579c122"; public const string SILENCER_SR3M_9X39_SOUND_SUPPRESSOR = "65144ff50e00edc79406836f"; - public const string SILENCER_STEYR_AUG_ASE_UTRA_S_SERIES_SL7I_556X45_SOUND_SUPPRESSOR = "634eba08f69c710e0108d386"; - public const string SILENCER_STEYR_AUG_RELFEX_T4AUG_RANGER_556X45_SOUND_SUPPRESSOR = "630f2982cdb9e392db0cbcc7"; - public const string SILENCER_SUREFIRE_SOCOM556MINI_MONSTER_556X45_SOUND_SUPPRESSOR = "55d6190f4bdc2d87028b4567"; - public const string SILENCER_SUREFIRE_SOCOM556MONSTER_556X45_SOUND_SUPPRESSOR = "55d614004bdc2d86028b4568"; - public const string SILENCER_SUREFIRE_SOCOM556RC2_556X45_SOUND_SUPPRESSOR = "5ea17bbc09aa976f2e7a51cd"; + public const string SILENCER_STEYR_AUG_ASE_UTRA_S_SERIES_SL7I_556X45_SOUND_SUPPRESSOR = + "634eba08f69c710e0108d386"; + public const string SILENCER_STEYR_AUG_RELFEX_T4AUG_RANGER_556X45_SOUND_SUPPRESSOR = + "630f2982cdb9e392db0cbcc7"; + public const string SILENCER_SUREFIRE_SOCOM556MINI_MONSTER_556X45_SOUND_SUPPRESSOR = + "55d6190f4bdc2d87028b4567"; + public const string SILENCER_SUREFIRE_SOCOM556MONSTER_556X45_SOUND_SUPPRESSOR = + "55d614004bdc2d86028b4568"; + public const string SILENCER_SUREFIRE_SOCOM556RC2_556X45_SOUND_SUPPRESSOR = + "5ea17bbc09aa976f2e7a51cd"; public const string SILENCER_SV98_762X54R_SOUND_SUPPRESSOR = "5c4eecc32e221602b412b440"; - public const string SILENCER_THUNDER_BEAST_ARMS_ULTRA_5_SOUND_SUPPRESSOR = "5d44064fa4b9361e4f6eb8b5"; + public const string SILENCER_THUNDER_BEAST_ARMS_ULTRA_5_SOUND_SUPPRESSOR = + "5d44064fa4b9361e4f6eb8b5"; public const string SILENCER_TT_762X25_MAKESHIFT_SOUND_SUPPRESSOR = "571a28e524597720b4066567"; public const string SILENCER_UZI_9X19_SOUND_SUPPRESSOR = "66993733f74fef4dfd0b04ff"; - public const string SILENCER_VPO101_ROTOR_43_762X51_SOUND_SUPPRESSOR = "5f63407e1b231926f2329f15"; + public const string SILENCER_VPO101_ROTOR_43_762X51_SOUND_SUPPRESSOR = + "5f63407e1b231926f2329f15"; public const string SILENCER_VSS_9X39_INTEGRAL_BARRELSUPPRESSOR = "57838c962459774a1651ec63"; public const string SMG_BT_MP9_9X19_SUBMACHINE_GUN = "5e00903ae9dc277128008b87"; public const string SMG_BT_MP9N_9X19_SUBMACHINE_GUN = "5de7bd7bfd6b4e6e2276dc25"; public const string SMG_FN_P90_57X28_SUBMACHINE_GUN = "5cc82d76e24e8d00134b4b83"; - public const string SMG_HK_MP5_9X19_SUBMACHINE_GUN_NAVY_3_ROUND_BURST = "5926bb2186f7744b1c6c6e60"; + public const string SMG_HK_MP5_9X19_SUBMACHINE_GUN_NAVY_3_ROUND_BURST = + "5926bb2186f7744b1c6c6e60"; public const string SMG_HK_MP5K_9X19_SUBMACHINE_GUN = "5d2f0d8048f0356c925bc3b0"; public const string SMG_HK_MP7A1_46X30_SUBMACHINE_GUN = "5ba26383d4351e00334c93d9"; public const string SMG_HK_MP7A2_46X30_SUBMACHINE_GUN = "5bd70322209c4d00d7167b8f"; @@ -4010,32 +4781,49 @@ public static class ItemTpl public const string SMG_SIG_MPX_9X19_SUBMACHINE_GUN = "58948c8e86f77409493f7266"; public const string SMG_SOYUZTM_STM9_GEN2_9X19_CARBINE = "60339954d62c9b14ed777c06"; public const string SMG_SR2M_VERESK_9X21_SUBMACHINE_GUN = "62e14904c2699c0ec93adc47"; - public const string SMG_TDI_KRISS_VECTOR_GEN2_45_ACP_SUBMACHINE_GUN = "5fb64bc92b1b027b1f50bcf2"; + public const string SMG_TDI_KRISS_VECTOR_GEN2_45_ACP_SUBMACHINE_GUN = + "5fb64bc92b1b027b1f50bcf2"; public const string SMG_TDI_KRISS_VECTOR_GEN2_9X19_SUBMACHINE_GUN = "5fc3f2d5900b1d5091531e57"; - public const string SNIPERRIFLE_ACCURACY_INTERNATIONAL_AXMC_338_LM_BOLTACTION_SNIPER_RIFLE = "627e14b21713922ded6f2c15"; - public const string SNIPERRIFLE_LOBAEV_ARMS_DVL10_762X51_BOLTACTION_SNIPER_RIFLE = "588892092459774ac91d4b11"; - public const string SNIPERRIFLE_MOLOT_ARMS_VPO215_GORNOSTAY_366_TKM_BOLTACTION_RIFLE = "5de652c31b7e3716273428be"; - public const string SNIPERRIFLE_MOSIN_762X54R_BOLTACTION_RIFLE_INFANTRY = "5bfd297f0db834001a669119"; - public const string SNIPERRIFLE_MOSIN_762X54R_BOLTACTION_RIFLE_SNIPER = "5ae08f0a5acfc408fb1398a1"; - public const string SNIPERRIFLE_ORSIS_T5000M_762X51_BOLTACTION_SNIPER_RIFLE = "5df24cf80dee1b22f862e9bc"; - public const string SNIPERRIFLE_REMINGTON_MODEL_700_762X51_BOLTACTION_SNIPER_RIFLE = "5bfea6e90db834001b7347f3"; - public const string SNIPERRIFLE_SAKO_TRG_M10_338_LM_BOLTACTION_SNIPER_RIFLE = "673cab3e03c6a20581028bc1"; - public const string SNIPERRIFLE_SV98_762X54R_BOLTACTION_SNIPER_RIFLE = "55801eed4bdc2d89578b4588"; + public const string SNIPERRIFLE_ACCURACY_INTERNATIONAL_AXMC_338_LM_BOLTACTION_SNIPER_RIFLE = + "627e14b21713922ded6f2c15"; + public const string SNIPERRIFLE_LOBAEV_ARMS_DVL10_762X51_BOLTACTION_SNIPER_RIFLE = + "588892092459774ac91d4b11"; + public const string SNIPERRIFLE_MOLOT_ARMS_VPO215_GORNOSTAY_366_TKM_BOLTACTION_RIFLE = + "5de652c31b7e3716273428be"; + public const string SNIPERRIFLE_MOSIN_762X54R_BOLTACTION_RIFLE_INFANTRY = + "5bfd297f0db834001a669119"; + public const string SNIPERRIFLE_MOSIN_762X54R_BOLTACTION_RIFLE_SNIPER = + "5ae08f0a5acfc408fb1398a1"; + public const string SNIPERRIFLE_ORSIS_T5000M_762X51_BOLTACTION_SNIPER_RIFLE = + "5df24cf80dee1b22f862e9bc"; + public const string SNIPERRIFLE_REMINGTON_MODEL_700_762X51_BOLTACTION_SNIPER_RIFLE = + "5bfea6e90db834001b7347f3"; + public const string SNIPERRIFLE_SAKO_TRG_M10_338_LM_BOLTACTION_SNIPER_RIFLE = + "673cab3e03c6a20581028bc1"; + public const string SNIPERRIFLE_SV98_762X54R_BOLTACTION_SNIPER_RIFLE = + "55801eed4bdc2d89578b4588"; public const string SORTINGTABLE_SORTING_TABLE = "602543c13fee350cd564d032"; - public const string SPECIALSCOPE_ARMASIGHT_VULCAN_MG_35X_BRAVO_NIGHT_VISION_SCOPE = "5b3b6e495acfc4330140bd88"; - public const string SPECIALSCOPE_ARMASIGHT_ZEUSPRO_640_28X50_30HZ_THERMAL_SCOPE = "63fc44e2429a8a166c7f61e6"; + public const string SPECIALSCOPE_ARMASIGHT_VULCAN_MG_35X_BRAVO_NIGHT_VISION_SCOPE = + "5b3b6e495acfc4330140bd88"; + public const string SPECIALSCOPE_ARMASIGHT_ZEUSPRO_640_28X50_30HZ_THERMAL_SCOPE = + "63fc44e2429a8a166c7f61e6"; public const string SPECIALSCOPE_CYCLONE_SHAKHIN_37X_THERMAL_SCOPE = "67641b461c2eb66ade05dba6"; - public const string SPECIALSCOPE_FLIR_RS32_2259X_35MM_60HZ_THERMAL_RIFLESCOPE = "5d1b5e94d7ad1a2b865a96b0"; + public const string SPECIALSCOPE_FLIR_RS32_2259X_35MM_60HZ_THERMAL_RIFLESCOPE = + "5d1b5e94d7ad1a2b865a96b0"; public const string SPECIALSCOPE_MP155_ULTIMA_THERMAL_CAMERA = "606f2696f2cb2e02a42aceb1"; - public const string SPECIALSCOPE_NSPUM_35X_DOVETAIL_NIGHT_VISION_SCOPE = "5a7c74b3e899ef0014332c29"; - public const string SPECIALSCOPE_SIG_SAUER_ECHO1_12X30MM_30HZ_THERMAL_REFLEX_SCOPE = "6478641c19d732620e045e17"; - public const string SPECIALSCOPE_TORREY_PINES_LOGIC_T12W_30HZ_THERMAL_REFLEX_SIGHT = "609bab8b455afd752b2e6138"; + public const string SPECIALSCOPE_NSPUM_35X_DOVETAIL_NIGHT_VISION_SCOPE = + "5a7c74b3e899ef0014332c29"; + public const string SPECIALSCOPE_SIG_SAUER_ECHO1_12X30MM_30HZ_THERMAL_REFLEX_SCOPE = + "6478641c19d732620e045e17"; + public const string SPECIALSCOPE_TORREY_PINES_LOGIC_T12W_30HZ_THERMAL_REFLEX_SIGHT = + "609bab8b455afd752b2e6138"; public const string SPECIALSCOPE_TRIJICON_REAPIR_THERMAL_SCOPE = "5a1eaa87fcdbcb001865f75e"; public const string SPECITEM_IMP_MINE_DETECTOR = "5af056f186f7746da511291f"; public const string SPECITEM_MS2000_MARKER = "5991b51486f77447b112d44f"; public const string SPECITEM_RADIO_REPEATER = "63a0b2eabea67a6d93009e52"; public const string SPECITEM_SIGNAL_JAMMER = "5ac78a9b86f7741cca0bbd8d"; - public const string SPECITEM_THE_EYE_MORTAR_STRIKE_SIGNALING_DEVICE = "6655e35b6bc645cb7b059912"; + public const string SPECITEM_THE_EYE_MORTAR_STRIKE_SIGNALING_DEVICE = + "6655e35b6bc645cb7b059912"; public const string SPECITEM_WIFI_CAMERA = "5b4391a586f7745321235ab2"; public const string STASH_10X300 = "5c0a596086f7747bef5731c2"; public const string STASH_EDGE_OF_DARKNESS_STASH_10X68 = "5811ce772459770e9e5f9532"; @@ -4076,7 +4864,8 @@ public static class ItemTpl public const string STOCK_AI_AXMC_PISTOL_GRIP = "62811e2510e26c1f344e6554"; public const string STOCK_AK_100SERIES_METAL_SKELETONIZED = "6386300124a1dc425c00577a"; public const string STOCK_AK_AKEVO = "6761779c48fa5c377e06fc3f"; - public const string STOCK_AK_CUSTOM_ARMS_STEF_74_SKELETON_STOCK_EXTENSION = "6494094948796d891603e59f"; + public const string STOCK_AK_CUSTOM_ARMS_STEF_74_SKELETON_STOCK_EXTENSION = + "6494094948796d891603e59f"; public const string STOCK_AK_GP25_ACCESSORY_KIT_RECOIL_PAD = "5a0c59791526d8dba737bba7"; public const string STOCK_AK_SKELETONIZED_STOCK_CUSTOMIZED = "66ac9d9740e27931602042d4"; public const string STOCK_AK_ZENIT_PT1_KLASSIKA = "5b222d405acfc400153af4fe"; @@ -4094,7 +4883,8 @@ public static class ItemTpl public const string STOCK_AKMAK74_CAA_AKTS_BUFFER_TUBE = "5cf518cfd7f00c065b422214"; public const string STOCK_AKMAK74_FAB_DEFENSE_UAS = "5b04473a5acfc40018632f70"; public const string STOCK_AKMAK74_HERA_ARMS_CQR47_PISTOL_GRIPBUTT = "619b69037b9de8162902673e"; - public const string STOCK_AKMAK74_HEXAGON_KOCHERGA_STOCK_ANODIZED_RED = "5e217ba4c1434648c13568cd"; + public const string STOCK_AKMAK74_HEXAGON_KOCHERGA_STOCK_ANODIZED_RED = + "5e217ba4c1434648c13568cd"; public const string STOCK_AKMAK74_MAGPUL_ZHUKOVS = "5b0e794b5acfc47a877359b2"; public const string STOCK_AKMAK74_ME4_BUFFER_TUBE_ADAPTER = "5649b2314bdc2d79388b4576"; public const string STOCK_AKMAK74_PROMAG_ARCHANGEL_OPFOR_AA47_BUTT = "6087e2a5232e5a31c233d552"; @@ -4114,8 +4904,10 @@ public static class ItemTpl public const string STOCK_AR15_CMMG_RIPSTOCK_BUTT = "606587d11246154cad35d635"; public const string STOCK_AR15_COLT_A2_BUFFER_TUBE = "5a33ca0fc4a282000d72292f"; public const string STOCK_AR15_COLT_CARBINE_BUFFER_TUBE = "5649be884bdc2d79388b4577"; - public const string STOCK_AR15_DANIEL_DEFENSE_ENHANCED_COLLAPSIBLE_BUTTSTOCK_BLACK = "6516e91f609aaf354b34b3e2"; - public const string STOCK_AR15_DANIEL_DEFENSE_ENHANCED_COLLAPSIBLE_BUTTSTOCK_FDE = "6516e971a3d4c6497930b450"; + public const string STOCK_AR15_DANIEL_DEFENSE_ENHANCED_COLLAPSIBLE_BUTTSTOCK_BLACK = + "6516e91f609aaf354b34b3e2"; + public const string STOCK_AR15_DANIEL_DEFENSE_ENHANCED_COLLAPSIBLE_BUTTSTOCK_FDE = + "6516e971a3d4c6497930b450"; public const string STOCK_AR15_DOUBLESTAR_ACE_ARFX_SKELETON = "6761777a1f08ed5e8800b7ac"; public const string STOCK_AR15_DOUBLESTAR_ACE_SOCOM_GEN4 = "5d120a10d7ad1a4e1026ba85"; public const string STOCK_AR15_ERGO_F93_PRO = "5b0800175acfc400153aebd4"; @@ -4133,9 +4925,11 @@ public static class ItemTpl public const string STOCK_AR15_MAGPUL_CTR_CARBINE_STOCK_FDE = "5d135ecbd7ad1a21c176542e"; public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_BLACK = "56eabf3bd2720b75698b4569"; public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_FDE = "58d2946386f774496974c37e"; - public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_FOLIAGE_GREEN = "58d2946c86f7744e271174b5"; + public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_FOLIAGE_GREEN = + "58d2946c86f7744e271174b5"; public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_OLIVE_DRAB = "58d2947686f774485c6a1ee5"; - public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_STEALTH_GREY = "58d2947e86f77447aa070d53"; + public const string STOCK_AR15_MAGPUL_MOE_CARBINE_STOCK_STEALTH_GREY = + "58d2947e86f77447aa070d53"; public const string STOCK_AR15_MAGPUL_MOE_SLK_BUTTSTOCK_COYOTE_TAN = "6529370c405a5f51dd023db8"; public const string STOCK_AR15_MAGPUL_PRS_GEN2_STOCK_FDE = "5a33cae9c4a28232980eb086"; public const string STOCK_AR15_MAGPUL_PRS_GEN3_STOCK_BLACK = "5d44069ca4b9361ebd26fc37"; @@ -4146,8 +4940,10 @@ public static class ItemTpl public const string STOCK_AR15_RTM_ATP_BUFFER_TUBE = "638de3603a1a4031d8260b8c"; public const string STOCK_AR15_SB_TACTICAL_SBA3_BRACE = "628a85ee6b1d481ff772e9d5"; public const string STOCK_AR15_SOYUZTM_BUFFER_TUBE = "602e3f1254072b51b239f713"; - public const string STOCK_AR15_STRIKE_INDUSTRIES_ADVANCED_RECEIVER_EXTENSION_BUFFER_TUBE = "5c793fb92e221644f31bfb64"; - public const string STOCK_AR15_STRIKE_INDUSTRIES_ADVANCED_RECEIVER_EXTENSION_BUFFER_TUBE_ANODIZED_RED = "5c793fc42e221600114ca25d"; + public const string STOCK_AR15_STRIKE_INDUSTRIES_ADVANCED_RECEIVER_EXTENSION_BUFFER_TUBE = + "5c793fb92e221644f31bfb64"; + public const string STOCK_AR15_STRIKE_INDUSTRIES_ADVANCED_RECEIVER_EXTENSION_BUFFER_TUBE_ANODIZED_RED = + "5c793fc42e221600114ca25d"; public const string STOCK_AR15_STRIKE_INDUSTRIES_VIPER_MOD_1 = "5c793fde2e221601da358614"; public const string STOCK_AR15_STRIKE_INDUSTRIES_VIPER_PDW = "627254cc9c563e6e442c398f"; public const string STOCK_AR15_TROY_M7A1_PDW_STOCK_BLACK = "591aef7986f774139d495f03"; @@ -4172,14 +4968,17 @@ public static class ItemTpl public const string STOCK_FN_SCAR_CHEEK_REST_FDE = "61825d24d3a39d50044c13af"; public const string STOCK_FN_SCAR_FOLDING_POLYMER = "61816734d8e3106d9806c1f3"; public const string STOCK_FN_SCAR_FOLDING_POLYMER_STOCK_FDE = "61825d06d92c473c770215de"; - public const string STOCK_FN_SCAR_JMAC_CUSTOMS_RSASCAR_1913_ADAPTER = "66ffc246a81a4f85e70d4d06"; + public const string STOCK_FN_SCAR_JMAC_CUSTOMS_RSASCAR_1913_ADAPTER = + "66ffc246a81a4f85e70d4d06"; public const string STOCK_FN_SCAR_RETRACTABLE_POLYMER = "618167528004cc50514c34f9"; public const string STOCK_FN_SCAR_RETRACTABLE_POLYMER_STOCK_FDE = "61825d136ef05c2ce828f1cc"; public const string STOCK_FN_SCAR_RUBBER_BUTTPAD = "618167616ef05c2ce828f1a8"; public const string STOCK_FN_SCAR_VLTOR_RESCAR_STOCK_ADAPTER = "66ffbfb1a73a7bce3d0b45a8"; - public const string STOCK_FN_SCAR_VLTOR_RESCAR_STOCK_ADAPTER_PATRIOT_BROWN = "66ffc20ba73a7bce3d0b45ab"; + public const string STOCK_FN_SCAR_VLTOR_RESCAR_STOCK_ADAPTER_PATRIOT_BROWN = + "66ffc20ba73a7bce3d0b45ab"; public const string STOCK_FN_SCAR_VLTOR_VSS11_POLYMER = "66ffc2bd132225f0fe0611d8"; - public const string STOCK_FN_SCAR_VLTOR_VSS11_POLYMER_STOCK_PATRIOT_BROWN = "66ffc2ecfe9b3825960652f7"; + public const string STOCK_FN_SCAR_VLTOR_VSS11_POLYMER_STOCK_PATRIOT_BROWN = + "66ffc2ecfe9b3825960652f7"; public const string STOCK_GLOCK_FAB_DEFENSE_GLR17 = "5d1c702ad7ad1a632267f429"; public const string STOCK_HK_416_ENHANCED_BUFFER_TUBE = "5bb20e58d4351e00320205d7"; public const string STOCK_HK_ADJUSTABLE_BUTTSTOCK_CHEEK_REST = "61715e7e67085e45ef140b33"; @@ -4224,18 +5023,21 @@ public static class ItemTpl public const string STOCK_M870_SHOCKWAVE_RAPTOR_GRIP = "5a788169c5856700142fdd9e"; public const string STOCK_M870_SPS_POLYMER = "5a7880d0c5856700142fdd9d"; public const string STOCK_MAGPUL_MOE_CARBINE_RUBBER_BUTTPAD = "58d2912286f7744e27117493"; - public const string STOCK_MESA_TACTICAL_CROSSHAIR_HYDRAULIC_BUFFER_TUBE = "5ef1ba28c64c5d0dfc0571a5"; + public const string STOCK_MESA_TACTICAL_CROSSHAIR_HYDRAULIC_BUFFER_TUBE = + "5ef1ba28c64c5d0dfc0571a5"; public const string STOCK_MOSIN_RIFLE_AIM_SPORTS_RECOIL_PAD = "5bbde409d4351e003562b036"; public const string STOCK_MOSIN_RIFLE_ATI_MONTE_CARLO = "5bbdb870d4351e00367fb67d"; public const string STOCK_MOSIN_RIFLE_CARBINE = "5bfd384c0db834001a6691d3"; public const string STOCK_MOSIN_RIFLE_INFANTRY = "5bfd35380db83400232fe5cc"; - public const string STOCK_MOSIN_RIFLE_PROMAG_ARCHANGEL_OPFOR_PRS_CHASSIS = "5bae13bad4351e00320204af"; + public const string STOCK_MOSIN_RIFLE_PROMAG_ARCHANGEL_OPFOR_PRS_CHASSIS = + "5bae13bad4351e00320204af"; public const string STOCK_MOSIN_RIFLE_SAWEDOFF = "5bfd36ad0db834001c38ef66"; public const string STOCK_MOSIN_RIFLE_SAWEDOFF_SNIPER = "5bfd36290db834001966869a"; public const string STOCK_MOSIN_RIFLE_SNIPER_CARBINE = "5bfd37c80db834001d23e842"; public const string STOCK_MOSIN_RIFLE_STANDARD = "5ae096d95acfc400185c2c81"; public const string STOCK_MOSSBERG_590A1_MAGPUL_SGA = "5eea217fc64c5d0dfc05712a"; - public const string STOCK_MOSSBERG_590A1_MESA_TACTICAL_LEO_GEN1_STOCK_ADAPTER = "5ef1b9f0c64c5d0dfc0571a1"; + public const string STOCK_MOSSBERG_590A1_MESA_TACTICAL_LEO_GEN1_STOCK_ADAPTER = + "5ef1b9f0c64c5d0dfc0571a1"; public const string STOCK_MOSSBERG_590A1_POLYMER = "5e87116b81c4ed43e83cefdd"; public const string STOCK_MP133153_PLASTIC = "56083be64bdc2d20478b456f"; public const string STOCK_MP133153_PLASTIC_PISTOL_GRIP = "56083a334bdc2dc8488b4571"; @@ -4274,7 +5076,8 @@ public static class ItemTpl public const string STOCK_SIG_SAUER_COLLAPSINGTELESCOPING = "5894a13e86f7742405482982"; public const string STOCK_SIG_SAUER_FOLDING_KNUCKLE_STOCK_ADAPTER = "58ac1bf086f77420ed183f9f"; public const string STOCK_SIG_SAUER_LOCKING_STOCK_HINGE_ASSEMBLY = "6529348224cbe3c74a05e5c4"; - public const string STOCK_SIG_SAUER_STOCK_ADAPTER_LOW_PROFILE_TUBE_COYOTE_TAN = "6529366450dc782999054ba0"; + public const string STOCK_SIG_SAUER_STOCK_ADAPTER_LOW_PROFILE_TUBE_COYOTE_TAN = + "6529366450dc782999054ba0"; public const string STOCK_SIG_SAUER_TELESCOPINGFOLDING = "5fbcc429900b1d5091531dd7"; public const string STOCK_SIG_SAUER_THIN_SIDEFOLDING = "5fbcc437d724d907e2077d5c"; public const string STOCK_SKS_ATI_MONTE_CARLO = "653ecef836fae5a82f02b869"; @@ -4293,7 +5096,8 @@ public static class ItemTpl public const string STOCK_TOZ106 = "5a38ef1fc4a282000b1521f6"; public const string STOCK_TOZ106_CUSTOM_CUT_MOSIN = "5c99f3592e221644fc633070"; public const string STOCK_TOZ106_FAB_DEFENSE_GPCP_CHEEK_REST = "626a8ae89e664a2e2a75f409"; - public const string STOCK_UZI_PRO_A3_TACTICAL_MODULAR_FOLDING_BRACE = "6686717ffb75ee4a5e02eb19"; + public const string STOCK_UZI_PRO_A3_TACTICAL_MODULAR_FOLDING_BRACE = + "6686717ffb75ee4a5e02eb19"; public const string STOCK_UZI_PRO_A3_TACTICAL_REAR_STOCK_ADAPTER = "668672b8c99550c6fd0f0b29"; public const string STOCK_UZI_PRO_BACKPLATE = "66881008f23233ee9a0742e7"; public const string STOCK_UZI_PRO_CSM_STOCK_ADAPTER = "669cf78806768ff39504fc1c"; @@ -4312,27 +5116,40 @@ public static class ItemTpl public const string STOCK_VSK94 = "6452519e3d52156624001fd5"; public const string STOCK_VSS_WOODEN = "578395e82459774a0e553c7b"; public const string TACTICALCOMBO_BE_MEYERS_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065"; - public const string TACTICALCOMBO_GLOCK_GTL_21_TACTICAL_FLASHLIGHT_WITH_LASER = "5a800961159bd4315e3a1657"; + public const string TACTICALCOMBO_GLOCK_GTL_21_TACTICAL_FLASHLIGHT_WITH_LASER = + "5a800961159bd4315e3a1657"; public const string TACTICALCOMBO_HOLOSUN_LS321_TACTICAL_DEVICE = "57fd23e32459772d0805bcf1"; public const string TACTICALCOMBO_INSIGHT_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0"; - public const string TACTICALCOMBO_INSIGHT_WMX200_TACTICAL_FLASHLIGHT = "626becf9582c3e319310b837"; + public const string TACTICALCOMBO_INSIGHT_WMX200_TACTICAL_FLASHLIGHT = + "626becf9582c3e319310b837"; public const string TACTICALCOMBO_L3HARRIS_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577"; public const string TACTICALCOMBO_L3HARRIS_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c"; public const string TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER = "5cc9c20cd7f00c001336c65d"; - public const string TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER = "6272370ee4013c5d7e31f418"; - public const string TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER_TAN = "6272379924e29f06af4d5ecb"; + public const string TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER = + "6272370ee4013c5d7e31f418"; + public const string TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER_TAN = + "6272379924e29f06af4d5ecb"; public const string TACTICALCOMBO_STEINER_DBALPL_TACTICAL_DEVICE = "5d2369418abbc306c62e0c80"; - public const string TACTICALCOMBO_STEINER_LASTAC_2_TACTICAL_FLASHLIGHT = "5b07dd285acfc4001754240d"; - public const string TACTICALCOMBO_SUREFIRE_X400_ULTRA_TACTICAL_FLASHLIGHT_WITH_LASER = "56def37dd2720bec348b456a"; + public const string TACTICALCOMBO_STEINER_LASTAC_2_TACTICAL_FLASHLIGHT = + "5b07dd285acfc4001754240d"; + public const string TACTICALCOMBO_SUREFIRE_X400_ULTRA_TACTICAL_FLASHLIGHT_WITH_LASER = + "56def37dd2720bec348b456a"; public const string TACTICALCOMBO_SUREFIRE_XC1_TACTICAL_FLASHLIGHT = "5a7b483fe899ef0016170d15"; - public const string TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LASER_SIGHT = "5c079ed60db834001a66b372"; - public const string TACTICALCOMBO_WILCOX_RAPTAR_ES_TACTICAL_RANGEFINDER = "61605d88ffa6e502ac5e7eeb"; - public const string TACTICALCOMBO_ZENIT_KLESCH2IKS_IR_ILLUMINATOR_WITH_LASER = "5a5f1ce64f39f90b401987bc"; - public const string TACTICALCOMBO_ZENIT_KLESCH2P_FLASHLIGHT_WITH_LASER = "560d657b4bdc2da74d8b4572"; - public const string TACTICALCOMBO_ZENIT_KLESCH2U_TACTICAL_FLASHLIGHT = "5b3a337e5acfc4704b4a19a0"; + public const string TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LASER_SIGHT = + "5c079ed60db834001a66b372"; + public const string TACTICALCOMBO_WILCOX_RAPTAR_ES_TACTICAL_RANGEFINDER = + "61605d88ffa6e502ac5e7eeb"; + public const string TACTICALCOMBO_ZENIT_KLESCH2IKS_IR_ILLUMINATOR_WITH_LASER = + "5a5f1ce64f39f90b401987bc"; + public const string TACTICALCOMBO_ZENIT_KLESCH2P_FLASHLIGHT_WITH_LASER = + "560d657b4bdc2da74d8b4572"; + public const string TACTICALCOMBO_ZENIT_KLESCH2U_TACTICAL_FLASHLIGHT = + "5b3a337e5acfc4704b4a19a0"; public const string TACTICALCOMBO_ZENIT_PERST3_TACTICAL_DEVICE = "5c5952732e2216398b5abda2"; - public const string THERMALVISION_T7_THERMAL_GOGGLES_WITH_A_NIGHT_VISION_MOUNT = "5c110624d174af029e69734c"; - public const string VEST_511_TACTICAL_TACTEC_PLATE_CARRIER_RANGER_GREEN = "5b44cad286f77402a54ae7e5"; + public const string THERMALVISION_T7_THERMAL_GOGGLES_WITH_A_NIGHT_VISION_MOUNT = + "5c110624d174af029e69734c"; + public const string VEST_511_TACTICAL_TACTEC_PLATE_CARRIER_RANGER_GREEN = + "5b44cad286f77402a54ae7e5"; public const string VEST_511_TACTICAL_TACTEC_PLATE_CARRIER_STORM = "67ab4b2d6f7ae4aa550bbcf6"; public const string VEST_6B3TM01_ARMORED_RIG_KHAKI = "5d5d646386f7742797261fd9"; public const string VEST_6B515_ZH86_ULEY_ARMORED_RIG_FLORA = "5c0e446786f7742013381639"; @@ -4341,58 +5158,80 @@ public static class ItemTpl public const string VEST_ANA_TACTICAL_ALPHA_CHEST_RIG_OLIVE_DRAB = "592c2d1a86f7746dbe2af32a"; public const string VEST_ANA_TACTICAL_M1_PLATE_CARRIER_OLIVE_DRAB = "5c0e722886f7740458316a57"; public const string VEST_ANA_TACTICAL_M2_PLATE_CARRIER_EMR = "5ab8dced86f774646209ec87"; - public const string VEST_ARS_ARMA_A18_SKANDA_PLATE_CARRIER_MULTICAM = "5d5d87f786f77427997cfaef"; + public const string VEST_ARS_ARMA_A18_SKANDA_PLATE_CARRIER_MULTICAM = + "5d5d87f786f77427997cfaef"; public const string VEST_ARS_ARMA_CPC_MOD1_PLATE_CARRIER_ATACS_FG = "5e4ac41886f77406a511c9a8"; public const string VEST_AZIMUT_SS_KHAMELION_CHEST_HARNESS_OLIVE = "63611865ba5b90db0c0399d1"; public const string VEST_AZIMUT_SS_ZHUK_CHEST_HARNESS_BLACK = "603648ff5a45383c122086ac"; public const string VEST_AZIMUT_SS_ZHUK_CHEST_HARNESS_SURPAT = "6040dd4ddcf9592f401632d2"; public const string VEST_BLACKHAWK_COMMANDO_CHEST_HARNESS_BLACK = "5c0e9f2c86f77432297fe0a3"; - public const string VEST_BLACKHAWK_COMMANDO_CHEST_HARNESS_DESERT_TAN = "5b44c8ea86f7742d1627baf1"; + public const string VEST_BLACKHAWK_COMMANDO_CHEST_HARNESS_DESERT_TAN = + "5b44c8ea86f7742d1627baf1"; public const string VEST_BLACKROCK_CHEST_RIG_GRAY = "5648a69d4bdc2ded0b8b457b"; public const string VEST_BLACKROCK_CHEST_RIG_KHAKI = "67ab3f146d7ece17bf0096ff"; public const string VEST_CQC_OSPREY_MK4A_PLATE_CARRIER_ASSAULT_MTP = "60a3c70cde5f453f634816a3"; - public const string VEST_CQC_OSPREY_MK4A_PLATE_CARRIER_PROTECTION_MTP = "60a3c68c37ea821725773ef5"; + public const string VEST_CQC_OSPREY_MK4A_PLATE_CARRIER_PROTECTION_MTP = + "60a3c68c37ea821725773ef5"; public const string VEST_CRYE_PRECISION_AVS_PLATE_CARRIER_MULTICAM = "67ab49aab9c7a1e18c095686"; - public const string VEST_CRYE_PRECISION_AVS_PLATE_CARRIER_RANGER_GREEN = "544a5caa4bdc2d1a388b4568"; - public const string VEST_CRYE_PRECISION_AVS_PLATE_CARRIER_TAGILLA_EDITION = "609e860ebd219504d8507525"; - public const string VEST_CRYE_PRECISION_CPC_PLATE_CARRIER_GOONS_EDITION = "628b9c7d45122232a872358f"; + public const string VEST_CRYE_PRECISION_AVS_PLATE_CARRIER_RANGER_GREEN = + "544a5caa4bdc2d1a388b4568"; + public const string VEST_CRYE_PRECISION_AVS_PLATE_CARRIER_TAGILLA_EDITION = + "609e860ebd219504d8507525"; + public const string VEST_CRYE_PRECISION_CPC_PLATE_CARRIER_GOONS_EDITION = + "628b9c7d45122232a872358f"; public const string VEST_CSA_CHEST_RIG_BLACK = "6034d0230ca681766b6a0fb5"; - public const string VEST_DIRECT_ACTION_THUNDERBOLT_COMPACT_CHEST_RIG_SHADOW_GREY = "5f5f41f56760b4138443b352"; + public const string VEST_DIRECT_ACTION_THUNDERBOLT_COMPACT_CHEST_RIG_SHADOW_GREY = + "5f5f41f56760b4138443b352"; public const string VEST_DIY_IDEA_CHEST_RIG = "5fd4c4fa16cac650092f6771"; public const string VEST_DYNAFORCE_TRITON_M43A_CHEST_HARNESS_BLACK = "5ca20abf86f77418567a43f2"; - public const string VEST_EAGLE_ALLIED_INDUSTRIES_MBSS_PLATE_CARRIER_COYOTE_BROWN = "64a5366719bab53bd203bf33"; - public const string VEST_EAGLE_INDUSTRIES_MMAC_PLATE_CARRIER_RANGER_GREEN = "61bc85697113f767765c7fe7"; + public const string VEST_EAGLE_ALLIED_INDUSTRIES_MBSS_PLATE_CARRIER_COYOTE_BROWN = + "64a5366719bab53bd203bf33"; + public const string VEST_EAGLE_INDUSTRIES_MMAC_PLATE_CARRIER_RANGER_GREEN = + "61bc85697113f767765c7fe7"; public const string VEST_ECLIPSE_RBAVAF_PLATE_CARRIER_RANGER_GREEN = "628dc750b910320f4c27a732"; - public const string VEST_FIRSTSPEAR_STRANDHOGG_PLATE_CARRIER_RANGER_GREEN = "61bcc89aef0f505f0c6cd0fc"; + public const string VEST_FIRSTSPEAR_STRANDHOGG_PLATE_CARRIER_RANGER_GREEN = + "61bcc89aef0f505f0c6cd0fc"; public const string VEST_GEAR_CRAFT_GCBSSMK1_CHEST_RIG_ATACS_FG = "5fd4c60f875c30179f5d04c2"; - public const string VEST_HALEY_STRATEGIC_D3CRX_CHEST_HARNESS_RANGER_GREEN = "5d5d85c586f774279a21cbdb"; - public const string VEST_LBT1961A_LOAD_BEARING_CHEST_RIG_GOONS_EDITION = "628baf0b967de16aab5a4f36"; + public const string VEST_HALEY_STRATEGIC_D3CRX_CHEST_HARNESS_RANGER_GREEN = + "5d5d85c586f774279a21cbdb"; + public const string VEST_LBT1961A_LOAD_BEARING_CHEST_RIG_GOONS_EDITION = + "628baf0b967de16aab5a4f36"; public const string VEST_LBT1961A_LOAD_BEARING_CHEST_RIG_MAS_GREY = "5e9db13186f7742f845ee9d3"; public const string VEST_NPP_KLASS_BAGARIY_PLATE_CARRIER_EMR = "628d0618d1ba6e4fa07ce5a4"; public const string VEST_POYASA_POYASB_GEAR_RIG = "5c0e6a1586f77404597b4965"; public const string VEST_SCAV = "572b7adb24597762ae139821"; public const string VEST_SECURITY = "5fd4c5477a8d854fa0105061"; - public const string VEST_SHELLBACK_TACTICAL_BANSHEE_PLATE_CARRIER_ATACS_AU = "639343fce101f4caa40a4ef3"; + public const string VEST_SHELLBACK_TACTICAL_BANSHEE_PLATE_CARRIER_ATACS_AU = + "639343fce101f4caa40a4ef3"; public const string VEST_SOE_MICRO_RIG_MULTICAM = "5d5d8ca986f7742798716522"; - public const string VEST_SPIRITUS_SYSTEMS_BANK_ROBBER_CHEST_RIG_MULTICAM_ALPINE = "674589d98dd67746010329e6"; - public const string VEST_SPIRITUS_SYSTEMS_BANK_ROBBER_CHEST_RIG_MULTICAM_BLACK = "5e4abc1f86f774069619fbaa"; + public const string VEST_SPIRITUS_SYSTEMS_BANK_ROBBER_CHEST_RIG_MULTICAM_ALPINE = + "674589d98dd67746010329e6"; + public const string VEST_SPIRITUS_SYSTEMS_BANK_ROBBER_CHEST_RIG_MULTICAM_BLACK = + "5e4abc1f86f774069619fbaa"; public const string VEST_SPLAV_TARZAN_M22_CHEST_RIG_SMOG = "5e4abfed86f77406a2713cf7"; - public const string VEST_SS_PRECISION_PLATEFRAME_PLATE_CARRIER_GOONS_EDITION = "628b9784bcf6e2659e09b8a2"; - public const string VEST_STICH_PROFI_CHEST_RIG_MK2_ASSAULT_ATACS_FG = "60a621c49c197e4e8c4455e6"; + public const string VEST_SS_PRECISION_PLATEFRAME_PLATE_CARRIER_GOONS_EDITION = + "628b9784bcf6e2659e09b8a2"; + public const string VEST_STICH_PROFI_CHEST_RIG_MK2_ASSAULT_ATACS_FG = + "60a621c49c197e4e8c4455e6"; public const string VEST_STICH_PROFI_CHEST_RIG_MK2_RECON_ATACS_FG = "60a6220e953894617404b00a"; public const string VEST_STICH_PROFI_PLATE_CARRIER_V2_BLACK = "66b6296d7994640992013b17"; - public const string VEST_STICH_PROFI_STICH_DEFENSE_MOD2_PLATE_CARRIER_MULTICAM = "66b6295178bbc0200425f995"; - public const string VEST_TASMANIAN_TIGER_PLATE_CARRIER_MKIII_COYOTE_BROWN = "66b6295a8ca68c6461709efa"; - public const string VEST_TASMANIAN_TIGER_SK_PLATE_CARRIER_MULTICAM_BLACK = "628cd624459354321c4b7fa2"; + public const string VEST_STICH_PROFI_STICH_DEFENSE_MOD2_PLATE_CARRIER_MULTICAM = + "66b6295178bbc0200425f995"; + public const string VEST_TASMANIAN_TIGER_PLATE_CARRIER_MKIII_COYOTE_BROWN = + "66b6295a8ca68c6461709efa"; + public const string VEST_TASMANIAN_TIGER_SK_PLATE_CARRIER_MULTICAM_BLACK = + "628cd624459354321c4b7fa2"; public const string VEST_TYPE_56_CHICOM_CHEST_HARNESS = "64be7110bf597ba84a0a41ea"; public const string VEST_UMKA_M33SET1_HUNTER_VEST_OLIVE_DRAB = "6034cf5fffd42c541047f72e"; public const string VEST_UMTBS_6SH112_SCOUTSNIPER_CHEST_RIG_EMR = "5929a2a086f7744f4b234d43"; - public const string VEST_VELOCITY_SYSTEMS_MPPV_MULTIPURPOSE_PATROL_VEST_WOLF_GREY = "5df8a42886f77412640e2e75"; + public const string VEST_VELOCITY_SYSTEMS_MPPV_MULTIPURPOSE_PATROL_VEST_WOLF_GREY = + "5df8a42886f77412640e2e75"; public const string VEST_WARTECH_MK3_TV104_CHEST_RIG_MULTICAM = "5ab8dab586f77441cd04f2a2"; public const string VEST_WARTECH_TV109_TV106_CHEST_RIG_ATACS_FG = "59e7643b86f7742cbf2c109a"; public const string VEST_WARTECH_TV110_PLATE_CARRIER_COYOTE = "5c0e746986f7741453628fe5"; public const string VEST_WARTECH_TV115_PLATE_CARRIER_OLIVE_DRAB = "64a536392d2c4e6e970f4121"; - public const string VEST_ZULU_NYLON_GEAR_M4_REDUCED_SIGNATURE_CHEST_RIG_RANGER_GREEN = "64be7095047e826eae02b0c1"; + public const string VEST_ZULU_NYLON_GEAR_M4_REDUCED_SIGNATURE_CHEST_RIG_RANGER_GREEN = + "64be7095047e826eae02b0c1"; public const string VISORS_6B34_ANTIFRAGMENTATION_GLASSES = "5b432be65acfc433000ed01f"; public const string VISORS_ANTIFRAGMENTATION_GLASSES = "59e770b986f7742cbd762754"; public const string VISORS_DUNDUKK_SPORT_SUNGLASSES = "5aa2b986e5b5b00014028f4c"; @@ -4404,7 +5243,8 @@ public static class ItemTpl public const string VISORS_OAKLEY_SI_BATWOLF_GLASSES = "62a61c988ec41a51b34758d5"; public const string VISORS_OAKLEY_SI_GASCAN_GLASSES = "5d6d2e22a4b9361bd5780d05"; public const string VISORS_OAKLEY_SI_M_FRAME_SAFETY_GLASSES = "5c1a1cc52e221602b3136e3d"; - public const string VISORS_OAKLEY_SI_M_FRAME_SAFETY_GLASSES_ORANGE_LENSES = "67af42942676ade5750b50e8"; + public const string VISORS_OAKLEY_SI_M_FRAME_SAFETY_GLASSES_ORANGE_LENSES = + "67af42942676ade5750b50e8"; public const string VISORS_PYRAMEX_PROXIMITY_SAFETY_GLASSES = "5c0d32fcd174af02a1659c75"; public const string VISORS_RAYBENCH_AVIATOR_GLASSES = "5d6d2ef3a4b93618084f58bd"; public const string VISORS_RAYBENCH_AVIATOR_GLASSES_GREEN_LENSES = "67af425c2676ade5750b50e6"; diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/LootRarity.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/LootRarity.cs index 7a26f4c3..069ae177 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/LootRarity.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/LootRarity.cs @@ -5,5 +5,5 @@ public enum LootRarity Not_exist = -1, Common, Rare, - Superrare + Superrare, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/MemberCategory.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/MemberCategory.cs index f4350748..411d834b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/MemberCategory.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/MemberCategory.cs @@ -16,5 +16,5 @@ public enum MemberCategory UnitTest = 128, Sherpa = 256, Emissary = 512, - Unheard = 1024 + Unheard = 1024, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ModSpawn.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ModSpawn.cs index c8420e68..774f8010 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ModSpawn.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ModSpawn.cs @@ -15,5 +15,5 @@ public enum ModSpawn /** * Item should not be chosen */ - SKIP = 2 + SKIP = 2, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Money.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Money.cs index 3d48c871..78c33cef 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Money.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Money.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Enums; public record Money diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/PlayerSide.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/PlayerSide.cs index 74db6c64..7a5b5e68 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/PlayerSide.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/PlayerSide.cs @@ -8,5 +8,5 @@ public enum PlayerSide { Usec = 1, Bear = 2, - Savage = 4 + Savage = 4, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/PlayersSpawnPlace.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/PlayersSpawnPlace.cs index 3a19d50e..f339410c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/PlayersSpawnPlace.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/PlayersSpawnPlace.cs @@ -7,5 +7,5 @@ public enum PlayersSpawnPlace { SamePlace, DifferentPlaces, - AtTheEndsOfTheMap + AtTheEndsOfTheMap, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ProfileStatus.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ProfileStatus.cs index 7d18d697..38dcde60 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ProfileStatus.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ProfileStatus.cs @@ -6,5 +6,5 @@ public enum ProfileStatus MATCH_WAIT, BUSY, LEAVING, - TRANSFER + TRANSFER, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/QuestStatusEnum.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/QuestStatusEnum.cs index 14bec0f5..af2fb47a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/QuestStatusEnum.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/QuestStatusEnum.cs @@ -14,5 +14,5 @@ public enum QuestStatusEnum FailRestartable = 6, MarkedAsFailed = 7, Expired = 8, - AvailableAfter = 9 + AvailableAfter = 9, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/QuestTypeEnum.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/QuestTypeEnum.cs index f1311b63..c5bbf834 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/QuestTypeEnum.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/QuestTypeEnum.cs @@ -17,5 +17,5 @@ public enum QuestTypeEnum Merchant, Skill, Multi, - WeaponAssembly + WeaponAssembly, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RagfairSort.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RagfairSort.cs index 86652433..4ae2d2ad 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RagfairSort.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RagfairSort.cs @@ -7,5 +7,5 @@ public enum RagfairSort RATING = 3, OFFER_TITLE = 4, PRICE = 5, - EXPIRY = 6 + EXPIRY = 6, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidMode.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidMode.cs index af0b062f..4d4ad090 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidMode.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidMode.cs @@ -4,5 +4,5 @@ public enum RaidMode { ONLINE, LOCAL, - COOP + COOP, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotAmount.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotAmount.cs index 203b8f1d..623b11c0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotAmount.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotAmount.cs @@ -7,5 +7,5 @@ public enum BotAmount Low, Medium, High, - Horde + Horde, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotDifficulty.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotDifficulty.cs index b987d1f6..2f6e6627 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotDifficulty.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/BotDifficulty.cs @@ -7,5 +7,5 @@ public enum BotDifficulty Medium, Hard, Impossible, - Random + Random, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/CloudinessType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/CloudinessType.cs index 3d04a1b4..7f8e5a69 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/CloudinessType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/CloudinessType.cs @@ -7,5 +7,5 @@ public enum CloudinessType CLOUDY, CLOUDY_WITH_GAPS, HEAVY_CLOUD_COVER, - THUNDER_CLOUD + THUNDER_CLOUD, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/FogType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/FogType.cs index 3cb9103e..ab17e9e5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/FogType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/FogType.cs @@ -6,5 +6,5 @@ public enum FogType Faint, Fog, Heavy, - Continuous + Continuous, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/RainType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/RainType.cs index 630207fa..9e48fb58 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/RainType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/RainType.cs @@ -6,5 +6,5 @@ public enum RainType Drizzling, Rain, Heavy, - Shower + Shower, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/TimeFlowType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/TimeFlowType.cs index 2e050fb4..b1a04ec3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/TimeFlowType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/TimeFlowType.cs @@ -9,5 +9,5 @@ public enum TimeFlowType x1, x2, x4, - x8 + x8, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/WindSpeed.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/WindSpeed.cs index 69cf9313..fadd6f49 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/WindSpeed.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RaidSettings/TimeAndWeather/WindSpeed.cs @@ -6,5 +6,5 @@ public enum WindSpeed Moderate, Strong, VeryStrong, - Hurricane + Hurricane, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ReloadMode.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ReloadMode.cs index 66dd41cf..97a257e9 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ReloadMode.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ReloadMode.cs @@ -5,5 +5,5 @@ public enum ReloadMode ExternalMagazine, InternalMagazine, OnlyBarrel, - ExternalMagazineWithInternalReloadSupport + ExternalMagazineWithInternalReloadSupport, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RepairStrategyType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RepairStrategyType.cs index 473cc5a7..d59baba7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RepairStrategyType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RepairStrategyType.cs @@ -7,5 +7,5 @@ public enum RepairStrategyType { MeleeWeapon, Firearms, - Armor + Armor, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RequirementState.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RequirementState.cs index b926f02c..b10a66d7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RequirementState.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RequirementState.cs @@ -18,5 +18,5 @@ public enum RequirementState ScavCooperation, Train, Timer, - SecretTransferItem + SecretTransferItem, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/RewardType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/RewardType.cs index 232f957f..48706824 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/RewardType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/RewardType.cs @@ -28,5 +28,5 @@ public enum RewardType Customization = 116, BattlePassExperience, BattlePassCurrency, - ArenaArmoryItem = 100 + ArenaArmoryItem = 100, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/Season.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/Season.cs index 5fa0d231..8dec583e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/Season.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/Season.cs @@ -8,5 +8,5 @@ public enum Season SPRING = 3, AUTUMN_LATE = 4, SPRING_EARLY = 5, - STORM = 6 + STORM = 6, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/SeasonalEventType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/SeasonalEventType.cs index 418ff1bb..b13a05da 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/SeasonalEventType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/SeasonalEventType.cs @@ -10,5 +10,5 @@ public enum SeasonalEventType Halloween, NewYears, Promo, - AprilFools + AprilFools, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/SideType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/SideType.cs index 2f69a3f3..fbba46ab 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/SideType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/SideType.cs @@ -7,5 +7,5 @@ public enum SideType { Pmc, Savage, - Random + Random, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/SkillClass.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/SkillClass.cs index feba9443..db68a144 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/SkillClass.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/SkillClass.cs @@ -9,6 +9,6 @@ namespace SPTarkov.Server.Core.Models.Enums Combat, Special, Practical, - Mental + Mental, } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/SkillTypes.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/SkillTypes.cs index dced80f3..6122023c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/SkillTypes.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/SkillTypes.cs @@ -50,6 +50,7 @@ public enum SkillTypes SilentOps, Lockpicking, Search, + // Also called Weapon Maintenance WeaponTreatment, Freetrading, @@ -72,5 +73,5 @@ public enum SkillTypes BotSound, AimDrills, HideoutManagement, - Crafting = 66 + Crafting = 66, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/ThrowWeapType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/ThrowWeapType.cs index 8f13b877..983ddc00 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/ThrowWeapType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/ThrowWeapType.cs @@ -11,5 +11,5 @@ public enum ThrowWeapType smoke_grenade, gas_grenade, incendiary_grenade, - sonar + sonar, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/TraderServiceType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/TraderServiceType.cs index 2fae19c0..d17487e7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/TraderServiceType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/TraderServiceType.cs @@ -11,5 +11,5 @@ public enum TraderServiceType BtrItemsDelivery, PlayerTaxi, BtrBotCover, - TransitItemsDelivery + TransitItemsDelivery, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/TransitionType.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/TransitionType.cs index 87c7b1a3..4ada3029 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/TransitionType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/TransitionType.cs @@ -4,5 +4,5 @@ public enum TransitionType { NONE = 0, COMMON = 1, - EVENT = 2 + EVENT = 2, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Enums/WindDirection.cs b/Libraries/SPTarkov.Server.Core/Models/Enums/WindDirection.cs index 1d8589de..941be738 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Enums/WindDirection.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Enums/WindDirection.cs @@ -9,5 +9,5 @@ public enum WindDirection SE = 5, SW = 6, NW = 7, - NE = 8 + NE = 8, } diff --git a/Libraries/SPTarkov.Server.Core/Models/External/IPostDBLoadModAsync.cs b/Libraries/SPTarkov.Server.Core/Models/External/IPostDBLoadModAsync.cs index 1880389d..095c189f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/External/IPostDBLoadModAsync.cs +++ b/Libraries/SPTarkov.Server.Core/Models/External/IPostDBLoadModAsync.cs @@ -14,7 +14,9 @@ namespace SPTarkov.Server.Core.Models.External; /// /// DEPRECATED, see code example above for replacement! /// -[Obsolete("This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples.")] +[Obsolete( + "This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples." +)] public interface IPostDBLoadModAsync { Task PostDBLoadAsync(); diff --git a/Libraries/SPTarkov.Server.Core/Models/External/IPostSptLoadModAsync.cs b/Libraries/SPTarkov.Server.Core/Models/External/IPostSptLoadModAsync.cs index f468c03e..3e4765f4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/External/IPostSptLoadModAsync.cs +++ b/Libraries/SPTarkov.Server.Core/Models/External/IPostSptLoadModAsync.cs @@ -14,7 +14,9 @@ namespace SPTarkov.Server.Core.Models.External; /// /// DEPRECATED, see code example above for replacement! /// -[Obsolete("This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples.")] +[Obsolete( + "This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples." +)] public interface IPostSptLoadModAsync { Task PostSptLoadAsync(); diff --git a/Libraries/SPTarkov.Server.Core/Models/External/IPreSptLoadModAsync.cs b/Libraries/SPTarkov.Server.Core/Models/External/IPreSptLoadModAsync.cs index c319de3a..3db35e77 100644 --- a/Libraries/SPTarkov.Server.Core/Models/External/IPreSptLoadModAsync.cs +++ b/Libraries/SPTarkov.Server.Core/Models/External/IPreSptLoadModAsync.cs @@ -14,7 +14,9 @@ namespace SPTarkov.Server.Core.Models.External; /// /// DEPRECATED, see code example above for replacement! /// -[Obsolete("This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples.")] +[Obsolete( + "This interface is obsolete and will be removed in 4.1.0, please use IOnLoad instead with the desired Injectable(TypePriority). See class documentation for examples." +)] public interface IPreSptLoadModAsync { Task PreSptLoadAsync(); diff --git a/Libraries/SPTarkov.Server.Core/Models/Logging/LogBackgroundColor.cs b/Libraries/SPTarkov.Server.Core/Models/Logging/LogBackgroundColor.cs index 31ac44c3..4551e73d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Logging/LogBackgroundColor.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Logging/LogBackgroundColor.cs @@ -13,5 +13,5 @@ public enum LogBackgroundColor Magenta = 45, Cyan = 46, White = 47, - Default = 49 + Default = 49, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Logging/LogTextColor.cs b/Libraries/SPTarkov.Server.Core/Models/Logging/LogTextColor.cs index 8198a180..326fde55 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Logging/LogTextColor.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Logging/LogTextColor.cs @@ -13,5 +13,5 @@ public enum LogTextColor Magenta = 35, Cyan = 36, White = 37, - Gray = 90 + Gray = 90, } diff --git a/Libraries/SPTarkov.Server.Core/Models/RadioStationType.cs b/Libraries/SPTarkov.Server.Core/Models/RadioStationType.cs index 19be1aae..f6a28320 100644 --- a/Libraries/SPTarkov.Server.Core/Models/RadioStationType.cs +++ b/Libraries/SPTarkov.Server.Core/Models/RadioStationType.cs @@ -15,5 +15,5 @@ public enum RadioStationType LoFi, Metal, Punk, - Pop + Pop, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs index 22ffc299..ad12efab 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs @@ -8,33 +8,13 @@ public record BotDetailsForChatMessages [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string Nickname - { - get; - set; - } = string.Empty; + public string Nickname { get; set; } = string.Empty; - public DogtagSide Side - { - get; - set; - } + public DogtagSide Side { get; set; } - public int? Aid - { - get; - set; - } + public int? Aid { get; set; } - public int? Level - { - get; - set; - } + public int? Level { get; set; } - public MemberCategory? Type - { - get; - set; - } + public MemberCategory? Type { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs index 2543ac8c..da610084 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs @@ -12,120 +12,68 @@ public record BotGenerationDetails /// Should the bot be generated as a PMC /// [JsonPropertyName("isPmc")] - public bool? IsPmc - { - get; - set; - } + public bool? IsPmc { get; set; } /// /// assault/pmcBot etc /// [JsonPropertyName("role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } /// /// Side of bot /// [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } /// /// Active players current level /// [JsonPropertyName("playerLevel")] - public int? PlayerLevel - { - get; - set; - } + public int? PlayerLevel { get; set; } [JsonPropertyName("playerName")] - public string? PlayerName - { - get; - set; - } + public string? PlayerName { get; set; } /// /// Level specific overrides for PMC level /// [JsonPropertyName("locationSpecificPmcLevelOverride")] - public MinMax? LocationSpecificPmcLevelOverride - { - get; - set; - } + public MinMax? LocationSpecificPmcLevelOverride { get; set; } /// /// Delta of highest level of bot e.g. 50 means 50 levels above player /// [JsonPropertyName("botRelativeLevelDeltaMax")] - public int? BotRelativeLevelDeltaMax - { - get; - set; - } + public int? BotRelativeLevelDeltaMax { get; set; } /// /// Delta of lowest level of bot e.g. 50 means 50 levels below player /// [JsonPropertyName("botRelativeLevelDeltaMin")] - public int? BotRelativeLevelDeltaMin - { - get; - set; - } + public int? BotRelativeLevelDeltaMin { get; set; } /// /// How many to create and store /// [JsonPropertyName("botCountToGenerate")] - public int? BotCountToGenerate - { - get; - set; - } + public int? BotCountToGenerate { get; set; } /// /// Desired difficulty of the bot /// [JsonPropertyName("botDifficulty")] - public string? BotDifficulty - { - get; - set; - } + public string? BotDifficulty { get; set; } /// /// Will the generated bot be a player scav /// [JsonPropertyName("isPlayerScav")] - public bool? IsPlayerScav - { - get; - set; - } + public bool? IsPlayerScav { get; set; } [JsonPropertyName("eventRole")] - public string? EventRole - { - get; - set; - } + public string? EventRole { get; set; } [JsonPropertyName("allPmcsHaveSameNameAsPlayer")] - public bool? AllPmcsHaveSameNameAsPlayer - { - get; - set; - } + public bool? AllPmcsHaveSameNameAsPlayer { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs index 01dfa99e..f800e0c5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs @@ -8,95 +8,43 @@ public record BotLootCache public Dictionary ExtensionData { get; set; } [JsonPropertyName("backpackLoot")] - public Dictionary BackpackLoot - { - get; - set; - } = []; + public Dictionary BackpackLoot { get; set; } = []; [JsonPropertyName("pocketLoot")] - public Dictionary PocketLoot - { - get; - set; - } = []; + public Dictionary PocketLoot { get; set; } = []; [JsonPropertyName("vestLoot")] - public Dictionary VestLoot - { - get; - set; - } = []; + public Dictionary VestLoot { get; set; } = []; [JsonPropertyName("secureLoot")] - public Dictionary SecureLoot - { - get; - set; - } = []; + public Dictionary SecureLoot { get; set; } = []; [JsonPropertyName("combinedPoolLoot")] - public Dictionary CombinedPoolLoot - { - get; - set; - } = []; + public Dictionary CombinedPoolLoot { get; set; } = []; [JsonPropertyName("specialItems")] - public Dictionary SpecialItems - { - get; - set; - } = []; + public Dictionary SpecialItems { get; set; } = []; [JsonPropertyName("healingItems")] - public Dictionary HealingItems - { - get; - set; - } = []; + public Dictionary HealingItems { get; set; } = []; [JsonPropertyName("drugItems")] - public Dictionary DrugItems - { - get; - set; - } = []; + public Dictionary DrugItems { get; set; } = []; [JsonPropertyName("foodItems")] - public Dictionary FoodItems - { - get; - set; - } = []; + public Dictionary FoodItems { get; set; } = []; [JsonPropertyName("drinkItems")] - public Dictionary DrinkItems - { - get; - set; - } = []; + public Dictionary DrinkItems { get; set; } = []; [JsonPropertyName("currencyItems")] - public Dictionary CurrencyItems - { - get; - set; - } = []; + public Dictionary CurrencyItems { get; set; } = []; [JsonPropertyName("stimItems")] - public Dictionary StimItems - { - get; - set; - } = []; + public Dictionary StimItems { get; set; } = []; [JsonPropertyName("grenadeItems")] - public Dictionary GrenadeItems - { - get; - set; - } = []; + public Dictionary GrenadeItems { get; set; } = []; } public record LootCacheType diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs index 0416c1af..cfef04f5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs @@ -9,23 +9,11 @@ public record Bots public Dictionary ExtensionData { get; set; } [JsonPropertyName("types")] - public Dictionary? Types - { - get; - set; - } + public Dictionary? Types { get; set; } [JsonPropertyName("base")] - public BotBase? Base - { - get; - set; - } + public BotBase? Base { get; set; } [JsonPropertyName("core")] - public Dictionary? Core - { - get; - set; - } + public Dictionary? Core { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ChooseRandomCompatibleModResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ChooseRandomCompatibleModResult.cs index 9b0715a7..21b10eec 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ChooseRandomCompatibleModResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ChooseRandomCompatibleModResult.cs @@ -8,37 +8,17 @@ public record ChooseRandomCompatibleModResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("incompatible")] - public bool? Incompatible - { - get; - set; - } + public bool? Incompatible { get; set; } [JsonPropertyName("found")] - public bool? Found - { - get; - set; - } + public bool? Found { get; set; } [JsonPropertyName("chosenTpl")] - public string? ChosenTemplate - { - get; - set; - } + public string? ChosenTemplate { get; set; } [JsonPropertyName("reason")] - public string? Reason - { - get; - set; - } + public string? Reason { get; set; } [JsonPropertyName("slotBlocked")] - public bool? SlotBlocked - { - get; - set; - } + public bool? SlotBlocked { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/FilterPlateModsForSlotByLevelResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/FilterPlateModsForSlotByLevelResult.cs index bf88ae54..1e08ff38 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/FilterPlateModsForSlotByLevelResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/FilterPlateModsForSlotByLevelResult.cs @@ -8,18 +8,10 @@ public record FilterPlateModsForSlotByLevelResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("result")] - public Result? Result - { - get; - set; - } + public Result? Result { get; set; } [JsonPropertyName("plateModTpls")] - public HashSet? PlateModTemplates - { - get; - set; - } + public HashSet? PlateModTemplates { get; set; } } public enum Result @@ -28,5 +20,5 @@ public enum Result SUCCESS = 1, NO_DEFAULT_FILTER = 2, NOT_PLATE_HOLDING_SLOT = 3, - LACKS_PLATE_WEIGHTS = 4 + LACKS_PLATE_WEIGHTS = 4, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateEquipmentProperties.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateEquipmentProperties.cs index 1fa30122..91b1e0c6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateEquipmentProperties.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateEquipmentProperties.cs @@ -14,87 +14,47 @@ public record GenerateEquipmentProperties /// Root Slot being generated /// [JsonPropertyName("rootEquipmentSlot")] - public EquipmentSlots RootEquipmentSlot - { - get; - set; - } + public EquipmentSlots RootEquipmentSlot { get; set; } /// /// Equipment pool for root slot being generated /// [JsonPropertyName("rootEquipmentPool")] - public Dictionary? RootEquipmentPool - { - get; - set; - } + public Dictionary? RootEquipmentPool { get; set; } [JsonPropertyName("modPool")] - public GlobalMods? ModPool - { - get; - set; - } + public GlobalMods? ModPool { get; set; } /// /// Dictionary of mod items and their chance to spawn for this bot type /// [JsonPropertyName("spawnChances")] - public Chances? SpawnChances - { - get; - set; - } + public Chances? SpawnChances { get; set; } /// /// Bot-specific properties /// [JsonPropertyName("botData")] - public BotData? BotData - { - get; - set; - } + public BotData? BotData { get; set; } [JsonPropertyName("inventory")] - public BotBaseInventory? Inventory - { - get; - set; - } + public BotBaseInventory? Inventory { get; set; } [JsonPropertyName("botEquipmentConfig")] - public EquipmentFilters? BotEquipmentConfig - { - get; - set; - } + public EquipmentFilters? BotEquipmentConfig { get; set; } /// /// Settings from bot.json to adjust how item is generated /// [JsonPropertyName("randomisationDetails")] - public RandomisationDetails? RandomisationDetails - { - get; - set; - } + public RandomisationDetails? RandomisationDetails { get; set; } /// /// OPTIONAL - Do not generate mods for tpls in this array /// [JsonPropertyName("generateModsBlacklist")] - public HashSet? GenerateModsBlacklist - { - get; - set; - } + public HashSet? GenerateModsBlacklist { get; set; } [JsonPropertyName("generatingPlayerLevel")] - public double? GeneratingPlayerLevel - { - get; - set; - } + public double? GeneratingPlayerLevel { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponRequest.cs index 801ecf45..1e99a182 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponRequest.cs @@ -12,101 +12,61 @@ public record GenerateWeaponRequest /// Weapon to add mods to / result that is returned /// [JsonPropertyName("weapon")] - public List? Weapon - { - get; - set; - } + public List? Weapon { get; set; } /// /// Pool of compatible mods to attach to weapon /// [JsonPropertyName("modPool")] - public GlobalMods? ModPool - { - get; - set; - } + public GlobalMods? ModPool { get; set; } /// /// ParentId of weapon /// [JsonPropertyName("weaponId")] - public string? WeaponId - { - get; - set; - } + public string? WeaponId { get; set; } /// /// Weapon which mods will be generated on /// [JsonPropertyName("parentTemplate")] - public TemplateItem? ParentTemplate - { - get; - set; - } + public TemplateItem? ParentTemplate { get; set; } /// /// Chance values mod will be added /// [JsonPropertyName("modSpawnChances")] - public Dictionary? ModSpawnChances - { - get; - set; - } + public Dictionary? ModSpawnChances { get; set; } /// /// Ammo tpl to use when generating magazines/cartridges /// [JsonPropertyName("ammoTpl")] - public string? AmmoTpl - { - get; - set; - } + public string? AmmoTpl { get; set; } /// /// Bot-specific properties /// [JsonPropertyName("botData")] - public BotData? BotData - { - get; - set; - } + public BotData? BotData { get; set; } /// /// limits placed on certain mod types per gun /// [JsonPropertyName("modLimits")] - public BotModLimits? ModLimits - { - get; - set; - } + public BotModLimits? ModLimits { get; set; } /// /// Info related to the weapon being generated /// [JsonPropertyName("weaponStats")] - public WeaponStats? WeaponStats - { - get; - set; - } + public WeaponStats? WeaponStats { get; set; } /// /// Array of item tpls the weapon does not support /// [JsonPropertyName("conflictingItemTpls")] - public HashSet? ConflictingItemTpls - { - get; - set; - } + public HashSet? ConflictingItemTpls { get; set; } } public record BotData @@ -118,31 +78,19 @@ public record BotData /// Role of bot weapon is generated for /// [JsonPropertyName("role")] - public string? Role - { - get; - set; - } + public string? Role { get; set; } /// /// Level of the bot weapon is being generated for /// [JsonPropertyName("level")] - public int? Level - { - get; - set; - } + public int? Level { get; set; } /// /// role of bot when accessing bot.json equipment config settings /// [JsonPropertyName("equipmentRole")] - public string? EquipmentRole - { - get; - set; - } + public string? EquipmentRole { get; set; } } public record WeaponStats @@ -151,25 +99,13 @@ public record WeaponStats public Dictionary ExtensionData { get; set; } [JsonPropertyName("hasOptic")] - public bool? HasOptic - { - get; - set; - } + public bool? HasOptic { get; set; } [JsonPropertyName("hasFrontIronSight")] - public bool? HasFrontIronSight - { - get; - set; - } + public bool? HasFrontIronSight { get; set; } [JsonPropertyName("hasRearIronSight")] - public bool? HasRearIronSight - { - get; - set; - } + public bool? HasRearIronSight { get; set; } } public record BotModLimits @@ -178,46 +114,22 @@ public record BotModLimits public Dictionary ExtensionData { get; set; } [JsonPropertyName("scope")] - public ItemCount? Scope - { - get; - set; - } + public ItemCount? Scope { get; set; } [JsonPropertyName("scopeMax")] - public int? ScopeMax - { - get; - set; - } + public int? ScopeMax { get; set; } [JsonPropertyName("scopeBaseTypes")] - public List? ScopeBaseTypes - { - get; - set; - } + public List? ScopeBaseTypes { get; set; } [JsonPropertyName("flashlightLaser")] - public ItemCount? FlashlightLaser - { - get; - set; - } + public ItemCount? FlashlightLaser { get; set; } [JsonPropertyName("flashlightLaserMax")] - public int? FlashlightLaserMax - { - get; - set; - } + public int? FlashlightLaserMax { get; set; } [JsonPropertyName("flashlightLaserBaseTypes")] - public List? FlashlightLaserBaseTypes - { - get; - set; - } + public List? FlashlightLaserBaseTypes { get; set; } } public record ItemCount @@ -226,9 +138,5 @@ public record ItemCount public Dictionary ExtensionData { get; set; } [JsonPropertyName("count")] - public int? Count - { - get; - set; - } + public int? Count { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponResult.cs index e6638a82..19f380b3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/GenerateWeaponResult.cs @@ -9,37 +9,17 @@ public record GenerateWeaponResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("weapon")] - public List? Weapon - { - get; - set; - } + public List? Weapon { get; set; } [JsonPropertyName("chosenAmmoTpl")] - public string? ChosenAmmoTemplate - { - get; - set; - } + public string? ChosenAmmoTemplate { get; set; } [JsonPropertyName("chosenUbglAmmoTpl")] - public string? ChosenUbglAmmoTemplate - { - get; - set; - } + public string? ChosenUbglAmmoTemplate { get; set; } [JsonPropertyName("weaponMods")] - public GlobalMods? WeaponMods - { - get; - set; - } + public GlobalMods? WeaponMods { get; set; } [JsonPropertyName("weaponTemplate")] - public TemplateItem? WeaponTemplate - { - get; - set; - } + public TemplateItem? WeaponTemplate { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ItemSpawnLimitSettings.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ItemSpawnLimitSettings.cs index 7fca75b2..17124fb6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ItemSpawnLimitSettings.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ItemSpawnLimitSettings.cs @@ -8,16 +8,8 @@ public record ItemSpawnLimitSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("currentLimits")] - public Dictionary? CurrentLimits - { - get; - set; - } + public Dictionary? CurrentLimits { get; set; } [JsonPropertyName("globalLimits")] - public Dictionary? GlobalLimits - { - get; - set; - } + public Dictionary? GlobalLimits { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ModToSpawnRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ModToSpawnRequest.cs index 644b3e6a..326da149 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ModToSpawnRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/ModToSpawnRequest.cs @@ -14,123 +14,71 @@ public record ModToSpawnRequest /// Slot mod will fit into /// [JsonPropertyName("modSlot")] - public string? ModSlot - { - get; - set; - } + public string? ModSlot { get; set; } /// /// Will generate a randomised mod pool if true /// [JsonPropertyName("isRandomisableSlot")] - public bool? IsRandomisableSlot - { - get; - set; - } + public bool? IsRandomisableSlot { get; set; } [JsonPropertyName("randomisationSettings")] - public RandomisationDetails? RandomisationSettings - { - get; - set; - } + public RandomisationDetails? RandomisationSettings { get; set; } /// /// Parent slot the item will be a part of /// [JsonPropertyName("botWeaponSightWhitelist")] - public Dictionary>? BotWeaponSightWhitelist - { - get; - set; - } + public Dictionary>? BotWeaponSightWhitelist { get; set; } /// /// Blacklist to prevent mods from being picked /// [JsonPropertyName("botEquipBlacklist")] - public EquipmentFilterDetails? BotEquipBlacklist - { - get; - set; - } + public EquipmentFilterDetails? BotEquipBlacklist { get; set; } /// /// Pool of items to pick from /// [JsonPropertyName("itemModPool")] - public Dictionary>? ItemModPool - { - get; - set; - } + public Dictionary>? ItemModPool { get; set; } /// /// List with only weapon tpl in it, ready for mods to be added /// [JsonPropertyName("weapon")] - public List? Weapon - { - get; - set; - } + public List? Weapon { get; set; } /// /// Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) /// [JsonPropertyName("ammoTpl")] - public string? AmmoTpl - { - get; - set; - } + public string? AmmoTpl { get; set; } /// /// Parent item the mod will go into /// [JsonPropertyName("parentTemplate")] - public TemplateItem? ParentTemplate - { - get; - set; - } + public TemplateItem? ParentTemplate { get; set; } /// /// Should mod be spawned/skipped/use default /// [JsonPropertyName("modSpawnResult")] - public ModSpawn? ModSpawnResult - { - get; - set; - } + public ModSpawn? ModSpawnResult { get; set; } /// /// Weapon stats for weapon being generated /// [JsonPropertyName("weaponStats")] - public WeaponStats? WeaponStats - { - get; - set; - } + public WeaponStats? WeaponStats { get; set; } /// /// List of item tpls the weapon does not support /// [JsonPropertyName("conflictingItemTpls")] - public HashSet? ConflictingItemTpls - { - get; - set; - } + public HashSet? ConflictingItemTpls { get; set; } [JsonPropertyName("botData")] - public BotData? BotData - { - get; - set; - } + public BotData? BotData { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs index 8a48e3ae..38cdc050 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs @@ -7,35 +7,19 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record AirdropConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-airdrop"; + public override string Kind { get; set; } = "spt-airdrop"; [JsonPropertyName("airdropTypeWeightings")] - public required Dictionary AirdropTypeWeightings - { - get; - set; - } + public required Dictionary AirdropTypeWeightings { get; set; } /// /// What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter /// [JsonPropertyName("loot")] - public required Dictionary Loot - { - get; - set; - } + public required Dictionary Loot { get; set; } [JsonPropertyName("customAirdropMapping")] - public required Dictionary CustomAirdropMapping - { - get; - set; - } + public required Dictionary CustomAirdropMapping { get; set; } } /// @@ -48,137 +32,77 @@ public record AirdropLoot [JsonPropertyName("icon")] [JsonConverter(typeof(JsonStringEnumConverter))] - public required AirdropTypeEnum Icon - { - get; - set; - } + public required AirdropTypeEnum Icon { get; set; } /// /// Min/max of weapons inside crate /// [JsonPropertyName("weaponPresetCount")] - public required MinMax WeaponPresetCount - { - get; - set; - } + public required MinMax WeaponPresetCount { get; set; } /// /// Min/max of armors (head/chest/rig) inside crate /// [JsonPropertyName("armorPresetCount")] - public required MinMax ArmorPresetCount - { - get; - set; - } + public required MinMax ArmorPresetCount { get; set; } /// /// Min/max of items inside crate /// [JsonPropertyName("itemCount")] - public required MinMax ItemCount - { - get; - set; - } + public required MinMax ItemCount { get; set; } /// /// Min/max of sealed weapon boxes inside crate /// [JsonPropertyName("weaponCrateCount")] - public required MinMax WeaponCrateCount - { - get; - set; - } + public required MinMax WeaponCrateCount { get; set; } /// /// Items to never allow - tpls /// [JsonPropertyName("itemBlacklist")] - public required List ItemBlacklist - { - get; - set; - } + public required List ItemBlacklist { get; set; } /// /// Item type (parentId) to allow inside crate /// [JsonPropertyName("itemTypeWhitelist")] - public required List ItemTypeWhitelist - { - get; - set; - } + public required List ItemTypeWhitelist { get; set; } /// /// Item type/ item tpls to limit count of inside crate - key: item base type: value: max count /// [JsonPropertyName("itemLimits")] - public required Dictionary ItemLimits - { - get; - set; - } + public required Dictionary ItemLimits { get; set; } /// /// Items to limit stack size of key: item tpl value: min/max stack size /// [JsonPropertyName("itemStackLimits")] - public required Dictionary> ItemStackLimits - { - get; - set; - } + public required Dictionary> ItemStackLimits { get; set; } /// /// Armor levels to allow inside crate e.g. [4,5,6] /// [JsonPropertyName("armorLevelWhitelist")] - public List? ArmorLevelWhitelist - { - get; - set; - } + public List? ArmorLevelWhitelist { get; set; } /// /// Should boss items be added to airdrop crate /// [JsonPropertyName("allowBossItems")] - public bool AllowBossItems - { - get; - set; - } + public bool AllowBossItems { get; set; } [JsonPropertyName("useForcedLoot")] - public bool UseForcedLoot - { - get; - set; - } + public bool UseForcedLoot { get; set; } [JsonPropertyName("forcedLoot")] - public Dictionary>? ForcedLoot - { - get; - set; - } + public Dictionary>? ForcedLoot { get; set; } [JsonPropertyName("useRewardItemBlacklist")] - public bool UseRewardItemBlacklist - { - get; - set; - } + public bool UseRewardItemBlacklist { get; set; } [JsonPropertyName("blockSeasonalItemsOutOfSeason")] - public bool BlockSeasonalItemsOutOfSeason - { - get; - set; - } + public bool BlockSeasonalItemsOutOfSeason { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs index a7b8912a..6166fb34 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs @@ -5,39 +5,19 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BackupConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-backup"; + public override string Kind { get; set; } = "spt-backup"; [JsonPropertyName("enabled")] - public required bool Enabled - { - get; - set; - } + public required bool Enabled { get; set; } [JsonPropertyName("maxBackups")] - public int MaxBackups - { - get; - set; - } + public int MaxBackups { get; set; } [JsonPropertyName("directory")] - public string Directory - { - get; - set; - } = string.Empty; + public string Directory { get; set; } = string.Empty; [JsonPropertyName("backupInterval")] - public required BackupConfigInterval BackupInterval - { - get; - set; - } + public required BackupConfigInterval BackupInterval { get; set; } } public record BackupConfigInterval @@ -46,16 +26,8 @@ public record BackupConfigInterval public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } [JsonPropertyName("intervalMinutes")] - public int IntervalMinutes - { - get; - set; - } + public int IntervalMinutes { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs index fe172622..ef079711 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs @@ -5,11 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public abstract record BaseConfig { [JsonPropertyName("kind")] - public abstract string Kind - { - get; - set; - } + public abstract string Kind { get; set; } } public record RunIntervalValues @@ -18,16 +14,8 @@ public record RunIntervalValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("inRaid")] - public int InRaid - { - get; - set; - } + public int InRaid { get; set; } [JsonPropertyName("outOfRaid")] - public int OutOfRaid - { - get; - set; - } + public int OutOfRaid { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs index 09bc6576..aa784e34 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs @@ -8,62 +8,41 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BotConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-bot"; + public override string Kind { get; set; } = "spt-bot"; /// /// How many variants of each bot should be generated on raid start /// [JsonPropertyName("presetBatch")] - public required Dictionary PresetBatch - { - get; - set; - } + public required Dictionary PresetBatch { get; set; } /// /// What bot types should be classified as bosses /// [JsonPropertyName("bosses")] - public required List Bosses - { - get; - set; - } + public required List Bosses { get; set; } /// /// Control weapon/armor durability min/max values for each bot type /// [JsonPropertyName("durability")] - public required BotDurability Durability - { - get; - set; - } + public required BotDurability Durability { get; set; } /// /// Controls the percentage values of randomization item resources /// [JsonPropertyName("lootItemResourceRandomization")] - public required Dictionary LootItemResourceRandomization - { - get; - set; - } + public required Dictionary< + string, + RandomisedResourceDetails + > LootItemResourceRandomization { get; set; } /// /// Control what bots are added to a bots revenge list
/// key: bottype, value: bottypes to revenge on seeing their death ///
[JsonPropertyName("revenge")] - public required Dictionary> Revenge - { - get; - set; - } + public required Dictionary> Revenge { get; set; } /// /// Control how many items are allowed to spawn on a bot
@@ -71,151 +50,94 @@ public record BotConfig : BaseConfig /// key: itemTpl: value: max item count> ///
[JsonPropertyName("itemSpawnLimits")] - public required Dictionary> ItemSpawnLimits - { - get; - set; - } + public required Dictionary> ItemSpawnLimits { get; set; } /// /// Blacklist/whitelist items on a bot /// [JsonPropertyName("equipment")] - public required Dictionary Equipment - { - get; - set; - } + public required Dictionary Equipment { get; set; } /// /// Show a bots botType value after their name /// [JsonPropertyName("showTypeInNickname")] - public bool ShowTypeInNickname - { - get; - set; - } + public bool ShowTypeInNickname { get; set; } /// /// What ai brain should a normal scav use per map /// [JsonPropertyName("assaultBrainType")] - public required Dictionary> AssaultBrainType - { - get; - set; - } + public required Dictionary> AssaultBrainType { get; set; } /// /// What ai brain should a player scav use per map /// [JsonPropertyName("playerScavBrainType")] - public required Dictionary> PlayerScavBrainType - { - get; - set; - } + public required Dictionary> PlayerScavBrainType { get; set; } /// /// Max number of bots that can be spawned in a raid at any one time /// [JsonPropertyName("maxBotCap")] - public required Dictionary MaxBotCap - { - get; - set; - } + public required Dictionary MaxBotCap { get; set; } /// /// Chance scav has fake pscav name e.g. Scav name (player name) /// [JsonPropertyName("chanceAssaultScavHasPlayerScavName")] - public int ChanceAssaultScavHasPlayerScavName - { - get; - set; - } + public int ChanceAssaultScavHasPlayerScavName { get; set; } /// /// How many stacks of secret ammo should a bot have in its bot secure container /// [JsonPropertyName("secureContainerAmmoStackCount")] - public int SecureContainerAmmoStackCount - { - get; - set; - } + public int SecureContainerAmmoStackCount { get; set; } /// /// Bot roles in this array will be given a dog tag on generation /// [JsonPropertyName("botRolesWithDogTags")] - public required HashSet BotRolesWithDogTags - { - get; - set; - } + public required HashSet BotRolesWithDogTags { get; set; } /// /// Settings to control the items that get added into wallets on bots /// [JsonPropertyName("walletLoot")] - public required WalletLootSettings WalletLoot - { - get; - set; - } + public required WalletLootSettings WalletLoot { get; set; } /// /// Currency weights, Keyed by botrole / currency /// [JsonPropertyName("currencyStackSize")] - public required Dictionary>> CurrencyStackSize - { - get; - set; - } + public required Dictionary< + string, + Dictionary> + > CurrencyStackSize { get; set; } /// /// Tpls for low profile gas blocks /// [JsonPropertyName("lowProfileGasBlockTpls")] - public required HashSet LowProfileGasBlockTpls - { - get; - set; - } + public required HashSet LowProfileGasBlockTpls { get; set; } /// /// What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ /// [JsonPropertyName("disableLootOnBotTypes")] - public required HashSet DisableLootOnBotTypes - { - get; - set; - } + public required HashSet DisableLootOnBotTypes { get; set; } /// /// Max length a bots name can be /// [JsonPropertyName("botNameLengthLimit")] - public int BotNameLengthLimit - { - get; - set; - } + public int BotNameLengthLimit { get; set; } /// /// Bot roles that must have a unique name when generated vs other bots in raid /// [JsonPropertyName("botRolesThatMustHaveUniqueName")] - public required HashSet BotRolesThatMustHaveUniqueName - { - get; - set; - } + public required HashSet BotRolesThatMustHaveUniqueName { get; set; } } /// @@ -227,319 +149,139 @@ public record PresetBatch public Dictionary ExtensionData { get; set; } [JsonPropertyName("assault")] - public int Assault - { - get; - set; - } + public int Assault { get; set; } [JsonPropertyName("bossBully")] - public int BossBully - { - get; - set; - } + public int BossBully { get; set; } [JsonPropertyName("bossGluhar")] - public int BossGluhar - { - get; - set; - } + public int BossGluhar { get; set; } [JsonPropertyName("bossKilla")] - public int BossKilla - { - get; - set; - } + public int BossKilla { get; set; } [JsonPropertyName("bossKojaniy")] - public int BossKojaniy - { - get; - set; - } + public int BossKojaniy { get; set; } [JsonPropertyName("bossSanitar")] - public int BossSanitar - { - get; - set; - } + public int BossSanitar { get; set; } [JsonPropertyName("bossTagilla")] - public int BossTagilla - { - get; - set; - } + public int BossTagilla { get; set; } [JsonPropertyName("bossKnight")] - public int BossKnight - { - get; - set; - } + public int BossKnight { get; set; } [JsonPropertyName("bossZryachiy")] - public int BossZryachiy - { - get; - set; - } + public int BossZryachiy { get; set; } [JsonPropertyName("bossKolontay")] - public int BossKolontay - { - get; - set; - } + public int BossKolontay { get; set; } [JsonPropertyName("bossPartisan")] - public int BossPartisan - { - get; - set; - } + public int BossPartisan { get; set; } [JsonPropertyName("bossTest")] - public int BossTest - { - get; - set; - } + public int BossTest { get; set; } [JsonPropertyName("cursedAssault")] - public int CursedAssault - { - get; - set; - } + public int CursedAssault { get; set; } [JsonPropertyName("followerBully")] - public int FollowerBully - { - get; - set; - } + public int FollowerBully { get; set; } [JsonPropertyName("followerGluharAssault")] - public int FollowerGluharAssault - { - get; - set; - } + public int FollowerGluharAssault { get; set; } [JsonPropertyName("followerGluharScout")] - public int FollowerGluharScout - { - get; - set; - } + public int FollowerGluharScout { get; set; } [JsonPropertyName("followerGluharSecurity")] - public int FollowerGluharSecurity - { - get; - set; - } + public int FollowerGluharSecurity { get; set; } [JsonPropertyName("followerGluharSnipe")] - public int FollowerGluharSnipe - { - get; - set; - } + public int FollowerGluharSnipe { get; set; } [JsonPropertyName("followerKojaniy")] - public int FollowerKojaniy - { - get; - set; - } + public int FollowerKojaniy { get; set; } [JsonPropertyName("followerSanitar")] - public int FollowerSanitar - { - get; - set; - } + public int FollowerSanitar { get; set; } [JsonPropertyName("followerTagilla")] - public int FollowerTagilla - { - get; - set; - } + public int FollowerTagilla { get; set; } [JsonPropertyName("followerBirdEye")] - public int FollowerBirdEye - { - get; - set; - } + public int FollowerBirdEye { get; set; } [JsonPropertyName("followerBigPipe")] - public int FollowerBigPipe - { - get; - set; - } + public int FollowerBigPipe { get; set; } [JsonPropertyName("followerTest")] - public int FollowerTest - { - get; - set; - } + public int FollowerTest { get; set; } [JsonPropertyName("followerBoar")] - public int FollowerBoar - { - get; - set; - } + public int FollowerBoar { get; set; } [JsonPropertyName("followerBoarClose1")] - public int FollowerBoarClose1 - { - get; - set; - } + public int FollowerBoarClose1 { get; set; } [JsonPropertyName("followerBoarClose2")] - public int FollowerBoarClose2 - { - get; - set; - } + public int FollowerBoarClose2 { get; set; } [JsonPropertyName("followerZryachiy")] - public int FollowerZryachiy - { - get; - set; - } + public int FollowerZryachiy { get; set; } [JsonPropertyName("followerKolontayAssault")] - public int FollowerKolontayAssault - { - get; - set; - } + public int FollowerKolontayAssault { get; set; } [JsonPropertyName("followerKolontaySecurity")] - public int FollowerKolontaySecurity - { - get; - set; - } + public int FollowerKolontaySecurity { get; set; } [JsonPropertyName("marksman")] - public int Marksman - { - get; - set; - } + public int Marksman { get; set; } [JsonPropertyName("pmcBot")] - public int PmcBot - { - get; - set; - } + public int PmcBot { get; set; } [JsonPropertyName("sectantPriest")] - public int SectantPriest - { - get; - set; - } + public int SectantPriest { get; set; } [JsonPropertyName("sectantWarrior")] - public int SectantWarrior - { - get; - set; - } + public int SectantWarrior { get; set; } [JsonPropertyName("gifter")] - public int Gifter - { - get; - set; - } + public int Gifter { get; set; } [JsonPropertyName("test")] - public int Test - { - get; - set; - } + public int Test { get; set; } [JsonPropertyName("exUsec")] - public int ExUsec - { - get; - set; - } + public int ExUsec { get; set; } [JsonPropertyName("arenaFighterEvent")] - public int ArenaFighterEvent - { - get; - set; - } + public int ArenaFighterEvent { get; set; } [JsonPropertyName("arenaFighter")] - public int ArenaFighter - { - get; - set; - } + public int ArenaFighter { get; set; } [JsonPropertyName("crazyAssaultEvent")] - public int CrazyAssaultEvent - { - get; - set; - } + public int CrazyAssaultEvent { get; set; } [JsonPropertyName("bossBoar")] - public int BossBoar - { - get; - set; - } + public int BossBoar { get; set; } [JsonPropertyName("bossBoarSniper")] - public int BossBoarSniper - { - get; - set; - } + public int BossBoarSniper { get; set; } [JsonPropertyName("pmcUSEC")] - public int PmcUSEC - { - get; - set; - } + public int PmcUSEC { get; set; } [JsonPropertyName("pmcBEAR")] - public int PmcBEAR - { - get; - set; - } + public int PmcBEAR { get; set; } [JsonPropertyName("shooterBTR")] - public int ShooterBTR - { - get; - set; - } + public int ShooterBTR { get; set; } } public record WalletLootSettings @@ -551,42 +293,22 @@ public record WalletLootSettings /// Chance wallets have loot in them /// [JsonPropertyName("chancePercent")] - public float ChancePercent - { - get; - set; - } + public float ChancePercent { get; set; } [JsonPropertyName("itemCount")] - public required MinMax ItemCount - { - get; - set; - } + public required MinMax ItemCount { get; set; } [JsonPropertyName("stackSizeWeight")] - public required Dictionary StackSizeWeight - { - get; - set; - } + public required Dictionary StackSizeWeight { get; set; } [JsonPropertyName("currencyWeight")] - public required Dictionary CurrencyWeight - { - get; - set; - } + public required Dictionary CurrencyWeight { get; set; } /// /// What wallets will have money in them /// [JsonPropertyName("walletTplPool")] - public required List WalletTplPool - { - get; - set; - } + public required List WalletTplPool { get; set; } } public record EquipmentFilters @@ -598,182 +320,106 @@ public record EquipmentFilters /// Limits for mod types per weapon .e.g. scopes ///
[JsonPropertyName("weaponModLimits")] - public ModLimits WeaponModLimits - { - get; - set; - } + public ModLimits WeaponModLimits { get; set; } /// /// Whitelist for weapon sight types allowed per gun /// [JsonPropertyName("weaponSightWhitelist")] - public Dictionary> WeaponSightWhitelist - { - get; - set; - } + public Dictionary> WeaponSightWhitelist { get; set; } /// /// Chance face shield is down/active /// [JsonPropertyName("faceShieldIsActiveChancePercent")] - public double? FaceShieldIsActiveChancePercent - { - get; - set; - } + public double? FaceShieldIsActiveChancePercent { get; set; } /// /// Chance gun flashlight is active during the day /// [JsonPropertyName("lightIsActiveDayChancePercent")] - public double? LightIsActiveDayChancePercent - { - get; - set; - } + public double? LightIsActiveDayChancePercent { get; set; } /// /// Chance gun flashlight is active during the night /// [JsonPropertyName("lightIsActiveNightChancePercent")] - public double? LightIsActiveNightChancePercent - { - get; - set; - } + public double? LightIsActiveNightChancePercent { get; set; } /// /// Chance gun laser is active during the day /// [JsonPropertyName("laserIsActiveChancePercent")] - public double? LaserIsActiveChancePercent - { - get; - set; - } + public double? LaserIsActiveChancePercent { get; set; } /// /// Chance NODS are down/active during the day /// [JsonPropertyName("nvgIsActiveChanceDayPercent")] - public double? NvgIsActiveChanceDayPercent - { - get; - set; - } + public double? NvgIsActiveChanceDayPercent { get; set; } /// /// Chance NODS are down/active during the night /// [JsonPropertyName("nvgIsActiveChanceNightPercent")] - public double? NvgIsActiveChanceNightPercent - { - get; - set; - } + public double? NvgIsActiveChanceNightPercent { get; set; } [JsonPropertyName("forceOnlyArmoredRigWhenNoArmor")] - public bool? ForceOnlyArmoredRigWhenNoArmor - { - get; - set; - } + public bool? ForceOnlyArmoredRigWhenNoArmor { get; set; } /// /// Should plates be filtered by level /// [JsonPropertyName("filterPlatesByLevel")] - public bool? FilterPlatesByLevel - { - get; - set; - } + public bool? FilterPlatesByLevel { get; set; } /// /// What additional slot ids should be seen as required when choosing a mod to add to a weapon /// [JsonPropertyName("weaponSlotIdsToMakeRequired")] - public HashSet? WeaponSlotIdsToMakeRequired - { - get; - set; - } + public HashSet? WeaponSlotIdsToMakeRequired { get; set; } /// /// Adjust weighting/chances of items on bot by level of bot /// [JsonPropertyName("randomisation")] - public List Randomisation - { - get; - set; - } + public List Randomisation { get; set; } /// /// Blacklist equipment by level of bot /// [JsonPropertyName("blacklist")] - public List Blacklist - { - get; - set; - } + public List Blacklist { get; set; } /// /// Whitelist equipment by level of bot /// [JsonPropertyName("whitelist")] - public List Whitelist - { - get; - set; - } + public List Whitelist { get; set; } /// /// Adjust equipment/ammo /// [JsonPropertyName("weightingAdjustmentsByBotLevel")] - public List WeightingAdjustmentsByBotLevel - { - get; - set; - } + public List WeightingAdjustmentsByBotLevel { get; set; } /// /// Same as weightingAdjustments but based on player level instead of bot level /// [JsonPropertyName("weightingAdjustmentsByPlayerLevel")] - public List? WeightingAdjustmentsByPlayerLevel - { - get; - set; - } + public List? WeightingAdjustmentsByPlayerLevel { get; set; } /// /// Should the stock mod be forced to spawn on bot /// [JsonPropertyName("forceStock")] - public bool? ForceStock - { - get; - set; - } + public bool? ForceStock { get; set; } [JsonPropertyName("armorPlateWeighting")] - public List? ArmorPlateWeighting - { - get; - set; - } + public List? ArmorPlateWeighting { get; set; } [JsonPropertyName("forceRigWhenNoVest")] - public bool? ForceRigWhenNoVest - { - get; - set; - } + public bool? ForceRigWhenNoVest { get; set; } } public record ModLimits @@ -785,21 +431,13 @@ public record ModLimits /// How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR /// [JsonPropertyName("scopeLimit")] - public int? ScopeLimit - { - get; - set; - } + public int? ScopeLimit { get; set; } /// /// How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT /// [JsonPropertyName("lightLaserLimit")] - public int? LightLaserLimit - { - get; - set; - } + public int? LightLaserLimit { get; set; } } public record RandomisationDetails @@ -811,85 +449,49 @@ public record RandomisationDetails /// Between what levels do these randomisation setting apply to /// [JsonPropertyName("levelRange")] - public MinMax LevelRange - { - get; - set; - } + public MinMax LevelRange { get; set; } [JsonPropertyName("generation")] - public Dictionary? Generation - { - get; - set; - } + public Dictionary? Generation { get; set; } /// /// Mod slots that should be fully randomised -ignores mods from bottype.json and instead creates a pool using items.json /// [JsonPropertyName("randomisedWeaponModSlots")] - public List? RandomisedWeaponModSlots - { - get; - set; - } + public List? RandomisedWeaponModSlots { get; set; } /// /// Armor slots that should be randomised e.g. 'Headwear, Armband' /// [JsonPropertyName("randomisedArmorSlots")] - public List? RandomisedArmorSlots - { - get; - set; - } + public List? RandomisedArmorSlots { get; set; } /// /// Equipment chances /// [JsonPropertyName("equipment")] - public Dictionary? Equipment - { - get; - set; - } + public Dictionary? Equipment { get; set; } /// /// Weapon mod chances /// [JsonPropertyName("weaponMods")] - public Dictionary? WeaponMods - { - get; - set; - } + public Dictionary? WeaponMods { get; set; } /// /// Equipment mod chances /// [JsonPropertyName("equipmentMods")] - public Dictionary? EquipmentMods - { - get; - set; - } + public Dictionary? EquipmentMods { get; set; } [JsonPropertyName("nighttimeChanges")] - public NighttimeChanges? NighttimeChanges - { - get; - set; - } + public NighttimeChanges? NighttimeChanges { get; set; } /// /// Key = weapon tpl, value = min size of magazine allowed /// [JsonPropertyName("minimumMagazineSize")] - public Dictionary? MinimumMagazineSize - { - get; - set; - } + public Dictionary? MinimumMagazineSize { get; set; } } public record NighttimeChanges @@ -901,18 +503,10 @@ public record NighttimeChanges /// Applies changes to values stored in equipmentMods /// [JsonPropertyName("equipmentModsModifiers")] - public Dictionary EquipmentModsModifiers - { - get; - set; - } + public Dictionary EquipmentModsModifiers { get; set; } [JsonPropertyName("weaponModsModifiers")] - public Dictionary WeaponModsModifiers - { - get; - set; - } // TODO: currently not in use anywhere + public Dictionary WeaponModsModifiers { get; set; } // TODO: currently not in use anywhere } public record EquipmentFilterDetails @@ -924,41 +518,25 @@ public record EquipmentFilterDetails /// Between what levels do these equipment filter setting apply to /// [JsonPropertyName("levelRange")] - public MinMax LevelRange - { - get; - set; - } + public MinMax LevelRange { get; set; } /// /// Key: mod slot name e.g. mod_magazine, value: item tpls /// [JsonPropertyName("equipment")] - public Dictionary>? Equipment - { - get; - set; - } + public Dictionary>? Equipment { get; set; } /// /// Key: equipment slot name e.g. FirstPrimaryWeapon, value: item tpls /// [JsonPropertyName("gear")] - public Dictionary>? Gear - { - get; - set; - } + public Dictionary>? Gear { get; set; } /// /// Key: cartridge type e.g. Caliber23x75, value: item tpls /// [JsonPropertyName("cartridge")] - public Dictionary>? Cartridge - { - get; - set; - } + public Dictionary>? Cartridge { get; set; } } public record WeightingAdjustmentDetails @@ -970,41 +548,25 @@ public record WeightingAdjustmentDetails /// Between what levels do these weight settings apply to /// [JsonPropertyName("levelRange")] - public MinMax LevelRange - { - get; - set; - } + public MinMax LevelRange { get; set; } /// /// Key: ammo type e.g. Caliber556x45NATO, value: item tpl + weight /// [JsonPropertyName("ammo")] - public AdjustmentDetails? Ammo - { - get; - set; - } + public AdjustmentDetails? Ammo { get; set; } /// /// Key: equipment slot e.g. TacticalVest, value: item tpl + weight /// [JsonPropertyName("equipment")] - public AdjustmentDetails? Equipment - { - get; - set; - } + public AdjustmentDetails? Equipment { get; set; } /// /// Key: clothing slot e.g. feet, value: item tpl + weight /// [JsonPropertyName("clothing")] - public AdjustmentDetails? Clothing - { - get; - set; - } + public AdjustmentDetails? Clothing { get; set; } } public record AdjustmentDetails @@ -1013,18 +575,10 @@ public record AdjustmentDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("add")] - public Dictionary> Add - { - get; - set; - } + public Dictionary> Add { get; set; } [JsonPropertyName("edit")] - public Dictionary> Edit - { - get; - set; - } + public Dictionary> Edit { get; set; } } public class ArmorPlateWeights @@ -1033,18 +587,10 @@ public class ArmorPlateWeights public Dictionary ExtensionData { get; set; } [JsonPropertyName("levelRange")] - public MinMax LevelRange - { - get; - set; - } + public MinMax LevelRange { get; set; } [JsonPropertyName("values")] - public Dictionary> Values - { - get; - set; - } + public Dictionary> Values { get; set; } } public record RandomisedResourceDetails @@ -1053,18 +599,10 @@ public record RandomisedResourceDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("food")] - public RandomisedResourceValues Food - { - get; - set; - } + public RandomisedResourceValues Food { get; set; } [JsonPropertyName("meds")] - public RandomisedResourceValues Meds - { - get; - set; - } + public RandomisedResourceValues Meds { get; set; } } public record RandomisedResourceValues @@ -1076,19 +614,11 @@ public record RandomisedResourceValues /// Minimum percent of item to randomized between min and max resource /// [JsonPropertyName("resourcePercent")] - public float ResourcePercent - { - get; - set; - } + public float ResourcePercent { get; set; } /// /// Chance for randomization to not occur /// [JsonPropertyName("chanceMaxResourcePercent")] - public float ChanceMaxResourcePercent - { - get; - set; - } + public float ChanceMaxResourcePercent { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs index a89dd926..401486e8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs @@ -8,25 +8,13 @@ public record BotDurability public Dictionary ExtensionData { get; set; } [JsonPropertyName("default")] - public required DefaultDurability Default - { - get; - set; - } + public required DefaultDurability Default { get; set; } [JsonPropertyName("botDurabilities")] - public required Dictionary BotDurabilities - { - get; - set; - } + public required Dictionary BotDurabilities { get; set; } [JsonPropertyName("pmc")] - public required PmcDurability Pmc - { - get; - set; - } + public required PmcDurability Pmc { get; set; } } /// @@ -38,18 +26,10 @@ public record DefaultDurability public Dictionary ExtensionData { get; set; } [JsonPropertyName("armor")] - public required ArmorDurability Armor - { - get; - set; - } + public required ArmorDurability Armor { get; set; } [JsonPropertyName("weapon")] - public required WeaponDurability Weapon - { - get; - set; - } + public required WeaponDurability Weapon { get; set; } } public record PmcDurability @@ -58,18 +38,10 @@ public record PmcDurability public Dictionary ExtensionData { get; set; } [JsonPropertyName("armor")] - public required PmcDurabilityArmor Armor - { - get; - set; - } + public required PmcDurabilityArmor Armor { get; set; } [JsonPropertyName("weapon")] - public required WeaponDurability Weapon - { - get; - set; - } + public required WeaponDurability Weapon { get; set; } } public record PmcDurabilityArmor @@ -78,39 +50,19 @@ public record PmcDurabilityArmor public Dictionary ExtensionData { get; set; } [JsonPropertyName("lowestMaxPercent")] - public int LowestMaxPercent - { - get; - set; - } + public int LowestMaxPercent { get; set; } [JsonPropertyName("highestMaxPercent")] - public int HighestMaxPercent - { - get; - set; - } + public int HighestMaxPercent { get; set; } [JsonPropertyName("maxDelta")] - public int MaxDelta - { - get; - set; - } + public int MaxDelta { get; set; } [JsonPropertyName("minDelta")] - public int MinDelta - { - get; - set; - } + public int MinDelta { get; set; } [JsonPropertyName("minLimitPercent")] - public int MinLimitPercent - { - get; - set; - } + public int MinLimitPercent { get; set; } } public record ArmorDurability @@ -119,39 +71,19 @@ public record ArmorDurability public Dictionary ExtensionData { get; set; } [JsonPropertyName("maxDelta")] - public int MaxDelta - { - get; - set; - } + public int MaxDelta { get; set; } [JsonPropertyName("minDelta")] - public int MinDelta - { - get; - set; - } + public int MinDelta { get; set; } [JsonPropertyName("minLimitPercent")] - public int MinLimitPercent - { - get; - set; - } + public int MinLimitPercent { get; set; } [JsonPropertyName("lowestMaxPercent")] - public int LowestMaxPercent - { - get; - set; - } + public int LowestMaxPercent { get; set; } [JsonPropertyName("highestMaxPercent")] - public int HighestMaxPercent - { - get; - set; - } + public int HighestMaxPercent { get; set; } } public record WeaponDurability @@ -160,37 +92,17 @@ public record WeaponDurability public Dictionary ExtensionData { get; set; } [JsonPropertyName("lowestMax")] - public int LowestMax - { - get; - set; - } + public int LowestMax { get; set; } [JsonPropertyName("highestMax")] - public int HighestMax - { - get; - set; - } + public int HighestMax { get; set; } [JsonPropertyName("maxDelta")] - public int MaxDelta - { - get; - set; - } + public int MaxDelta { get; set; } [JsonPropertyName("minDelta")] - public int MinDelta - { - get; - set; - } + public int MinDelta { get; set; } [JsonPropertyName("minLimitPercent")] - public double MinLimitPercent - { - get; - set; - } + public double MinLimitPercent { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BtrDeliveryConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BtrDeliveryConfig.cs index 3d5c25c0..7f7b5ee4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BtrDeliveryConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BtrDeliveryConfig.cs @@ -5,29 +5,17 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BtrDeliveryConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-btrdelivery"; + public override string Kind { get; set; } = "spt-btrdelivery"; /// /// Override to control how quickly delivery is processed/returned in seconds /// [JsonPropertyName("returnTimeOverrideSeconds")] - public double ReturnTimeOverrideSeconds - { - get; - set; - } + public double ReturnTimeOverrideSeconds { get; set; } /// /// How often server should process BTR delivery in seconds /// [JsonPropertyName("runIntervalSeconds")] - public double RunIntervalSeconds - { - get; - set; - } + public double RunIntervalSeconds { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs index f92ef6ff..b3bd6ad8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs @@ -6,125 +6,61 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record CoreConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-core"; + public override string Kind { get; set; } = "spt-core"; [JsonPropertyName("sptVersion")] - public required string SptVersion - { - get; - set; - } + public required string SptVersion { get; set; } [JsonPropertyName("projectName")] - public required string ProjectName - { - get; - set; - } + public required string ProjectName { get; set; } [JsonPropertyName("compatibleTarkovVersion")] - public required string CompatibleTarkovVersion - { - get; - set; - } + public required string CompatibleTarkovVersion { get; set; } [JsonPropertyName("serverName")] - public required string ServerName - { - get; - set; - } + public required string ServerName { get; set; } [JsonPropertyName("profileSaveIntervalSeconds")] - public required int ProfileSaveIntervalInSeconds - { - get; - set; - } + public required int ProfileSaveIntervalInSeconds { get; set; } [JsonPropertyName("sptFriendNickname")] - public required string SptFriendNickname - { - get; - set; - } + public required string SptFriendNickname { get; set; } [JsonPropertyName("allowProfileWipe")] - public required bool AllowProfileWipe - { - get; - set; - } + public required bool AllowProfileWipe { get; set; } [JsonPropertyName("bsgLogging")] - public required BsgLogging BsgLogging - { - get; - set; - } + public required BsgLogging BsgLogging { get; set; } [JsonPropertyName("release")] - public required Release Release - { - get; - set; - } + public required Release Release { get; set; } [JsonPropertyName("fixes")] - public required GameFixes Fixes - { - get; - set; - } + public required GameFixes Fixes { get; set; } [JsonPropertyName("survey")] - public required SurveyResponseData Survey - { - get; - set; - } + public required SurveyResponseData Survey { get; set; } [JsonPropertyName("features")] - public required ServerFeatures Features - { - get; - set; - } + public required ServerFeatures Features { get; set; } /// /// Commit hash build server was created from /// [JsonPropertyName("commit")] - public string? Commit - { - get; - set; - } + public string? Commit { get; set; } /// /// Timestamp of server build /// [JsonPropertyName("buildTime")] - public string? BuildTime - { - get; - set; - } + public string? BuildTime { get; set; } /// /// Server locale keys that will be added to the bottom of the startup watermark /// [JsonPropertyName("customWatermarkLocaleKeys")] - public List? CustomWatermarkLocaleKeys - { - get; - set; - } + public List? CustomWatermarkLocaleKeys { get; set; } } public record BsgLogging @@ -145,21 +81,13 @@ public record BsgLogging /// 6 - off /// [JsonPropertyName("verbosity")] - public int Verbosity - { - get; - set; - } + public int Verbosity { get; set; } /// /// Should we send the logging to the server /// [JsonPropertyName("sendToServer")] - public bool SendToServer - { - get; - set; - } + public bool SendToServer { get; set; } } public record Release @@ -171,131 +99,79 @@ public record Release /// Disclaimer outlining the intended usage of bleeding edge /// [JsonPropertyName("betaDisclaimerText")] - public string? BetaDisclaimerText - { - get; - set; - } + public string? BetaDisclaimerText { get; set; } /// /// Text logged when users agreed to terms /// [JsonPropertyName("betaDisclaimerAcceptText")] - public string? BetaDisclaimerAcceptText - { - get; - set; - } + public string? BetaDisclaimerAcceptText { get; set; } /// /// Server mods loaded message /// [JsonPropertyName("serverModsLoadedText")] - public string? ServerModsLoadedText - { - get; - set; - } + public string? ServerModsLoadedText { get; set; } /// /// Server mods loaded debug message text /// [JsonPropertyName("serverModsLoadedDebugText")] - public string? ServerModsLoadedDebugText - { - get; - set; - } + public string? ServerModsLoadedDebugText { get; set; } /// /// Client mods loaded message /// [JsonPropertyName("clientModsLoadedText")] - public string? ClientModsLoadedText - { - get; - set; - } + public string? ClientModsLoadedText { get; set; } /// /// Client mods loaded debug message text /// [JsonPropertyName("clientModsLoadedDebugText")] - public string? ClientModsLoadedDebugText - { - get; - set; - } + public string? ClientModsLoadedDebugText { get; set; } /// /// Illegal plugins log message /// [JsonPropertyName("illegalPluginsLoadedText")] - public string? IllegalPluginsLoadedText - { - get; - set; - } + public string? IllegalPluginsLoadedText { get; set; } /// /// Illegal plugins exception /// [JsonPropertyName("illegalPluginsExceptionText")] - public string? IllegalPluginsExceptionText - { - get; - set; - } + public string? IllegalPluginsExceptionText { get; set; } /// /// Summary of release changes /// [JsonPropertyName("releaseSummaryText")] - public string? ReleaseSummaryText - { - get; - set; - } + public string? ReleaseSummaryText { get; set; } /// /// Enables the cool watermark in-game /// [JsonPropertyName("isBeta")] - public bool? IsBeta - { - get; - set; - } + public bool? IsBeta { get; set; } /// /// Whether mods are enabled /// [JsonPropertyName("isModdable")] - public bool? IsModdable - { - get; - set; - } + public bool? IsModdable { get; set; } /// /// Are mods loaded on the server? /// [JsonPropertyName("isModded")] - public bool IsModded - { - get; - set; - } + public bool IsModded { get; set; } /// /// How long before the messagebox times out and closes the game /// [JsonPropertyName("betaDisclaimerTimeoutDelay")] - public int BetaDisclaimerTimeoutDelay - { - get; - set; - } + public int BetaDisclaimerTimeoutDelay { get; set; } } public record GameFixes @@ -307,41 +183,25 @@ public record GameFixes /// Shotguns use a different value than normal guns causing huge pellet dispersion /// [JsonPropertyName("fixShotgunDispersion")] - public bool FixShotgunDispersion - { - get; - set; - } + public bool FixShotgunDispersion { get; set; } /// /// Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load /// [JsonPropertyName("removeModItemsFromProfile")] - public bool RemoveModItemsFromProfile - { - get; - set; - } + public bool RemoveModItemsFromProfile { get; set; } /// /// Remove invalid traders from profile - trader data can be leftover when player removes trader mod /// [JsonPropertyName("removeInvalidTradersFromProfile")] - public bool RemoveInvalidTradersFromProfile - { - get; - set; - } + public bool RemoveInvalidTradersFromProfile { get; set; } /// /// Fix issues that cause the game to not start due to inventory item issues /// [JsonPropertyName("fixProfileBreakingInventoryItemIssues")] - public bool FixProfileBreakingInventoryItemIssues - { - get; - set; - } + public bool FixProfileBreakingInventoryItemIssues { get; set; } } public record ServerFeatures @@ -350,38 +210,22 @@ public record ServerFeatures public Dictionary ExtensionData { get; set; } [JsonPropertyName("compressProfile")] - public bool CompressProfile - { - get; - set; - } + public bool CompressProfile { get; set; } [JsonPropertyName("chatbotFeatures")] - public required ChatbotFeatures ChatbotFeatures - { - get; - set; - } + public required ChatbotFeatures ChatbotFeatures { get; set; } /// /// Keyed to profile type e.g. "Standard" or "SPT Developer" /// [JsonPropertyName("createNewProfileTypesBlacklist")] - public required HashSet CreateNewProfileTypesBlacklist - { - get; - set; - } + public required HashSet CreateNewProfileTypesBlacklist { get; set; } /// /// Profile ids to ignore when calculating achievement stats /// [JsonPropertyName("achievementProfileIdBlacklist")] - public required HashSet? AchievementProfileIdBlacklist - { - get; - set; - } + public required HashSet? AchievementProfileIdBlacklist { get; set; } } public record ChatbotFeatures @@ -390,45 +234,25 @@ public record ChatbotFeatures public Dictionary ExtensionData { get; set; } [JsonPropertyName("sptFriendGiftsEnabled")] - public bool SptFriendGiftsEnabled - { - get; - set; - } + public bool SptFriendGiftsEnabled { get; set; } [JsonPropertyName("commandoFeatures")] - public required CommandoFeatures CommandoFeatures - { - get; - set; - } + public required CommandoFeatures CommandoFeatures { get; set; } [JsonPropertyName("commandUseLimits")] - public required Dictionary CommandUseLimits - { - get; - set; - } + public required Dictionary CommandUseLimits { get; set; } /// /// Human readable id to guid for each bot /// [JsonPropertyName("ids")] - public required Dictionary Ids - { - get; - set; - } + public required Dictionary Ids { get; set; } /// /// Bot Ids player is allowed to interact with /// [JsonPropertyName("enabledBots")] - public required Dictionary EnabledBots - { - get; - set; - } + public required Dictionary EnabledBots { get; set; } } public record CommandoFeatures @@ -437,9 +261,5 @@ public record CommandoFeatures public Dictionary ExtensionData { get; set; } [JsonPropertyName("giveCommandEnabled")] - public bool GiveCommandEnabled - { - get; - set; - } + public bool GiveCommandEnabled { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs index 5a9e79d4..4f009fbc 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs @@ -9,18 +9,10 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record GiftsConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-gifts"; + public override string Kind { get; set; } = "spt-gifts"; [JsonPropertyName("gifts")] - public required Dictionary Gifts - { - get; - set; - } + public required Dictionary Gifts { get; set; } } public record Gift @@ -32,112 +24,59 @@ public record Gift /// Items to send to player /// [JsonPropertyName("items")] - public List Items - { - get; - set; - } = []; + public List Items { get; set; } = []; /// /// Who is sending the gift to player /// [JsonPropertyName("sender")] - public GiftSenderType Sender - { - get; - set; - } + public GiftSenderType Sender { get; set; } /// /// Optional - supply a users id to send from, not necessary when sending from SYSTEM or TRADER /// [JsonPropertyName("senderId")] - public string? SenderId - { - get; - set; - } + public string? SenderId { get; set; } [JsonPropertyName("senderDetails")] - public UserDialogInfo? SenderDetails - { - get; - set; - } + public UserDialogInfo? SenderDetails { get; set; } /// /// Optional - supply a trader type to send from, not necessary when sending from SYSTEM or USER /// [JsonPropertyName("trader")] - public string? Trader - { - get; - set; - } + public string? Trader { get; set; } [JsonPropertyName("messageText")] - public string? MessageText - { - get; - set; - } + public string? MessageText { get; set; } /// /// Optional - if sending text from the client locale file /// [JsonPropertyName("localeTextId")] - public string? LocaleTextId - { - get; - set; - } + public string? LocaleTextId { get; set; } /// /// Optional - Used by Seasonal events to send on specific day /// [JsonPropertyName("timestampToSend")] - public long? TimestampToSend - { - get; - set; - } + public long? TimestampToSend { get; set; } [JsonPropertyName("associatedEvent")] - public SeasonalEventType AssociatedEvent - { - get; - set; - } + public SeasonalEventType AssociatedEvent { get; set; } [JsonPropertyName("collectionTimeHours")] - public int? CollectionTimeHours - { - get; - set; - } + public int? CollectionTimeHours { get; set; } /// /// Optional, can be used to change profile settings like level/skills /// [JsonPropertyName("profileChangeEvents")] - public List? ProfileChangeEvents - { - get; - set; - } + public List? ProfileChangeEvents { get; set; } [JsonPropertyName("maxToSendPlayer")] - public int? MaxToSendPlayer - { - get; - set; - } - + public int? MaxToSendPlayer { get; set; } [JsonPropertyName("maxToSendToPlayer")] - public int? MaxToSendToPlayer - { - get; - set; - } + public int? MaxToSendToPlayer { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs index 12cfef69..645c5b2d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs @@ -5,25 +5,13 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HealthConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-health"; + public override string Kind { get; set; } = "spt-health"; [JsonPropertyName("healthMultipliers")] - public required HealthMultipliers HealthMultipliers - { - get; - set; - } + public required HealthMultipliers HealthMultipliers { get; set; } [JsonPropertyName("save")] - public required HealthSave Save - { - get; - set; - } + public required HealthSave Save { get; set; } } public record HealthMultipliers @@ -32,18 +20,10 @@ public record HealthMultipliers public Dictionary ExtensionData { get; set; } [JsonPropertyName("death")] - public double Death - { - get; - set; - } + public double Death { get; set; } [JsonPropertyName("blacked")] - public double Blacked - { - get; - set; - } + public double Blacked { get; set; } } public record HealthSave @@ -52,16 +32,8 @@ public record HealthSave public Dictionary ExtensionData { get; set; } [JsonPropertyName("health")] - public bool Health - { - get; - set; - } + public bool Health { get; set; } [JsonPropertyName("effects")] - public bool Effects - { - get; - set; - } + public bool Effects { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs index fee4da38..b0259919 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs @@ -7,83 +7,43 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HideoutConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-hideout"; + public override string Kind { get; set; } = "spt-hideout"; /// /// How many seconds should pass before hideout crafts / fuel usage is checked and processed /// [JsonPropertyName("runIntervalSeconds")] - public int RunIntervalSeconds - { - get; - set; - } + public int RunIntervalSeconds { get; set; } /// /// Default values used to hydrate `RunIntervalSeconds` with /// [JsonPropertyName("runIntervalValues")] - public required RunIntervalValues RunIntervalValues - { - get; - set; - } + public required RunIntervalValues RunIntervalValues { get; set; } [JsonPropertyName("hoursForSkillCrafting")] - public int HoursForSkillCrafting - { - get; - set; - } + public int HoursForSkillCrafting { get; set; } [JsonPropertyName("expCraftAmount")] - public int ExpCraftAmount - { - get; - set; - } + public int ExpCraftAmount { get; set; } [JsonPropertyName("overrideCraftTimeSeconds")] - public int OverrideCraftTimeSeconds - { - get; - set; - } + public int OverrideCraftTimeSeconds { get; set; } [JsonPropertyName("overrideBuildTimeSeconds")] - public int OverrideBuildTimeSeconds - { - get; - set; - } + public int OverrideBuildTimeSeconds { get; set; } /// /// Only process a profile's hideout crafts when it has been active in the last x minutes /// [JsonPropertyName("updateProfileHideoutWhenActiveWithinMinutes")] - public int UpdateProfileHideoutWhenActiveWithinMinutes - { - get; - set; - } + public int UpdateProfileHideoutWhenActiveWithinMinutes { get; set; } [JsonPropertyName("cultistCircle")] - public required CultistCircleSettings CultistCircle - { - get; - set; - } + public required CultistCircleSettings CultistCircle { get; set; } [JsonPropertyName("hideoutCraftsToAdd")] - public required List HideoutCraftsToAdd - { - get; - set; - } + public required List HideoutCraftsToAdd { get; set; } } public record HideoutCraftToAdd @@ -95,32 +55,16 @@ public record HideoutCraftToAdd /// The new mongoId for the craft to use /// [JsonPropertyName("newId")] - public required string NewId - { - get; - set; - } + public required string NewId { get; set; } [JsonPropertyName("requirements")] - public required List Requirements - { - get; - set; - } + public required List Requirements { get; set; } [JsonPropertyName("craftIdToCopy")] - public required string CraftIdToCopy - { - get; - set; - } + public required string CraftIdToCopy { get; set; } [JsonPropertyName("craftOutputTpl")] - public required string CraftOutputTpl - { - get; - set; - } + public required string CraftOutputTpl { get; set; } } public record CultistCircleSettings @@ -129,146 +73,82 @@ public record CultistCircleSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("maxRewardItemCount")] - public int MaxRewardItemCount - { - get; - set; - } + public int MaxRewardItemCount { get; set; } [JsonPropertyName("maxAttemptsToPickRewardsWithinBudget")] - public int MaxAttemptsToPickRewardsWithinBudget - { - get; - set; - } + public int MaxAttemptsToPickRewardsWithinBudget { get; set; } [JsonPropertyName("rewardPriceMultiplerMinMax")] - public required MinMax RewardPriceMultiplierMinMax - { - get; - set; - } + public required MinMax RewardPriceMultiplierMinMax { get; set; } /// /// The odds that meeting the highest threshold gives you a bonus to crafting time /// [JsonPropertyName("bonusAmountMultiplier")] - public double BonusAmountMultiplier - { - get; - set; - } + public double BonusAmountMultiplier { get; set; } [JsonPropertyName("bonusChanceMultiplier")] - public double BonusChanceMultiplier - { - get; - set; - } + public double BonusChanceMultiplier { get; set; } /// /// What is considered a "high-value" item /// [JsonPropertyName("highValueThresholdRub")] - public int HighValueThresholdRub - { - get; - set; - } + public int HighValueThresholdRub { get; set; } /// /// Hideout/task reward crafts have a unique craft time /// [JsonPropertyName("hideoutTaskRewardTimeSeconds")] - public int HideoutTaskRewardTimeSeconds - { - get; - set; - } + public int HideoutTaskRewardTimeSeconds { get; set; } /// /// Rouble amount player needs to sacrifice to get chance of hideout/task rewards /// [JsonPropertyName("hideoutCraftSacrificeThresholdRub")] - public int HideoutCraftSacrificeThresholdRub - { - get; - set; - } + public int HideoutCraftSacrificeThresholdRub { get; set; } [JsonPropertyName("craftTimeThreshholds")] - public required List CraftTimeThreshholds - { - get; - set; - } + public required List CraftTimeThreshholds { get; set; } /// /// -1 means no override, value in seconds /// [JsonPropertyName("craftTimeOverride")] - public int CraftTimeOverride - { - get; - set; - } + public int CraftTimeOverride { get; set; } /// /// Specific reward pool when player sacrifices specific item(s) /// [JsonPropertyName("directRewards")] - public required List DirectRewards - { - get; - set; - } + public required List DirectRewards { get; set; } /// /// Overrides for reward stack sizes, keyed by item tpl /// [JsonPropertyName("directRewardStackSize")] - public required Dictionary> DirectRewardStackSize - { - get; - set; - } + public required Dictionary> DirectRewardStackSize { get; set; } /// /// Item tpls to exclude from the reward pool /// [JsonPropertyName("rewardItemBlacklist")] - public required List RewardItemBlacklist - { - get; - set; - } + public required List RewardItemBlacklist { get; set; } /// /// Item tpls to include in the reward pool /// [JsonPropertyName("additionalRewardItemPool")] - public required List AdditionalRewardItemPool - { - get; - set; - } + public required List AdditionalRewardItemPool { get; set; } [JsonPropertyName("currencyRewards")] - public required Dictionary> CurrencyRewards - { - get; - set; - } + public required Dictionary> CurrencyRewards { get; set; } } public record CraftTimeThreshold : MinMax { [JsonPropertyName("craftTimeSeconds")] - public int CraftTimeSeconds - { - get; - set; - } + public int CraftTimeSeconds { get; set; } } public record DirectRewardSettings @@ -277,33 +157,17 @@ public record DirectRewardSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("reward")] - public required List Reward - { - get; - set; - } + public required List Reward { get; set; } [JsonPropertyName("requiredItems")] - public required List RequiredItems - { - get; - set; - } + public required List RequiredItems { get; set; } [JsonPropertyName("craftTimeSeconds")] - public required int CraftTimeSeconds - { - get; - set; - } + public required int CraftTimeSeconds { get; set; } /// /// Is the reward a one time reward or can it be given multiple times /// [JsonPropertyName("repeatable")] - public required bool Repeatable - { - get; - set; - } + public required bool Repeatable { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs index a7a2459f..0e3c6072 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs @@ -5,74 +5,38 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HttpConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-http"; + public override string Kind { get; set; } = "spt-http"; /// /// Address used by webserver /// [JsonPropertyName("ip")] - public required string Ip - { - get; - set; - } + public required string Ip { get; set; } [JsonPropertyName("port")] - public required int Port - { - get; - set; - } + public required int Port { get; set; } /// /// Address used by game client to connect to /// [JsonPropertyName("backendIp")] - public required string BackendIp - { - get; - set; - } + public required string BackendIp { get; set; } [JsonPropertyName("backendPort")] - public required int BackendPort - { - get; - set; - } + public required int BackendPort { get; set; } [JsonPropertyName("webSocketPingDelayMs")] - public required int WebSocketPingDelayMs - { - get; - set; - } + public required int WebSocketPingDelayMs { get; set; } [JsonPropertyName("logRequests")] - public required bool LogRequests - { - get; - set; - } + public required bool LogRequests { get; set; } /// /// e.g. "SPT_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "SPT_Data/Server/images/traders/NewTraderImage.png" /// [JsonPropertyName("serverImagePathOverride")] - public required Dictionary ServerImagePathOverride - { - get; - set; - } + public required Dictionary ServerImagePathOverride { get; set; } [JsonPropertyName("certificatePassword")] - public required string CertificatePassword - { - get; - set; - } + public required string CertificatePassword { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs index 72e0edff..a9db4848 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs @@ -5,121 +5,73 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InRaidConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-inraid"; + public override string Kind { get; set; } = "spt-inraid"; /// /// Overrides to apply to the pre-raid settings screen /// [JsonPropertyName("raidMenuSettings")] - public required RaidMenuSettings RaidMenuSettings - { - get; - set; - } + public required RaidMenuSettings RaidMenuSettings { get; set; } /// /// What effects should be saved post-raid /// [JsonPropertyName("save")] - public RaidSave Save - { - get; - set; - } + public RaidSave Save { get; set; } /// /// Names of car extracts /// [JsonPropertyName("carExtracts")] - public required List CarExtracts - { - get; - set; - } + public required List CarExtracts { get; set; } /// /// Names of coop extracts /// [JsonPropertyName("coopExtracts")] - public required List CoopExtracts - { - get; - set; - } + public required List CoopExtracts { get; set; } /// /// Fence rep gain from a single car extract /// [JsonPropertyName("carExtractBaseStandingGain")] - public double CarExtractBaseStandingGain - { - get; - set; - } + public double CarExtractBaseStandingGain { get; set; } /// /// Fence rep gain from a single coop extract /// [JsonPropertyName("coopExtractBaseStandingGain")] - public double CoopExtractBaseStandingGain - { - get; - set; - } + public double CoopExtractBaseStandingGain { get; set; } /// /// Fence rep gain when successfully extracting as pscav /// [JsonPropertyName("scavExtractStandingGain")] - public double ScavExtractStandingGain - { - get; - set; - } + public double ScavExtractStandingGain { get; set; } /// /// The likelihood of PMC eliminating a minimum of 2 scavs while you engage them as a pscav. /// [JsonPropertyName("pmcKillProbabilityForScavGain")] - public double PmcKillProbabilityForScavGain - { - get; - set; - } + public double PmcKillProbabilityForScavGain { get; set; } /// /// On death should items in your secure keep their Find in raid status regardless of how you finished the raid /// [JsonPropertyName("keepFiRSecureContainerOnDeath")] - public bool KeepFiRSecureContainerOnDeath - { - get; - set; - } + public bool KeepFiRSecureContainerOnDeath { get; set; } /// /// If enabled always keep found in raid status on items /// [JsonPropertyName("alwaysKeepFoundInRaidOnRaidEnd")] - public bool AlwaysKeepFoundInRaidOnRaidEnd - { - get; - set; - } + public bool AlwaysKeepFoundInRaidOnRaidEnd { get; set; } /// /// Percentage chance a player scav hot is hostile to the player when scavving /// [JsonPropertyName("playerScavHostileChancePercent")] - public double PlayerScavHostileChancePercent - { - get; - set; - } + public double PlayerScavHostileChancePercent { get; set; } } public record RaidMenuSettings @@ -128,60 +80,28 @@ public record RaidMenuSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("aiAmount")] - public required string AiAmount - { - get; - set; - } + public required string AiAmount { get; set; } [JsonPropertyName("aiDifficulty")] - public required string AiDifficulty - { - get; - set; - } + public required string AiDifficulty { get; set; } [JsonPropertyName("bossEnabled")] - public bool BossEnabled - { - get; - set; - } + public bool BossEnabled { get; set; } [JsonPropertyName("scavWars")] - public bool ScavWars - { - get; - set; - } + public bool ScavWars { get; set; } [JsonPropertyName("taggedAndCursed")] - public bool TaggedAndCursed - { - get; - set; - } + public bool TaggedAndCursed { get; set; } [JsonPropertyName("enablePve")] - public bool EnablePve - { - get; - set; - } + public bool EnablePve { get; set; } [JsonPropertyName("randomWeather")] - public bool RandomWeather - { - get; - set; - } + public bool RandomWeather { get; set; } [JsonPropertyName("randomTime")] - public bool RandomTime - { - get; - set; - } + public bool RandomTime { get; set; } } public record RaidSave @@ -193,9 +113,5 @@ public record RaidSave /// Should loot gained from raid be saved /// [JsonPropertyName("loot")] - public bool Loot - { - get; - set; - } + public bool Loot { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs index 7501712d..924ee3ad 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs @@ -5,96 +5,56 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InsuranceConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-insurance"; + public override string Kind { get; set; } = "spt-insurance"; /// /// Chance item is returned as insurance, keyed by trader id /// [JsonPropertyName("returnChancePercent")] - public Dictionary ReturnChancePercent - { - get; - set; - } = []; + public Dictionary ReturnChancePercent { get; set; } = []; /// /// Item slots that should never be returned as insurance /// [JsonPropertyName("blacklistedEquipment")] - public List BlacklistedEquipment - { - get; - set; - } = []; + public List BlacklistedEquipment { get; set; } = []; /// /// Some slots should always be removed, e.g. 'cartridges' /// [JsonPropertyName("slotIdsToAlwaysRemove")] - public List SlotIdsToAlwaysRemove - { - get; - set; - } = []; + public List SlotIdsToAlwaysRemove { get; set; } = []; /// /// Override to control how quickly insurance is processed/returned in seconds /// [JsonPropertyName("returnTimeOverrideSeconds")] - public double ReturnTimeOverrideSeconds - { - get; - set; - } + public double ReturnTimeOverrideSeconds { get; set; } /// /// Override to control how long insurance returns stay in mail before expiring - in seconds /// [JsonPropertyName("storageTimeOverrideSeconds")] - public double StorageTimeOverrideSeconds - { - get; - set; - } + public double StorageTimeOverrideSeconds { get; set; } /// /// How often server should process insurance in seconds /// [JsonPropertyName("runIntervalSeconds")] - public double RunIntervalSeconds - { - get; - set; - } + public double RunIntervalSeconds { get; set; } /// /// Lowest rouble price for an attachment to be allowed to be taken /// [JsonPropertyName("minAttachmentRoublePriceToBeTaken")] - public double MinAttachmentRoublePriceToBeTaken - { - get; - set; - } + public double MinAttachmentRoublePriceToBeTaken { get; set; } /// /// Chance out of 100% no attachments from a parent are taken /// [JsonPropertyName("chanceNoAttachmentsTakenPercent")] - public double ChanceNoAttachmentsTakenPercent - { - get; - set; - } + public double ChanceNoAttachmentsTakenPercent { get; set; } [JsonPropertyName("simulateItemsBeingTaken")] - public bool SimulateItemsBeingTaken - { - get; - set; - } + public bool SimulateItemsBeingTaken { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs index 560bca0b..403c641f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs @@ -6,65 +6,37 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InventoryConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-inventory"; + public override string Kind { get; set; } = "spt-inventory"; /// /// Should new items purchased by flagged as found in raid /// [JsonPropertyName("newItemsMarkedFound")] - public bool NewItemsMarkedFound - { - get; - set; - } + public bool NewItemsMarkedFound { get; set; } [JsonPropertyName("randomLootContainers")] - public required Dictionary RandomLootContainers - { - get; - set; - } + public required Dictionary RandomLootContainers { get; set; } [JsonPropertyName("sealedAirdropContainer")] - public required SealedAirdropContainerSettings SealedAirdropContainer - { - get; - set; - } + public required SealedAirdropContainerSettings SealedAirdropContainer { get; set; } /// /// Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars /// [JsonPropertyName("customMoneyTpls")] - public required List CustomMoneyTpls - { - get; - set; - } + public required List CustomMoneyTpls { get; set; } /// /// Multipliers for skill gain when inside menus, NOT in-game /// [JsonPropertyName("skillGainMultiplers")] - public required Dictionary SkillGainMultipliers - { - get; - set; - } + public required Dictionary SkillGainMultipliers { get; set; } /// /// Container Tpls that should be deprioritised when choosing where to take money from for payments /// [JsonPropertyName("deprioritisedMoneyContainers")] - public required HashSet DeprioritisedMoneyContainers - { - get; - set; - } + public required HashSet DeprioritisedMoneyContainers { get; set; } } public record RewardDetails @@ -73,39 +45,19 @@ public record RewardDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("_type")] - public string? Type - { - get; - set; - } + public string? Type { get; set; } [JsonPropertyName("rewardCount")] - public int RewardCount - { - get; - set; - } + public int RewardCount { get; set; } [JsonPropertyName("foundInRaid")] - public bool FoundInRaid - { - get; - set; - } + public bool FoundInRaid { get; set; } [JsonPropertyName("rewardTplPool")] - public Dictionary? RewardTplPool - { - get; - set; - } + public Dictionary? RewardTplPool { get; set; } [JsonPropertyName("rewardTypePool")] - public List? RewardTypePool - { - get; - set; - } + public List? RewardTypePool { get; set; } } public record SealedAirdropContainerSettings @@ -114,54 +66,26 @@ public record SealedAirdropContainerSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("weaponRewardWeight")] - public required Dictionary WeaponRewardWeight - { - get; - set; - } + public required Dictionary WeaponRewardWeight { get; set; } [JsonPropertyName("defaultPresetsOnly")] - public bool DefaultPresetsOnly - { - get; - set; - } + public bool DefaultPresetsOnly { get; set; } /// /// Should contents be flagged as found in raid when opened /// [JsonPropertyName("foundInRaid")] - public bool FoundInRaid - { - get; - set; - } + public bool FoundInRaid { get; set; } [JsonPropertyName("weaponModRewardLimits")] - public required Dictionary> WeaponModRewardLimits - { - get; - set; - } + public required Dictionary> WeaponModRewardLimits { get; set; } [JsonPropertyName("rewardTypeLimits")] - public required Dictionary> RewardTypeLimits - { - get; - set; - } + public required Dictionary> RewardTypeLimits { get; set; } [JsonPropertyName("ammoBoxWhitelist")] - public required List AmmoBoxWhitelist - { - get; - set; - } + public required List AmmoBoxWhitelist { get; set; } [JsonPropertyName("allowBossItems")] - public bool AllowBossItems - { - get; - set; - } + public bool AllowBossItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs index f133f0c9..f218135d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs @@ -6,78 +6,46 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record ItemConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-item"; + public override string Kind { get; set; } = "spt-item"; /// /// Items that should be globally blacklisted /// [JsonPropertyName("blacklist")] - public required HashSet Blacklist - { - get; - set; - } + public required HashSet Blacklist { get; set; } /// /// Items that should not be lootable from any location /// [JsonPropertyName("lootableItemBlacklist")] - public required HashSet LootableItemBlacklist - { - get; - set; - } + public required HashSet LootableItemBlacklist { get; set; } /// /// items that should not be given as rewards /// [JsonPropertyName("rewardItemBlacklist")] - public required HashSet RewardItemBlacklist - { - get; - set; - } + public required HashSet RewardItemBlacklist { get; set; } /// /// Item base types that should not be given as rewards /// [JsonPropertyName("rewardItemTypeBlacklist")] - public required HashSet RewardItemTypeBlacklist - { - get; - set; - } + public required HashSet RewardItemTypeBlacklist { get; set; } /// /// Items that can only be found on bosses /// [JsonPropertyName("bossItems")] - public required HashSet BossItems - { - get; - set; - } + public required HashSet BossItems { get; set; } [JsonPropertyName("handbookPriceOverride")] - public required Dictionary HandbookPriceOverride - { - get; - set; - } + public required Dictionary HandbookPriceOverride { get; set; } /// /// Presets to add to the globals.json `ItemPresets` dictionary on server start /// [JsonPropertyName("customItemGlobalPresets")] - public required List CustomItemGlobalPresets - { - get; - set; - } + public required List CustomItemGlobalPresets { get; set; } } public record HandbookPriceOverride @@ -89,19 +57,11 @@ public record HandbookPriceOverride /// Price in roubles /// [JsonPropertyName("price")] - public double Price - { - get; - set; - } + public double Price { get; set; } /// /// NOT parentId from items.json, but handbook.json /// [JsonPropertyName("parentId")] - public string? ParentId - { - get; - set; - } = string.Empty; + public string? ParentId { get; set; } = string.Empty; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs index 04753619..9a2cabf7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs @@ -5,46 +5,26 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LocaleConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-locale"; + public override string Kind { get; set; } = "spt-locale"; /// /// e.g. ru/en/cn/fr etc, or 'system', will take computer locale setting /// [JsonPropertyName("gameLocale")] - public required string GameLocale - { - get; - set; - } + public required string GameLocale { get; set; } /// /// e.g. ru/en/cn/fr etc, or 'system', will take computer locale setting /// [JsonPropertyName("serverLocale")] - public required string ServerLocale - { - get; - set; - } + public required string ServerLocale { get; set; } /// /// Languages server can be translated into /// [JsonPropertyName("serverSupportedLocales")] - public required List ServerSupportedLocales - { - get; - set; - } + public required List ServerSupportedLocales { get; set; } [JsonPropertyName("fallbacks")] - public required Dictionary Fallbacks - { - get; - set; - } + public required Dictionary Fallbacks { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs index 6a3ff5d8..aa37e663 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs @@ -7,232 +7,136 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LocationConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-location"; + public override string Kind { get; set; } = "spt-location"; /// /// Rogues are classified as bosses and spawn immediately, this can result in no scavs spawning, delay rogues spawning to allow scavs to spawn first /// [JsonPropertyName("rogueLighthouseSpawnTimeSettings")] - public required RogueLighthouseSpawnTimeSettings RogueLighthouseSpawnTimeSettings - { - get; - set; - } + public required RogueLighthouseSpawnTimeSettings RogueLighthouseSpawnTimeSettings { get; set; } [JsonPropertyName("looseLootMultiplier")] - public required Dictionary LooseLootMultiplier - { - get; - set; - } + public required Dictionary LooseLootMultiplier { get; set; } [JsonPropertyName("staticLootMultiplier")] - public required Dictionary StaticLootMultiplier - { - get; - set; - } + public required Dictionary StaticLootMultiplier { get; set; } /// /// Custom bot waves to add to a locations base json on game start if addCustomBotWavesToMaps is true /// [JsonPropertyName("customWaves")] - public CustomWaves? CustomWaves - { - get; - set; - } + public CustomWaves? CustomWaves { get; set; } /// /// Open zones to add to map /// [JsonPropertyName("openZones")] - public required Dictionary> OpenZones - { - get; - set; - } + public required Dictionary> OpenZones { get; set; } /// /// Key = map id, value = item tpls that should only have one forced loot spawn position /// [JsonPropertyName("forcedLootSingleSpawnById")] - public required Dictionary> ForcedLootSingleSpawnById - { - get; - set; - } + public required Dictionary> ForcedLootSingleSpawnById { get; set; } /// /// How many attempts should be taken to fit an item into a container before giving up /// [JsonPropertyName("fitLootIntoContainerAttempts")] - public int FitLootIntoContainerAttempts - { - get; - set; - } + public int FitLootIntoContainerAttempts { get; set; } /// /// Add all possible zones to each maps `OpenZones` property /// [JsonPropertyName("addOpenZonesToAllMaps")] - public bool AddOpenZonesToAllMaps - { - get; - set; - } + public bool AddOpenZonesToAllMaps { get; set; } /// /// Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves /// [JsonPropertyName("addCustomBotWavesToMaps")] - public bool AddCustomBotWavesToMaps - { - get; - set; - } + public bool AddCustomBotWavesToMaps { get; set; } /// /// Should the limits defined inside botTypeLimits to be applied to locations on game start /// [JsonPropertyName("enableBotTypeLimits")] - public bool EnableBotTypeLimits - { - get; - set; - } + public bool EnableBotTypeLimits { get; set; } /// /// Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true /// [JsonPropertyName("botTypeLimits")] - public required Dictionary> BotTypeLimits - { - get; - set; - } + public required Dictionary> BotTypeLimits { get; set; } /// /// Container randomisation settings /// [JsonPropertyName("containerRandomisationSettings")] - public required ContainerRandomisationSettings ContainerRandomisationSettings - { - get; - set; - } + public required ContainerRandomisationSettings ContainerRandomisationSettings { get; set; } /// /// How full must a random loose magazine be % /// [JsonPropertyName("minFillLooseMagazinePercent")] - public int MinFillLooseMagazinePercent - { - get; - set; - } + public int MinFillLooseMagazinePercent { get; set; } /// /// How full must a random static magazine be % /// [JsonPropertyName("minFillStaticMagazinePercent")] - public int MinFillStaticMagazinePercent - { - get; - set; - } + public int MinFillStaticMagazinePercent { get; set; } [JsonPropertyName("allowDuplicateItemsInStaticContainers")] - public bool AllowDuplicateItemsInStaticContainers - { - get; - set; - } + public bool AllowDuplicateItemsInStaticContainers { get; set; } /// /// Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent /// [JsonPropertyName("magazineLootHasAmmoChancePercent")] - public int MagazineLootHasAmmoChancePercent - { - get; - set; - } + public int MagazineLootHasAmmoChancePercent { get; set; } /// /// Chance static magazines have ammo in them /// [JsonPropertyName("staticMagazineLootHasAmmoChancePercent")] - public int StaticMagazineLootHasAmmoChancePercent - { - get; - set; - } + public int StaticMagazineLootHasAmmoChancePercent { get; set; } /// /// Key: map, value: loose loot ids to ignore /// [JsonPropertyName("looseLootBlacklist")] - public required Dictionary> LooseLootBlacklist - { - get; - set; - } + public required Dictionary> LooseLootBlacklist { get; set; } /// /// Key: map, value: settings to control how long scav raids are /// [JsonPropertyName("scavRaidTimeSettings")] - public required ScavRaidTimeSettings ScavRaidTimeSettings - { - get; - set; - } + public required ScavRaidTimeSettings ScavRaidTimeSettings { get; set; } /// /// Settings to adjust mods for lootable equipment in raid /// [JsonPropertyName("equipmentLootSettings")] - public required EquipmentLootSettings EquipmentLootSettings - { - get; - set; - } + public required EquipmentLootSettings EquipmentLootSettings { get; set; } /// /// Min percentage to set raider spawns at, -1 makes no changes /// [JsonPropertyName("reserveRaiderSpawnChanceOverrides")] - public required ReserveRaiderSpawnChanceOverrides ReserveRaiderSpawnChanceOverrides - { - get; - set; - } + public required ReserveRaiderSpawnChanceOverrides ReserveRaiderSpawnChanceOverrides { get; set; } /// /// Containers to remove all children from when generating static/loose loot /// [JsonPropertyName("tplsToStripChildItemsFrom")] - public required HashSet TplsToStripChildItemsFrom - { - get; - set; - } + public required HashSet TplsToStripChildItemsFrom { get; set; } /// /// Map ids players cannot visit /// [JsonPropertyName("nonMaps")] - public required HashSet NonMaps - { - get; - set; - } + public required HashSet NonMaps { get; set; } [JsonPropertyName("transitSettings")] public TransitSettings? TransitSettings { get; set; } @@ -256,18 +160,10 @@ public record ReserveRaiderSpawnChanceOverrides public Dictionary ExtensionData { get; set; } [JsonPropertyName("nonTriggered")] - public int NonTriggered - { - get; - set; - } + public int NonTriggered { get; set; } [JsonPropertyName("triggered")] - public int Triggered - { - get; - set; - } + public int Triggered { get; set; } } public record EquipmentLootSettings @@ -279,11 +175,7 @@ public record EquipmentLootSettings /// Percentage chance item will be added to equipment /// [JsonPropertyName("modSpawnChancePercent")] - public required Dictionary ModSpawnChancePercent - { - get; - set; - } + public required Dictionary ModSpawnChancePercent { get; set; } } public record RogueLighthouseSpawnTimeSettings @@ -292,18 +184,10 @@ public record RogueLighthouseSpawnTimeSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } [JsonPropertyName("waitTimeSeconds")] - public int WaitTimeSeconds - { - get; - set; - } + public int WaitTimeSeconds { get; set; } } public record CustomWaves @@ -315,28 +199,16 @@ public record CustomWaves /// Bosses spawn on raid start /// [JsonPropertyName("boss")] - public Dictionary> Boss - { - get; - set; - } = []; + public Dictionary> Boss { get; set; } = []; [JsonPropertyName("normal")] - public Dictionary> Normal - { - get; - set; - } = []; + public Dictionary> Normal { get; set; } = []; } public record BotTypeLimit : MinMax { [JsonPropertyName("type")] - public new required string Type - { - get; - set; - } + public new required string Type { get; set; } } public record ContainerRandomisationSettings @@ -345,45 +217,25 @@ public record ContainerRandomisationSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } /// /// What maps can use the container randomisation feature /// [JsonPropertyName("maps")] - public required Dictionary Maps - { - get; - set; - } + public required Dictionary Maps { get; set; } /// /// Some container types don't work when randomised /// [JsonPropertyName("containerTypesToNotRandomise")] - public required HashSet ContainerTypesToNotRandomise - { - get; - set; - } + public required HashSet ContainerTypesToNotRandomise { get; set; } [JsonPropertyName("containerGroupMinSizeMultiplier")] - public double ContainerGroupMinSizeMultiplier - { - get; - set; - } + public double ContainerGroupMinSizeMultiplier { get; set; } [JsonPropertyName("containerGroupMaxSizeMultiplier")] - public double ContainerGroupMaxSizeMultiplier - { - get; - set; - } + public double ContainerGroupMaxSizeMultiplier { get; set; } } public record ScavRaidTimeSettings @@ -392,18 +244,10 @@ public record ScavRaidTimeSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("settings")] - public required ScavRaidTimeConfigSettings Settings - { - get; - set; - } + public required ScavRaidTimeConfigSettings Settings { get; set; } [JsonPropertyName("maps")] - public required Dictionary Maps - { - get; - set; - } + public required Dictionary Maps { get; set; } } public record ScavRaidTimeConfigSettings @@ -412,11 +256,7 @@ public record ScavRaidTimeConfigSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("trainArrivalDelayObservedSeconds")] - public int TrainArrivalDelayObservedSeconds - { - get; - set; - } + public int TrainArrivalDelayObservedSeconds { get; set; } } public record ScavRaidTimeLocationSettings @@ -428,59 +268,35 @@ public record ScavRaidTimeLocationSettings /// Should loot be reduced by same percent length of raid is reduced by /// [JsonPropertyName("reduceLootByPercent")] - public bool ReduceLootByPercent - { - get; - set; - } + public bool ReduceLootByPercent { get; set; } /// /// Smallest % of container loot that should be spawned /// [JsonPropertyName("minStaticLootPercent")] - public double MinStaticLootPercent - { - get; - set; - } + public double MinStaticLootPercent { get; set; } /// /// Smallest % of loose loot that should be spawned /// [JsonPropertyName("minDynamicLootPercent")] - public double MinDynamicLootPercent - { - get; - set; - } + public double MinDynamicLootPercent { get; set; } /// /// Chance raid time is reduced /// [JsonPropertyName("reducedChancePercent")] - public double ReducedChancePercent - { - get; - set; - } + public double ReducedChancePercent { get; set; } /// /// How much should raid time be reduced - weighted /// [JsonPropertyName("reductionPercentWeights")] - public Dictionary ReductionPercentWeights - { - get; - set; - } = []; + public Dictionary ReductionPercentWeights { get; set; } = []; /// /// Should bot waves be removed / spawn times be adjusted /// [JsonPropertyName("adjustWaves")] - public bool AdjustWaves - { - get; - set; - } + public bool AdjustWaves { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs index 3196bd4b..bd2ee422 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs @@ -6,29 +6,20 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LootConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-loot"; + public override string Kind { get; set; } = "spt-loot"; /// /// Spawn positions to add into a map, key=mapid /// [JsonPropertyName("looseLoot")] - public required Dictionary LooseLoot - { - get; - set; - } + public required Dictionary LooseLoot { get; set; } /// /// Loose loot probability adjustments to apply on game start /// [JsonPropertyName("looseLootSpawnPointAdjustments")] - public required Dictionary> LooseLootSpawnPointAdjustments - { - get; - set; - } + public required Dictionary< + string, + Dictionary + > LooseLootSpawnPointAdjustments { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs index 284e73d1..f449482a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs @@ -5,41 +5,25 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LostOnDeathConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-lostondeath"; + public override string Kind { get; set; } = "spt-lostondeath"; /// /// What equipment in each slot should be lost on death /// [JsonPropertyName("equipment")] - public required LostEquipment Equipment - { - get; - set; - } + public required LostEquipment Equipment { get; set; } /// /// Should special slot items be removed from quest inventory on death e.g. wifi camera/markers /// [JsonPropertyName("specialSlotItems")] - public bool SpecialSlotItems - { - get; - set; - } + public bool SpecialSlotItems { get; set; } /// /// Should quest items be removed from quest inventory on death /// [JsonPropertyName("questItems")] - public bool QuestItems - { - get; - set; - } + public bool QuestItems { get; set; } } public record LostEquipment @@ -48,107 +32,47 @@ public record LostEquipment public Dictionary ExtensionData { get; set; } [JsonPropertyName("ArmBand")] - public bool ArmBand - { - get; - set; - } + public bool ArmBand { get; set; } [JsonPropertyName("Headwear")] - public bool Headwear - { - get; - set; - } + public bool Headwear { get; set; } [JsonPropertyName("Earpiece")] - public bool Earpiece - { - get; - set; - } + public bool Earpiece { get; set; } [JsonPropertyName("FaceCover")] - public bool FaceCover - { - get; - set; - } + public bool FaceCover { get; set; } [JsonPropertyName("ArmorVest")] - public bool ArmorVest - { - get; - set; - } + public bool ArmorVest { get; set; } [JsonPropertyName("Eyewear")] - public bool Eyewear - { - get; - set; - } + public bool Eyewear { get; set; } [JsonPropertyName("TacticalVest")] - public bool TacticalVest - { - get; - set; - } + public bool TacticalVest { get; set; } [JsonPropertyName("PocketItems")] - public bool PocketItems - { - get; - set; - } + public bool PocketItems { get; set; } [JsonPropertyName("Backpack")] - public bool Backpack - { - get; - set; - } + public bool Backpack { get; set; } [JsonPropertyName("Holster")] - public bool Holster - { - get; - set; - } + public bool Holster { get; set; } [JsonPropertyName("FirstPrimaryWeapon")] - public bool FirstPrimaryWeapon - { - get; - set; - } + public bool FirstPrimaryWeapon { get; set; } [JsonPropertyName("SecondPrimaryWeapon")] - public bool SecondPrimaryWeapon - { - get; - set; - } + public bool SecondPrimaryWeapon { get; set; } [JsonPropertyName("Scabbard")] - public bool Scabbard - { - get; - set; - } + public bool Scabbard { get; set; } [JsonPropertyName("Compass")] - public bool Compass - { - get; - set; - } + public bool Compass { get; set; } [JsonPropertyName("SecuredContainer")] - public bool SecuredContainer - { - get; - set; - } + public bool SecuredContainer { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs index be22dd99..b49a3c29 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs @@ -5,23 +5,11 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record MatchConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-match"; + public override string Kind { get; set; } = "spt-match"; [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } [JsonPropertyName("randomiseMapContainers")] - public required Dictionary RandomiseMapContainers - { - get; - set; - } + public required Dictionary RandomiseMapContainers { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs index ff1dca7e..7a8f16ab 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs @@ -7,18 +7,10 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PlayerScavConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-playerscav"; + public override string Kind { get; set; } = "spt-playerscav"; [JsonPropertyName("karmaLevel")] - public required Dictionary KarmaLevel - { - get; - set; - } + public required Dictionary KarmaLevel { get; set; } } public record KarmaLevel @@ -27,46 +19,22 @@ public record KarmaLevel public Dictionary ExtensionData { get; set; } [JsonPropertyName("botTypeForLoot")] - public required string BotTypeForLoot - { - get; - set; - } + public required string BotTypeForLoot { get; set; } [JsonPropertyName("modifiers")] - public required Modifiers Modifiers - { - get; - set; - } + public required Modifiers Modifiers { get; set; } [JsonPropertyName("itemLimits")] - public required Dictionary ItemLimits - { - get; - set; - } + public required Dictionary ItemLimits { get; set; } [JsonPropertyName("equipmentBlacklist")] - public required Dictionary> EquipmentBlacklist - { - get; - set; - } + public required Dictionary> EquipmentBlacklist { get; set; } [JsonPropertyName("labsAccessCardChancePercent")] - public double? LabsAccessCardChancePercent - { - get; - set; - } + public double? LabsAccessCardChancePercent { get; set; } [JsonPropertyName("lootItemsToAddChancePercent")] - public required Dictionary LootItemsToAddChancePercent - { - get; - set; - } + public required Dictionary LootItemsToAddChancePercent { get; set; } } public record Modifiers @@ -75,16 +43,8 @@ public record Modifiers public Dictionary ExtensionData { get; set; } [JsonPropertyName("equipment")] - public required Dictionary Equipment - { - get; - set; - } + public required Dictionary Equipment { get; set; } [JsonPropertyName("mod")] - public required Dictionary Mod - { - get; - set; - } + public required Dictionary Mod { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs index c14eeb18..8e598a94 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs @@ -5,25 +5,13 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PmcChatResponse : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-pmcchatresponse"; + public override string Kind { get; set; } = "spt-pmcchatresponse"; [JsonPropertyName("victim")] - public required ResponseSettings Victim - { - get; - set; - } + public required ResponseSettings Victim { get; set; } [JsonPropertyName("killer")] - public required ResponseSettings Killer - { - get; - set; - } + public required ResponseSettings Killer { get; set; } } public record ResponseSettings @@ -32,37 +20,17 @@ public record ResponseSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("responseChancePercent")] - public double ResponseChancePercent - { - get; - set; - } + public double ResponseChancePercent { get; set; } [JsonPropertyName("responseTypeWeights")] - public required Dictionary ResponseTypeWeights - { - get; - set; - } + public required Dictionary ResponseTypeWeights { get; set; } [JsonPropertyName("stripCapitalisationChancePercent")] - public double StripCapitalisationChancePercent - { - get; - set; - } + public double StripCapitalisationChancePercent { get; set; } [JsonPropertyName("allCapsChancePercent")] - public double AllCapsChancePercent - { - get; - set; - } + public double AllCapsChancePercent { get; set; } [JsonPropertyName("appendBroToMessageEndChancePercent")] - public double AppendBroToMessageEndChancePercent - { - get; - set; - } + public double AppendBroToMessageEndChancePercent { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs index 270f3e37..9fbdc545 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs @@ -8,282 +8,157 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PmcConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-pmc"; + public override string Kind { get; set; } = "spt-pmc"; /// /// What game version should the PMC have /// [JsonPropertyName("gameVersionWeight")] - public required Dictionary GameVersionWeight - { - get; - set; - } + public required Dictionary GameVersionWeight { get; set; } /// /// What account type should the PMC have /// [JsonPropertyName("accountTypeWeight")] - public required Dictionary AccountTypeWeight - { - get; - set; - } + public required Dictionary AccountTypeWeight { get; set; } /// /// Global whitelist/blacklist of vest loot for PMCs /// [JsonPropertyName("vestLoot")] - public required SlotLootSettings VestLoot - { - get; - set; - } + public required SlotLootSettings VestLoot { get; set; } /// /// Global whitelist/blacklist of pocket loot for PMCs /// [JsonPropertyName("pocketLoot")] - public required SlotLootSettings PocketLoot - { - get; - set; - } + public required SlotLootSettings PocketLoot { get; set; } /// /// Global whitelist/blacklist of backpack loot for PMCs /// [JsonPropertyName("backpackLoot")] - public required SlotLootSettings BackpackLoot - { - get; - set; - } + public required SlotLootSettings BackpackLoot { get; set; } [JsonPropertyName("globalLootBlacklist")] - public required List GlobalLootBlacklist - { - get; - set; - } + public required List GlobalLootBlacklist { get; set; } /// /// Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value /// [JsonPropertyName("useDifficultyOverride")] - public required bool UseDifficultyOverride - { - get; - set; - } + public required bool UseDifficultyOverride { get; set; } /// /// Difficulty override e.g. "AsOnline/Hard" /// [JsonPropertyName("difficulty")] - public required string Difficulty - { - get; - set; - } + public required string Difficulty { get; set; } /// /// Chance out of 100 to have a complete gun in backpack /// [JsonPropertyName("looseWeaponInBackpackChancePercent")] - public required double LooseWeaponInBackpackChancePercent - { - get; - set; - } + public required double LooseWeaponInBackpackChancePercent { get; set; } /// /// Chance out of 100 to have an enhancement applied to PMC weapon /// [JsonPropertyName("weaponHasEnhancementChancePercent")] - public required double WeaponHasEnhancementChancePercent - { - get; - set; - } + public required double WeaponHasEnhancementChancePercent { get; set; } /// /// MinMax count of weapons to have in backpack /// [JsonPropertyName("looseWeaponInBackpackLootMinMax")] - public required MinMax LooseWeaponInBackpackLootMinMax - { - get; - set; - } + public required MinMax LooseWeaponInBackpackLootMinMax { get; set; } [JsonPropertyName("_isUsec")] - public string? IsUsecDescription - { - get; - set; - } + public string? IsUsecDescription { get; set; } /// /// Percentage chance PMC will be USEC /// [JsonPropertyName("isUsec")] - public required double IsUsec - { - get; - set; - } + public required double IsUsec { get; set; } /// /// WildSpawnType enum value USEC PMCs use /// [JsonPropertyName("usecType")] - public required string UsecType - { - get; - set; - } + public required string UsecType { get; set; } /// /// WildSpawnType enum value BEAR PMCs use /// [JsonPropertyName("bearType")] - public required string BearType - { - get; - set; - } + public required string BearType { get; set; } [JsonPropertyName("_pmcType")] - public string? PmcTypeDescription - { - get; - set; - } + public string? PmcTypeDescription { get; set; } /// /// What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear /// [JsonPropertyName("pmcType")] - public required Dictionary>> PmcType - { - get; - set; - } + public required Dictionary< + string, + Dictionary> + > PmcType { get; set; } [JsonPropertyName("maxBackpackLootTotalRub")] - public required List MaxBackpackLootTotalRub - { - get; - set; - } + public required List MaxBackpackLootTotalRub { get; set; } [JsonPropertyName("maxPocketLootTotalRub")] - public required int MaxPocketLootTotalRub - { - get; - set; - } + public required int MaxPocketLootTotalRub { get; set; } [JsonPropertyName("maxVestLootTotalRub")] - public required int MaxVestLootTotalRub - { - get; - set; - } + public required int MaxVestLootTotalRub { get; set; } /// /// How many levels above player level can a PMC be /// [JsonPropertyName("botRelativeLevelDeltaMax")] - public required int BotRelativeLevelDeltaMax - { - get; - set; - } + public required int BotRelativeLevelDeltaMax { get; set; } /// /// How many levels below player level can a PMC be /// [JsonPropertyName("botRelativeLevelDeltaMin")] - public required int BotRelativeLevelDeltaMin - { - get; - set; - } + public required int BotRelativeLevelDeltaMin { get; set; } /// /// Force a number of healing items into PMCs secure container to ensure they can heal /// [JsonPropertyName("forceHealingItemsIntoSecure")] - public required bool ForceHealingItemsIntoSecure - { - get; - set; - } + public required bool ForceHealingItemsIntoSecure { get; set; } [JsonPropertyName("hostilitySettings")] - public required Dictionary HostilitySettings - { - get; - set; - } + public required Dictionary HostilitySettings { get; set; } [JsonPropertyName("allPMCsHavePlayerNameWithRandomPrefixChance")] - public required double AllPMCsHavePlayerNameWithRandomPrefixChance - { - get; - set; - } + public required double AllPMCsHavePlayerNameWithRandomPrefixChance { get; set; } [JsonPropertyName("locationSpecificPmcLevelOverride")] - public required Dictionary> LocationSpecificPmcLevelOverride - { - get; - set; - } + public required Dictionary> LocationSpecificPmcLevelOverride { get; set; } /// /// Should secure container loot from usec.json/bear.json be added to pmc bots secure /// [JsonPropertyName("addSecureContainerLootFromBotConfig")] - public required bool AddSecureContainerLootFromBotConfig - { - get; - set; - } + public required bool AddSecureContainerLootFromBotConfig { get; set; } [JsonPropertyName("addPrefixToSameNamePMCAsPlayerChance")] - public required int? AddPrefixToSameNamePMCAsPlayerChance - { - get; - set; - } + public required int? AddPrefixToSameNamePMCAsPlayerChance { get; set; } [JsonPropertyName("lootItemLimitsRub")] - public required List? LootItemLimitsRub - { - get; - set; - } + public required List? LootItemLimitsRub { get; set; } [JsonPropertyName("removeExistingPmcWaves")] - public required bool? RemoveExistingPmcWaves - { - get; - set; - } + public required bool? RemoveExistingPmcWaves { get; set; } [JsonPropertyName("customPmcWaves")] - public required Dictionary> CustomPmcWaves - { - get; - set; - } + public required Dictionary> CustomPmcWaves { get; set; } } public record HostilitySettings @@ -295,59 +170,31 @@ public record HostilitySettings /// Bot roles that are 100% an enemy /// [JsonPropertyName("additionalEnemyTypes")] - public List? AdditionalEnemyTypes - { - get; - set; - } + public List? AdditionalEnemyTypes { get; set; } /// /// Objects that determine the % chance another bot type is an enemy /// [JsonPropertyName("chancedEnemies")] - public List? ChancedEnemies - { - get; - set; - } + public List? ChancedEnemies { get; set; } [JsonPropertyName("bearEnemyChance")] - public double? BearEnemyChance - { - get; - set; - } + public double? BearEnemyChance { get; set; } [JsonPropertyName("usecEnemyChance")] - public double? UsecEnemyChance - { - get; - set; - } + public double? UsecEnemyChance { get; set; } [JsonPropertyName("savageEnemyChance")] - public double? SavageEnemyChance - { - get; - set; - } + public double? SavageEnemyChance { get; set; } /// /// Bot roles that are 100% a friendly /// [JsonPropertyName("additionalFriendlyTypes")] - public List? AdditionalFriendlyTypes - { - get; - set; - } + public List? AdditionalFriendlyTypes { get; set; } [JsonPropertyName("savagePlayerBehaviour")] - public string? SavagePlayerBehaviour - { - get; - set; - } + public string? SavagePlayerBehaviour { get; set; } } public record SlotLootSettings @@ -359,53 +206,29 @@ public record SlotLootSettings /// Item Type whitelist /// [JsonPropertyName("whitelist")] - public HashSet Whitelist - { - get; - set; - } = []; + public HashSet Whitelist { get; set; } = []; /// /// Item tpl blacklist /// [JsonPropertyName("blacklist")] - public HashSet Blacklist - { - get; - set; - } = []; + public HashSet Blacklist { get; set; } = []; } public record MinMaxLootValue : MinMax { [JsonPropertyName("value")] - public double Value - { - get; - set; - } + public double Value { get; set; } } public record MinMaxLootItemValue : MinMax { [JsonPropertyName("backpack")] - public required MinMax Backpack - { - get; - set; - } + public required MinMax Backpack { get; set; } [JsonPropertyName("pocket")] - public required MinMax Pocket - { - get; - set; - } + public required MinMax Pocket { get; set; } [JsonPropertyName("vest")] - public required MinMax Vest - { - get; - set; - } + public required MinMax Vest { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs index 0164831f..685c68d3 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs @@ -9,93 +9,49 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record QuestConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-quest"; + public override string Kind { get; set; } = "spt-quest"; /// /// Hours to get/redeem items from quest mail keyed by profile type /// [JsonPropertyName("mailRedeemTimeHours")] - public Dictionary? MailRedeemTimeHours - { - get; - set; - } + public Dictionary? MailRedeemTimeHours { get; set; } [JsonPropertyName("questTemplateIds")] - public PlayerTypeQuestIds? QuestTemplateIds - { - get; - set; - } + public PlayerTypeQuestIds? QuestTemplateIds { get; set; } /// /// Show non-seasonal quests be shown to player /// [JsonPropertyName("showNonSeasonalEventQuests")] - public bool? ShowNonSeasonalEventQuests - { - get; - set; - } + public bool? ShowNonSeasonalEventQuests { get; set; } [JsonPropertyName("eventQuests")] - public Dictionary? EventQuests - { - get; - set; - } + public Dictionary? EventQuests { get; set; } [JsonPropertyName("repeatableQuests")] - public List? RepeatableQuests - { - get; - set; - } + public List? RepeatableQuests { get; set; } [JsonPropertyName("locationIdMap")] - public Dictionary? LocationIdMap - { - get; - set; - } + public Dictionary? LocationIdMap { get; set; } [JsonPropertyName("bearOnlyQuests")] - public HashSet? BearOnlyQuests - { - get; - set; - } + public HashSet? BearOnlyQuests { get; set; } [JsonPropertyName("usecOnlyQuests")] - public HashSet? UsecOnlyQuests - { - get; - set; - } + public HashSet? UsecOnlyQuests { get; set; } /// /// Quests that the keyed game version do not see/access /// [JsonPropertyName("profileBlacklist")] - public Dictionary>? ProfileBlacklist - { - get; - set; - } + public Dictionary>? ProfileBlacklist { get; set; } /// /// key=questid, gameversions that can see/access quest /// [JsonPropertyName("profileWhitelist")] - public Dictionary>? ProfileWhitelist - { - get; - set; - } + public Dictionary>? ProfileWhitelist { get; set; } } public record PlayerTypeQuestIds @@ -104,18 +60,10 @@ public record PlayerTypeQuestIds public Dictionary ExtensionData { get; set; } [JsonPropertyName("pmc")] - public QuestTypeIds? Pmc - { - get; - set; - } + public QuestTypeIds? Pmc { get; set; } [JsonPropertyName("scav")] - public QuestTypeIds? Scav - { - get; - set; - } + public QuestTypeIds? Scav { get; set; } } public record QuestTypeIds @@ -124,32 +72,16 @@ public record QuestTypeIds public Dictionary ExtensionData { get; set; } [JsonPropertyName("elimination")] - public string? Elimination - { - get; - set; - } + public string? Elimination { get; set; } [JsonPropertyName("completion")] - public string? Completion - { - get; - set; - } + public string? Completion { get; set; } [JsonPropertyName("exploration")] - public string? Exploration - { - get; - set; - } + public string? Exploration { get; set; } [JsonPropertyName("pickup")] - public string? Pickup - { - get; - set; - } + public string? Pickup { get; set; } } public record EventQuestData @@ -158,40 +90,20 @@ public record EventQuestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("season")] - public SeasonalEventType? Season - { - get; - set; - } + public SeasonalEventType? Season { get; set; } [JsonPropertyName("startTimestamp")] - public long? StartTimestamp - { - get; - set; - } + public long? StartTimestamp { get; set; } [JsonPropertyName("endTimestamp")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public long? EndTimestamp - { - get; - set; - } + public long? EndTimestamp { get; set; } [JsonPropertyName("yearly")] - public bool? Yearly - { - get; - set; - } + public bool? Yearly { get; set; } } public record RepeatableQuestConfig @@ -200,139 +112,67 @@ public record RepeatableQuestConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("side")] - public string? Side - { - get; - set; - } + public string? Side { get; set; } [JsonPropertyName("types")] - public List? Types - { - get; - set; - } + public List? Types { get; set; } [JsonPropertyName("resetTime")] - public long? ResetTime - { - get; - set; - } + public long? ResetTime { get; set; } [JsonPropertyName("numQuests")] - public int? NumQuests - { - get; - set; - } + public int? NumQuests { get; set; } [JsonPropertyName("minPlayerLevel")] - public int? MinPlayerLevel - { - get; - set; - } + public int? MinPlayerLevel { get; set; } [JsonPropertyName("rewardScaling")] - public RewardScaling? RewardScaling - { - get; - set; - } + public RewardScaling? RewardScaling { get; set; } [JsonPropertyName("locations")] - public Dictionary>? Locations - { - get; - set; - } + public Dictionary>? Locations { get; set; } [JsonPropertyName("traderWhitelist")] - public List? TraderWhitelist - { - get; - set; - } + public List? TraderWhitelist { get; set; } [JsonPropertyName("questConfig")] - public RepeatableQuestTypesConfig? QuestConfig - { - get; - set; - } + public RepeatableQuestTypesConfig? QuestConfig { get; set; } /// /// Item base types to block when generating rewards /// [JsonPropertyName("rewardBaseTypeBlacklist")] - public HashSet? RewardBaseTypeBlacklist - { - get; - set; - } + public HashSet? RewardBaseTypeBlacklist { get; set; } /// /// Item tplIds to ignore when generating rewards /// [JsonPropertyName("rewardBlacklist")] - public HashSet? RewardBlacklist - { - get; - set; - } + public HashSet? RewardBlacklist { get; set; } [JsonPropertyName("rewardAmmoStackMinSize")] - public int? RewardAmmoStackMinSize - { - get; - set; - } + public int? RewardAmmoStackMinSize { get; set; } [JsonPropertyName("freeChangesAvailable")] - public int? FreeChangesAvailable - { - get; - set; - } + public int? FreeChangesAvailable { get; set; } [JsonPropertyName("freeChanges")] - public int? FreeChanges - { - get; - set; - } + public int? FreeChanges { get; set; } [JsonPropertyName("keepDailyQuestTypeOnReplacement")] - public bool? KeepDailyQuestTypeOnReplacement - { - get; - set; - } + public bool? KeepDailyQuestTypeOnReplacement { get; set; } /// /// Reputation standing price for replacing a repeatable /// [JsonPropertyName("standingChangeCost")] - public IList? StandingChangeCost - { - get; - set; - } + public IList? StandingChangeCost { get; set; } } public record RewardScaling @@ -341,67 +181,31 @@ public record RewardScaling public Dictionary ExtensionData { get; set; } [JsonPropertyName("levels")] - public List? Levels - { - get; - set; - } + public List? Levels { get; set; } [JsonPropertyName("experience")] - public List? Experience - { - get; - set; - } + public List? Experience { get; set; } [JsonPropertyName("roubles")] - public List? Roubles - { - get; - set; - } + public List? Roubles { get; set; } [JsonPropertyName("gpCoins")] - public List? GpCoins - { - get; - set; - } + public List? GpCoins { get; set; } [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } [JsonPropertyName("reputation")] - public List? Reputation - { - get; - set; - } + public List? Reputation { get; set; } [JsonPropertyName("rewardSpread")] - public double? RewardSpread - { - get; - set; - } + public double? RewardSpread { get; set; } [JsonPropertyName("skillRewardChance")] - public List? SkillRewardChance - { - get; - set; - } + public List? SkillRewardChance { get; set; } [JsonPropertyName("skillPointReward")] - public List? SkillPointReward - { - get; - set; - } + public List? SkillPointReward { get; set; } } public record TraderWhitelist @@ -410,46 +214,22 @@ public record TraderWhitelist public Dictionary ExtensionData { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } [JsonPropertyName("questTypes")] - public List? QuestTypes - { - get; - set; - } + public List? QuestTypes { get; set; } [JsonPropertyName("rewardBaseWhitelist")] - public List? RewardBaseWhitelist - { - get; - set; - } + public List? RewardBaseWhitelist { get; set; } [JsonPropertyName("rewardCanBeWeapon")] - public bool? RewardCanBeWeapon - { - get; - set; - } + public bool? RewardCanBeWeapon { get; set; } [JsonPropertyName("weaponRewardChancePercent")] - public double? WeaponRewardChancePercent - { - get; - set; - } + public double? WeaponRewardChancePercent { get; set; } } public record RepeatableQuestTypesConfig @@ -458,56 +238,28 @@ public record RepeatableQuestTypesConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("Exploration")] - public Exploration? Exploration - { - get; - set; - } + public Exploration? Exploration { get; set; } [JsonPropertyName("Completion")] - public Completion? Completion - { - get; - set; - } + public Completion? Completion { get; set; } [JsonPropertyName("Pickup")] - public Pickup? Pickup - { - get; - set; - } + public Pickup? Pickup { get; set; } [JsonPropertyName("Elimination")] - public List? Elimination - { - get; - set; - } + public List? Elimination { get; set; } } public record Exploration : BaseQuestConfig { [JsonPropertyName("maxExtracts")] - public int? MaximumExtracts - { - get; - set; - } + public int? MaximumExtracts { get; set; } [JsonPropertyName("maxExtractsWithSpecificExit")] - public int? MaximumExtractsWithSpecificExit - { - get; - set; - } + public int? MaximumExtractsWithSpecificExit { get; set; } [JsonPropertyName("specificExits")] - public SpecificExits? SpecificExits - { - get; - set; - } + public SpecificExits? SpecificExits { get; set; } } public record SpecificExits @@ -516,123 +268,63 @@ public record SpecificExits public Dictionary ExtensionData { get; set; } [JsonPropertyName("probability")] - public double? Probability - { - get; - set; - } + public double? Probability { get; set; } [JsonPropertyName("passageRequirementWhitelist")] - public List? PassageRequirementWhitelist - { - get; - set; - } + public List? PassageRequirementWhitelist { get; set; } } public record Completion : BaseQuestConfig { [JsonPropertyName("minRequestedAmount")] - public int? MinimumRequestedAmount - { - get; - set; - } + public int? MinimumRequestedAmount { get; set; } [JsonPropertyName("maxRequestedAmount")] - public int? MaximumRequestedAmount - { - get; - set; - } + public int? MaximumRequestedAmount { get; set; } [JsonPropertyName("uniqueItemCount")] - public int? UniqueItemCount - { - get; - set; - } + public int? UniqueItemCount { get; set; } [JsonPropertyName("minRequestedBulletAmount")] - public int? MinimumRequestedBulletAmount - { - get; - set; - } + public int? MinimumRequestedBulletAmount { get; set; } [JsonPropertyName("maxRequestedBulletAmount")] - public int? MaximumRequestedBulletAmount - { - get; - set; - } + public int? MaximumRequestedBulletAmount { get; set; } [JsonPropertyName("useWhitelist")] - public bool? UseWhitelist - { - get; - set; - } + public bool? UseWhitelist { get; set; } [JsonPropertyName("useBlacklist")] - public bool? UseBlacklist - { - get; - set; - } + public bool? UseBlacklist { get; set; } /// /// Should supplied items be required FiR /// [JsonPropertyName("requiredItemsAreFiR")] - public bool? RequiredItemsAreFiR - { - get; - set; - } + public bool? RequiredItemsAreFiR { get; set; } /// /// Should supplied items be required FiR /// [JsonPropertyName("requiredItemMinDurabilityMinMax")] - public MinMax? RequiredItemMinDurabilityMinMax - { - get; - set; - } + public MinMax? RequiredItemMinDurabilityMinMax { get; set; } /// /// Blacklisted item types to not collect /// [JsonPropertyName("requiredItemTypeBlacklist")] - public HashSet? RequiredItemTypeBlacklist - { - get; - set; - } + public HashSet? RequiredItemTypeBlacklist { get; set; } } public record Pickup : BaseQuestConfig { [JsonPropertyName("ItemTypeToFetchWithMaxCount")] - public List? ItemTypeToFetchWithMaxCount - { - get; - set; - } + public List? ItemTypeToFetchWithMaxCount { get; set; } - public List? ItemTypesToFetch - { - get; - set; - } + public List? ItemTypesToFetch { get; set; } [JsonPropertyName("maxItemFetchCount")] - public int? MaxItemFetchCount - { - get; - set; - } + public int? MaxItemFetchCount { get; set; } } public record PickupTypeWithMaxCount @@ -641,161 +333,73 @@ public record PickupTypeWithMaxCount public Dictionary ExtensionData { get; set; } [JsonPropertyName("itemType")] - public string? ItemType - { - get; - set; - } + public string? ItemType { get; set; } [JsonPropertyName("maxPickupCount")] - public int? MaximumPickupCount - { - get; - set; - } + public int? MaximumPickupCount { get; set; } [JsonPropertyName("minPickupCount")] - public int? MinimumPickupCount - { - get; - set; - } + public int? MinimumPickupCount { get; set; } } public record EliminationConfig : BaseQuestConfig { [JsonPropertyName("levelRange")] - public MinMax? LevelRange - { - get; - set; - } + public MinMax? LevelRange { get; set; } [JsonPropertyName("targets")] - public List>? Targets - { - get; - set; - } + public List>? Targets { get; set; } [JsonPropertyName("bodyPartProb")] - public double? BodyPartProbability - { - get; - set; - } + public double? BodyPartProbability { get; set; } [JsonPropertyName("bodyParts")] - public List>>? BodyParts - { - get; - set; - } + public List>>? BodyParts { get; set; } [JsonPropertyName("specificLocationProb")] - public double? SpecificLocationProbability - { - get; - set; - } + public double? SpecificLocationProbability { get; set; } [JsonPropertyName("distLocationBlacklist")] - public List? DistLocationBlacklist - { - get; - set; - } + public List? DistLocationBlacklist { get; set; } [JsonPropertyName("distProb")] - public double? DistanceProbability - { - get; - set; - } + public double? DistanceProbability { get; set; } [JsonPropertyName("maxDist")] - public double? MaxDistance - { - get; - set; - } + public double? MaxDistance { get; set; } [JsonPropertyName("minDist")] - public double? MinDistance - { - get; - set; - } + public double? MinDistance { get; set; } [JsonPropertyName("maxKills")] - public int? MaxKills - { - get; - set; - } + public int? MaxKills { get; set; } [JsonPropertyName("minKills")] - public int? MinKills - { - get; - set; - } + public int? MinKills { get; set; } [JsonPropertyName("minBossKills")] - public int? MinBossKills - { - get; - set; - } + public int? MinBossKills { get; set; } [JsonPropertyName("maxBossKills")] - public int? MaxBossKills - { - get; - set; - } + public int? MaxBossKills { get; set; } [JsonPropertyName("minPmcKills")] - public int? MinPmcKills - { - get; - set; - } + public int? MinPmcKills { get; set; } [JsonPropertyName("maxPmcKills")] - public int? MaxPmcKills - { - get; - set; - } + public int? MaxPmcKills { get; set; } [JsonPropertyName("weaponCategoryRequirementProb")] - public double? WeaponCategoryRequirementProbability - { - get; - set; - } + public double? WeaponCategoryRequirementProbability { get; set; } [JsonPropertyName("weaponCategoryRequirements")] - public List>>? WeaponCategoryRequirements - { - get; - set; - } + public List>>? WeaponCategoryRequirements { get; set; } [JsonPropertyName("weaponRequirementProb")] - public double? WeaponRequirementProbability - { - get; - set; - } + public double? WeaponRequirementProbability { get; set; } [JsonPropertyName("weaponRequirements")] - public List>>? WeaponRequirements - { - get; - set; - } + public List>>? WeaponRequirements { get; set; } } public record BaseQuestConfig @@ -804,11 +408,7 @@ public record BaseQuestConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("possibleSkillRewards")] - public List? PossibleSkillRewards - { - get; - set; - } + public List? PossibleSkillRewards { get; set; } } public record BossInfo @@ -817,16 +417,8 @@ public record BossInfo public Dictionary ExtensionData { get; set; } [JsonPropertyName("isBoss")] - public bool? IsBoss - { - get; - set; - } + public bool? IsBoss { get; set; } [JsonPropertyName("isPmc")] - public bool? IsPmc - { - get; - set; - } + public bool? IsPmc { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs index d8af41d1..6bb91415 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs @@ -6,65 +6,37 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record RagfairConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-ragfair"; + public override string Kind { get; set; } = "spt-ragfair"; /// /// How many seconds should pass before expired offers and processed + player offers checked if sold /// [JsonPropertyName("runIntervalSeconds")] - public int RunIntervalSeconds - { - get; - set; - } + public int RunIntervalSeconds { get; set; } /// /// Default values used to hydrate `runIntervalSeconds` with /// [JsonPropertyName("runIntervalValues")] - public RunIntervalValues RunIntervalValues - { - get; - set; - } + public RunIntervalValues RunIntervalValues { get; set; } /// /// Player listing settings /// [JsonPropertyName("sell")] - public Sell Sell - { - get; - set; - } + public Sell Sell { get; set; } /// /// Trader ids + should their assorts be listed on flea /// [JsonPropertyName("traders")] - public Dictionary Traders - { - get; - set; - } + public Dictionary Traders { get; set; } [JsonPropertyName("dynamic")] - public Dynamic Dynamic - { - get; - set; - } + public Dynamic Dynamic { get; set; } [JsonPropertyName("tieredFlea")] - public TieredFlea TieredFlea - { - get; - set; - } + public TieredFlea TieredFlea { get; set; } } public record Sell @@ -76,41 +48,25 @@ public record Sell /// Should a fee be deducted from player when listing an item for sale /// [JsonPropertyName("fees")] - public bool Fees - { - get; - set; - } + public bool Fees { get; set; } /// /// Settings to control chances of offer being sold /// [JsonPropertyName("chance")] - public Chance Chance - { - get; - set; - } + public Chance Chance { get; set; } /// /// Settings to control how long it takes for a player offer to sell /// [JsonPropertyName("time")] - public MinMax Time - { - get; - set; - } + public MinMax Time { get; set; } /// /// Seconds from clicking remove to remove offer from market /// [JsonPropertyName("expireSeconds")] - public int ExpireSeconds - { - get; - set; - } + public int ExpireSeconds { get; set; } } public record Chance @@ -122,41 +78,25 @@ public record Chance /// Base chance percent to sell an item /// [JsonPropertyName("base")] - public int Base - { - get; - set; - } + public int Base { get; set; } /// /// Value to multiply the sell chance by /// [JsonPropertyName("sellMultiplier")] - public double SellMultiplier - { - get; - set; - } + public double SellMultiplier { get; set; } /// /// Max possible sell chance % for a player listed offer /// [JsonPropertyName("maxSellChancePercent")] - public int MaxSellChancePercent - { - get; - set; - } + public int MaxSellChancePercent { get; set; } /// /// Min possible sell chance % for a player listed offer /// [JsonPropertyName("minSellChancePercent")] - public int MinSellChancePercent - { - get; - set; - } + public int MinSellChancePercent { get; set; } } public record Dynamic @@ -168,232 +108,136 @@ public record Dynamic /// Should a purchased dynamic offers items be flagged as found in raid /// [JsonPropertyName("purchasesAreFoundInRaid")] - public bool PurchasesAreFoundInRaid - { - get; - set; - } + public bool PurchasesAreFoundInRaid { get; set; } /// /// Use the highest trader price for an offer if its greater than the price in templates/prices.json /// [JsonPropertyName("useTraderPriceForOffersIfHigher")] - public bool UseTraderPriceForOffersIfHigher - { - get; - set; - } + public bool UseTraderPriceForOffersIfHigher { get; set; } /// /// Barter offer specific settings /// [JsonPropertyName("barter")] - public BarterDetails Barter - { - get; - set; - } + public BarterDetails Barter { get; set; } [JsonPropertyName("pack")] - public PackDetails Pack - { - get; - set; - } + public PackDetails Pack { get; set; } /// /// Dynamic offer price below handbook adjustment values /// [JsonPropertyName("offerAdjustment")] - public OfferAdjustment OfferAdjustment - { - get; - set; - } + public OfferAdjustment OfferAdjustment { get; set; } /// /// How many offers should expire before an offer regeneration occurs /// [JsonPropertyName("expiredOfferThreshold")] - public int ExpiredOfferThreshold - { - get; - set; - } + public int ExpiredOfferThreshold { get; set; } /// /// How many offers should be listed /// [JsonPropertyName("offerItemCount")] - public Dictionary> OfferItemCount - { - get; - set; - } + public Dictionary> OfferItemCount { get; set; } /// /// How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) /// [JsonPropertyName("priceRanges")] - public PriceRanges PriceRanges - { - get; - set; - } + public PriceRanges PriceRanges { get; set; } /// /// Should default presets to listed only or should non-standard presets found in globals.json be listed too /// [JsonPropertyName("showDefaultPresetsOnly")] - public bool ShowDefaultPresetsOnly - { - get; - set; - } + public bool ShowDefaultPresetsOnly { get; set; } /// /// Tpls that should not use the variable price system when their quality is less than 100% (lower dura/uses = lower price) /// [JsonPropertyName("ignoreQualityPriceVarianceBlacklist")] - public HashSet IgnoreQualityPriceVarianceBlacklist - { - get; - set; - } + public HashSet IgnoreQualityPriceVarianceBlacklist { get; set; } [JsonPropertyName("endTimeSeconds")] - public MinMax EndTimeSeconds - { - get; - set; - } + public MinMax EndTimeSeconds { get; set; } /// /// Settings to control the durability range of item items listed on flea /// [JsonPropertyName("condition")] - public Dictionary Condition - { - get; - set; - } + public Dictionary Condition { get; set; } /// /// Size stackable items should be listed for in percent of max stack size /// [JsonPropertyName("stackablePercent")] - public MinMax StackablePercent - { - get; - set; - } + public MinMax StackablePercent { get; set; } /// /// Items that cannot be stacked can have multiples sold in one offer, what range of values can be listed /// [JsonPropertyName("nonStackableCount")] - public MinMax NonStackableCount - { - get; - set; - } + public MinMax NonStackableCount { get; set; } /// /// Range of rating offers for items being listed /// [JsonPropertyName("rating")] - public MinMax Rating - { - get; - set; - } + public MinMax Rating { get; set; } /// /// Armor specific flea settings /// [JsonPropertyName("armor")] - public ArmorSettings Armor - { - get; - set; - } + public ArmorSettings Armor { get; set; } /// /// A multipler to apply to individual tpls price just prior to item quality adjustment /// [JsonPropertyName("itemPriceMultiplier")] - public Dictionary? ItemPriceMultiplier - { - get; - set; - } + public Dictionary? ItemPriceMultiplier { get; set; } [JsonPropertyName("_currencies")] - public string? CurrenciesDescription - { - get; - set; - } + public string? CurrenciesDescription { get; set; } /// /// Percentages to sell offers in each currency /// [JsonPropertyName("currencies")] - public Dictionary Currencies - { - get; - set; - } + public Dictionary Currencies { get; set; } /// /// Item tpls that should be forced to sell as a single item /// [JsonPropertyName("showAsSingleStack")] - public HashSet ShowAsSingleStack - { - get; - set; - } + public HashSet ShowAsSingleStack { get; set; } /// /// Should christmas/halloween items be removed from flea when not within the seasonal bounds /// [JsonPropertyName("removeSeasonalItemsWhenNotInEvent")] - public bool RemoveSeasonalItemsWhenNotInEvent - { - get; - set; - } + public bool RemoveSeasonalItemsWhenNotInEvent { get; set; } /// /// Flea blacklist settings /// [JsonPropertyName("blacklist")] - public RagfairBlacklist Blacklist - { - get; - set; - } + public RagfairBlacklist Blacklist { get; set; } /// /// Dict of price limits keyed by item type /// [JsonPropertyName("unreasonableModPrices")] - public Dictionary UnreasonableModPrices - { - get; - set; - } + public Dictionary UnreasonableModPrices { get; set; } /// /// Custom rouble prices for items to override values from prices.json /// [JsonPropertyName("itemPriceOverrideRouble")] - public Dictionary ItemPriceOverrideRouble - { - get; - set; - } + public Dictionary ItemPriceOverrideRouble { get; set; } } public record PriceRanges @@ -402,25 +246,13 @@ public record PriceRanges public Dictionary ExtensionData { get; set; } [JsonPropertyName("default")] - public MinMax Default - { - get; - set; - } + public MinMax Default { get; set; } [JsonPropertyName("preset")] - public MinMax Preset - { - get; - set; - } + public MinMax Preset { get; set; } [JsonPropertyName("pack")] - public MinMax Pack - { - get; - set; - } + public MinMax Pack { get; set; } } public record BarterDetails @@ -432,71 +264,43 @@ public record BarterDetails /// Percentage change an offer is listed as a barter /// [JsonPropertyName("chancePercent")] - public double ChancePercent - { - get; - set; - } + public double ChancePercent { get; set; } /// /// Min number of required items for a barter requirement /// [JsonPropertyName("itemCountMin")] - public int ItemCountMin - { - get; - set; - } + public int ItemCountMin { get; set; } /// /// Max number of required items for a barter requirement /// [JsonPropertyName("itemCountMax")] - public int ItemCountMax - { - get; - set; - } + public int ItemCountMax { get; set; } /// /// How much can the total price of requested items vary from the item offered /// [JsonPropertyName("priceRangeVariancePercent")] - public double PriceRangeVariancePercent - { - get; - set; - } + public double PriceRangeVariancePercent { get; set; } /// /// Min rouble price for an offer to be considered for turning into a barter /// [JsonPropertyName("minRoubleCostToBecomeBarter")] - public double MinRoubleCostToBecomeBarter - { - get; - set; - } + public double MinRoubleCostToBecomeBarter { get; set; } /// /// Should barter offers only single stack /// [JsonPropertyName("makeSingleStackOnly")] - public bool MakeSingleStackOnly - { - get; - set; - } + public bool MakeSingleStackOnly { get; set; } /// /// Item Tpls to never be turned into a barter /// [JsonPropertyName("itemTypeBlacklist")] - public HashSet ItemTypeBlacklist - { - get; - set; - } + public HashSet ItemTypeBlacklist { get; set; } } public record PackDetails @@ -508,41 +312,25 @@ public record PackDetails /// Percentage change an offer is listed as a pack /// [JsonPropertyName("chancePercent")] - public double ChancePercent - { - get; - set; - } + public double ChancePercent { get; set; } /// /// Min number of required items for a pack /// [JsonPropertyName("itemCountMin")] - public int ItemCountMin - { - get; - set; - } + public int ItemCountMin { get; set; } /// /// Max number of required items for a pack /// [JsonPropertyName("itemCountMax")] - public int ItemCountMax - { - get; - set; - } + public int ItemCountMax { get; set; } /// /// item types to allow being a pack /// [JsonPropertyName("itemTypeWhitelist")] - public HashSet ItemTypeWhitelist - { - get; - set; - } + public HashSet ItemTypeWhitelist { get; set; } } public record OfferAdjustment @@ -554,41 +342,25 @@ public record OfferAdjustment /// Shuld offer price be adjusted when below handbook price /// [JsonPropertyName("adjustPriceWhenBelowHandbookPrice")] - public bool AdjustPriceWhenBelowHandbookPrice - { - get; - set; - } + public bool AdjustPriceWhenBelowHandbookPrice { get; set; } /// /// How big a percentage difference does price need to vary from handbook to be considered for adjustment /// [JsonPropertyName("maxPriceDifferenceBelowHandbookPercent")] - public double MaxPriceDifferenceBelowHandbookPercent - { - get; - set; - } + public double MaxPriceDifferenceBelowHandbookPercent { get; set; } /// /// How much to multiply the handbook price to get the new price /// [JsonPropertyName("handbookPriceMultipier")] - public double HandbookPriceMultiplier - { - get; - set; - } + public double HandbookPriceMultiplier { get; set; } /// /// What is the minimum rouble price to consider adjusting price of item /// [JsonPropertyName("priceThreshholdRub")] - public double PriceThresholdRub - { - get; - set; - } + public double PriceThresholdRub { get; set; } } public record Condition @@ -600,32 +372,16 @@ public record Condition /// Percentage change durability is altered /// [JsonPropertyName("conditionChance")] - public double ConditionChance - { - get; - set; - } + public double ConditionChance { get; set; } [JsonPropertyName("current")] - public MinMax Current - { - get; - set; - } + public MinMax Current { get; set; } [JsonPropertyName("max")] - public MinMax Max - { - get; - set; - } + public MinMax Max { get; set; } [JsonPropertyName("_name")] - public string Name - { - get; - set; - } + public string Name { get; set; } } public record RagfairBlacklist @@ -637,81 +393,49 @@ public record RagfairBlacklist /// Damaged ammo packs /// [JsonPropertyName("damagedAmmoPacks")] - public bool DamagedAmmoPacks - { - get; - set; - } + public bool DamagedAmmoPacks { get; set; } /// /// Custom blacklist for item Tpls /// [JsonPropertyName("custom")] - public HashSet Custom - { - get; - set; - } + public HashSet Custom { get; set; } /// /// BSG blacklist a large number of items from flea, true = use blacklist /// [JsonPropertyName("enableBsgList")] - public bool EnableBsgList - { - get; - set; - } + public bool EnableBsgList { get; set; } /// /// Should quest items be blacklisted from flea /// [JsonPropertyName("enableQuestList")] - public bool EnableQuestList - { - get; - set; - } + public bool EnableQuestList { get; set; } /// /// Should trader items that are blacklisted by bsg be listed on flea /// [JsonPropertyName("traderItems")] - public bool TraderItems - { - get; - set; - } + public bool TraderItems { get; set; } /// /// Maximum level an armor plate can be found in a flea-listed armor item /// [JsonPropertyName("armorPlate")] - public ArmorPlateBlacklistSettings ArmorPlate - { - get; - set; - } + public ArmorPlateBlacklistSettings ArmorPlate { get; set; } /// /// Should specific categories be blacklisted from the flea, true = use blacklist /// [JsonPropertyName("enableCustomItemCategoryList")] - public bool EnableCustomItemCategoryList - { - get; - set; - } + public bool EnableCustomItemCategoryList { get; set; } /// /// Custom category blacklist for parent Ids /// [JsonPropertyName("customItemCategoryList")] - public HashSet CustomItemCategoryList - { - get; - set; - } + public HashSet CustomItemCategoryList { get; set; } } public record ArmorPlateBlacklistSettings @@ -723,21 +447,13 @@ public record ArmorPlateBlacklistSettings /// Max level of plates an armor can have without being removed /// [JsonPropertyName("maxProtectionLevel")] - public int MaxProtectionLevel - { - get; - set; - } + public int MaxProtectionLevel { get; set; } /// /// Item slots to NOT remove from items on flea /// [JsonPropertyName("ignoreSlots")] - public HashSet IgnoreSlots - { - get; - set; - } + public HashSet IgnoreSlots { get; set; } } public record UnreasonableModPrices @@ -749,38 +465,22 @@ public record UnreasonableModPrices /// Enable a system that adjusts very high ragfair prices to be below a max multiple of items the handbook values /// [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } /// /// Multipler to start adjusting item values from, e.g. a value of 10 means any value over 10x the handbook price gets adjusted /// [JsonPropertyName("handbookPriceOverMultiplier")] - public int HandbookPriceOverMultiplier - { - get; - set; - } + public int HandbookPriceOverMultiplier { get; set; } /// /// The new multiplier for items found using above property, e.g. a value of 4 means set items price to 4x handbook price /// [JsonPropertyName("newPriceHandbookMultiplier")] - public int NewPriceHandbookMultiplier - { - get; - set; - } + public int NewPriceHandbookMultiplier { get; set; } [JsonPropertyName("itemType")] - public string ItemType - { - get; - set; - } + public string ItemType { get; set; } } public record ArmorSettings @@ -792,21 +492,13 @@ public record ArmorSettings /// % chance / 100 that armor plates will be removed from an offer before listing /// [JsonPropertyName("removeRemovablePlateChance")] - public int RemoveRemovablePlateChance - { - get; - set; - } + public int RemoveRemovablePlateChance { get; set; } /// /// What slots are to be removed when removeRemovablePlateChance is true /// [JsonPropertyName("plateSlotIdToRemovePool")] - public HashSet? PlateSlotIdToRemovePool - { - get; - set; - } + public HashSet? PlateSlotIdToRemovePool { get; set; } } public record TieredFlea @@ -815,43 +507,23 @@ public record TieredFlea public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } /// /// key: tpl, value: playerlevel /// [JsonPropertyName("unlocksTpl")] - public Dictionary UnlocksTpl - { - get; - set; - } + public Dictionary UnlocksTpl { get; set; } /// /// key: item type id, value: playerlevel /// [JsonPropertyName("unlocksType")] - public Dictionary UnlocksType - { - get; - set; - } + public Dictionary UnlocksType { get; set; } [JsonPropertyName("ammoTplUnlocks")] - public Dictionary? AmmoTplUnlocks - { - get; - set; - } + public Dictionary? AmmoTplUnlocks { get; set; } [JsonPropertyName("ammoTiersEnabled")] - public bool AmmoTiersEnabled - { - get; - set; - } + public bool AmmoTiersEnabled { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs index 3f8df3ea..bfd7281e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs @@ -6,73 +6,37 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record RepairConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-repair"; + public override string Kind { get; set; } = "spt-repair"; [JsonPropertyName("priceMultiplier")] - public double PriceMultiplier - { - get; - set; - } + public double PriceMultiplier { get; set; } [JsonPropertyName("applyRandomizeDurabilityLoss")] - public bool ApplyRandomizeDurabilityLoss - { - get; - set; - } + public bool ApplyRandomizeDurabilityLoss { get; set; } [JsonPropertyName("weaponSkillRepairGain")] - public double WeaponSkillRepairGain - { - get; - set; - } + public double WeaponSkillRepairGain { get; set; } [JsonPropertyName("armorKitSkillPointGainPerRepairPointMultiplier")] - public double ArmorKitSkillPointGainPerRepairPointMultiplier - { - get; - set; - } + public double ArmorKitSkillPointGainPerRepairPointMultiplier { get; set; } /// /// INT gain multiplier per repaired item type /// [JsonPropertyName("repairKitIntellectGainMultiplier")] - public required IntellectGainValues RepairKitIntellectGainMultiplier - { - get; - set; - } + public required IntellectGainValues RepairKitIntellectGainMultiplier { get; set; } /// /// How much INT can be given to player per repair action /// [JsonPropertyName("maxIntellectGainPerRepair")] - public required MaxIntellectGainValues MaxIntellectGainPerRepair - { - get; - set; - } + public required MaxIntellectGainValues MaxIntellectGainPerRepair { get; set; } [JsonPropertyName("weaponTreatment")] - public required WeaponTreatmentRepairValues WeaponTreatment - { - get; - set; - } + public required WeaponTreatmentRepairValues WeaponTreatment { get; set; } [JsonPropertyName("repairKit")] - public required RepairKit RepairKit - { - get; - set; - } + public required RepairKit RepairKit { get; set; } } public record IntellectGainValues @@ -81,18 +45,10 @@ public record IntellectGainValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("weapon")] - public double Weapon - { - get; - set; - } + public double Weapon { get; set; } [JsonPropertyName("armor")] - public double Armor - { - get; - set; - } + public double Armor { get; set; } } public record MaxIntellectGainValues @@ -101,18 +57,10 @@ public record MaxIntellectGainValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("kit")] - public double Kit - { - get; - set; - } + public double Kit { get; set; } [JsonPropertyName("trader")] - public double Trader - { - get; - set; - } + public double Trader { get; set; } } public record WeaponTreatmentRepairValues @@ -124,45 +72,25 @@ public record WeaponTreatmentRepairValues /// The chance to gain more weapon maintenance skill /// [JsonPropertyName("critSuccessChance")] - public double CritSuccessChance - { - get; - set; - } + public double CritSuccessChance { get; set; } [JsonPropertyName("critSuccessAmount")] - public double CritSuccessAmount - { - get; - set; - } + public double CritSuccessAmount { get; set; } /// /// The chance to gain less weapon maintenance skill /// [JsonPropertyName("critFailureChance")] - public double CritFailureChance - { - get; - set; - } + public double CritFailureChance { get; set; } [JsonPropertyName("critFailureAmount")] - public double CritFailureAmount - { - get; - set; - } + public double CritFailureAmount { get; set; } /// /// The multiplier used for calculating weapon maintenance XP /// [JsonPropertyName("pointGainMultiplier")] - public double PointGainMultiplier - { - get; - set; - } + public double PointGainMultiplier { get; set; } } public record RepairKit @@ -171,32 +99,16 @@ public record RepairKit public Dictionary ExtensionData { get; set; } [JsonPropertyName("armor")] - public required BonusSettings Armor - { - get; - set; - } + public required BonusSettings Armor { get; set; } [JsonPropertyName("weapon")] - public required BonusSettings Weapon - { - get; - set; - } + public required BonusSettings Weapon { get; set; } [JsonPropertyName("vest")] - public required BonusSettings Vest - { - get; - set; - } + public required BonusSettings Vest { get; set; } [JsonPropertyName("headwear")] - public required BonusSettings Headwear - { - get; - set; - } + public required BonusSettings Headwear { get; set; } } public record BonusSettings @@ -205,32 +117,16 @@ public record BonusSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("rarityWeight")] - public required Dictionary RarityWeight - { - get; - set; - } + public required Dictionary RarityWeight { get; set; } [JsonPropertyName("bonusTypeWeight")] - public required Dictionary BonusTypeWeight - { - get; - set; - } + public required Dictionary BonusTypeWeight { get; set; } [JsonPropertyName("Common")] - public required Dictionary Common - { - get; - set; - } + public required Dictionary Common { get; set; } [JsonPropertyName("Rare")] - public required Dictionary Rare - { - get; - set; - } + public required Dictionary Rare { get; set; } } public record BonusValues @@ -239,19 +135,11 @@ public record BonusValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("valuesMinMax")] - public required MinMax ValuesMinMax - { - get; - set; - } + public required MinMax ValuesMinMax { get; set; } /// /// What dura is buff active between (min max of current max) /// [JsonPropertyName("activeDurabilityPercentMinMax")] - public required MinMax ActiveDurabilityPercentMinMax - { - get; - set; - } + public required MinMax ActiveDurabilityPercentMinMax { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs index 2a3aa204..bdc3f733 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs @@ -6,67 +6,31 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record ScavCaseConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-scavcase"; + public override string Kind { get; set; } = "spt-scavcase"; [JsonPropertyName("rewardItemValueRangeRub")] - public required Dictionary> RewardItemValueRangeRub - { - get; - set; - } + public required Dictionary> RewardItemValueRangeRub { get; set; } [JsonPropertyName("moneyRewards")] - public required MoneyRewards MoneyRewards - { - get; - set; - } + public required MoneyRewards MoneyRewards { get; set; } [JsonPropertyName("ammoRewards")] - public required AmmoRewards AmmoRewards - { - get; - set; - } + public required AmmoRewards AmmoRewards { get; set; } [JsonPropertyName("rewardItemParentBlacklist")] - public required HashSet RewardItemParentBlacklist - { - get; - set; - } + public required HashSet RewardItemParentBlacklist { get; set; } [JsonPropertyName("rewardItemBlacklist")] - public required HashSet RewardItemBlacklist - { - get; - set; - } + public required HashSet RewardItemBlacklist { get; set; } [JsonPropertyName("allowMultipleMoneyRewardsPerRarity")] - public bool AllowMultipleMoneyRewardsPerRarity - { - get; - set; - } + public bool AllowMultipleMoneyRewardsPerRarity { get; set; } [JsonPropertyName("allowMultipleAmmoRewardsPerRarity")] - public bool AllowMultipleAmmoRewardsPerRarity - { - get; - set; - } + public bool AllowMultipleAmmoRewardsPerRarity { get; set; } [JsonPropertyName("allowBossItemsAsRewards")] - public bool AllowBossItemsAsRewards - { - get; - set; - } + public bool AllowBossItemsAsRewards { get; set; } } public record MoneyRewards @@ -75,39 +39,19 @@ public record MoneyRewards public Dictionary ExtensionData { get; set; } [JsonPropertyName("moneyRewardChancePercent")] - public int MoneyRewardChancePercent - { - get; - set; - } + public int MoneyRewardChancePercent { get; set; } [JsonPropertyName("rubCount")] - public required MoneyLevels RubCount - { - get; - set; - } + public required MoneyLevels RubCount { get; set; } [JsonPropertyName("usdCount")] - public required MoneyLevels UsdCount - { - get; - set; - } + public required MoneyLevels UsdCount { get; set; } [JsonPropertyName("eurCount")] - public required MoneyLevels EurCount - { - get; - set; - } + public required MoneyLevels EurCount { get; set; } [JsonPropertyName("gpCount")] - public required MoneyLevels GpCount - { - get; - set; - } + public required MoneyLevels GpCount { get; set; } } public record MoneyLevels @@ -116,25 +60,13 @@ public record MoneyLevels public Dictionary ExtensionData { get; set; } [JsonPropertyName("common")] - public required MinMax Common - { - get; - set; - } + public required MinMax Common { get; set; } [JsonPropertyName("rare")] - public required MinMax Rare - { - get; - set; - } + public required MinMax Rare { get; set; } [JsonPropertyName("superrare")] - public required MinMax SuperRare - { - get; - set; - } + public required MinMax SuperRare { get; set; } } public record AmmoRewards @@ -143,30 +75,14 @@ public record AmmoRewards public Dictionary ExtensionData { get; set; } [JsonPropertyName("ammoRewardChancePercent")] - public int AmmoRewardChancePercent - { - get; - set; - } + public int AmmoRewardChancePercent { get; set; } [JsonPropertyName("ammoRewardBlacklist")] - public required Dictionary> AmmoRewardBlacklist - { - get; - set; - } + public required Dictionary> AmmoRewardBlacklist { get; set; } [JsonPropertyName("ammoRewardValueRangeRub")] - public required Dictionary> AmmoRewardValueRangeRub - { - get; - set; - } + public required Dictionary> AmmoRewardValueRangeRub { get; set; } [JsonPropertyName("minStackSize")] - public int MinStackSize - { - get; - set; - } + public int MinStackSize { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs index 7bf23a3e..7219ab67 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs @@ -8,103 +8,70 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record SeasonalEventConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-seasonalevents"; + public override string Kind { get; set; } = "spt-seasonalevents"; [JsonPropertyName("enableSeasonalEventDetection")] - public bool EnableSeasonalEventDetection - { - get; - set; - } + public bool EnableSeasonalEventDetection { get; set; } /// /// event / botType / equipSlot / itemid /// [JsonPropertyName("eventGear")] - public required Dictionary>>> EventGear - { - get; - set; - } + public required Dictionary< + SeasonalEventType, + Dictionary>> + > EventGear { get; set; } /// /// event / bot type / equipSlot / itemid /// [JsonPropertyName("eventLoot")] - public required Dictionary>>> EventLoot - { - get; - set; - } + public required Dictionary< + SeasonalEventType, + Dictionary>> + > EventLoot { get; set; } [JsonPropertyName("events")] - public required List Events - { - get; - set; - } + public required List Events { get; set; } [JsonPropertyName("eventBotMapping")] - public required Dictionary EventBotMapping - { - get; - set; - } + public required Dictionary EventBotMapping { get; set; } [JsonPropertyName("eventBossSpawns")] - public required Dictionary>> EventBossSpawns - { - get; - set; - } + public required Dictionary< + string, + Dictionary> + > EventBossSpawns { get; set; } [JsonPropertyName("eventWaves")] - public required Dictionary>> EventWaves - { - get; - set; - } + public required Dictionary>> EventWaves { get; set; } [JsonPropertyName("gifterSettings")] - public required List GifterSettings - { - get; - set; - } + public required List GifterSettings { get; set; } /// /// key = event, second key = map name /// [JsonPropertyName("hostilitySettingsForEvent")] - public required Dictionary>> HostilitySettingsForEvent - { - get; - set; - } + public required Dictionary< + string, + Dictionary> + > HostilitySettingsForEvent { get; set; } /// /// Ids of containers on locations that only have Christmas loot /// [JsonPropertyName("christmasContainerIds")] - public required List ChristmasContainerIds - { - get; - set; - } + public required List ChristmasContainerIds { get; set; } /// /// Season - botType - location (body/feet/hands/head) /// [JsonPropertyName("botAppearanceChanges")] - public required Dictionary>>> BotAppearanceChanges - { - get; - set; - } + public required Dictionary< + SeasonalEventType, + Dictionary>> + > BotAppearanceChanges { get; set; } } public record SeasonalEvent @@ -113,72 +80,37 @@ public record SeasonalEvent public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } + public bool Enabled { get; set; } [JsonPropertyName("name")] - public string Name - { - get; - set; - } = string.Empty; + public string Name { get; set; } = string.Empty; [JsonPropertyName("type")] - public SeasonalEventType Type - { - get; - set; - } + public SeasonalEventType Type { get; set; } [JsonPropertyName("startDay")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int StartDay - { - get; - set; - } + public int StartDay { get; set; } [JsonPropertyName("startMonth")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int StartMonth - { - get; - set; - } + public int StartMonth { get; set; } [JsonPropertyName("endDay")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int EndDay - { - get; - set; - } + public int EndDay { get; set; } [JsonPropertyName("endMonth")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int EndMonth - { - get; - set; - } + public int EndMonth { get; set; } [JsonPropertyName("settings")] - public SeasonalEventSettings? Settings - { - get; - set; - } + public SeasonalEventSettings? Settings { get; set; } [JsonPropertyName("setting")] public SeasonalEventSettings? SettingsDoNOTUse { - set - { - Settings = value; - } + set { Settings = value; } } } @@ -188,95 +120,43 @@ public record SeasonalEventSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("enableSummoning")] - public bool? EnableSummoning - { - get; - set; - } + public bool? EnableSummoning { get; set; } [JsonPropertyName("enableHalloweenHideout")] - public bool? EnableHalloweenHideout - { - get; - set; - } + public bool? EnableHalloweenHideout { get; set; } [JsonPropertyName("enableChristmasHideout")] - public bool? EnableChristmasHideout - { - get; - set; - } + public bool? EnableChristmasHideout { get; set; } [JsonPropertyName("enableSanta")] - public bool? EnableSanta - { - get; - set; - } + public bool? EnableSanta { get; set; } [JsonPropertyName("adjustBotAppearances")] - public bool? AdjustBotAppearances - { - get; - set; - } + public bool? AdjustBotAppearances { get; set; } [JsonPropertyName("addEventGearToBots")] - public bool? AddEventGearToBots - { - get; - set; - } + public bool? AddEventGearToBots { get; set; } [JsonPropertyName("addEventLootToBots")] - public bool? AddEventLootToBots - { - get; - set; - } + public bool? AddEventLootToBots { get; set; } [JsonPropertyName("removeEntryRequirement")] - public List? RemoveEntryRequirement - { - get; - set; - } + public List? RemoveEntryRequirement { get; set; } [JsonPropertyName("replaceBotHostility")] - public bool? ReplaceBotHostility - { - get; - set; - } + public bool? ReplaceBotHostility { get; set; } [JsonPropertyName("forceSeason")] - public Season? ForceSeason - { - get; - set; - } + public Season? ForceSeason { get; set; } [JsonPropertyName("zombieSettings")] - public ZombieSettings? ZombieSettings - { - get; - set; - } + public ZombieSettings? ZombieSettings { get; set; } [JsonPropertyName("disableBosses")] - public List? DisableBosses - { - get; - set; - } + public List? DisableBosses { get; set; } [JsonPropertyName("disableWaves")] - public List? DisableWaves - { - get; - set; - } + public List? DisableWaves { get; set; } } public record ZombieSettings @@ -285,32 +165,16 @@ public record ZombieSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("mapInfectionAmount")] - public Dictionary? MapInfectionAmount - { - get; - set; - } + public Dictionary? MapInfectionAmount { get; set; } [JsonPropertyName("disableBosses")] - public List? DisableBosses - { - get; - set; - } + public List? DisableBosses { get; set; } [JsonPropertyName("disableWaves")] - public List? DisableWaves - { - get; - set; - } + public List? DisableWaves { get; set; } } public record GifterSetting @@ -319,23 +183,11 @@ public record GifterSetting public Dictionary ExtensionData { get; set; } [JsonPropertyName("map")] - public string? Map - { - get; - set; - } + public string? Map { get; set; } [JsonPropertyName("zones")] - public string? Zones - { - get; - set; - } + public string? Zones { get; set; } [JsonPropertyName("spawnChance")] - public int? SpawnChance - { - get; - set; - } + public int? SpawnChance { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs index f982f614..433d771e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs @@ -7,63 +7,31 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record TraderConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-trader"; + public override string Kind { get; set; } = "spt-trader"; [JsonPropertyName("updateTime")] - public List UpdateTime - { - get; - set; - } = []; + public List UpdateTime { get; set; } = []; [JsonPropertyName("updateTimeDefault")] - public int UpdateTimeDefault - { - get; - set; - } + public int UpdateTimeDefault { get; set; } [JsonPropertyName("purchasesAreFoundInRaid")] - public bool PurchasesAreFoundInRaid - { - get; - set; - } + public bool PurchasesAreFoundInRaid { get; set; } /// /// Should trader reset times be set based on server start time (false = bsg time - on the hour) /// [JsonPropertyName("tradersResetFromServerStart")] - public bool TradersResetFromServerStart - { - get; - set; - } + public bool TradersResetFromServerStart { get; set; } [JsonPropertyName("traderPriceMultipler")] - public double TraderPriceMultiplier - { - get; - set; - } + public double TraderPriceMultiplier { get; set; } [JsonPropertyName("fence")] - public required FenceConfig Fence - { - get; - set; - } + public required FenceConfig Fence { get; set; } [JsonPropertyName("moddedTraders")] - public required ModdedTraders ModdedTraders - { - get; - set; - } + public required ModdedTraders ModdedTraders { get; set; } } public record UpdateTime @@ -72,28 +40,16 @@ public record UpdateTime public Dictionary ExtensionData { get; set; } [JsonPropertyName("_name")] - public string Name - { - get; - set; - } = string.Empty; + public string Name { get; set; } = string.Empty; [JsonPropertyName("traderId")] - public string TraderId - { - get; - set; - } = string.Empty; + public string TraderId { get; set; } = string.Empty; /// /// Seconds between trader resets /// [JsonPropertyName("seconds")] - public required MinMax Seconds - { - get; - set; - } + public required MinMax Seconds { get; set; } } public record FenceConfig @@ -102,199 +58,103 @@ public record FenceConfig public Dictionary ExtensionData { get; set; } [JsonPropertyName("discountOptions")] - public required DiscountOptions DiscountOptions - { - get; - set; - } + public required DiscountOptions DiscountOptions { get; set; } [JsonPropertyName("partialRefreshTimeSeconds")] - public int PartialRefreshTimeSeconds - { - get; - set; - } + public int PartialRefreshTimeSeconds { get; set; } [JsonPropertyName("partialRefreshChangePercent")] - public double PartialRefreshChangePercent - { - get; - set; - } + public double PartialRefreshChangePercent { get; set; } [JsonPropertyName("assortSize")] - public int AssortSize - { - get; - set; - } + public int AssortSize { get; set; } [JsonPropertyName("weaponPresetMinMax")] - public required MinMax WeaponPresetMinMax - { - get; - set; - } + public required MinMax WeaponPresetMinMax { get; set; } [JsonPropertyName("equipmentPresetMinMax")] - public required MinMax EquipmentPresetMinMax - { - get; - set; - } + public required MinMax EquipmentPresetMinMax { get; set; } [JsonPropertyName("itemPriceMult")] - public double ItemPriceMult - { - get; - set; - } + public double ItemPriceMult { get; set; } [JsonPropertyName("presetPriceMult")] - public double PresetPriceMult - { - get; - set; - } + public double PresetPriceMult { get; set; } [JsonPropertyName("armorMaxDurabilityPercentMinMax")] - public required ItemDurabilityCurrentMax ArmorMaxDurabilityPercentMinMax - { - get; - set; - } + public required ItemDurabilityCurrentMax ArmorMaxDurabilityPercentMinMax { get; set; } [JsonPropertyName("weaponDurabilityPercentMinMax")] - public required ItemDurabilityCurrentMax WeaponDurabilityPercentMinMax - { - get; - set; - } + public required ItemDurabilityCurrentMax WeaponDurabilityPercentMinMax { get; set; } /// /// Keyed to plate protection level /// [JsonPropertyName("chancePlateExistsInArmorPercent")] - public required Dictionary ChancePlateExistsInArmorPercent - { - get; - set; - } + public required Dictionary ChancePlateExistsInArmorPercent { get; set; } /// /// Key: item tpl /// [JsonPropertyName("itemStackSizeOverrideMinMax")] - public required Dictionary?> ItemStackSizeOverrideMinMax - { - get; - set; - } + public required Dictionary?> ItemStackSizeOverrideMinMax { get; set; } [JsonPropertyName("itemTypeLimits")] - public required Dictionary ItemTypeLimits - { - get; - set; - } + public required Dictionary ItemTypeLimits { get; set; } /// /// Prevent duplicate offers of items of specific categories by parentId /// [JsonPropertyName("preventDuplicateOffersOfCategory")] - public required List PreventDuplicateOffersOfCategory - { - get; - set; - } + public required List PreventDuplicateOffersOfCategory { get; set; } [JsonPropertyName("regenerateAssortsOnRefresh")] - public bool RegenerateAssortsOnRefresh - { - get; - set; - } + public bool RegenerateAssortsOnRefresh { get; set; } /// /// Max rouble price before item is not listed on flea /// [JsonPropertyName("itemCategoryRoublePriceLimit")] - public required Dictionary ItemCategoryRoublePriceLimit - { - get; - set; - } + public required Dictionary ItemCategoryRoublePriceLimit { get; set; } /// /// Each slotid with % to be removed prior to listing on fence /// [JsonPropertyName("presetSlotsToRemoveChancePercent")] - public required Dictionary PresetSlotsToRemoveChancePercent - { - get; - set; - } + public required Dictionary PresetSlotsToRemoveChancePercent { get; set; } /// /// Block seasonal items from appearing when season is inactive /// [JsonPropertyName("blacklistSeasonalItems")] - public bool BlacklistSeasonalItems - { - get; - set; - } + public bool BlacklistSeasonalItems { get; set; } /// /// Max pen value allowed to be listed on flea - affects ammo + ammo boxes /// [JsonPropertyName("ammoMaxPenLimit")] - public double AmmoMaxPenLimit - { - get; - set; - } + public double AmmoMaxPenLimit { get; set; } [JsonPropertyName("blacklist")] - public required HashSet Blacklist - { - get; - set; - } + public required HashSet Blacklist { get; set; } [JsonPropertyName("coopExtractGift")] - public required CoopExtractReward CoopExtractGift - { - get; - set; - } + public required CoopExtractReward CoopExtractGift { get; set; } [JsonPropertyName("btrDeliveryExpireHours")] - public int BtrDeliveryExpireHours - { - get; - set; - } + public int BtrDeliveryExpireHours { get; set; } /// /// Smallest value player rep with fence can fall to /// [JsonPropertyName("playerRepMin")] - public double PlayerRepMin - { - get; - set; - } + public double PlayerRepMin { get; set; } /// /// Highest value player rep with fence can climb to /// [JsonPropertyName("playerRepMax")] - public double PlayerRepMax - { - get; - set; - } + public double PlayerRepMax { get; set; } } public record ItemDurabilityCurrentMax @@ -303,49 +163,25 @@ public record ItemDurabilityCurrentMax public Dictionary ExtensionData { get; set; } [JsonPropertyName("current")] - public required MinMax Current - { - get; - set; - } + public required MinMax Current { get; set; } [JsonPropertyName("max")] - public required MinMax Max - { - get; - set; - } + public required MinMax Max { get; set; } } public record CoopExtractReward : LootRequest { [JsonPropertyName("sendGift")] - public bool SendGift - { - get; - set; - } + public bool SendGift { get; set; } [JsonPropertyName("useRewardItemBlacklist")] - public new bool UseRewardItemBlacklist - { - get; - set; - } + public new bool UseRewardItemBlacklist { get; set; } [JsonPropertyName("messageLocaleIds")] - public required List MessageLocaleIds - { - get; - set; - } + public required List MessageLocaleIds { get; set; } [JsonPropertyName("giftExpiryHours")] - public int GiftExpiryHours - { - get; - set; - } + public int GiftExpiryHours { get; set; } } public record DiscountOptions @@ -354,39 +190,19 @@ public record DiscountOptions public Dictionary ExtensionData { get; set; } [JsonPropertyName("assortSize")] - public int AssortSize - { - get; - set; - } + public int AssortSize { get; set; } [JsonPropertyName("itemPriceMult")] - public double ItemPriceMult - { - get; - set; - } + public double ItemPriceMult { get; set; } [JsonPropertyName("presetPriceMult")] - public double PresetPriceMult - { - get; - set; - } + public double PresetPriceMult { get; set; } [JsonPropertyName("weaponPresetMinMax")] - public required MinMax WeaponPresetMinMax - { - get; - set; - } + public required MinMax WeaponPresetMinMax { get; set; } [JsonPropertyName("equipmentPresetMinMax")] - public required MinMax EquipmentPresetMinMax - { - get; - set; - } + public required MinMax EquipmentPresetMinMax { get; set; } } /// @@ -401,9 +217,5 @@ public record ModdedTraders /// Trader Ids to enable the clothing service for /// [JsonPropertyName("clothingService")] - public List ClothingService - { - get; - set; - } = []; + public List ClothingService { get; set; } = []; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs index 0666a136..7ec97c9a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs @@ -8,39 +8,19 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record WeatherConfig : BaseConfig { [JsonPropertyName("kind")] - public override string Kind - { - get; - set; - } = "spt-weather"; + public override string Kind { get; set; } = "spt-weather"; [JsonPropertyName("acceleration")] - public double? Acceleration - { - get; - set; - } + public double? Acceleration { get; set; } [JsonPropertyName("weather")] - public WeatherValues? Weather - { - get; - set; - } + public WeatherValues? Weather { get; set; } [JsonPropertyName("seasonDates")] - public List? SeasonDates - { - get; - set; - } + public List? SeasonDates { get; set; } [JsonPropertyName("overrideSeason")] - public Season? OverrideSeason - { - get; - set; - } + public Season? OverrideSeason { get; set; } } public record SeasonDateTimes @@ -49,50 +29,26 @@ public record SeasonDateTimes public Dictionary ExtensionData { get; set; } [JsonPropertyName("seasonType")] - public Season? SeasonType - { - get; - set; - } + public Season? SeasonType { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("startDay")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? StartDay - { - get; - set; - } + public int? StartDay { get; set; } [JsonPropertyName("startMonth")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? StartMonth - { - get; - set; - } + public int? StartMonth { get; set; } [JsonPropertyName("endDay")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? EndDay - { - get; - set; - } + public int? EndDay { get; set; } [JsonPropertyName("endMonth")] [JsonConverter(typeof(StringToNumberFactoryConverter))] - public int? EndMonth - { - get; - set; - } + public int? EndMonth { get; set; } } public record WeatherValues @@ -101,31 +57,19 @@ public record WeatherValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("seasonValues")] - public Dictionary? SeasonValues - { - get; - set; - } + public Dictionary? SeasonValues { get; set; } /// /// How many hours to generate weather data into the future /// [JsonPropertyName("generateWeatherAmountHours")] - public int? GenerateWeatherAmountHours - { - get; - set; - } + public int? GenerateWeatherAmountHours { get; set; } /// /// Length of each weather period /// [JsonPropertyName("timePeriod")] - public WeatherSettings? TimePeriod - { - get; - set; - } + public WeatherSettings? TimePeriod { get; set; } } public record SeasonalValues @@ -134,67 +78,31 @@ public record SeasonalValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("clouds")] - public WeatherSettings? Clouds - { - get; - set; - } + public WeatherSettings? Clouds { get; set; } [JsonPropertyName("windSpeed")] - public WeatherSettings? WindSpeed - { - get; - set; - } + public WeatherSettings? WindSpeed { get; set; } [JsonPropertyName("windDirection")] - public WeatherSettings? WindDirection - { - get; - set; - } + public WeatherSettings? WindDirection { get; set; } [JsonPropertyName("windGustiness")] - public MinMax? WindGustiness - { - get; - set; - } + public MinMax? WindGustiness { get; set; } [JsonPropertyName("rain")] - public WeatherSettings? Rain - { - get; - set; - } + public WeatherSettings? Rain { get; set; } [JsonPropertyName("rainIntensity")] - public MinMax? RainIntensity - { - get; - set; - } + public MinMax? RainIntensity { get; set; } [JsonPropertyName("fog")] - public WeatherSettings? Fog - { - get; - set; - } + public WeatherSettings? Fog { get; set; } [JsonPropertyName("temp")] - public TempDayNight? Temp - { - get; - set; - } + public TempDayNight? Temp { get; set; } [JsonPropertyName("pressure")] - public MinMax? Pressure - { - get; - set; - } + public MinMax? Pressure { get; set; } } public record TempDayNight @@ -203,18 +111,10 @@ public record TempDayNight public Dictionary ExtensionData { get; set; } [JsonPropertyName("day")] - public MinMax? Day - { - get; - set; - } + public MinMax? Day { get; set; } [JsonPropertyName("night")] - public MinMax? Night - { - get; - set; - } + public MinMax? Night { get; set; } } public record WeatherSettings @@ -223,16 +123,8 @@ public record WeatherSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("values")] - public List? Values - { - get; - set; - } + public List? Values { get; set; } [JsonPropertyName("weights")] - public List? Weights - { - get; - set; - } + public List? Weights { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Dialog/SendMessageDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Dialog/SendMessageDetails.cs index 97b2dd9a..68e33c5d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Dialog/SendMessageDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Dialog/SendMessageDetails.cs @@ -14,131 +14,79 @@ public record SendMessageDetails /// Player id /// [JsonPropertyName("recipientId")] - public string? RecipientId - { - get; - set; - } + public string? RecipientId { get; set; } /// /// Who is sending this message /// [JsonPropertyName("sender")] - public MessageType? Sender - { - get; - set; - } + public MessageType? Sender { get; set; } /// /// Optional - leave blank to use sender value /// [JsonPropertyName("dialogType")] - public MessageType? DialogType - { - get; - set; - } + public MessageType? DialogType { get; set; } /// /// Optional - if sender is USER these details are used /// [JsonPropertyName("senderDetails")] - public UserDialogInfo? SenderDetails - { - get; - set; - } + public UserDialogInfo? SenderDetails { get; set; } /// /// Optional - the trader sending the message /// [JsonPropertyName("trader")] - public string? Trader - { - get; - set; - } + public string? Trader { get; set; } /// /// Optional - used in player/system messages, otherwise templateId is used /// [JsonPropertyName("messageText")] - public string? MessageText - { - get; - set; - } + public string? MessageText { get; set; } /// /// Optional - Items to send to player /// [JsonPropertyName("items")] - public List? Items - { - get; - set; - } + public List? Items { get; set; } /// /// Optional - How long items will be stored in mail before expiry /// [JsonPropertyName("itemsMaxStorageLifetimeSeconds")] - public long? ItemsMaxStorageLifetimeSeconds - { - get; - set; - } + public long? ItemsMaxStorageLifetimeSeconds { get; set; } /// /// Optional - Used when sending messages from traders who send text from locale json /// [JsonPropertyName("templateId")] - public string? TemplateId - { - get; - set; - } + public string? TemplateId { get; set; } /// /// Optional - ragfair related /// [JsonPropertyName("systemData")] - public SystemData? SystemData - { - get; - set; - } + public SystemData? SystemData { get; set; } /// /// Optional - Used by ragfair messages /// [JsonPropertyName("ragfairDetails")] - public MessageContentRagfair? RagfairDetails - { - get; - set; - } + public MessageContentRagfair? RagfairDetails { get; set; } /// /// OPTIONAL - allows modification of profile settings via mail /// [JsonPropertyName("profileChangeEvents")] - public List? ProfileChangeEvents - { - get; - set; - } + public List? ProfileChangeEvents { get; set; } /// /// Optional - the MongoID of the dialogue message to reply to /// [JsonPropertyName("replyTo")] - public string? ReplyTo - { - get; - set; - } + public string? ReplyTo { get; set; } } public record ProfileChangeEvent @@ -147,37 +95,17 @@ public record ProfileChangeEvent public Dictionary ExtensionData { get; set; } [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("Type")] - public string Type - { - get; - set; - } + public string Type { get; set; } [JsonPropertyName("value")] - public double? Value - { - get; - set; - } + public double? Value { get; set; } [JsonPropertyName("entity")] - public string? Entity - { - get; - set; - } + public string? Entity { get; set; } [JsonPropertyName("data")] - public string? Data - { - get; - set; - } + public string? Data { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/CreateFenceAssortsResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/CreateFenceAssortsResult.cs index 303b27e4..323261cd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/CreateFenceAssortsResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/CreateFenceAssortsResult.cs @@ -9,23 +9,11 @@ public record CreateFenceAssortsResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("sptItems")] - public List>? SptItems - { - get; - set; - } + public List>? SptItems { get; set; } [JsonPropertyName("barter_scheme")] - public Dictionary>>? BarterScheme - { - get; - set; - } + public Dictionary>>? BarterScheme { get; set; } [JsonPropertyName("loyal_level_items")] - public Dictionary? LoyalLevelItems - { - get; - set; - } + public Dictionary? LoyalLevelItems { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/FenceAssortGenerationValues.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/FenceAssortGenerationValues.cs index 20b0c491..4ba19c30 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/FenceAssortGenerationValues.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Fence/FenceAssortGenerationValues.cs @@ -8,18 +8,10 @@ public record FenceAssortGenerationValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("normal")] - public GenerationAssortValues? Normal - { - get; - set; - } + public GenerationAssortValues? Normal { get; set; } [JsonPropertyName("discount")] - public GenerationAssortValues? Discount - { - get; - set; - } + public GenerationAssortValues? Discount { get; set; } } public record GenerationAssortValues @@ -28,23 +20,11 @@ public record GenerationAssortValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("item")] - public int? Item - { - get; - set; - } + public int? Item { get; set; } [JsonPropertyName("weaponPreset")] - public int? WeaponPreset - { - get; - set; - } + public int? WeaponPreset { get; set; } [JsonPropertyName("equipmentPreset")] - public int? EquipmentPreset - { - get; - set; - } + public int? EquipmentPreset { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs index 3f4f7ece..71a0e5c9 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Spt.Helper; public record WeightedRandomResult @@ -6,15 +7,7 @@ public record WeightedRandomResult [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required T Item - { - get; - set; - } + public required T Item { get; set; } - public required int Index - { - get; - set; - } + public required int Index { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs index faf541fa..e27d933b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs @@ -10,30 +10,14 @@ public record CircleCraftDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("time")] - public required long Time - { - get; - set; - } + public required long Time { get; set; } [JsonPropertyName("rewardType")] - public required CircleRewardType RewardType - { - get; - set; - } + public required CircleRewardType RewardType { get; set; } [JsonPropertyName("rewardAmountRoubles")] - public required int RewardAmountRoubles - { - get; - set; - } + public required int RewardAmountRoubles { get; set; } [JsonPropertyName("rewardDetails")] - public required CraftTimeThreshold RewardDetails - { - get; - set; - } + public required CraftTimeThreshold RewardDetails { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs index 9f477c31..ed3034f7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs @@ -9,44 +9,20 @@ public record Hideout public Dictionary ExtensionData { get; set; } [JsonPropertyName("areas")] - public List? Areas - { - get; - set; - } + public List? Areas { get; set; } [JsonPropertyName("customAreas")] - public List? CustomAreas - { - get; - set; - } + public List? CustomAreas { get; set; } [JsonPropertyName("customisation")] - public HideoutCustomisation? Customisation - { - get; - set; - } + public HideoutCustomisation? Customisation { get; set; } [JsonPropertyName("production")] - public HideoutProductionData? Production - { - get; - set; - } + public HideoutProductionData? Production { get; set; } [JsonPropertyName("settings")] - public HideoutSettingsBase? Settings - { - get; - set; - } + public HideoutSettingsBase? Settings { get; set; } [JsonPropertyName("qte")] - public List? Qte - { - get; - set; - } + public List? Qte { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/ScavCaseRewardCountsAndPrices.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/ScavCaseRewardCountsAndPrices.cs index 7ca943fa..12b9a13f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/ScavCaseRewardCountsAndPrices.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/ScavCaseRewardCountsAndPrices.cs @@ -8,25 +8,13 @@ public record ScavCaseRewardCountsAndPrices public Dictionary ExtensionData { get; set; } [JsonPropertyName("Common")] - public RewardCountAndPriceDetails? Common - { - get; - set; - } + public RewardCountAndPriceDetails? Common { get; set; } [JsonPropertyName("Rare")] - public RewardCountAndPriceDetails? Rare - { - get; - set; - } + public RewardCountAndPriceDetails? Rare { get; set; } [JsonPropertyName("Superrare")] - public RewardCountAndPriceDetails? Superrare - { - get; - set; - } + public RewardCountAndPriceDetails? Superrare { get; set; } } public record RewardCountAndPriceDetails @@ -35,30 +23,14 @@ public record RewardCountAndPriceDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("minCount")] - public double? MinCount - { - get; - set; - } + public double? MinCount { get; set; } [JsonPropertyName("maxCount")] - public double? MaxCount - { - get; - set; - } + public double? MaxCount { get; set; } [JsonPropertyName("minPriceRub")] - public double? MinPriceRub - { - get; - set; - } + public double? MinPriceRub { get; set; } [JsonPropertyName("maxPriceRub")] - public double? MaxPriceRub - { - get; - set; - } + public double? MaxPriceRub { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs index 03a48037..7127cd20 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs @@ -8,16 +8,8 @@ public record ItemSize public Dictionary ExtensionData { get; set; } [JsonPropertyName("width")] - public required int Width - { - get; - set; - } + public required int Width { get; set; } [JsonPropertyName("height")] - public required int Height - { - get; - set; - } + public required int Height { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/OwnerInventoryItems.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/OwnerInventoryItems.cs index 9b950c72..50963447 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/OwnerInventoryItems.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/OwnerInventoryItems.cs @@ -12,33 +12,17 @@ public record OwnerInventoryItems /// Inventory items from source /// [JsonPropertyName("from")] - public List? From - { - get; - set; - } + public List? From { get; set; } /// /// Inventory items at destination /// [JsonPropertyName("to")] - public List? To - { - get; - set; - } + public List? To { get; set; } [JsonPropertyName("sameInventory")] - public bool? SameInventory - { - get; - set; - } + public bool? SameInventory { get; set; } [JsonPropertyName("isMail")] - public bool? IsMail - { - get; - set; - } + public bool? IsMail { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2CompatibleVersion.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2CompatibleVersion.cs index 2e505c3b..502817c6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2CompatibleVersion.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2CompatibleVersion.cs @@ -8,15 +8,7 @@ public class LauncherV2CompatibleVersion : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required string SptVersion - { - get; - set; - } + public required string SptVersion { get; set; } - public required string EftVersion - { - get; - set; - } + public required string EftVersion { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2LoginResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2LoginResponse.cs index f988529a..754f6e14 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2LoginResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2LoginResponse.cs @@ -8,9 +8,5 @@ public class LauncherV2LoginResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required bool Response - { - get; - set; - } + public required bool Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ModsResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ModsResponse.cs index 59bd86ea..17f7ef25 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ModsResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ModsResponse.cs @@ -9,9 +9,5 @@ public class LauncherV2ModsResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required Dictionary Response - { - get; - set; - } + public required Dictionary Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PasswordChangeResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PasswordChangeResponse.cs index aa6b5fc2..85661de0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PasswordChangeResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PasswordChangeResponse.cs @@ -9,15 +9,7 @@ public class LauncherV2PasswordChangeResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required bool Response - { - get; - set; - } + public required bool Response { get; set; } - public required List Profiles - { - get; - set; - } + public required List Profiles { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PingResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PingResponse.cs index 6727d384..b9b218c4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PingResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2PingResponse.cs @@ -8,9 +8,5 @@ public class LauncherV2PingResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required string Response - { - get; - set; - } + public required string Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfileResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfileResponse.cs index 630fda69..da90f2f1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfileResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfileResponse.cs @@ -9,9 +9,5 @@ public class LauncherV2ProfileResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public SptProfile Response - { - get; - set; - } + public SptProfile Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfilesResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfilesResponse.cs index e5710ab1..e1701387 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfilesResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2ProfilesResponse.cs @@ -9,9 +9,5 @@ public class LauncherV2ProfilesResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required List Response - { - get; - set; - } + public required List Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RegisterResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RegisterResponse.cs index 5cbf8249..7238211a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RegisterResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RegisterResponse.cs @@ -9,15 +9,7 @@ public class LauncherV2RegisterResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required bool Response - { - get; - set; - } + public required bool Response { get; set; } - public required List Profiles - { - get; - set; - } + public required List Profiles { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RemoveResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RemoveResponse.cs index aa6c92a0..3229da3f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RemoveResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2RemoveResponse.cs @@ -9,15 +9,7 @@ public class LauncherV2RemoveResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required bool Response - { - get; - set; - } + public required bool Response { get; set; } - public required List Profiles - { - get; - set; - } + public required List Profiles { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2TypesResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2TypesResponse.cs index 0ea0e505..ec819bd5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2TypesResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2TypesResponse.cs @@ -8,9 +8,5 @@ public class LauncherV2TypesResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required Dictionary Response - { - get; - set; - } + public required Dictionary Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2VersionResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2VersionResponse.cs index e1b43157..7e0124d2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2VersionResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/LauncherV2VersionResponse.cs @@ -8,9 +8,5 @@ public record LauncherV2VersionResponse : IRequestData [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public required LauncherV2CompatibleVersion Response - { - get; - set; - } + public required LauncherV2CompatibleVersion Response { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/NicknameValidationResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/NicknameValidationResult.cs index 68c7439b..b9157ec7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/NicknameValidationResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Launcher/NicknameValidationResult.cs @@ -4,6 +4,6 @@ { Taken, Short, - Valid + Valid, } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Location/RaidChanges.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Location/RaidChanges.cs index 82575868..bcb4547d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Location/RaidChanges.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Location/RaidChanges.cs @@ -11,71 +11,43 @@ public record RaidChanges /// What percentage of dynamic loot should the map contain /// [JsonPropertyName("dynamicLootPercent")] - public double? DynamicLootPercent - { - get; - set; - } + public double? DynamicLootPercent { get; set; } /// /// What percentage of static loot should the map contain /// [JsonPropertyName("staticLootPercent")] - public double? StaticLootPercent - { - get; - set; - } + public double? StaticLootPercent { get; set; } /// /// How many seconds into the raid is the player simulated to spawn in at /// [JsonPropertyName("simulatedRaidStartSeconds")] - public double? SimulatedRaidStartSeconds - { - get; - set; - } + public double? SimulatedRaidStartSeconds { get; set; } /// /// How many minutes are in the raid total /// [JsonPropertyName("raidTimeMinutes")] - public double? RaidTimeMinutes - { - get; - set; - } + public double? RaidTimeMinutes { get; set; } /// /// The new number of seconds required to avoid a run through /// [JsonPropertyName("newSurviveTimeSeconds")] - public double? NewSurviveTimeSeconds - { - get; - set; - } + public double? NewSurviveTimeSeconds { get; set; } /// /// The original number of seconds required to avoid a run through /// [JsonPropertyName("originalSurvivalTimeSeconds")] - public double? OriginalSurvivalTimeSeconds - { - get; - set; - } + public double? OriginalSurvivalTimeSeconds { get; set; } /// /// Any changes required to the extract list /// [JsonPropertyName("exitChanges")] - public List? ExitChanges - { - get; - set; - } + public List? ExitChanges { get; set; } } public record ExtractChange @@ -84,30 +56,14 @@ public record ExtractChange public Dictionary ExtensionData { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("MinTime")] - public double? MinTime - { - get; - set; - } + public double? MinTime { get; set; } [JsonPropertyName("MaxTime")] - public double? MaxTime - { - get; - set; - } + public double? MaxTime { get; set; } [JsonPropertyName("Chance")] - public double? Chance - { - get; - set; - } + public double? Chance { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/ClientLogRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/ClientLogRequest.cs index f2c80952..34d4f932 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/ClientLogRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/ClientLogRequest.cs @@ -10,40 +10,20 @@ public record ClientLogRequest : IRequestData public Dictionary ExtensionData { get; set; } [JsonPropertyName("Source")] - public string? Source - { - get; - set; - } + public string? Source { get; set; } [JsonPropertyName("Level")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LogLevel? Level - { - get; - set; - } + public LogLevel? Level { get; set; } [JsonPropertyName("Message")] - public string? Message - { - get; - set; - } + public string? Message { get; set; } [JsonPropertyName("Color")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LogTextColor? Color - { - get; - set; - } + public LogTextColor? Color { get; set; } [JsonPropertyName("BackgroundColor")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LogBackgroundColor? BackgroundColor - { - get; - set; - } + public LogBackgroundColor? BackgroundColor { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogBackgroundColor.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogBackgroundColor.cs index 974bd71b..5794bda9 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogBackgroundColor.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogBackgroundColor.cs @@ -14,6 +14,3 @@ // } // TODO: this likely wont be used anymore, so commenting out insteaad of reimplementing - - - diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogLevel.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogLevel.cs index d88d7e7e..34db24c7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogLevel.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogLevel.cs @@ -8,5 +8,5 @@ public enum LogLevel Warn, Info, Debug, - Trace + Trace, } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogTextColor.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogTextColor.cs index 96857388..6ad3914b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogTextColor.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/LogTextColor.cs @@ -14,6 +14,3 @@ // } // TODO: this likely wont be used anymore, so commenting out insteaad of reimplementing - - - diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/SptLogger.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/SptLogger.cs index 2854b828..2d60d11a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/SptLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Logging/SptLogger.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Spt.Logging; public record SptLogger @@ -6,35 +7,15 @@ public record SptLogger [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public object Error - { - get; - set; - } // error: (msg: string | Record) => void; + public object Error { get; set; } // error: (msg: string | Record) => void; - public object Warn - { - get; - set; - } // warn: (msg: string | Record) => void; + public object Warn { get; set; } // warn: (msg: string | Record) => void; - public object Succ - { - get; - set; - } // succ?: (msg: string | Record) => void; + public object Succ { get; set; } // succ?: (msg: string | Record) => void; - public object Info - { - get; - set; - } // info: (msg: string | Record) => void; + public object Info { get; set; } // info: (msg: string | Record) => void; - public object Debug - { - get; - set; - } // debug: (msg: string | Record) => void; + public object Debug { get; set; } // debug: (msg: string | Record) => void; } // TODO: needs to be reimplemented however we want to do it in this project diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/AbstractModMetadata.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/AbstractModMetadata.cs index f1eab7de..114b054c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/AbstractModMetadata.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/AbstractModMetadata.cs @@ -10,110 +10,62 @@ public abstract record AbstractModMetadata /// /// Name of this mod /// - public abstract string Name - { - get; - set; - } + public abstract string Name { get; set; } /// /// Your username /// - public abstract string Author - { - get; - set; - } + public abstract string Author { get; set; } /// /// People who have contributed to this mod /// - public abstract List? Contributors - { - get; - set; - } + public abstract List? Contributors { get; set; } /// /// Semantic version of this mod, this uses the semver standard /// - public abstract string Version - { - get; - set; - } + public abstract string Version { get; set; } /// /// SPT version this mod was built for /// - public abstract string SptVersion - { - get; - set; - } + public abstract string SptVersion { get; set; } /// /// List of mods this mod should load before /// - public abstract List? LoadBefore - { - get; - set; - } + public abstract List? LoadBefore { get; set; } /// /// List of mods this mod should load after /// - public abstract List? LoadAfter - { - get; - set; - } + public abstract List? LoadAfter { get; set; } /// /// List of mods not compatible with this mod /// - public abstract List? Incompatibilities - { - get; - set; - } + public abstract List? Incompatibilities { get; set; } /// /// Dictionary of mods this mod depends on. /// /// Mod dependency is the key, version is the value /// - public abstract Dictionary? ModDependencies - { - get; - set; - } + public abstract Dictionary? ModDependencies { get; set; } /// /// Link to this mod's mod page, or GitHub page /// - public abstract string? Url - { - get; - set; - } + public abstract string? Url { get; set; } /// /// Does this mod load bundles /// - public abstract bool? IsBundleMod - { - get; - set; - } + public abstract bool? IsBundleMod { get; set; } /// /// Name of the license this mod uses /// - public abstract string? Licence - { - get; - set; - } + public abstract string? Licence { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/ModOrder.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/ModOrder.cs index 1c13963f..2785523d 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/ModOrder.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/ModOrder.cs @@ -8,9 +8,5 @@ public class ModOrder public Dictionary ExtensionData { get; set; } [JsonPropertyName("order")] - public List Order - { - get; - set; - } + public List Order { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/NewItemDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/NewItemDetails.cs index ca6f0156..ff2c8130 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/NewItemDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/NewItemDetails.cs @@ -6,11 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Mod; public record NewItemDetails : NewItemDetailsBase { [JsonPropertyName("newItem")] - public TemplateItem? NewItem - { - get; - set; - } + public TemplateItem? NewItem { get; set; } } public record NewItemFromCloneDetails : NewItemDetailsBase @@ -19,42 +15,26 @@ public record NewItemFromCloneDetails : NewItemDetailsBase /// Id of the item to copy and use as a base /// [JsonPropertyName("itemTplToClone")] - public string? ItemTplToClone - { - get; - set; - } + public string? ItemTplToClone { get; set; } /// /// Item properties that should be applied over the top of the cloned base /// [JsonPropertyName("overrideProperties")] - public Props? OverrideProperties - { - get; - set; - } + public Props? OverrideProperties { get; set; } /// /// ParentId for the new item (item type) /// [JsonPropertyName("parentId")] - public string? ParentId - { - get; - set; - } + public string? ParentId { get; set; } /// /// the id the new item should have, leave blank to have one generated for you. /// This is often known as the TplId, or TemplateId /// [JsonPropertyName("newId")] - public string? NewId - { - get; - set; - } = ""; + public string? NewId { get; set; } = ""; } public record NewItemDetailsBase @@ -63,32 +43,16 @@ public record NewItemDetailsBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("fleaPriceRoubles")] - public double? FleaPriceRoubles - { - get; - set; - } + public double? FleaPriceRoubles { get; set; } [JsonPropertyName("handbookPriceRoubles")] - public double? HandbookPriceRoubles - { - get; - set; - } + public double? HandbookPriceRoubles { get; set; } [JsonPropertyName("handbookParentId")] - public string? HandbookParentId - { - get; - set; - } + public string? HandbookParentId { get; set; } [JsonPropertyName("locales")] - public Dictionary? Locales - { - get; - set; - } + public Dictionary? Locales { get; set; } } public record LocaleDetails @@ -97,25 +61,13 @@ public record LocaleDetails public Dictionary ExtensionData { get; set; } [JsonPropertyName("name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("shortName")] - public string? ShortName - { - get; - set; - } + public string? ShortName { get; set; } [JsonPropertyName("description")] - public string? Description - { - get; - set; - } + public string? Description { get; set; } } public record CreateItemResult @@ -130,25 +82,13 @@ public record CreateItemResult } [JsonPropertyName("success")] - public bool? Success - { - get; - set; - } + public bool? Success { get; set; } [JsonPropertyName("itemId")] - public string? ItemId - { - get; - set; - } + public string? ItemId { get; set; } [JsonPropertyName("errors")] - public List? Errors - { - get; - set; - } + public List? Errors { get; set; } } // TODO: This needs to be reworked with however we do it for this project diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/SptMod.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/SptMod.cs index d41dd624..59bd7ede 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/SptMod.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Mod/SptMod.cs @@ -9,23 +9,11 @@ public class SptMod public Dictionary ExtensionData { get; set; } [JsonPropertyName("directory")] - public string Directory - { - get; - set; - } + public string Directory { get; set; } [JsonPropertyName("modMetadata")] - public AbstractModMetadata? ModMetadata - { - get; - set; - } + public AbstractModMetadata? ModMetadata { get; set; } [JsonPropertyName("assemblies")] - public List? Assemblies - { - get; - set; - } + public List? Assemblies { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Presets/PresetCacheDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Presets/PresetCacheDetails.cs index 95670aa7..a7781b45 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Presets/PresetCacheDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Presets/PresetCacheDetails.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; + namespace SPTarkov.Server.Core.Models.Spt.Presets; public record PresetCacheDetails @@ -7,16 +8,8 @@ public record PresetCacheDetails public Dictionary ExtensionData { get; set; } // Preset Ids related to the tpl - public HashSet PresetIds - { - get; - set; - } + public HashSet PresetIds { get; set; } // Id of the default preset for this tpl - public string? DefaultId - { - get; - set; - } + public string? DefaultId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Quests/GetRepeatableByIdResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Quests/GetRepeatableByIdResult.cs index 327f1457..6ee47bb1 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Quests/GetRepeatableByIdResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Quests/GetRepeatableByIdResult.cs @@ -9,16 +9,8 @@ public record GetRepeatableByIdResult public Dictionary ExtensionData { get; set; } [JsonPropertyName("quest")] - public RepeatableQuest? Quest - { - get; - set; - } + public RepeatableQuest? Quest { get; set; } [JsonPropertyName("repeatableType")] - public PmcDataRepeatableQuest? RepeatableType - { - get; - set; - } + public PmcDataRepeatableQuest? RepeatableType { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/RagfairServerPrices.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/RagfairServerPrices.cs index 07898786..aa7292a7 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/RagfairServerPrices.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/RagfairServerPrices.cs @@ -8,16 +8,8 @@ public record RagfairServerPrices public Dictionary ExtensionData { get; set; } [JsonPropertyName("staticPrices")] - public Dictionary? StaticPrices - { - get; - set; - } + public Dictionary? StaticPrices { get; set; } [JsonPropertyName("dynamicPrices")] - public Dictionary? DynamicPrices - { - get; - set; - } + public Dictionary? DynamicPrices { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/TplWithFleaPrice.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/TplWithFleaPrice.cs index ee13d7ae..3b9302c2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/TplWithFleaPrice.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Ragfair/TplWithFleaPrice.cs @@ -8,19 +8,11 @@ public record TplWithFleaPrice public Dictionary ExtensionData { get; set; } [JsonPropertyName("tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } /// /// Roubles /// [JsonPropertyName("price")] - public double? Price - { - get; - set; - } + public double? Price { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestRewardValues.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestRewardValues.cs index 6ceb45d9..c4cb240b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestRewardValues.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestRewardValues.cs @@ -8,51 +8,23 @@ public record QuestRewardValues public Dictionary ExtensionData { get; set; } [JsonPropertyName("skillPointReward")] - public double? SkillPointReward - { - get; - set; - } + public double? SkillPointReward { get; set; } [JsonPropertyName("skillRewardChance")] - public double? SkillRewardChance - { - get; - set; - } + public double? SkillRewardChance { get; set; } [JsonPropertyName("rewardReputation")] - public double? RewardReputation - { - get; - set; - } + public double? RewardReputation { get; set; } [JsonPropertyName("rewardNumItems")] - public int? RewardNumItems - { - get; - set; - } + public int? RewardNumItems { get; set; } [JsonPropertyName("rewardRoubles")] - public double? RewardRoubles - { - get; - set; - } + public double? RewardRoubles { get; set; } [JsonPropertyName("gpCoinRewardCount")] - public double? GpCoinRewardCount - { - get; - set; - } + public double? GpCoinRewardCount { get; set; } [JsonPropertyName("rewardXP")] - public double? RewardXP - { - get; - set; - } + public double? RewardXP { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestTypePool.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestTypePool.cs index 4ca43df1..92b7df0a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestTypePool.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Repeatable/QuestTypePool.cs @@ -9,18 +9,10 @@ public record QuestTypePool public Dictionary ExtensionData { get; set; } [JsonPropertyName("types")] - public List? Types - { - get; - set; - } + public List? Types { get; set; } [JsonPropertyName("pool")] - public QuestPool? Pool - { - get; - set; - } + public QuestPool? Pool { get; set; } } public record QuestPool @@ -29,25 +21,13 @@ public record QuestPool public Dictionary ExtensionData { get; set; } [JsonPropertyName("Exploration")] - public ExplorationPool? Exploration - { - get; - set; - } + public ExplorationPool? Exploration { get; set; } [JsonPropertyName("Elimination")] - public EliminationPool? Elimination - { - get; - set; - } + public EliminationPool? Elimination { get; set; } [JsonPropertyName("Pickup")] - public ExplorationPool? Pickup - { - get; - set; - } + public ExplorationPool? Pickup { get; set; } } public record ExplorationPool @@ -56,11 +36,7 @@ public record ExplorationPool public Dictionary ExtensionData { get; set; } [JsonPropertyName("locations")] - public Dictionary>? Locations - { - get; - set; - } // TODO: check the type, originally - Partial> + public Dictionary>? Locations { get; set; } // TODO: check the type, originally - Partial> } public record EliminationPool @@ -69,11 +45,7 @@ public record EliminationPool public Dictionary ExtensionData { get; set; } [JsonPropertyName("targets")] - public Dictionary? Targets - { - get; - set; - } + public Dictionary? Targets { get; set; } } public record TargetLocation @@ -82,9 +54,5 @@ public record TargetLocation public Dictionary ExtensionData { get; set; } [JsonPropertyName("locations")] - public List? Locations - { - get; - set; - } + public List? Locations { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs index a3b7cbbc..9a33cb4e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs @@ -9,63 +9,23 @@ public record DatabaseTables [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public Bots.Bots? Bots - { - get; - set; - } + public Bots.Bots? Bots { get; set; } - public Hideout.Hideout? Hideout - { - get; - set; - } + public Hideout.Hideout? Hideout { get; set; } - public LocaleBase? Locales - { - get; - set; - } + public LocaleBase? Locales { get; set; } - public Locations? Locations - { - get; - set; - } + public Locations? Locations { get; set; } - public Match? Match - { - get; - set; - } + public Match? Match { get; set; } - public Templates.Templates? Templates - { - get; - set; - } + public Templates.Templates? Templates { get; set; } - public Dictionary? Traders - { - get; - set; - } + public Dictionary? Traders { get; set; } - public Globals? Globals - { - get; - set; - } + public Globals? Globals { get; set; } - public ServerBase? Server - { - get; - set; - } + public ServerBase? Server { get; set; } - public SettingsBase? Settings - { - get; - set; - } + public SettingsBase? Settings { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs index 6c44082d..680dace4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs @@ -11,23 +11,11 @@ public record LocaleBase [JsonPropertyName("global")] /// DO NOT USE THIS PROPERTY DIRECTLY, USE LOCALESERVICE INSTEAD /// THIS IS LAZY LOADED AND YOUR CHANGES WILL NOT BE SAVED - public required Dictionary>> Global - { - get; - set; - } + public required Dictionary>> Global { get; set; } [JsonPropertyName("menu")] - public required Dictionary> Menu - { - get; - set; - } + public required Dictionary> Menu { get; set; } [JsonPropertyName("languages")] - public required Dictionary Languages - { - get; - set; - } + public required Dictionary Languages { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs index dcb97bff..399ad687 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs @@ -11,7 +11,10 @@ public record Locations // sometimes we get the key or value given so save changing logic in each place // have it key both - private readonly FrozenDictionary _locationMappings = new Dictionary + private readonly FrozenDictionary _locationMappings = new Dictionary< + string, + string + > { // EFT { "factory4_day", "Factory4Day" }, @@ -33,7 +36,6 @@ public record Locations { "woods", "Woods" }, { "sandbox", "Sandbox" }, { "sandbox_high", "SandboxHigh" }, - // SPT { "Factory4Day", "Factory4Day" }, { "Bigmap", "Bigmap" }, @@ -53,153 +55,73 @@ public record Locations { "Woods", "Woods" }, { "Labyrinth", "Labyrinth" }, { "Sandbox", "Sandbox" }, - { "SandboxHigh", "SandboxHigh" } + { "SandboxHigh", "SandboxHigh" }, }.ToFrozenDictionary(); private Dictionary? _locationDictionaryCache; [JsonPropertyName("bigmap")] - public Eft.Common.Location? Bigmap - { - get; - set; - } + public Eft.Common.Location? Bigmap { get; set; } [JsonPropertyName("develop")] - public Eft.Common.Location? Develop - { - get; - set; - } + public Eft.Common.Location? Develop { get; set; } [JsonPropertyName("factory4_day")] - public Eft.Common.Location? Factory4Day - { - get; - set; - } + public Eft.Common.Location? Factory4Day { get; set; } [JsonPropertyName("factory4_night")] - public Eft.Common.Location? Factory4Night - { - get; - set; - } + public Eft.Common.Location? Factory4Night { get; set; } [JsonPropertyName("hideout")] - public Eft.Common.Location? Hideout - { - get; - set; - } + public Eft.Common.Location? Hideout { get; set; } [JsonPropertyName("interchange")] - public Eft.Common.Location? Interchange - { - get; - set; - } + public Eft.Common.Location? Interchange { get; set; } [JsonPropertyName("laboratory")] - public Eft.Common.Location? Laboratory - { - get; - set; - } + public Eft.Common.Location? Laboratory { get; set; } [JsonPropertyName("lighthouse")] - public Eft.Common.Location? Lighthouse - { - get; - set; - } + public Eft.Common.Location? Lighthouse { get; set; } [JsonPropertyName("privatearea")] - public Eft.Common.Location? PrivateArea - { - get; - set; - } + public Eft.Common.Location? PrivateArea { get; set; } [JsonPropertyName("rezervbase")] - public Eft.Common.Location? RezervBase - { - get; - set; - } + public Eft.Common.Location? RezervBase { get; set; } [JsonPropertyName("shoreline")] - public Eft.Common.Location? Shoreline - { - get; - set; - } + public Eft.Common.Location? Shoreline { get; set; } [JsonPropertyName("suburbs")] - public Eft.Common.Location? Suburbs - { - get; - set; - } + public Eft.Common.Location? Suburbs { get; set; } [JsonPropertyName("tarkovstreets")] - public Eft.Common.Location? TarkovStreets - { - get; - set; - } + public Eft.Common.Location? TarkovStreets { get; set; } [JsonPropertyName("labyrinth")] - public Eft.Common.Location? Labyrinth - { - get; - set; - } + public Eft.Common.Location? Labyrinth { get; set; } [JsonPropertyName("terminal")] - public Eft.Common.Location? Terminal - { - get; - set; - } + public Eft.Common.Location? Terminal { get; set; } [JsonPropertyName("town")] - public Eft.Common.Location? Town - { - get; - set; - } + public Eft.Common.Location? Town { get; set; } [JsonPropertyName("woods")] - public Eft.Common.Location? Woods - { - get; - set; - } + public Eft.Common.Location? Woods { get; set; } [JsonPropertyName("sandbox")] - public Eft.Common.Location? Sandbox - { - get; - set; - } + public Eft.Common.Location? Sandbox { get; set; } [JsonPropertyName("sandbox_high")] - public Eft.Common.Location? SandboxHigh - { - get; - set; - } + public Eft.Common.Location? SandboxHigh { get; set; } /// /// Holds a mapping of the linkages between locations on the UI /// [JsonPropertyName("base")] - public LocationsBase? Base - { - get; - set; - } + public LocationsBase? Base { get; set; } /// /// Get map locations as a dictionary, keyed by its name e.g. Factory4Day @@ -227,9 +149,13 @@ public record Locations private void HydrateDictionary() { - var classProps = typeof(Locations).GetProperties().Where(p => p.PropertyType == typeof(Eft.Common.Location) && p.Name != "Item"); - _locationDictionaryCache = classProps - .ToDictionary(propertyInfo => propertyInfo.Name, propertyInfo => propertyInfo.GetValue(this, null) as Eft.Common.Location, - StringComparer.OrdinalIgnoreCase); + var classProps = typeof(Locations) + .GetProperties() + .Where(p => p.PropertyType == typeof(Eft.Common.Location) && p.Name != "Item"); + _locationDictionaryCache = classProps.ToDictionary( + propertyInfo => propertyInfo.Name, + propertyInfo => propertyInfo.GetValue(this, null) as Eft.Common.Location, + StringComparer.OrdinalIgnoreCase + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs index 52bfea3f..d87e623b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs @@ -11,16 +11,8 @@ public record ServerBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("ip")] - public required string Ip - { - get; - set; - } + public required string Ip { get; set; } [JsonPropertyName("port")] - public required int Port - { - get; - set; - } + public required int Port { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/SettingsBase.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/SettingsBase.cs index 9f59eaee..7019cdbd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/SettingsBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/SettingsBase.cs @@ -9,11 +9,7 @@ public record SettingsBase public Dictionary ExtensionData { get; set; } [JsonPropertyName("config")] - public Config? Configuration - { - get; - set; - } + public Config? Configuration { get; set; } } public record Config @@ -22,200 +18,88 @@ public record Config public Dictionary ExtensionData { get; set; } [JsonPropertyName("AFKTimeoutSeconds")] - public int? AFKTimeoutSeconds - { - get; - set; - } + public int? AFKTimeoutSeconds { get; set; } [JsonPropertyName("AdditionalRandomDelaySeconds")] - public int? AdditionalRandomDelaySeconds - { - get; - set; - } + public int? AdditionalRandomDelaySeconds { get; set; } [JsonPropertyName("AudioSettings")] - public AudioSettings? AudioSettings - { - get; - set; - } + public AudioSettings? AudioSettings { get; set; } [JsonPropertyName("ClientSendRateLimit")] - public int? ClientSendRateLimit - { - get; - set; - } + public int? ClientSendRateLimit { get; set; } [JsonPropertyName("CriticalRetriesCount")] - public int? CriticalRetriesCount - { - get; - set; - } + public int? CriticalRetriesCount { get; set; } [JsonPropertyName("DefaultRetriesCount")] - public int? DefaultRetriesCount - { - get; - set; - } + public int? DefaultRetriesCount { get; set; } [JsonPropertyName("FirstCycleDelaySeconds")] - public int? FirstCycleDelaySeconds - { - get; - set; - } + public int? FirstCycleDelaySeconds { get; set; } [JsonPropertyName("FramerateLimit")] - public FramerateLimit? FramerateLimit - { - get; - set; - } + public FramerateLimit? FramerateLimit { get; set; } [JsonPropertyName("GroupStatusInterval")] - public int? GroupStatusInterval - { - get; - set; - } + public int? GroupStatusInterval { get; set; } [JsonPropertyName("GroupStatusButtonInterval")] - public int? GroupStatusButtonInterval - { - get; - set; - } + public int? GroupStatusButtonInterval { get; set; } [JsonPropertyName("KeepAliveInterval")] - public int? KeepAliveInterval - { - get; - set; - } + public int? KeepAliveInterval { get; set; } [JsonPropertyName("LobbyKeepAliveInterval")] - public int? LobbyKeepAliveInterval - { - get; - set; - } + public int? LobbyKeepAliveInterval { get; set; } [JsonPropertyName("Mark502and504AsNonImportant")] - public bool? Mark502and504AsNonImportant - { - get; - set; - } + public bool? Mark502and504AsNonImportant { get; set; } [JsonPropertyName("MemoryManagementSettings")] - public MemoryManagementSettings? MemoryManagementSettings - { - get; - set; - } + public MemoryManagementSettings? MemoryManagementSettings { get; set; } [JsonPropertyName("NVidiaHighlights")] - public bool? NVidiaHighlights - { - get; - set; - } + public bool? NVidiaHighlights { get; set; } [JsonPropertyName("NextCycleDelaySeconds")] - public int? NextCycleDelaySeconds - { - get; - set; - } + public int? NextCycleDelaySeconds { get; set; } [JsonPropertyName("PingServerResultSendInterval")] - public int? PingServerResultSendInterval - { - get; - set; - } + public int? PingServerResultSendInterval { get; set; } [JsonPropertyName("PingServersInterval")] - public int? PingServersInterval - { - get; - set; - } + public int? PingServersInterval { get; set; } [JsonPropertyName("ReleaseProfiler")] - public ReleaseProfiler? ReleaseProfiler - { - get; - set; - } + public ReleaseProfiler? ReleaseProfiler { get; set; } [JsonPropertyName("RequestConfirmationTimeouts")] - public List? RequestConfirmationTimeouts - { - get; - set; - } + public List? RequestConfirmationTimeouts { get; set; } [JsonPropertyName("RequestsMadeThroughLobby")] - public List? RequestsMadeThroughLobby - { - get; - set; - } + public List? RequestsMadeThroughLobby { get; set; } [JsonPropertyName("SecondCycleDelaySeconds")] - public int? SecondCycleDelaySeconds - { - get; - set; - } + public int? SecondCycleDelaySeconds { get; set; } [JsonPropertyName("ShouldEstablishLobbyConnection")] - public bool? ShouldEstablishLobbyConnection - { - get; - set; - } + public bool? ShouldEstablishLobbyConnection { get; set; } [JsonPropertyName("TurnOffLogging")] - public bool? TurnOffLogging - { - get; - set; - } + public bool? TurnOffLogging { get; set; } [JsonPropertyName("WeaponOverlapDistanceCulling")] - public int? WeaponOverlapDistanceCulling - { - get; - set; - } + public int? WeaponOverlapDistanceCulling { get; set; } [JsonPropertyName("WebDiagnosticsEnabled")] - public bool? WebDiagnosticsEnabled - { - get; - set; - } + public bool? WebDiagnosticsEnabled { get; set; } [JsonPropertyName("NetworkStateView")] - public NetworkStateView? NetworkStateView - { - get; - set; - } + public NetworkStateView? NetworkStateView { get; set; } [JsonPropertyName("WsReconnectionDelays")] - public List? WsReconnectionDelays - { - get; - set; - } + public List? WsReconnectionDelays { get; set; } } public record AudioSettings @@ -224,46 +108,22 @@ public record AudioSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("AudioGroupPresets")] - public List? AudioGroupPresets - { - get; - set; - } + public List? AudioGroupPresets { get; set; } [JsonPropertyName("EnvironmentSettings")] - public EnvironmentSettings? EnvironmentSettings - { - get; - set; - } + public EnvironmentSettings? EnvironmentSettings { get; set; } [JsonPropertyName("HeadphonesSettings")] - public HeadphoneSettings HeadphonesSettings - { - get; - set; - } + public HeadphoneSettings HeadphonesSettings { get; set; } [JsonPropertyName("MetaXRAudioPluginSettings")] - public MetaXRAudioPluginSettings? MetaXRAudioPluginSettings - { - get; - set; - } + public MetaXRAudioPluginSettings? MetaXRAudioPluginSettings { get; set; } [JsonPropertyName("PlayerSettings")] - public PlayerSettings? PlayerSettings - { - get; - set; - } + public PlayerSettings? PlayerSettings { get; set; } [JsonPropertyName("RadioBroadcastSettings")] - public RadioBroadcastSettings? RadioBroadcastSettings - { - get; - set; - } + public RadioBroadcastSettings? RadioBroadcastSettings { get; set; } } public record FramerateLimit @@ -272,25 +132,13 @@ public record FramerateLimit public Dictionary ExtensionData { get; set; } [JsonPropertyName("MaxFramerateGameLimit")] - public int? MaxFramerateGameLimit - { - get; - set; - } + public int? MaxFramerateGameLimit { get; set; } [JsonPropertyName("MaxFramerateLobbyLimit")] - public int? MaxFramerateLobbyLimit - { - get; - set; - } + public int? MaxFramerateLobbyLimit { get; set; } [JsonPropertyName("MinFramerateLimit")] - public int? MinFramerateLimit - { - get; - set; - } + public int? MinFramerateLimit { get; set; } } public record MemoryManagementSettings @@ -299,46 +147,22 @@ public record MemoryManagementSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("AggressiveGC")] - public bool? AggressiveGC - { - get; - set; - } + public bool? AggressiveGC { get; set; } [JsonPropertyName("GigabytesRequiredToDisableGCDuringRaid")] - public int? GigabytesRequiredToDisableGCDuringRaid - { - get; - set; - } + public int? GigabytesRequiredToDisableGCDuringRaid { get; set; } [JsonPropertyName("HeapPreAllocationEnabled")] - public bool? HeapPreAllocationEnabled - { - get; - set; - } + public bool? HeapPreAllocationEnabled { get; set; } [JsonPropertyName("HeapPreAllocationMB")] - public int? HeapPreAllocationMB - { - get; - set; - } + public int? HeapPreAllocationMB { get; set; } [JsonPropertyName("OverrideRamCleanerSettings")] - public bool? OverrideRamCleanerSettings - { - get; - set; - } + public bool? OverrideRamCleanerSettings { get; set; } [JsonPropertyName("RamCleanerEnabled")] - public bool? RamCleanerEnabled - { - get; - set; - } + public bool? RamCleanerEnabled { get; set; } } public record ReleaseProfiler @@ -347,25 +171,13 @@ public record ReleaseProfiler public Dictionary ExtensionData { get; set; } [JsonPropertyName("Enabled")] - public bool? Enabled - { - get; - set; - } + public bool? Enabled { get; set; } [JsonPropertyName("MaxRecords")] - public int? MaxRecords - { - get; - set; - } + public int? MaxRecords { get; set; } [JsonPropertyName("RecordTriggerValue")] - public int? RecordTriggerValue - { - get; - set; - } + public int? RecordTriggerValue { get; set; } } public record NetworkStateView @@ -374,18 +186,10 @@ public record NetworkStateView public Dictionary ExtensionData { get; set; } [JsonPropertyName("LossThreshold")] - public int? LossThreshold - { - get; - set; - } + public int? LossThreshold { get; set; } [JsonPropertyName("RttThreshold")] - public int? RttThreshold - { - get; - set; - } + public int? RttThreshold { get; set; } } public record AudioGroupPreset @@ -394,74 +198,34 @@ public record AudioGroupPreset public Dictionary ExtensionData { get; set; } [JsonPropertyName("AngleToAllowBinaural")] - public double? AngleToAllowBinaural - { - get; - set; - } + public double? AngleToAllowBinaural { get; set; } [JsonPropertyName("DisabledBinauralByDistance")] - public bool? DisabledBinauralByDistance - { - get; - set; - } + public bool? DisabledBinauralByDistance { get; set; } [JsonPropertyName("DistanceToAllowBinaural")] - public double? DistanceToAllowBinaural - { - get; - set; - } + public double? DistanceToAllowBinaural { get; set; } [JsonPropertyName("GroupType")] - public double? GroupType - { - get; - set; - } + public double? GroupType { get; set; } [JsonPropertyName("HeightToAllowBinaural")] - public double? HeightToAllowBinaural - { - get; - set; - } + public double? HeightToAllowBinaural { get; set; } [JsonPropertyName("Name")] - public string? Name - { - get; - set; - } + public string? Name { get; set; } [JsonPropertyName("OcclusionEnabled")] - public bool? OcclusionEnabled - { - get; - set; - } + public bool? OcclusionEnabled { get; set; } [JsonPropertyName("OcclusionIntensity")] - public double? OcclusionIntensity - { - get; - set; - } + public double? OcclusionIntensity { get; set; } [JsonPropertyName("OcclusionRolloffScale")] - public double? OcclusionRolloffScale - { - get; - set; - } + public double? OcclusionRolloffScale { get; set; } [JsonPropertyName("OverallVolume")] - public double? OverallVolume - { - get; - set; - } + public double? OverallVolume { get; set; } } public record EnvironmentSettings @@ -470,60 +234,28 @@ public record EnvironmentSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("AutumnLateSettings")] - public SeasonEnvironmentSettings AutumnLateSettings - { - get; - set; - } + public SeasonEnvironmentSettings AutumnLateSettings { get; set; } [JsonPropertyName("AutumnSettings")] - public SeasonEnvironmentSettings AutumnSettings - { - get; - set; - } + public SeasonEnvironmentSettings AutumnSettings { get; set; } [JsonPropertyName("SpringEarlySettings")] - public SeasonEnvironmentSettings SpringEarlySettings - { - get; - set; - } + public SeasonEnvironmentSettings SpringEarlySettings { get; set; } [JsonPropertyName("SpringSettings")] - public SeasonEnvironmentSettings SpringSettings - { - get; - set; - } + public SeasonEnvironmentSettings SpringSettings { get; set; } [JsonPropertyName("StormSettings")] - public SeasonEnvironmentSettings StormSettings - { - get; - set; - } + public SeasonEnvironmentSettings StormSettings { get; set; } [JsonPropertyName("SummerSettings")] - public SeasonEnvironmentSettings SummerSettings - { - get; - set; - } + public SeasonEnvironmentSettings SummerSettings { get; set; } [JsonPropertyName("WinterSettings")] - public SeasonEnvironmentSettings WinterSettings - { - get; - set; - } + public SeasonEnvironmentSettings WinterSettings { get; set; } [JsonPropertyName("SurfaceMultipliers")] - public List? SurfaceMultipliers - { - get; - set; - } + public List? SurfaceMultipliers { get; set; } } public record SeasonEnvironmentSettings @@ -532,25 +264,13 @@ public record SeasonEnvironmentSettings public Dictionary ExtensionData { get; set; } [JsonPropertyName("RainSettings")] - public List RainSettings - { - get; - set; - } + public List RainSettings { get; set; } [JsonPropertyName("StepsVolumeMultiplier")] - public double StepsVolumeMultiplier - { - get; - set; - } + public double StepsVolumeMultiplier { get; set; } [JsonPropertyName("WindMultipliers")] - public List WindMultipliers - { - get; - set; - } + public List WindMultipliers { get; set; } } public record SurfaceMultiplier @@ -558,17 +278,9 @@ public record SurfaceMultiplier [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public string SurfaceType - { - get; - set; - } + public string SurfaceType { get; set; } - public double VolumeMult - { - get; - set; - } + public double VolumeMult { get; set; } } public record WindMultiplier @@ -577,18 +289,10 @@ public record WindMultiplier public Dictionary ExtensionData { get; set; } [JsonPropertyName("VolumeMult")] - public double VolumeMult - { - get; - set; - } + public double VolumeMult { get; set; } [JsonPropertyName("WindSpeed")] - public string WindSpeed - { - get; - set; - } + public string WindSpeed { get; set; } } public record RainSetting @@ -597,25 +301,13 @@ public record RainSetting public Dictionary ExtensionData { get; set; } [JsonPropertyName("IndoorVolumeMult")] - public int IndoorVolumeMult - { - get; - set; - } + public int IndoorVolumeMult { get; set; } [JsonPropertyName("OutdoorVolumeMult")] - public double OutdoorVolumeMult - { - get; - set; - } + public double OutdoorVolumeMult { get; set; } [JsonPropertyName("RainIntensity")] - public string RainIntensity - { - get; - set; - } + public string RainIntensity { get; set; } } public record HeadphoneSettings @@ -623,23 +315,11 @@ public record HeadphoneSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public double FadeDuration - { - get; - set; - } + public double FadeDuration { get; set; } - public string FadeIn - { - get; - set; - } + public string FadeIn { get; set; } - public string FadeOut - { - get; - set; - } + public string FadeOut { get; set; } } public record MetaXRAudioPluginSettings @@ -647,15 +327,7 @@ public record MetaXRAudioPluginSettings [JsonExtensionData] public Dictionary ExtensionData { get; set; } - public bool? EnabledPluginErrorChecker - { - get; - set; - } + public bool? EnabledPluginErrorChecker { get; set; } - public double? OutputVolumeCheckCooldown - { - get; - set; - } + public double? OutputVolumeCheckCooldown { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/InsuranceEquipmentPkg.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/InsuranceEquipmentPkg.cs index e471f1bc..9481f82e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/InsuranceEquipmentPkg.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/InsuranceEquipmentPkg.cs @@ -10,30 +10,14 @@ public record InsuranceEquipmentPkg public Dictionary ExtensionData { get; set; } [JsonPropertyName("sessionID")] - public string? SessionId - { - get; - set; - } + public string? SessionId { get; set; } [JsonPropertyName("pmcData")] - public PmcData? PmcData - { - get; - set; - } + public PmcData? PmcData { get; set; } [JsonPropertyName("itemToReturnToPlayer")] - public Item? ItemToReturnToPlayer - { - get; - set; - } + public Item? ItemToReturnToPlayer { get; set; } [JsonPropertyName("traderId")] - public string? TraderId - { - get; - set; - } + public string? TraderId { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootItem.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootItem.cs index 47beb847..85934679 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootItem.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootItem.cs @@ -8,30 +8,14 @@ public record LootItem public Dictionary ExtensionData { get; set; } [JsonPropertyName("id")] - public string? Id - { - get; - set; - } + public string? Id { get; set; } [JsonPropertyName("tpl")] - public string? Tpl - { - get; - set; - } + public string? Tpl { get; set; } [JsonPropertyName("isPreset")] - public bool? IsPreset - { - get; - set; - } + public bool? IsPreset { get; set; } [JsonPropertyName("stackCount")] - public int? StackCount - { - get; - set; - } + public int? StackCount { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootRequest.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootRequest.cs index 2326351d..f15dc3ea 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootRequest.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootRequest.cs @@ -13,138 +13,82 @@ public record LootRequest /// Count of weapons to generate /// [JsonPropertyName("weaponPresetCount")] - public MinMax? WeaponPresetCount - { - get; - set; - } + public MinMax? WeaponPresetCount { get; set; } /// /// Count of armor to generate /// [JsonPropertyName("armorPresetCount")] - public MinMax? ArmorPresetCount - { - get; - set; - } + public MinMax? ArmorPresetCount { get; set; } /// /// Count of items to generate /// [JsonPropertyName("itemCount")] - public MinMax? ItemCount - { - get; - set; - } + public MinMax? ItemCount { get; set; } /// /// Count of sealed weapon crates to generate /// [JsonPropertyName("weaponCrateCount")] - public MinMax? WeaponCrateCount - { - get; - set; - } + public MinMax? WeaponCrateCount { get; set; } /// /// Item tpl blacklist to exclude /// [JsonPropertyName("itemBlacklist")] - public HashSet? ItemBlacklist - { - get; - set; - } + public HashSet? ItemBlacklist { get; set; } /// /// Item tpl whitelist to pick from /// [JsonPropertyName("itemTypeWhitelist")] - public List? ItemTypeWhitelist - { - get; - set; - } + public List? ItemTypeWhitelist { get; set; } /// /// key: item base type: value: max count /// [JsonPropertyName("itemLimits")] - public Dictionary? ItemLimits - { - get; - set; - } + public Dictionary? ItemLimits { get; set; } [JsonPropertyName("itemStackLimits")] - public Dictionary>? ItemStackLimits - { - get; - set; - } + public Dictionary>? ItemStackLimits { get; set; } /// /// Allowed armor plate levels 2/3/4/5/6 for armor generated /// [JsonPropertyName("armorLevelWhitelist")] - public List? ArmorLevelWhitelist - { - get; - set; - } + public List? ArmorLevelWhitelist { get; set; } /// /// Should boss items be included in allowed items /// [JsonPropertyName("allowBossItems")] - public bool? AllowBossItems - { - get; - set; - } + public bool? AllowBossItems { get; set; } /// /// Should item.json item reward blacklist be used /// [JsonPropertyName("useRewardItemBlacklist")] - public bool? UseRewardItemBlacklist - { - get; - set; - } + public bool? UseRewardItemBlacklist { get; set; } /// /// Should forced loot be used instead of randomised loot /// [JsonPropertyName("useForcedLoot")] - public bool? UseForcedLoot - { - get; - set; - } + public bool? UseForcedLoot { get; set; } /// /// Item tpls + count of items to force include /// [JsonPropertyName("forcedLoot")] - public Dictionary>? ForcedLoot - { - get; - set; - } + public Dictionary>? ForcedLoot { get; set; } /// /// Should seasonal items appear when it's not the season for them /// [JsonPropertyName("blockSeasonalItemsOutOfSeason")] - public bool? BlockSeasonalItemsOutOfSeason - { - get; - set; - } + public bool? BlockSeasonalItemsOutOfSeason { get; set; } } public record AirdropLootRequest : LootRequest @@ -153,9 +97,5 @@ public record AirdropLootRequest : LootRequest /// Airdrop icon used by client to show crate type /// [JsonPropertyName("icon")] - public AirdropTypeEnum? Icon - { - get; - set; - } + public AirdropTypeEnum? Icon { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/ProfileActivityData.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/ProfileActivityData.cs index 007990f1..d7d4b139 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/ProfileActivityData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/ProfileActivityData.cs @@ -16,5 +16,4 @@ namespace SPTarkov.Server.Core.Models.Spt.Services public RaidChanges? RaidAdjustments { get; set; } = null; public LocationTransit? LocationTransit { get; set; } = null; } - } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/TraderServiceModel.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/TraderServiceModel.cs index 6e8009be..db2860a5 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Services/TraderServiceModel.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Services/TraderServiceModel.cs @@ -10,39 +10,19 @@ public record TraderServiceModel [JsonPropertyName("serviceType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public TraderServiceType? ServiceType - { - get; - set; - } + public TraderServiceType? ServiceType { get; set; } [JsonPropertyName("itemsToPay")] - public Dictionary? ItemsToPay - { - get; - set; - } + public Dictionary? ItemsToPay { get; set; } [JsonPropertyName("itemsToReceive")] - public List? ItemsToReceive - { - get; - set; - } + public List? ItemsToReceive { get; set; } [JsonPropertyName("subServices")] - public Dictionary? SubServices - { - get; - set; - } + public Dictionary? SubServices { get; set; } [JsonPropertyName("requirements")] - public TraderServiceRequirementsModel? Requirements - { - get; - set; - } + public TraderServiceRequirementsModel? Requirements { get; set; } } public record TraderServiceRequirementsModel @@ -51,16 +31,8 @@ public record TraderServiceRequirementsModel public Dictionary ExtensionData { get; set; } [JsonPropertyName("completedQuests")] - public List? CompletedQuests - { - get; - set; - } + public List? CompletedQuests { get; set; } [JsonPropertyName("standings")] - public Dictionary? Standings - { - get; - set; - } + public Dictionary? Standings { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs index cbe3206d..7cd042d2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs @@ -10,118 +10,62 @@ public record Templates public Dictionary ExtensionData { get; set; } [JsonPropertyName("character")] - public List? Character - { - get; - set; - } + public List? Character { get; set; } [JsonPropertyName("customisationStorage")] - public List? CustomisationStorage - { - get; - set; - } + public List? CustomisationStorage { get; set; } [JsonPropertyName("items")] - public Dictionary? Items - { - get; - set; - } + public Dictionary? Items { get; set; } [JsonPropertyName("prestige")] - public Prestige? Prestige - { - get; - set; - } + public Prestige? Prestige { get; set; } [JsonPropertyName("quests")] - public Dictionary? Quests - { - get; - set; - } + public Dictionary? Quests { get; set; } [JsonPropertyName("repeatableQuests")] - public RepeatableQuestDatabase? RepeatableQuests - { - get; - set; - } + public RepeatableQuestDatabase? RepeatableQuests { get; set; } [JsonPropertyName("handbook")] - public HandbookBase? Handbook - { - get; - set; - } + public HandbookBase? Handbook { get; set; } [JsonPropertyName("customization")] - public Dictionary? Customization - { - get; - set; - } + public Dictionary? Customization { get; set; } /// /// The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) /// [JsonPropertyName("profiles")] - public Dictionary? Profiles - { - get; - set; - } + public Dictionary? Profiles { get; set; } /// /// Flea prices of items - gathered from online flea market dump /// [JsonPropertyName("prices")] - public Dictionary? Prices - { - get; - set; - } + public Dictionary? Prices { get; set; } /// /// Default equipment loadouts that show on main inventory screen /// [JsonPropertyName("defaultEquipmentPresets")] - public List? DefaultEquipmentPresets - { - get; - set; - } + public List? DefaultEquipmentPresets { get; set; } /// /// Achievements /// [JsonPropertyName("achievements")] - public List? Achievements - { - get; - set; - } + public List? Achievements { get; set; } /// /// Achievements /// [JsonPropertyName("customAchievements")] - public List? CustomAchievements - { - get; - set; - } + public List? CustomAchievements { get; set; } /// /// Location services data /// [JsonPropertyName("locationServices")] - public LocationServices? LocationServices - { - get; - set; - } + public LocationServices? LocationServices { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Weather/GetLocalWeatherResponseData.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Weather/GetLocalWeatherResponseData.cs index e5c18da4..98017d6f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Weather/GetLocalWeatherResponseData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Weather/GetLocalWeatherResponseData.cs @@ -9,16 +9,8 @@ public record GetLocalWeatherResponseData public Dictionary ExtensionData { get; set; } [JsonPropertyName("season")] - public Season? Season - { - get; - set; - } + public Season? Season { get; set; } [JsonPropertyName("weather")] - public List? Weather - { - get; - set; - } + public List? Weather { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Trader/ITrader.cs b/Libraries/SPTarkov.Server.Core/Models/Trader/ITrader.cs index 7fd7b388..fa3566ef 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Trader/ITrader.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Trader/ITrader.cs @@ -13,8 +13,11 @@ public abstract record ICustomTrader : ITrader { public abstract string Name { get; } public abstract string Id { get; } + public abstract TraderAssort? GetAssort(); + public abstract Dictionary>? GetQuestAssort(); + public abstract TraderBase? GetBase(); public virtual List? GetSuits() diff --git a/Libraries/SPTarkov.Server.Core/Models/Utils/IRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Utils/IRequestData.cs index aba984fa..428fd0b0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Utils/IRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Utils/IRequestData.cs @@ -1,5 +1,3 @@ namespace SPTarkov.Server.Core.Models.Utils; -public interface IRequestData -{ -} +public interface IRequestData { } diff --git a/Libraries/SPTarkov.Server.Core/Models/Utils/ISptLogger.cs b/Libraries/SPTarkov.Server.Core/Models/Utils/ISptLogger.cs index 453508c5..7370ae64 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Utils/ISptLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Utils/ISptLogger.cs @@ -5,14 +5,25 @@ namespace SPTarkov.Server.Core.Models.Utils; public interface ISptLogger { - void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, Exception? ex = null); + void LogWithColor( + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ); void Success(string data, Exception? ex = null); void Error(string data, Exception? ex = null); void Warning(string data, Exception? ex = null); void Info(string data, Exception? ex = null); void Debug(string data, Exception? ex = null); void Critical(string data, Exception? ex = null); - void Log(LogLevel level, string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, Exception? ex = null); + void Log( + LogLevel level, + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ); bool IsLogEnabled(LogLevel level); void DumpAndStop(); } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BotDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BotDynamicRouter.cs index 2dba3e88..bd31874a 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BotDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BotDynamicRouter.cs @@ -9,59 +9,42 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class BotDynamicRouter : DynamicRouter { - public BotDynamicRouter( - JsonUtil jsonUtil, - BotCallbacks botCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/singleplayer/settings/bot/limit/", - async ( - url, - info, - sessionID, - output - ) => await botCallbacks.GetBotLimit(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/settings/bot/difficulty/", - async ( - url, - info, - sessionID, - output - ) => await botCallbacks.GetBotDifficulty(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/settings/bot/difficulties", - async ( - url, - info, - sessionID, - output - ) => await botCallbacks.GetAllBotDifficulties(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/settings/bot/maxCap", - async ( - url, - info, - sessionID, - output - ) => await botCallbacks.GetBotCap(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/settings/bot/getBotBehaviours/", - async ( - url, - info, - sessionID, - output - ) => await botCallbacks.GetBotBehaviours() - ) - ] - ) - { - } + public BotDynamicRouter(JsonUtil jsonUtil, BotCallbacks botCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/singleplayer/settings/bot/limit/", + async (url, info, sessionID, output) => + await botCallbacks.GetBotLimit(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/singleplayer/settings/bot/difficulty/", + async (url, info, sessionID, output) => + await botCallbacks.GetBotDifficulty( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/singleplayer/settings/bot/difficulties", + async (url, info, sessionID, output) => + await botCallbacks.GetAllBotDifficulties( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/singleplayer/settings/bot/maxCap", + async (url, info, sessionID, output) => + await botCallbacks.GetBotCap(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/singleplayer/settings/bot/getBotBehaviours/", + async (url, info, sessionID, output) => await botCallbacks.GetBotBehaviours() + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BundleDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BundleDynamicRouter.cs index 191d4bab..735dcc20 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BundleDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/BundleDynamicRouter.cs @@ -9,23 +9,15 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class BundleDynamicRouter : DynamicRouter { - public BundleDynamicRouter( - JsonUtil jsonUtil, - BundleCallbacks bundleCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/files/bundle", - async ( - url, - info, - sessionID, - output - ) => await bundleCallbacks.GetBundle(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public BundleDynamicRouter(JsonUtil jsonUtil, BundleCallbacks bundleCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/files/bundle", + async (url, info, sessionID, output) => + await bundleCallbacks.GetBundle(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/CustomizationDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/CustomizationDynamicRouter.cs index 29341527..04b7185c 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/CustomizationDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/CustomizationDynamicRouter.cs @@ -12,20 +12,19 @@ public class CustomizationDynamicRouter : DynamicRouter public CustomizationDynamicRouter( JsonUtil jsonUtil, CustomizationCallbacks customizationCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/trading/customization/", - async ( - url, - info, - sessionID, - output - ) => await customizationCallbacks.GetTraderSuits(url, info as EmptyRequestData, sessionID) - ) - ] ) - { - } + : base( + jsonUtil, + [ + new RouteAction( + "/client/trading/customization/", + async (url, info, sessionID, output) => + await customizationCallbacks.GetTraderSuits( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/DataDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/DataDynamicRouter.cs index 74b0f8d7..dab7bc05 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/DataDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/DataDynamicRouter.cs @@ -9,41 +9,29 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class DataDynamicRouter : DynamicRouter { - public DataDynamicRouter( - JsonUtil jsonUtil, - DataCallbacks dataCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/menu/locale/", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetLocalesMenu(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/locale/", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetLocalesGlobal(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/items/prices/", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetItemPrices(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public DataDynamicRouter(JsonUtil jsonUtil, DataCallbacks dataCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/menu/locale/", + async (url, info, sessionID, output) => + await dataCallbacks.GetLocalesMenu(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/locale/", + async (url, info, sessionID, output) => + await dataCallbacks.GetLocalesGlobal( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/items/prices/", + async (url, info, sessionID, output) => + await dataCallbacks.GetItemPrices(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/HttpDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/HttpDynamicRouter.cs index 0c20cac8..a3b97361 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/HttpDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/HttpDynamicRouter.cs @@ -7,14 +7,13 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class HttpDynamicRouter : DynamicRouter { - public HttpDynamicRouter(ImageRouter imageRouter, JsonUtil jsonUtil) : base( - jsonUtil, - [ - new RouteAction(".jpg", async (_, _, _, _) => await imageRouter.GetImage()), - new RouteAction(".png", async (_, _, _, _) => await imageRouter.GetImage()), - new RouteAction(".ico", async (_, _, _, _) => await imageRouter.GetImage()) - ] - ) - { - } + public HttpDynamicRouter(ImageRouter imageRouter, JsonUtil jsonUtil) + : base( + jsonUtil, + [ + new RouteAction(".jpg", async (_, _, _, _) => await imageRouter.GetImage()), + new RouteAction(".png", async (_, _, _, _) => await imageRouter.GetImage()), + new RouteAction(".ico", async (_, _, _, _) => await imageRouter.GetImage()), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/InraidDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/InraidDynamicRouter.cs index f278143c..1f44e3eb 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/InraidDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/InraidDynamicRouter.cs @@ -9,26 +9,22 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class InraidDynamicRouter : DynamicRouter { - public InraidDynamicRouter( - JsonUtil jsonUtil, - InraidCallbacks inraidCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/location/getLocalloot", - async ( - url, - info, - sessionID, - output - ) => await inraidCallbacks.RegisterPlayer(url, info as RegisterPlayerRequestData, sessionID), - typeof(RegisterPlayerRequestData) - ) - ] - ) - { - } + public InraidDynamicRouter(JsonUtil jsonUtil, InraidCallbacks inraidCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/location/getLocalloot", + async (url, info, sessionID, output) => + await inraidCallbacks.RegisterPlayer( + url, + info as RegisterPlayerRequestData, + sessionID + ), + typeof(RegisterPlayerRequestData) + ), + ] + ) { } public override string GetTopLevelRoute() { diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/LocationDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/LocationDynamicRouter.cs index 1e65dfb0..eefc7560 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/LocationDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/LocationDynamicRouter.cs @@ -7,14 +7,8 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class LocationDynamicRouter : DynamicRouter { - public LocationDynamicRouter( - JsonUtil jsonUtil - ) : base( - jsonUtil, - [] - ) - { - } + public LocationDynamicRouter(JsonUtil jsonUtil) + : base(jsonUtil, []) { } public override string GetTopLevelRoute() { diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/NotifierDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/NotifierDynamicRouter.cs index aecc6614..35dc6399 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/NotifierDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/NotifierDynamicRouter.cs @@ -8,50 +8,30 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class NotifierDynamicRouter : DynamicRouter { - public NotifierDynamicRouter( - JsonUtil jsonUtil, - NotifierCallbacks notifierCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/?last_id", - async ( - url, - info, - sessionID, - _ - ) => await notifierCallbacks.Notify(url, info, sessionID) - ), - new RouteAction( - "/notifierServer", - async ( - url, - info, - sessionID, - _ - ) => await notifierCallbacks.Notify(url, info, sessionID) - ), - new RouteAction( - "/push/notifier/get/", - async ( - url, - info, - sessionID, - _ - ) => await notifierCallbacks.GetNotifier(url, info, sessionID) - ), - new RouteAction( - "/push/notifier/get/", - async ( - url, - info, - sessionID, - _ - ) => await notifierCallbacks.GetNotifier(url, info, sessionID) - ) - ] - ) - { - } + public NotifierDynamicRouter(JsonUtil jsonUtil, NotifierCallbacks notifierCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/?last_id", + async (url, info, sessionID, _) => + await notifierCallbacks.Notify(url, info, sessionID) + ), + new RouteAction( + "/notifierServer", + async (url, info, sessionID, _) => + await notifierCallbacks.Notify(url, info, sessionID) + ), + new RouteAction( + "/push/notifier/get/", + async (url, info, sessionID, _) => + await notifierCallbacks.GetNotifier(url, info, sessionID) + ), + new RouteAction( + "/push/notifier/get/", + async (url, info, sessionID, _) => + await notifierCallbacks.GetNotifier(url, info, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/TraderDynamicRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/TraderDynamicRouter.cs index 20416344..9c2b0806 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Dynamic/TraderDynamicRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Dynamic/TraderDynamicRouter.cs @@ -9,32 +9,20 @@ namespace SPTarkov.Server.Core.Routers.Dynamic; [Injectable] public class TraderDynamicRouter : DynamicRouter { - public TraderDynamicRouter( - JsonUtil jsonUtil, - TraderCallbacks traderCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/trading/api/getTrader/", - async ( - url, - info, - sessionID, - output - ) => await traderCallbacks.GetTrader(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/trading/api/getTraderAssort/", - async ( - url, - info, - sessionID, - output - ) => await traderCallbacks.GetAssort(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public TraderDynamicRouter(JsonUtil jsonUtil, TraderCallbacks traderCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/trading/api/getTrader/", + async (url, info, sessionID, output) => + await traderCallbacks.GetTrader(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/trading/api/getTraderAssort/", + async (url, info, sessionID, output) => + await traderCallbacks.GetAssort(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/EventOutputHolder.cs b/Libraries/SPTarkov.Server.Core/Routers/EventOutputHolder.cs index fa6cf3d4..1709772e 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/EventOutputHolder.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/EventOutputHolder.cs @@ -70,7 +70,8 @@ public class EventOutputHolder ProfileChanges = new Dictionary { { - sessionId, new ProfileChange + sessionId, + new ProfileChange { Id = sessionId, Experience = pmcProfile.Info.Experience, @@ -82,7 +83,7 @@ public class EventOutputHolder { NewItems = [], ChangedItems = [], - DeletedItems = [] + DeletedItems = [], }, Production = new Dictionary(), Improvements = new Dictionary(), @@ -90,15 +91,15 @@ public class EventOutputHolder { Common = [], Mastering = [], - Points = 0 + Points = 0, }, Health = _cloner.Clone(pmcProfile.Health), TraderRelations = new Dictionary(), - QuestsStatus = [] + QuestsStatus = [], } - } + }, }, - Warnings = [] + Warnings = [], } ); } @@ -122,7 +123,9 @@ public class EventOutputHolder _cloner.Clone(pmcData.Hideout.Production), sessionId ); - profileChanges.Improvements = _cloner.Clone(GetImprovementsFromProfileAndFlagComplete(pmcData)); + profileChanges.Improvements = _cloner.Clone( + GetImprovementsFromProfileAndFlagComplete(pmcData) + ); profileChanges.TraderRelations = ConstructTraderRelations(pmcData.TradersInfo); ResetMoneyTransferLimit(pmcData.MoneyTransferLimitData); @@ -146,7 +149,10 @@ public class EventOutputHolder // remove production in case client already issued a HideoutDeleteProductionCommand and the item is moved to stash productions.Remove(production.Key); } - else if ((production.Value.SptIsComplete ?? false) && (production.Value.SptIsContinuous ?? false)) + else if ( + (production.Value.SptIsComplete ?? false) + && (production.Value.SptIsContinuous ?? false) + ) { // Water collector / Bitcoin etc production.Value.SptIsComplete = false; @@ -166,7 +172,9 @@ public class EventOutputHolder /// /// Player profile /// Dictionary of hideout improvements - private Dictionary? GetImprovementsFromProfileAndFlagComplete(PmcData pmcData) + private Dictionary? GetImprovementsFromProfileAndFlagComplete( + PmcData pmcData + ) { foreach (var improvementKey in pmcData.Hideout.Improvements) { @@ -193,7 +201,10 @@ public class EventOutputHolder /// Productions from player profile /// Player session ID /// Dictionary of hideout productions - private Dictionary? GetProductionsFromProfileAndFlagComplete(Dictionary? productions, string sessionId) + private Dictionary? GetProductionsFromProfileAndFlagComplete( + Dictionary? productions, + string sessionId + ) { foreach (var production in productions) { @@ -204,7 +215,10 @@ public class EventOutputHolder } // Complete and is Continuous e.g. water collector - if ((production.Value.SptIsComplete ?? false) && (production.Value.SptIsContinuous ?? false)) + if ( + (production.Value.SptIsComplete ?? false) + && (production.Value.SptIsContinuous ?? false) + ) { continue; } @@ -256,7 +270,9 @@ public class EventOutputHolder /// /// Server data for traders /// Dict of trader id + TraderData - private Dictionary ConstructTraderRelations(Dictionary traderData) + private Dictionary ConstructTraderRelations( + Dictionary traderData + ) { return traderData.ToDictionary( trader => trader.Key, @@ -266,7 +282,7 @@ public class EventOutputHolder Disabled = trader.Value.Disabled, Loyalty = trader.Value.LoyaltyLevel, Standing = trader.Value.Standing, - Unlocked = trader.Value.Unlocked + Unlocked = trader.Value.Unlocked, } ); } diff --git a/Libraries/SPTarkov.Server.Core/Routers/HttpRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/HttpRouter.cs index 1877bdd7..d0e37f60 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/HttpRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/HttpRouter.cs @@ -71,11 +71,23 @@ public class HttpRouter { if (dynamic) { - wrapper.Output = await (route as DynamicRouter).HandleDynamic(url, body, sessionID, wrapper.Output) as string; + wrapper.Output = + await (route as DynamicRouter).HandleDynamic( + url, + body, + sessionID, + wrapper.Output + ) as string; } else { - wrapper.Output = await (route as StaticRouter).HandleStatic(url, body, sessionID, wrapper.Output) as string; + wrapper.Output = + await (route as StaticRouter).HandleStatic( + url, + body, + sessionID, + wrapper.Output + ) as string; } matched = true; @@ -87,10 +99,6 @@ public class HttpRouter protected class ResponseWrapper(string? output) { - public string? Output - { - get; - set; - } = output; + public string? Output { get; set; } = output; } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEventRouter.cs index f424cb64..f40140dd 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEventRouter.cs @@ -12,23 +12,27 @@ using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; namespace SPTarkov.Server.Core.Routers; [Injectable] -public class ItemEventRouter(ISptLogger logger, +public class ItemEventRouter( + ISptLogger logger, ISptLogger fileLogger, JsonUtil jsonUtil, ProfileHelper profileHelper, LocalisationService localisationService, EventOutputHolder eventOutputHolder, IEnumerable itemEventRouters, - ICloner cloner) + ICloner cloner +) { - /// /// Handles ItemEventRouter Requests and processes them. /// /// Event request /// Session ID /// Item response - public async ValueTask HandleEvents(ItemEventRouterRequest info, string sessionID) + public async ValueTask HandleEvents( + ItemEventRouterRequest info, + string sessionID + ) { var output = eventOutputHolder.GetOutput(sessionID); diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/CustomizationItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/CustomizationItemEventRouter.cs index 2022eca9..346087e1 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/CustomizationItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/CustomizationItemEventRouter.cs @@ -16,8 +16,7 @@ public class CustomizationItemEventRouter : ItemEventRouterDefinition protected CustomizationCallbacks _customizationCallbacks; protected ISptLogger _logger; - public CustomizationItemEventRouter - ( + public CustomizationItemEventRouter( ISptLogger logger, CustomizationCallbacks customizationCallbacks ) @@ -31,21 +30,40 @@ public class CustomizationItemEventRouter : ItemEventRouterDefinition return new List { new(ItemEventActions.CUSTOMIZATION_BUY, false), - new(ItemEventActions.CUSTOMIZATION_SET, false) + new(ItemEventActions.CUSTOMIZATION_SET, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.CUSTOMIZATION_BUY: - return new ValueTask(_customizationCallbacks.BuyCustomisation(pmcData, body as BuyClothingRequestData, sessionID)); + return new ValueTask( + _customizationCallbacks.BuyCustomisation( + pmcData, + body as BuyClothingRequestData, + sessionID + ) + ); case ItemEventActions.CUSTOMIZATION_SET: - return new ValueTask(_customizationCallbacks.SetCustomisation(pmcData, body as CustomizationSetRequest, sessionID)); + return new ValueTask( + _customizationCallbacks.SetCustomisation( + pmcData, + body as CustomizationSetRequest, + sessionID + ) + ); default: - throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"CustomizationItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HealthItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HealthItemEventRouter.cs index 217ca073..5a682a07 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HealthItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HealthItemEventRouter.cs @@ -14,10 +14,7 @@ public class HealthItemEventRouter : ItemEventRouterDefinition { protected HealthCallbacks _healthCallbacks; - public HealthItemEventRouter - ( - HealthCallbacks healthCallbacks - ) + public HealthItemEventRouter(HealthCallbacks healthCallbacks) { _healthCallbacks = healthCallbacks; } @@ -28,23 +25,40 @@ public class HealthItemEventRouter : ItemEventRouterDefinition [ new HandledRoute(ItemEventActions.EAT, false), new HandledRoute(ItemEventActions.HEAL, false), - new HandledRoute(ItemEventActions.RESTORE_HEALTH, false) + new HandledRoute(ItemEventActions.RESTORE_HEALTH, false), ]; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.EAT: - return new ValueTask(_healthCallbacks.OffraidEat(pmcData, body as OffraidEatRequestData, sessionID)); + return new ValueTask( + _healthCallbacks.OffraidEat(pmcData, body as OffraidEatRequestData, sessionID) + ); case ItemEventActions.HEAL: - return new ValueTask(_healthCallbacks.OffraidHeal(pmcData, body as OffraidHealRequestData, sessionID)); + return new ValueTask( + _healthCallbacks.OffraidHeal(pmcData, body as OffraidHealRequestData, sessionID) + ); case ItemEventActions.RESTORE_HEALTH: - return new ValueTask(_healthCallbacks.HealthTreatment(pmcData, body as HealthTreatmentRequestData, sessionID)); + return new ValueTask( + _healthCallbacks.HealthTreatment( + pmcData, + body as HealthTreatmentRequestData, + sessionID + ) + ); default: - throw new Exception($"HealthItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"HealthItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HideoutItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HideoutItemEventRouter.cs index a911e1a2..0ead8c54 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HideoutItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/HideoutItemEventRouter.cs @@ -14,9 +14,7 @@ public class HideoutItemEventRouter : ItemEventRouterDefinition { protected HideoutCallbacks _hideoutCallbacks; - public HideoutItemEventRouter - ( - HideoutCallbacks hideoutCallbacks) + public HideoutItemEventRouter(HideoutCallbacks hideoutCallbacks) { _hideoutCallbacks = hideoutCallbacks; } @@ -40,49 +38,155 @@ public class HideoutItemEventRouter : ItemEventRouterDefinition new HandledRoute(HideoutEventActions.HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START, false), new HandledRoute(HideoutEventActions.HIDEOUT_DELETE_PRODUCTION_COMMAND, false), new HandledRoute(HideoutEventActions.HIDEOUT_CUSTOMIZATION_APPLY_COMMAND, false), - new HandledRoute(HideoutEventActions.HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE, false) + new HandledRoute(HideoutEventActions.HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE, false), ]; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case HideoutEventActions.HIDEOUT_UPGRADE: - return new ValueTask(_hideoutCallbacks.Upgrade(pmcData, body as HideoutUpgradeRequestData, sessionID, output)); + return new ValueTask( + _hideoutCallbacks.Upgrade( + pmcData, + body as HideoutUpgradeRequestData, + sessionID, + output + ) + ); case HideoutEventActions.HIDEOUT_UPGRADE_COMPLETE: - return new ValueTask(_hideoutCallbacks.UpgradeComplete(pmcData, body as HideoutUpgradeCompleteRequestData, sessionID, output)); + return new ValueTask( + _hideoutCallbacks.UpgradeComplete( + pmcData, + body as HideoutUpgradeCompleteRequestData, + sessionID, + output + ) + ); case HideoutEventActions.HIDEOUT_PUT_ITEMS_IN_AREA_SLOTS: - return new ValueTask(_hideoutCallbacks.PutItemsInAreaSlots(pmcData, body as HideoutPutItemInRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.PutItemsInAreaSlots( + pmcData, + body as HideoutPutItemInRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_TAKE_ITEMS_FROM_AREA_SLOTS: - return new ValueTask(_hideoutCallbacks.TakeItemsFromAreaSlots(pmcData, body as HideoutTakeItemOutRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.TakeItemsFromAreaSlots( + pmcData, + body as HideoutTakeItemOutRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_TOGGLE_AREA: - return new ValueTask(_hideoutCallbacks.ToggleArea(pmcData, body as HideoutToggleAreaRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.ToggleArea( + pmcData, + body as HideoutToggleAreaRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_SINGLE_PRODUCTION_START: - return new ValueTask(_hideoutCallbacks.SingleProductionStart(pmcData, body as HideoutSingleProductionStartRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.SingleProductionStart( + pmcData, + body as HideoutSingleProductionStartRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_SCAV_CASE_PRODUCTION_START: - return new ValueTask(_hideoutCallbacks.ScavCaseProductionStart(pmcData, body as HideoutScavCaseStartRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.ScavCaseProductionStart( + pmcData, + body as HideoutScavCaseStartRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_CONTINUOUS_PRODUCTION_START: - return new ValueTask(_hideoutCallbacks.ContinuousProductionStart(pmcData, body as HideoutContinuousProductionStartRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.ContinuousProductionStart( + pmcData, + body as HideoutContinuousProductionStartRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_TAKE_PRODUCTION: - return new ValueTask(_hideoutCallbacks.TakeProduction(pmcData, body as HideoutTakeProductionRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.TakeProduction( + pmcData, + body as HideoutTakeProductionRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_RECORD_SHOOTING_RANGE_POINTS: - return new ValueTask(_hideoutCallbacks.RecordShootingRangePoints(pmcData, body as RecordShootingRangePoints, sessionID, output)); + return new ValueTask( + _hideoutCallbacks.RecordShootingRangePoints( + pmcData, + body as RecordShootingRangePoints, + sessionID, + output + ) + ); case HideoutEventActions.HIDEOUT_IMPROVE_AREA: - return new ValueTask(_hideoutCallbacks.ImproveArea(pmcData, body as HideoutImproveAreaRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.ImproveArea( + pmcData, + body as HideoutImproveAreaRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_CANCEL_PRODUCTION_COMMAND: - return new ValueTask(_hideoutCallbacks.CancelProduction(pmcData, body as HideoutCancelProductionRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.CancelProduction( + pmcData, + body as HideoutCancelProductionRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START: - return new ValueTask(_hideoutCallbacks.CicleOfCultistProductionStart(pmcData, body as HideoutCircleOfCultistProductionStartRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.CicleOfCultistProductionStart( + pmcData, + body as HideoutCircleOfCultistProductionStartRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_DELETE_PRODUCTION_COMMAND: - return new ValueTask(_hideoutCallbacks.HideoutDeleteProductionCommand(pmcData, body as HideoutDeleteProductionRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.HideoutDeleteProductionCommand( + pmcData, + body as HideoutDeleteProductionRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_CUSTOMIZATION_APPLY_COMMAND: - return new ValueTask(_hideoutCallbacks.HideoutCustomizationApplyCommand(pmcData, body as HideoutCustomizationApplyRequestData, sessionID)); + return new ValueTask( + _hideoutCallbacks.HideoutCustomizationApplyCommand( + pmcData, + body as HideoutCustomizationApplyRequestData, + sessionID + ) + ); case HideoutEventActions.HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE: - return new ValueTask(_hideoutCallbacks.HideoutCustomizationSetMannequinPose(pmcData, body as HideoutCustomizationSetMannequinPoseRequest, sessionID)); + return new ValueTask( + _hideoutCallbacks.HideoutCustomizationSetMannequinPose( + pmcData, + body as HideoutCustomizationSetMannequinPoseRequest, + sessionID + ) + ); default: - throw new Exception($"HideoutItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"HideoutItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InsuranceItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InsuranceItemEventRouter.cs index b2c37e33..61183cf0 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InsuranceItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InsuranceItemEventRouter.cs @@ -14,31 +14,34 @@ public class InsuranceItemEventRouter : ItemEventRouterDefinition { protected InsuranceCallbacks _insuranceCallbacks; - public InsuranceItemEventRouter - ( - InsuranceCallbacks insuranceCallbacks - ) + public InsuranceItemEventRouter(InsuranceCallbacks insuranceCallbacks) { _insuranceCallbacks = insuranceCallbacks; } protected override List GetHandledRoutes() { - return new List - { - new(ItemEventActions.INSURE, false) - }; + return new List { new(ItemEventActions.INSURE, false) }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.INSURE: - return new ValueTask(_insuranceCallbacks.Insure(pmcData, body as InsureRequestData, sessionID)); + return new ValueTask( + _insuranceCallbacks.Insure(pmcData, body as InsureRequestData, sessionID) + ); default: - throw new Exception($"InsuranceItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"InsuranceItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InventoryItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InventoryItemEventRouter.cs index 9bda1e24..64e69b72 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InventoryItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/InventoryItemEventRouter.cs @@ -17,8 +17,7 @@ public class InventoryItemEventRouter : ItemEventRouterDefinition protected HideoutCallbacks _hideoutCallbacks; protected InventoryCallbacks _inventoryCallbacks; - public InventoryItemEventRouter - ( + public InventoryItemEventRouter( InventoryCallbacks inventoryCallbacks, HideoutCallbacks hideoutCallbacks ) @@ -53,63 +52,222 @@ public class InventoryItemEventRouter : ItemEventRouterDefinition new(ItemEventActions.REDEEM_PROFILE_REWARD, false), new(ItemEventActions.SET_FAVORITE_ITEMS, false), new(ItemEventActions.QUEST_FAIL, false), - new(ItemEventActions.PIN_LOCK, false) + new(ItemEventActions.PIN_LOCK, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.MOVE: - return new ValueTask(_inventoryCallbacks.MoveItem(pmcData, body as InventoryMoveRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.MoveItem( + pmcData, + body as InventoryMoveRequestData, + sessionID, + output + ) + ); case ItemEventActions.REMOVE: - return new ValueTask(_inventoryCallbacks.RemoveItem(pmcData, body as InventoryRemoveRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.RemoveItem( + pmcData, + body as InventoryRemoveRequestData, + sessionID, + output + ) + ); case ItemEventActions.SPLIT: - return new ValueTask(_inventoryCallbacks.SplitItem(pmcData, body as InventorySplitRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.SplitItem( + pmcData, + body as InventorySplitRequestData, + sessionID, + output + ) + ); case ItemEventActions.MERGE: - return new ValueTask(_inventoryCallbacks.MergeItem(pmcData, body as InventoryMergeRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.MergeItem( + pmcData, + body as InventoryMergeRequestData, + sessionID, + output + ) + ); case ItemEventActions.TRANSFER: - return new ValueTask(_inventoryCallbacks.TransferItem(pmcData, body as InventoryTransferRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.TransferItem( + pmcData, + body as InventoryTransferRequestData, + sessionID, + output + ) + ); case ItemEventActions.SWAP: - return new ValueTask(_inventoryCallbacks.SwapItem(pmcData, body as InventorySwapRequestData, sessionID)); + return new ValueTask( + _inventoryCallbacks.SwapItem( + pmcData, + body as InventorySwapRequestData, + sessionID + ) + ); case ItemEventActions.FOLD: - return new ValueTask(_inventoryCallbacks.FoldItem(pmcData, body as InventoryFoldRequestData, sessionID)); + return new ValueTask( + _inventoryCallbacks.FoldItem( + pmcData, + body as InventoryFoldRequestData, + sessionID + ) + ); case ItemEventActions.TOGGLE: - return new ValueTask(_inventoryCallbacks.ToggleItem(pmcData, body as InventoryToggleRequestData, sessionID)); + return new ValueTask( + _inventoryCallbacks.ToggleItem( + pmcData, + body as InventoryToggleRequestData, + sessionID + ) + ); case ItemEventActions.TAG: - return new ValueTask(_inventoryCallbacks.TagItem(pmcData, body as InventoryTagRequestData, sessionID)); + return new ValueTask( + _inventoryCallbacks.TagItem(pmcData, body as InventoryTagRequestData, sessionID) + ); case ItemEventActions.BIND: - return new ValueTask(_inventoryCallbacks.BindItem(pmcData, body as InventoryBindRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.BindItem( + pmcData, + body as InventoryBindRequestData, + sessionID, + output + ) + ); case ItemEventActions.UNBIND: - return new ValueTask(_inventoryCallbacks.UnBindItem(pmcData, body as InventoryBindRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.UnBindItem( + pmcData, + body as InventoryBindRequestData, + sessionID, + output + ) + ); case ItemEventActions.EXAMINE: - return new ValueTask(_inventoryCallbacks.ExamineItem(pmcData, body as InventoryExamineRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.ExamineItem( + pmcData, + body as InventoryExamineRequestData, + sessionID, + output + ) + ); case ItemEventActions.READ_ENCYCLOPEDIA: - return new ValueTask(_inventoryCallbacks.ReadEncyclopedia(pmcData, body as InventoryReadEncyclopediaRequestData, sessionID)); + return new ValueTask( + _inventoryCallbacks.ReadEncyclopedia( + pmcData, + body as InventoryReadEncyclopediaRequestData, + sessionID + ) + ); case ItemEventActions.APPLY_INVENTORY_CHANGES: - return new ValueTask(_inventoryCallbacks.SortInventory(pmcData, body as InventorySortRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.SortInventory( + pmcData, + body as InventorySortRequestData, + sessionID, + output + ) + ); case ItemEventActions.CREATE_MAP_MARKER: - return new ValueTask(_inventoryCallbacks.CreateMapMarker(pmcData, body as InventoryCreateMarkerRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.CreateMapMarker( + pmcData, + body as InventoryCreateMarkerRequestData, + sessionID, + output + ) + ); case ItemEventActions.DELETE_MAP_MARKER: - return new ValueTask(_inventoryCallbacks.DeleteMapMarker(pmcData, body as InventoryDeleteMarkerRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.DeleteMapMarker( + pmcData, + body as InventoryDeleteMarkerRequestData, + sessionID, + output + ) + ); case ItemEventActions.EDIT_MAP_MARKER: - return new ValueTask(_inventoryCallbacks.EditMapMarker(pmcData, body as InventoryEditMarkerRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.EditMapMarker( + pmcData, + body as InventoryEditMarkerRequestData, + sessionID, + output + ) + ); case ItemEventActions.OPEN_RANDOM_LOOT_CONTAINER: - return new ValueTask(_inventoryCallbacks.OpenRandomLootContainer(pmcData, body as OpenRandomLootContainerRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.OpenRandomLootContainer( + pmcData, + body as OpenRandomLootContainerRequestData, + sessionID, + output + ) + ); case ItemEventActions.HIDEOUT_QTE_EVENT: - return new ValueTask(_hideoutCallbacks.HandleQTEEvent(pmcData, body as HandleQTEEventRequestData, sessionID, output)); + return new ValueTask( + _hideoutCallbacks.HandleQTEEvent( + pmcData, + body as HandleQTEEventRequestData, + sessionID, + output + ) + ); case ItemEventActions.REDEEM_PROFILE_REWARD: - return new ValueTask(_inventoryCallbacks.RedeemProfileReward(pmcData, body as RedeemProfileRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.RedeemProfileReward( + pmcData, + body as RedeemProfileRequestData, + sessionID, + output + ) + ); case ItemEventActions.SET_FAVORITE_ITEMS: - return new ValueTask(_inventoryCallbacks.SetFavoriteItem(pmcData, body as SetFavoriteItems, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.SetFavoriteItem( + pmcData, + body as SetFavoriteItems, + sessionID, + output + ) + ); case ItemEventActions.QUEST_FAIL: - return new ValueTask(_inventoryCallbacks.FailQuest(pmcData, body as FailQuestRequestData, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.FailQuest( + pmcData, + body as FailQuestRequestData, + sessionID, + output + ) + ); case ItemEventActions.PIN_LOCK: - return new ValueTask(_inventoryCallbacks.PinOrLock(pmcData, body as PinOrLockItemRequest, sessionID, output)); + return new ValueTask( + _inventoryCallbacks.PinOrLock( + pmcData, + body as PinOrLockItemRequest, + sessionID, + output + ) + ); default: - throw new Exception($"InventoryItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"InventoryItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/NoteItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/NoteItemEventRouter.cs index fd5c0b83..2baa6f9e 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/NoteItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/NoteItemEventRouter.cs @@ -14,10 +14,7 @@ public class NoteItemEventRouter : ItemEventRouterDefinition { protected NoteCallbacks _noteCallbacks; - public NoteItemEventRouter - ( - NoteCallbacks noteCallbacks - ) + public NoteItemEventRouter(NoteCallbacks noteCallbacks) { _noteCallbacks = noteCallbacks; } @@ -28,23 +25,36 @@ public class NoteItemEventRouter : ItemEventRouterDefinition { new(ItemEventActions.ADD_NOTE, false), new(ItemEventActions.EDIT_NOTE, false), - new(ItemEventActions.DELETE_NOTE, false) + new(ItemEventActions.DELETE_NOTE, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.ADD_NOTE: - return new ValueTask(_noteCallbacks.AddNote(pmcData, body as NoteActionRequest, sessionID)); + return new ValueTask( + _noteCallbacks.AddNote(pmcData, body as NoteActionRequest, sessionID) + ); case ItemEventActions.EDIT_NOTE: - return new ValueTask(_noteCallbacks.EditNote(pmcData, body as NoteActionRequest, sessionID)); + return new ValueTask( + _noteCallbacks.EditNote(pmcData, body as NoteActionRequest, sessionID) + ); case ItemEventActions.DELETE_NOTE: - return new ValueTask(_noteCallbacks.DeleteNote(pmcData, body as NoteActionRequest, sessionID)); + return new ValueTask( + _noteCallbacks.DeleteNote(pmcData, body as NoteActionRequest, sessionID) + ); default: - throw new Exception($"NoteItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"NoteItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/QuestItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/QuestItemEventRouter.cs index 80d87c38..9fd9d1d9 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/QuestItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/QuestItemEventRouter.cs @@ -14,10 +14,7 @@ public class QuestItemEventRouter : ItemEventRouterDefinition { protected QuestCallbacks _questCallbacks; - public QuestItemEventRouter - ( - QuestCallbacks questCallbacks - ) + public QuestItemEventRouter(QuestCallbacks questCallbacks) { _questCallbacks = questCallbacks; } @@ -29,25 +26,52 @@ public class QuestItemEventRouter : ItemEventRouterDefinition new(ItemEventActions.QUEST_ACCEPT, false), new(ItemEventActions.QUEST_COMPLETE, false), new(ItemEventActions.QUEST_HANDOVER, false), - new(ItemEventActions.REPEATABLE_QUEST_CHANGE, false) + new(ItemEventActions.REPEATABLE_QUEST_CHANGE, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.QUEST_ACCEPT: - return new ValueTask(_questCallbacks.AcceptQuest(pmcData, body as AcceptQuestRequestData, sessionID)); + return new ValueTask( + _questCallbacks.AcceptQuest(pmcData, body as AcceptQuestRequestData, sessionID) + ); case ItemEventActions.QUEST_COMPLETE: - return new ValueTask(_questCallbacks.CompleteQuest(pmcData, body as CompleteQuestRequestData, sessionID)); + return new ValueTask( + _questCallbacks.CompleteQuest( + pmcData, + body as CompleteQuestRequestData, + sessionID + ) + ); case ItemEventActions.QUEST_HANDOVER: - return new ValueTask(_questCallbacks.HandoverQuest(pmcData, body as HandoverQuestRequestData, sessionID)); + return new ValueTask( + _questCallbacks.HandoverQuest( + pmcData, + body as HandoverQuestRequestData, + sessionID + ) + ); case ItemEventActions.REPEATABLE_QUEST_CHANGE: - return new ValueTask(_questCallbacks.ChangeRepeatableQuest(pmcData, body as RepeatableQuestChangeRequest, sessionID)); + return new ValueTask( + _questCallbacks.ChangeRepeatableQuest( + pmcData, + body as RepeatableQuestChangeRequest, + sessionID + ) + ); default: - throw new Exception($"QuestItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"QuestItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RagfairItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RagfairItemEventRouter.cs index c18804b4..80c38399 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RagfairItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RagfairItemEventRouter.cs @@ -14,10 +14,7 @@ public class RagfairItemEventRouter : ItemEventRouterDefinition { protected RagfairCallbacks _ragfairCallbacks; - public RagfairItemEventRouter - ( - RagfairCallbacks ragfairCallbacks - ) + public RagfairItemEventRouter(RagfairCallbacks ragfairCallbacks) { _ragfairCallbacks = ragfairCallbacks; } @@ -28,23 +25,44 @@ public class RagfairItemEventRouter : ItemEventRouterDefinition { new(ItemEventActions.RAGFAIR_ADD_OFFER, false), new(ItemEventActions.RAGFAIR_REMOVE_OFFER, false), - new(ItemEventActions.RAGFAIR_RENEW_OFFER, false) + new(ItemEventActions.RAGFAIR_RENEW_OFFER, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.RAGFAIR_ADD_OFFER: - return new ValueTask(_ragfairCallbacks.AddOffer(pmcData, body as AddOfferRequestData, sessionID)); + return new ValueTask( + _ragfairCallbacks.AddOffer(pmcData, body as AddOfferRequestData, sessionID) + ); case ItemEventActions.RAGFAIR_REMOVE_OFFER: - return new ValueTask(_ragfairCallbacks.RemoveOffer(pmcData, body as RemoveOfferRequestData, sessionID)); + return new ValueTask( + _ragfairCallbacks.RemoveOffer( + pmcData, + body as RemoveOfferRequestData, + sessionID + ) + ); case ItemEventActions.RAGFAIR_RENEW_OFFER: - return new ValueTask(_ragfairCallbacks.ExtendOffer(pmcData, body as ExtendOfferRequestData, sessionID)); + return new ValueTask( + _ragfairCallbacks.ExtendOffer( + pmcData, + body as ExtendOfferRequestData, + sessionID + ) + ); default: - throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"CustomizationItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RepairItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RepairItemEventRouter.cs index fe69279d..247373cd 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RepairItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/RepairItemEventRouter.cs @@ -14,10 +14,7 @@ public class RepairItemEventRouter : ItemEventRouterDefinition { protected RepairCallbacks _repairCallbacks; - public RepairItemEventRouter - ( - RepairCallbacks repairCallbacks - ) + public RepairItemEventRouter(RepairCallbacks repairCallbacks) { _repairCallbacks = repairCallbacks; } @@ -27,21 +24,36 @@ public class RepairItemEventRouter : ItemEventRouterDefinition return new List { new(ItemEventActions.REPAIR, false), - new(ItemEventActions.TRADER_REPAIR, false) + new(ItemEventActions.TRADER_REPAIR, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.REPAIR: - return new ValueTask(_repairCallbacks.Repair(pmcData, body as RepairActionDataRequest, sessionID)); + return new ValueTask( + _repairCallbacks.Repair(pmcData, body as RepairActionDataRequest, sessionID) + ); case ItemEventActions.TRADER_REPAIR: - return new ValueTask(_repairCallbacks.TraderRepair(pmcData, body as TraderRepairActionDataRequest, sessionID)); + return new ValueTask( + _repairCallbacks.TraderRepair( + pmcData, + body as TraderRepairActionDataRequest, + sessionID + ) + ); default: - throw new Exception($"RepairItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"RepairItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/TradeItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/TradeItemEventRouter.cs index 82336ad5..135c6f5e 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/TradeItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/TradeItemEventRouter.cs @@ -14,10 +14,7 @@ public class TradeItemEventRouter : ItemEventRouterDefinition { protected TradeCallbacks _tradeCallbacks; - public TradeItemEventRouter - ( - TradeCallbacks tradeCallbacks - ) + public TradeItemEventRouter(TradeCallbacks tradeCallbacks) { _tradeCallbacks = tradeCallbacks; } @@ -28,23 +25,48 @@ public class TradeItemEventRouter : ItemEventRouterDefinition { new(ItemEventActions.TRADING_CONFIRM, false), new(ItemEventActions.RAGFAIR_BUY_OFFER, false), - new(ItemEventActions.SELL_ALL_FROM_SAVAGE, false) + new(ItemEventActions.SELL_ALL_FROM_SAVAGE, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.TRADING_CONFIRM: - return new ValueTask(_tradeCallbacks.ProcessTrade(pmcData, body as ProcessBaseTradeRequestData, sessionID)); + return new ValueTask( + _tradeCallbacks.ProcessTrade( + pmcData, + body as ProcessBaseTradeRequestData, + sessionID + ) + ); case ItemEventActions.RAGFAIR_BUY_OFFER: - return new ValueTask(_tradeCallbacks.ProcessRagfairTrade(pmcData, body as ProcessRagfairTradeRequestData, sessionID)); + return new ValueTask( + _tradeCallbacks.ProcessRagfairTrade( + pmcData, + body as ProcessRagfairTradeRequestData, + sessionID + ) + ); case ItemEventActions.SELL_ALL_FROM_SAVAGE: - return new ValueTask(_tradeCallbacks.SellAllFromSavage(pmcData, body as SellScavItemsToFenceRequestData, sessionID)); + return new ValueTask( + _tradeCallbacks.SellAllFromSavage( + pmcData, + body as SellScavItemsToFenceRequestData, + sessionID + ) + ); default: - throw new Exception($"TradeItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"TradeItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/WishlistItemEventRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/WishlistItemEventRouter.cs index 23e8f7fe..948a0344 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/WishlistItemEventRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/ItemEvents/WishlistItemEventRouter.cs @@ -14,10 +14,7 @@ public class WishlistItemEventRouter : ItemEventRouterDefinition { protected WishlistCallbacks _wishlistCallbacks; - public WishlistItemEventRouter - ( - WishlistCallbacks wishlistCallbacks - ) + public WishlistItemEventRouter(WishlistCallbacks wishlistCallbacks) { _wishlistCallbacks = wishlistCallbacks; } @@ -28,23 +25,48 @@ public class WishlistItemEventRouter : ItemEventRouterDefinition { new(ItemEventActions.ADD_TO_WISHLIST, false), new(ItemEventActions.REMOVE_FROM_WISHLIST, false), - new(ItemEventActions.CHANGE_WISHLIST_ITEM_CATEGORY, false) + new(ItemEventActions.CHANGE_WISHLIST_ITEM_CATEGORY, false), }; } - public override ValueTask HandleItemEvent(string url, PmcData pmcData, BaseInteractionRequestData body, string sessionID, - ItemEventRouterResponse output) + public override ValueTask HandleItemEvent( + string url, + PmcData pmcData, + BaseInteractionRequestData body, + string sessionID, + ItemEventRouterResponse output + ) { switch (url) { case ItemEventActions.ADD_TO_WISHLIST: - return new ValueTask(_wishlistCallbacks.AddToWishlist(pmcData, body as AddToWishlistRequest, sessionID)); + return new ValueTask( + _wishlistCallbacks.AddToWishlist( + pmcData, + body as AddToWishlistRequest, + sessionID + ) + ); case ItemEventActions.REMOVE_FROM_WISHLIST: - return new ValueTask(_wishlistCallbacks.RemoveFromWishlist(pmcData, body as RemoveFromWishlistRequest, sessionID) ); + return new ValueTask( + _wishlistCallbacks.RemoveFromWishlist( + pmcData, + body as RemoveFromWishlistRequest, + sessionID + ) + ); case ItemEventActions.CHANGE_WISHLIST_ITEM_CATEGORY: - return new ValueTask(_wishlistCallbacks.ChangeWishlistItemCategory(pmcData, body as ChangeWishlistItemCategoryRequest, sessionID)); + return new ValueTask( + _wishlistCallbacks.ChangeWishlistItemCategory( + pmcData, + body as ChangeWishlistItemCategoryRequest, + sessionID + ) + ); default: - throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}"); + throw new Exception( + $"CustomizationItemEventRouter being used when it cant handle route {url}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/HealthSaveLoadRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/HealthSaveLoadRouter.cs index a8cacfae..af6af3b6 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/HealthSaveLoadRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/HealthSaveLoadRouter.cs @@ -27,81 +27,67 @@ public class HealthSaveLoadRouter : SaveLoadRouter Health = null, Energy = 0, Temperature = 0, - Hydration = 0 + Hydration = 0, }; vitality.Health = new Dictionary { { - "Head", new BodyPartHealth + "Head", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "Chest", new BodyPartHealth + "Chest", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "Stomach", new BodyPartHealth + "Stomach", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "LeftArm", new BodyPartHealth + "LeftArm", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "RightArm", new BodyPartHealth + "RightArm", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "LeftLeg", new BodyPartHealth + "LeftLeg", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } }, { - "RightLeg", new BodyPartHealth + "RightLeg", + new BodyPartHealth { - Health = new CurrentMinMax - { - Current = 0 - }, - Effects = new Dictionary() + Health = new CurrentMinMax { Current = 0 }, + Effects = new Dictionary(), } - } + }, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/InraidSaveLoadRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/InraidSaveLoadRouter.cs index 7ae807fa..9e143363 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/InraidSaveLoadRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/InraidSaveLoadRouter.cs @@ -16,11 +16,7 @@ public class InraidSaveLoadRouter : SaveLoadRouter { if (profile.InraidData == null) { - profile.InraidData = new Inraid - { - Location = "none", - Character = "none" - }; + profile.InraidData = new Inraid { Location = "none", Character = "none" }; } return profile; diff --git a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/ProfileSaveLoadRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/ProfileSaveLoadRouter.cs index 7315be0f..af5c2394 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/ProfileSaveLoadRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/SaveLoad/ProfileSaveLoadRouter.cs @@ -20,7 +20,7 @@ public class ProfileSaveLoadRouter : SaveLoadRouter profile.CharacterData = new Characters { PmcData = new PmcData(), - ScavData = new PmcData() + ScavData = new PmcData(), }; } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Serializers/NotifySerializer.cs b/Libraries/SPTarkov.Server.Core/Routers/Serializers/NotifySerializer.cs index 5cd58b27..24652e90 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Serializers/NotifySerializer.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Serializers/NotifySerializer.cs @@ -22,8 +22,11 @@ public class NotifySerializer( * Take our array of JSON message objects and cast them to JSON strings, so that they can then * be sent to client as NEWLINE separated strings... yup. */ - await notifierController.NotifyAsync(tmpSessionID) - .ContinueWith(messages => messages.Result.Select(message => string.Join("\n", jsonUtil.Serialize(message)))) + await notifierController + .NotifyAsync(tmpSessionID) + .ContinueWith(messages => + messages.Result.Select(message => string.Join("\n", jsonUtil.Serialize(message))) + ) .ContinueWith(text => httpServerHelper.SendTextJson(resp, text)); } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/AchievementStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/AchievementStaticRouter.cs index 6626f9dd..833b34bd 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/AchievementStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/AchievementStaticRouter.cs @@ -9,32 +9,28 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class AchievementStaticRouter : StaticRouter { - public AchievementStaticRouter( - JsonUtil jsonUtil, - AchievementCallbacks achievementCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/achievement/list", - async ( - url, - info, - sessionID, - output - ) => await achievementCallbacks.GetAchievements(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/achievement/statistic", - async ( - url, - info, - sessionID, - output - ) => await achievementCallbacks.Statistic(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public AchievementStaticRouter(JsonUtil jsonUtil, AchievementCallbacks achievementCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/achievement/list", + async (url, info, sessionID, output) => + await achievementCallbacks.GetAchievements( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/achievement/statistic", + async (url, info, sessionID, output) => + await achievementCallbacks.Statistic( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/BotStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/BotStaticRouter.cs index e74c625e..95e3727e 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/BotStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/BotStaticRouter.cs @@ -9,24 +9,20 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class BotStaticRouter : StaticRouter { - public BotStaticRouter( - JsonUtil jsonUtil, - BotCallbacks botCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/game/bot/generate", - async ( - url, - info, - sessionID, - outout - ) => await botCallbacks.GenerateBots(url, info as GenerateBotsRequestData, sessionID), - typeof(GenerateBotsRequestData) - ) - ] - ) - { - } + public BotStaticRouter(JsonUtil jsonUtil, BotCallbacks botCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/game/bot/generate", + async (url, info, sessionID, outout) => + await botCallbacks.GenerateBots( + url, + info as GenerateBotsRequestData, + sessionID + ), + typeof(GenerateBotsRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/BuildStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/BuildStaticRouter.cs index a2cb4d43..eaf962c1 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/BuildStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/BuildStaticRouter.cs @@ -11,63 +11,55 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class BuildStaticRouter : StaticRouter { - public BuildStaticRouter( - JsonUtil jsonUtil, - BuildsCallbacks buildsCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/builds/list", - async ( - url, - info, - sessionID, - output - ) => await buildsCallbacks.GetBuilds(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/builds/magazine/save", - async ( - url, - info, - sessionID, - output - ) => await buildsCallbacks.CreateMagazineTemplate(url, info as SetMagazineRequest, sessionID), - typeof(SetMagazineRequest) - ), - new RouteAction( - "/client/builds/weapon/save", - async ( - url, - info, - sessionID, - output - ) => await buildsCallbacks.SetWeapon(url, info as PresetBuildActionRequestData, sessionID), - typeof(PresetBuildActionRequestData) - ), - new RouteAction( - "/client/builds/equipment/save", - async ( - url, - info, - sessionID, - output - ) => await buildsCallbacks.SetEquipment(url, info as PresetBuildActionRequestData, sessionID), - typeof(PresetBuildActionRequestData) - ), - new RouteAction( - "/client/builds/delete", - async ( - url, - info, - sessionID, - output - ) => await buildsCallbacks.DeleteBuild(url, info as RemoveBuildRequestData, sessionID), - typeof(RemoveBuildRequestData) - ) - ] - ) - { - } + public BuildStaticRouter(JsonUtil jsonUtil, BuildsCallbacks buildsCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/builds/list", + async (url, info, sessionID, output) => + await buildsCallbacks.GetBuilds(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/builds/magazine/save", + async (url, info, sessionID, output) => + await buildsCallbacks.CreateMagazineTemplate( + url, + info as SetMagazineRequest, + sessionID + ), + typeof(SetMagazineRequest) + ), + new RouteAction( + "/client/builds/weapon/save", + async (url, info, sessionID, output) => + await buildsCallbacks.SetWeapon( + url, + info as PresetBuildActionRequestData, + sessionID + ), + typeof(PresetBuildActionRequestData) + ), + new RouteAction( + "/client/builds/equipment/save", + async (url, info, sessionID, output) => + await buildsCallbacks.SetEquipment( + url, + info as PresetBuildActionRequestData, + sessionID + ), + typeof(PresetBuildActionRequestData) + ), + new RouteAction( + "/client/builds/delete", + async (url, info, sessionID, output) => + await buildsCallbacks.DeleteBuild( + url, + info as RemoveBuildRequestData, + sessionID + ), + typeof(RemoveBuildRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/BundleStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/BundleStaticRouter.cs index cfcfe4f7..cdfbc2c8 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/BundleStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/BundleStaticRouter.cs @@ -9,23 +9,15 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class BundleStaticRouter : StaticRouter { - public BundleStaticRouter( - JsonUtil jsonUtil, - BundleCallbacks bundleCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/singleplayer/bundles", - async ( - url, - info, - sessionID, - output - ) => await bundleCallbacks.GetBundles(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public BundleStaticRouter(JsonUtil jsonUtil, BundleCallbacks bundleCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/singleplayer/bundles", + async (url, info, sessionID, output) => + await bundleCallbacks.GetBundles(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/ClientLogStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/ClientLogStaticRouter.cs index a6f36769..342bd694 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/ClientLogStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/ClientLogStaticRouter.cs @@ -9,42 +9,28 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class ClientLogStaticRouter : StaticRouter { - public ClientLogStaticRouter( - JsonUtil jsonUtil, - ClientLogCallbacks clientLogCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/singleplayer/log", - async ( - url, - info, - sessionID, - output - ) => await clientLogCallbacks.ClientLog(url, info as ClientLogRequest, sessionID), - typeof(ClientLogRequest) - ), - new RouteAction( - "/singleplayer/release", - async ( - url, - info, - sessionID, - output - ) => await clientLogCallbacks.ReleaseNotes() - ), - new RouteAction( - "/singleplayer/enableBSGlogging", - async ( - url, - info, - sessionID, - output - ) => await clientLogCallbacks.BsgLogging() - ) - ] - ) - { - } + public ClientLogStaticRouter(JsonUtil jsonUtil, ClientLogCallbacks clientLogCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/singleplayer/log", + async (url, info, sessionID, output) => + await clientLogCallbacks.ClientLog( + url, + info as ClientLogRequest, + sessionID + ), + typeof(ClientLogRequest) + ), + new RouteAction( + "/singleplayer/release", + async (url, info, sessionID, output) => await clientLogCallbacks.ReleaseNotes() + ), + new RouteAction( + "/singleplayer/enableBSGlogging", + async (url, info, sessionID, output) => await clientLogCallbacks.BsgLogging() + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/CustomizationStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/CustomizationStaticRouter.cs index a996a23f..d54622db 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/CustomizationStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/CustomizationStaticRouter.cs @@ -12,38 +12,37 @@ public class CustomizationStaticRouter : StaticRouter public CustomizationStaticRouter( JsonUtil jsonUtil, CustomizationCallbacks customizationCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/trading/customization/storage", - async ( - url, - info, - sessionID, - output - ) => await customizationCallbacks.GetCustomisationUnlocks(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/hideout/customization/offer/list", - async ( - url, - info, - sessionID, - output - ) => await customizationCallbacks.GetHideoutCustomisation(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/customization/storage", - async ( - url, - info, - sessionID, - output - ) => await customizationCallbacks.GetStorage(url, info as EmptyRequestData, sessionID) - ) - ] ) - { - } + : base( + jsonUtil, + [ + new RouteAction( + "/client/trading/customization/storage", + async (url, info, sessionID, output) => + await customizationCallbacks.GetCustomisationUnlocks( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/hideout/customization/offer/list", + async (url, info, sessionID, output) => + await customizationCallbacks.GetHideoutCustomisation( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/customization/storage", + async (url, info, sessionID, output) => + await customizationCallbacks.GetStorage( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/DataStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/DataStaticRouter.cs index ff627923..9993933e 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/DataStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/DataStaticRouter.cs @@ -9,113 +9,97 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class DataStaticRouter : StaticRouter { - public DataStaticRouter( - JsonUtil jsonUtil, - DataCallbacks dataCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/settings", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetSettings(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/globals", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetGlobals(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/items", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetTemplateItems(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/handbook/templates", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetTemplateHandbook(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/customization", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetTemplateSuits(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/account/customization", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetTemplateCharacter(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/hideout/production/recipes", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetHideoutProduction(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/hideout/settings", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetHideoutSettings(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/hideout/areas", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetHideoutAreas(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/languages", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetLocalesLanguages(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/hideout/qte/list", - async ( - url, - info, - sessionID, - output - ) => await dataCallbacks.GetQteList(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public DataStaticRouter(JsonUtil jsonUtil, DataCallbacks dataCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/settings", + async (url, info, sessionID, output) => + await dataCallbacks.GetSettings(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/globals", + async (url, info, sessionID, output) => + await dataCallbacks.GetGlobals(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/items", + async (url, info, sessionID, output) => + await dataCallbacks.GetTemplateItems( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/handbook/templates", + async (url, info, sessionID, output) => + await dataCallbacks.GetTemplateHandbook( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/customization", + async (url, info, sessionID, output) => + await dataCallbacks.GetTemplateSuits( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/account/customization", + async (url, info, sessionID, output) => + await dataCallbacks.GetTemplateCharacter( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/hideout/production/recipes", + async (url, info, sessionID, output) => + await dataCallbacks.GetHideoutProduction( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/hideout/settings", + async (url, info, sessionID, output) => + await dataCallbacks.GetHideoutSettings( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/hideout/areas", + async (url, info, sessionID, output) => + await dataCallbacks.GetHideoutAreas( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/languages", + async (url, info, sessionID, output) => + await dataCallbacks.GetLocalesLanguages( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/hideout/qte/list", + async (url, info, sessionID, output) => + await dataCallbacks.GetQteList(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/DialogStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/DialogStaticRouter.cs index d353ac04..04a13f57 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/DialogStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/DialogStaticRouter.cs @@ -11,270 +11,258 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class DialogStaticRouter : StaticRouter { - public DialogStaticRouter( - JsonUtil jsonUtil, - DialogueCallbacks dialogueCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/chatServer/list", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetChatServerList(url, info as GetChatServerListRequestData, sessionID), - typeof(GetChatServerListRequestData) - ), - new RouteAction( - "/client/mail/dialog/list", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetMailDialogList(url, info as GetMailDialogListRequestData, sessionID), - typeof(GetMailDialogListRequestData) - ), - new RouteAction( - "/client/mail/dialog/view", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetMailDialogView(url, info as GetMailDialogViewRequestData, sessionID), - typeof(GetMailDialogViewRequestData) - ), - new RouteAction( - "/client/mail/dialog/info", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetMailDialogInfo(url, info as GetMailDialogInfoRequestData, sessionID), - typeof(GetMailDialogInfoRequestData) - ), - new RouteAction( - "/client/mail/dialog/remove", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.RemoveDialog(url, info as RemoveDialogRequestData, sessionID), - typeof(RemoveDialogRequestData) - ), - new RouteAction( - "/client/mail/dialog/pin", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.PinDialog(url, info as PinDialogRequestData, sessionID), - typeof(PinDialogRequestData) - ), - new RouteAction( - "/client/mail/dialog/unpin", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.UnpinDialog(url, info as PinDialogRequestData, sessionID), - typeof(PinDialogRequestData) - ), - new RouteAction( - "/client/mail/dialog/read", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.SetRead(url, info as SetDialogReadRequestData, sessionID), - typeof(SetDialogReadRequestData) - ), - new RouteAction( - "/client/mail/dialog/getAllAttachments", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetAllAttachments(url, info as GetAllAttachmentsRequestData, sessionID), - typeof(GetAllAttachmentsRequestData) - ), - new RouteAction( - "/client/mail/msg/send", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.SendMessage(url, info as SendMessageRequest, sessionID), - typeof(SendMessageRequest) - ), - new RouteAction( - "/client/mail/dialog/clear", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.ClearMail(url, info as ClearMailMessageRequest, sessionID), - typeof(ClearMailMessageRequest) - ), - new RouteAction( - "/client/mail/dialog/group/create", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.CreateGroupMail(url, info as CreateGroupMailRequest, sessionID), - typeof(CreateGroupMailRequest) - ), - new RouteAction( - "/client/mail/dialog/group/owner/change", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.ChangeMailGroupOwner(url, info as ChangeGroupMailOwnerRequest, sessionID), - typeof(ChangeGroupMailOwnerRequest) - ), - new RouteAction( - "/client/mail/dialog/group/users/add", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.AddUserToMail(url, info as AddUserGroupMailRequest, sessionID), - typeof(AddUserGroupMailRequest) - ), - new RouteAction( - "/client/mail/dialog/group/users/remove", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.RemoveUserFromMail(url, info as RemoveUserGroupMailRequest, sessionID), - typeof(RemoveUserGroupMailRequest) - ), - new RouteAction( - "/client/friend/list", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.GetFriendList(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/friend/request/list/outbox", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.ListOutbox(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/friend/request/list/inbox", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.ListInbox(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/friend/request/send", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.SendFriendRequest(url, info as FriendRequestData, sessionID), - typeof(FriendRequestData) - ), - new RouteAction( - "/client/friend/request/accept-all", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.AcceptAllFriendRequests(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/friend/request/accept", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.AcceptFriendRequest(url, info as AcceptFriendRequestData, sessionID), - typeof(AcceptFriendRequestData) - ), - new RouteAction( - "/client/friend/request/decline", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.DeclineFriendRequest(url, info as DeclineFriendRequestData, sessionID), - typeof(DeclineFriendRequestData) - ), - new RouteAction( - "/client/friend/request/cancel", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.CancelFriendRequest(url, info as CancelFriendRequestData, sessionID), - typeof(CancelFriendRequestData) - ), - new RouteAction( - "/client/friend/delete", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.DeleteFriend(url, info as DeleteFriendRequest, sessionID), - typeof(DeleteFriendRequest) - ), - new RouteAction( - "/client/friend/ignore/set", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.IgnoreFriend(url, info as UIDRequestData, sessionID), - typeof(UIDRequestData) - ), - new RouteAction( - "/client/friend/ignore/remove", - async ( - url, - info, - sessionID, - output - ) => await dialogueCallbacks.UnIgnoreFriend(url, info as UIDRequestData, sessionID), - typeof(UIDRequestData) - ) - ] - ) - { - } + public DialogStaticRouter(JsonUtil jsonUtil, DialogueCallbacks dialogueCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/chatServer/list", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetChatServerList( + url, + info as GetChatServerListRequestData, + sessionID + ), + typeof(GetChatServerListRequestData) + ), + new RouteAction( + "/client/mail/dialog/list", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetMailDialogList( + url, + info as GetMailDialogListRequestData, + sessionID + ), + typeof(GetMailDialogListRequestData) + ), + new RouteAction( + "/client/mail/dialog/view", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetMailDialogView( + url, + info as GetMailDialogViewRequestData, + sessionID + ), + typeof(GetMailDialogViewRequestData) + ), + new RouteAction( + "/client/mail/dialog/info", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetMailDialogInfo( + url, + info as GetMailDialogInfoRequestData, + sessionID + ), + typeof(GetMailDialogInfoRequestData) + ), + new RouteAction( + "/client/mail/dialog/remove", + async (url, info, sessionID, output) => + await dialogueCallbacks.RemoveDialog( + url, + info as RemoveDialogRequestData, + sessionID + ), + typeof(RemoveDialogRequestData) + ), + new RouteAction( + "/client/mail/dialog/pin", + async (url, info, sessionID, output) => + await dialogueCallbacks.PinDialog( + url, + info as PinDialogRequestData, + sessionID + ), + typeof(PinDialogRequestData) + ), + new RouteAction( + "/client/mail/dialog/unpin", + async (url, info, sessionID, output) => + await dialogueCallbacks.UnpinDialog( + url, + info as PinDialogRequestData, + sessionID + ), + typeof(PinDialogRequestData) + ), + new RouteAction( + "/client/mail/dialog/read", + async (url, info, sessionID, output) => + await dialogueCallbacks.SetRead( + url, + info as SetDialogReadRequestData, + sessionID + ), + typeof(SetDialogReadRequestData) + ), + new RouteAction( + "/client/mail/dialog/getAllAttachments", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetAllAttachments( + url, + info as GetAllAttachmentsRequestData, + sessionID + ), + typeof(GetAllAttachmentsRequestData) + ), + new RouteAction( + "/client/mail/msg/send", + async (url, info, sessionID, output) => + await dialogueCallbacks.SendMessage( + url, + info as SendMessageRequest, + sessionID + ), + typeof(SendMessageRequest) + ), + new RouteAction( + "/client/mail/dialog/clear", + async (url, info, sessionID, output) => + await dialogueCallbacks.ClearMail( + url, + info as ClearMailMessageRequest, + sessionID + ), + typeof(ClearMailMessageRequest) + ), + new RouteAction( + "/client/mail/dialog/group/create", + async (url, info, sessionID, output) => + await dialogueCallbacks.CreateGroupMail( + url, + info as CreateGroupMailRequest, + sessionID + ), + typeof(CreateGroupMailRequest) + ), + new RouteAction( + "/client/mail/dialog/group/owner/change", + async (url, info, sessionID, output) => + await dialogueCallbacks.ChangeMailGroupOwner( + url, + info as ChangeGroupMailOwnerRequest, + sessionID + ), + typeof(ChangeGroupMailOwnerRequest) + ), + new RouteAction( + "/client/mail/dialog/group/users/add", + async (url, info, sessionID, output) => + await dialogueCallbacks.AddUserToMail( + url, + info as AddUserGroupMailRequest, + sessionID + ), + typeof(AddUserGroupMailRequest) + ), + new RouteAction( + "/client/mail/dialog/group/users/remove", + async (url, info, sessionID, output) => + await dialogueCallbacks.RemoveUserFromMail( + url, + info as RemoveUserGroupMailRequest, + sessionID + ), + typeof(RemoveUserGroupMailRequest) + ), + new RouteAction( + "/client/friend/list", + async (url, info, sessionID, output) => + await dialogueCallbacks.GetFriendList( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/friend/request/list/outbox", + async (url, info, sessionID, output) => + await dialogueCallbacks.ListOutbox(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/friend/request/list/inbox", + async (url, info, sessionID, output) => + await dialogueCallbacks.ListInbox(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/friend/request/send", + async (url, info, sessionID, output) => + await dialogueCallbacks.SendFriendRequest( + url, + info as FriendRequestData, + sessionID + ), + typeof(FriendRequestData) + ), + new RouteAction( + "/client/friend/request/accept-all", + async (url, info, sessionID, output) => + await dialogueCallbacks.AcceptAllFriendRequests( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/friend/request/accept", + async (url, info, sessionID, output) => + await dialogueCallbacks.AcceptFriendRequest( + url, + info as AcceptFriendRequestData, + sessionID + ), + typeof(AcceptFriendRequestData) + ), + new RouteAction( + "/client/friend/request/decline", + async (url, info, sessionID, output) => + await dialogueCallbacks.DeclineFriendRequest( + url, + info as DeclineFriendRequestData, + sessionID + ), + typeof(DeclineFriendRequestData) + ), + new RouteAction( + "/client/friend/request/cancel", + async (url, info, sessionID, output) => + await dialogueCallbacks.CancelFriendRequest( + url, + info as CancelFriendRequestData, + sessionID + ), + typeof(CancelFriendRequestData) + ), + new RouteAction( + "/client/friend/delete", + async (url, info, sessionID, output) => + await dialogueCallbacks.DeleteFriend( + url, + info as DeleteFriendRequest, + sessionID + ), + typeof(DeleteFriendRequest) + ), + new RouteAction( + "/client/friend/ignore/set", + async (url, info, sessionID, output) => + await dialogueCallbacks.IgnoreFriend( + url, + info as UIDRequestData, + sessionID + ), + typeof(UIDRequestData) + ), + new RouteAction( + "/client/friend/ignore/remove", + async (url, info, sessionID, output) => + await dialogueCallbacks.UnIgnoreFriend( + url, + info as UIDRequestData, + sessionID + ), + typeof(UIDRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/GameStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/GameStaticRouter.cs index 9460f7fa..14b1927a 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/GameStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/GameStaticRouter.cs @@ -11,167 +11,127 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class GameStaticRouter : StaticRouter { - public GameStaticRouter( - JsonUtil jsonUtil, - GameCallbacks gameCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/game/config", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetGameConfig(url, info as GameEmptyCrcRequestData, sessionID), - typeof(GameEmptyCrcRequestData) - ), - new RouteAction( - "/client/game/mode", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetGameMode(url, info as GameModeRequestData, sessionID), - typeof(GameModeRequestData) - ), - new RouteAction( - "/client/server/list", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetServer(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/current", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetCurrentGroup(url, info as EmptyRequestData, sessionID), - typeof(GameModeRequestData) - ), - new RouteAction( - "/client/game/version/validate", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.VersionValidate(url, info as VersionValidateRequestData, sessionID), - typeof(VersionValidateRequestData) - ), - new RouteAction( - "/client/game/start", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GameStart(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/game/logout", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GameLogout(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/checkVersion", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.ValidateGameVersion(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/game/keepalive", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GameKeepalive(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/settings/version", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetVersion(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/reports/lobby/send", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.ReportNickname(url, info as UIDRequestData, sessionID), - typeof(UIDRequestData) - ), - new RouteAction( - "/client/report/send", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.ReportNickname(url, info as UIDRequestData, sessionID), - typeof(GameModeRequestData) - ), - new RouteAction( - "/singleplayer/settings/getRaidTime", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetRaidTime(url, info as GetRaidTimeRequest, sessionID), - typeof(GetRaidTimeRequest) - ), - new RouteAction( - "/client/survey", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetSurvey(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/survey/view", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.GetSurveyView(url, info as SendSurveyOpinionRequest, sessionID), - typeof(SendSurveyOpinionRequest) - ), - new RouteAction( - "/client/survey/opinion", - async ( - url, - info, - sessionID, - output - ) => await gameCallbacks.SendSurveyOpinion(url, info as SendSurveyOpinionRequest, sessionID), - typeof(SendSurveyOpinionRequest) - ) - ] - ) - { - } + public GameStaticRouter(JsonUtil jsonUtil, GameCallbacks gameCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/game/config", + async (url, info, sessionID, output) => + await gameCallbacks.GetGameConfig( + url, + info as GameEmptyCrcRequestData, + sessionID + ), + typeof(GameEmptyCrcRequestData) + ), + new RouteAction( + "/client/game/mode", + async (url, info, sessionID, output) => + await gameCallbacks.GetGameMode( + url, + info as GameModeRequestData, + sessionID + ), + typeof(GameModeRequestData) + ), + new RouteAction( + "/client/server/list", + async (url, info, sessionID, output) => + await gameCallbacks.GetServer(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/current", + async (url, info, sessionID, output) => + await gameCallbacks.GetCurrentGroup( + url, + info as EmptyRequestData, + sessionID + ), + typeof(GameModeRequestData) + ), + new RouteAction( + "/client/game/version/validate", + async (url, info, sessionID, output) => + await gameCallbacks.VersionValidate( + url, + info as VersionValidateRequestData, + sessionID + ), + typeof(VersionValidateRequestData) + ), + new RouteAction( + "/client/game/start", + async (url, info, sessionID, output) => + await gameCallbacks.GameStart(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/game/logout", + async (url, info, sessionID, output) => + await gameCallbacks.GameLogout(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/checkVersion", + async (url, info, sessionID, output) => + await gameCallbacks.ValidateGameVersion( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/game/keepalive", + async (url, info, sessionID, output) => + await gameCallbacks.GameKeepalive(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/singleplayer/settings/version", + async (url, info, sessionID, output) => + await gameCallbacks.GetVersion(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/reports/lobby/send", + async (url, info, sessionID, output) => + await gameCallbacks.ReportNickname(url, info as UIDRequestData, sessionID), + typeof(UIDRequestData) + ), + new RouteAction( + "/client/report/send", + async (url, info, sessionID, output) => + await gameCallbacks.ReportNickname(url, info as UIDRequestData, sessionID), + typeof(GameModeRequestData) + ), + new RouteAction( + "/singleplayer/settings/getRaidTime", + async (url, info, sessionID, output) => + await gameCallbacks.GetRaidTime(url, info as GetRaidTimeRequest, sessionID), + typeof(GetRaidTimeRequest) + ), + new RouteAction( + "/client/survey", + async (url, info, sessionID, output) => + await gameCallbacks.GetSurvey(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/survey/view", + async (url, info, sessionID, output) => + await gameCallbacks.GetSurveyView( + url, + info as SendSurveyOpinionRequest, + sessionID + ), + typeof(SendSurveyOpinionRequest) + ), + new RouteAction( + "/client/survey/opinion", + async (url, info, sessionID, output) => + await gameCallbacks.SendSurveyOpinion( + url, + info as SendSurveyOpinionRequest, + sessionID + ), + typeof(SendSurveyOpinionRequest) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/HealthStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/HealthStaticRouter.cs index 0f79b52f..ddbdb5df 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/HealthStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/HealthStaticRouter.cs @@ -9,24 +9,20 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class HealthStaticRouter : StaticRouter { - public HealthStaticRouter( - JsonUtil jsonUtil, - HealthCallbacks healthCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/hideout/workout", - async ( - url, - info, - sessionID, - output - ) => await healthCallbacks.HandleWorkoutEffects(url, info as WorkoutData, sessionID), - typeof(WorkoutData) - ) - ] - ) - { - } + public HealthStaticRouter(JsonUtil jsonUtil, HealthCallbacks healthCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/hideout/workout", + async (url, info, sessionID, output) => + await healthCallbacks.HandleWorkoutEffects( + url, + info as WorkoutData, + sessionID + ), + typeof(WorkoutData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/InraidStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/InraidStaticRouter.cs index 0c1e6fa5..1f183026 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/InraidStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/InraidStaticRouter.cs @@ -10,48 +10,39 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class InraidStaticRouter : StaticRouter { - public InraidStaticRouter(InraidCallbacks inraidCallbacks, JsonUtil jsonUtil) : base( - jsonUtil, - [ - new RouteAction( - "/raid/profile/scavsave", - async ( - url, - info, - sessionID, - output - ) => await inraidCallbacks.SaveProgress(url, info as ScavSaveRequestData, sessionID), - typeof(ScavSaveRequestData) - ), - new RouteAction( - "/singleplayer/settings/raid/menu", - async ( - url, - info, - sessionID, - output - ) => await inraidCallbacks.GetRaidMenuSettings() - ), - new RouteAction( - "/singleplayer/scav/traitorscavhostile", - async ( - url, - info, - sessionID, - output - ) => await inraidCallbacks.GetTraitorScavHostileChance(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/bosstypes", - async ( - url, - info, - sessionID, - output - ) => await inraidCallbacks.GetBossTypes(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public InraidStaticRouter(InraidCallbacks inraidCallbacks, JsonUtil jsonUtil) + : base( + jsonUtil, + [ + new RouteAction( + "/raid/profile/scavsave", + async (url, info, sessionID, output) => + await inraidCallbacks.SaveProgress( + url, + info as ScavSaveRequestData, + sessionID + ), + typeof(ScavSaveRequestData) + ), + new RouteAction( + "/singleplayer/settings/raid/menu", + async (url, info, sessionID, output) => + await inraidCallbacks.GetRaidMenuSettings() + ), + new RouteAction( + "/singleplayer/scav/traitorscavhostile", + async (url, info, sessionID, output) => + await inraidCallbacks.GetTraitorScavHostileChance( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/singleplayer/bosstypes", + async (url, info, sessionID, output) => + await inraidCallbacks.GetBossTypes(url, info as EmptyRequestData, sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/InsuranceStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/InsuranceStaticRouter.cs index dec08281..b328b2a8 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/InsuranceStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/InsuranceStaticRouter.cs @@ -9,24 +9,20 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class InsuranceStaticRouter : StaticRouter { - public InsuranceStaticRouter( - JsonUtil jsonUtil, - InsuranceCallbacks insuranceCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/insurance/items/list/cost", - async ( - url, - info, - sessionID, - output - ) => await insuranceCallbacks.GetInsuranceCost(url, info as GetInsuranceCostRequestData, sessionID), - typeof(GetInsuranceCostRequestData) - ) - ] - ) - { - } + public InsuranceStaticRouter(JsonUtil jsonUtil, InsuranceCallbacks insuranceCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/insurance/items/list/cost", + async (url, info, sessionID, output) => + await insuranceCallbacks.GetInsuranceCost( + url, + info as GetInsuranceCostRequestData, + sessionID + ), + typeof(GetInsuranceCostRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/ItemEventStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/ItemEventStaticRouter.cs index 4b3e4e08..7e76dc60 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/ItemEventStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/ItemEventStaticRouter.cs @@ -9,24 +9,20 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class ItemEventStaticRouter : StaticRouter { - public ItemEventStaticRouter( - JsonUtil jsonUtil, - ItemEventCallbacks itemEventCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/game/profile/items/moving", - async ( - url, - info, - sessionID, - output - ) => await itemEventCallbacks.HandleEvents(url, info as ItemEventRouterRequest, sessionID), - typeof(ItemEventRouterRequest) - ) - ] - ) - { - } + public ItemEventStaticRouter(JsonUtil jsonUtil, ItemEventCallbacks itemEventCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/game/profile/items/moving", + async (url, info, sessionID, output) => + await itemEventCallbacks.HandleEvents( + url, + info as ItemEventRouterRequest, + sessionID + ), + typeof(ItemEventRouterRequest) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherStaticRouter.cs index 6acb4670..9df21f94 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherStaticRouter.cs @@ -10,74 +10,95 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class LauncherStaticRouter : StaticRouter { - public LauncherStaticRouter(LauncherCallbacks launcherCallbacks, JsonUtil jsonUtil) : base( - jsonUtil, - [ - new RouteAction( - "/launcher/ping", - async (url, _, sessionID, _) => await launcherCallbacks.Ping(url, null, sessionID) - ), - new RouteAction( - "/launcher/server/connect", - async (_, _, _, _) => await launcherCallbacks.Connect() - ), - new RouteAction( - "/launcher/profile/login", - async (url, info, sessionID, _) => await launcherCallbacks.Login(url, info as LoginRequestData, sessionID), - typeof(LoginRequestData) - ), - new RouteAction( - "/launcher/profile/register", - async (url, info, sessionID, _) => await launcherCallbacks.Register(url, info as RegisterData, sessionID), - typeof(RegisterData) - ), - new RouteAction( - "/launcher/profile/get", - async (url, info, sessionID, _) => await launcherCallbacks.Get(url, info as LoginRequestData, sessionID), - typeof(LoginRequestData) - ), - new RouteAction( - "/launcher/profile/change/username", - async (url, info, sessionID, _) => - await launcherCallbacks.ChangeUsername(url, info as ChangeRequestData, sessionID), - typeof(ChangeRequestData) - ), - new RouteAction( - "/launcher/profile/change/password", - async (url, info, sessionID, _) => - await launcherCallbacks.ChangePassword(url, info as ChangeRequestData, sessionID), - typeof(ChangeRequestData) - ), - new RouteAction( - "/launcher/profile/change/wipe", - async (url, info, sessionID, _) => await launcherCallbacks.Wipe(url, info as RegisterData, sessionID), - typeof(RegisterData) - ), - new RouteAction( - "/launcher/profile/remove", - async (url, info, sessionID, _) => await launcherCallbacks.RemoveProfile(url, info as RemoveProfileData, sessionID), - typeof(RemoveProfileData) - ), - new RouteAction( - "/launcher/profile/compatibleTarkovVersion", - async (_, _, _, _) => await launcherCallbacks.GetCompatibleTarkovVersion() - ), - new RouteAction( - "/launcher/server/version", - async (_, _, _, _) => await launcherCallbacks.GetServerVersion() - ), - new RouteAction( - "/launcher/server/loadedServerMods", - async (_, _, _, _) => await launcherCallbacks.GetLoadedServerMods() - ), - new RouteAction( - "/launcher/server/serverModsUsedByProfile", - async (url, info, sessionID, _) => - await launcherCallbacks.GetServerModsProfileUsed(url, info as EmptyRequestData, sessionID), - typeof(EmptyRequestData) - ) - ] - ) - { - } + public LauncherStaticRouter(LauncherCallbacks launcherCallbacks, JsonUtil jsonUtil) + : base( + jsonUtil, + [ + new RouteAction( + "/launcher/ping", + async (url, _, sessionID, _) => + await launcherCallbacks.Ping(url, null, sessionID) + ), + new RouteAction( + "/launcher/server/connect", + async (_, _, _, _) => await launcherCallbacks.Connect() + ), + new RouteAction( + "/launcher/profile/login", + async (url, info, sessionID, _) => + await launcherCallbacks.Login(url, info as LoginRequestData, sessionID), + typeof(LoginRequestData) + ), + new RouteAction( + "/launcher/profile/register", + async (url, info, sessionID, _) => + await launcherCallbacks.Register(url, info as RegisterData, sessionID), + typeof(RegisterData) + ), + new RouteAction( + "/launcher/profile/get", + async (url, info, sessionID, _) => + await launcherCallbacks.Get(url, info as LoginRequestData, sessionID), + typeof(LoginRequestData) + ), + new RouteAction( + "/launcher/profile/change/username", + async (url, info, sessionID, _) => + await launcherCallbacks.ChangeUsername( + url, + info as ChangeRequestData, + sessionID + ), + typeof(ChangeRequestData) + ), + new RouteAction( + "/launcher/profile/change/password", + async (url, info, sessionID, _) => + await launcherCallbacks.ChangePassword( + url, + info as ChangeRequestData, + sessionID + ), + typeof(ChangeRequestData) + ), + new RouteAction( + "/launcher/profile/change/wipe", + async (url, info, sessionID, _) => + await launcherCallbacks.Wipe(url, info as RegisterData, sessionID), + typeof(RegisterData) + ), + new RouteAction( + "/launcher/profile/remove", + async (url, info, sessionID, _) => + await launcherCallbacks.RemoveProfile( + url, + info as RemoveProfileData, + sessionID + ), + typeof(RemoveProfileData) + ), + new RouteAction( + "/launcher/profile/compatibleTarkovVersion", + async (_, _, _, _) => await launcherCallbacks.GetCompatibleTarkovVersion() + ), + new RouteAction( + "/launcher/server/version", + async (_, _, _, _) => await launcherCallbacks.GetServerVersion() + ), + new RouteAction( + "/launcher/server/loadedServerMods", + async (_, _, _, _) => await launcherCallbacks.GetLoadedServerMods() + ), + new RouteAction( + "/launcher/server/serverModsUsedByProfile", + async (url, info, sessionID, _) => + await launcherCallbacks.GetServerModsProfileUsed( + url, + info as EmptyRequestData, + sessionID + ), + typeof(EmptyRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherV2StaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherV2StaticRouter.cs index b9428b57..59514f72 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherV2StaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/LauncherV2StaticRouter.cs @@ -9,55 +9,58 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class LauncherV2StaticRouter : StaticRouter { - public LauncherV2StaticRouter(LauncherV2Callbacks launcherV2Callbacks, JsonUtil jsonUtil) : base( - jsonUtil, - [ - new RouteAction( - "/launcher/v2/ping", - async (url, _, sessionID, _) => await launcherV2Callbacks.Ping() - ), - new RouteAction( - "/launcher/v2/types", - async (url, _, sessionID, _) => await launcherV2Callbacks.Types() - ), - new RouteAction( - "/launcher/v2/login", - async (url, info, sessionID, _) => await launcherV2Callbacks.Login(info as LoginRequestData), - typeof(LoginRequestData) - ), - new RouteAction( - "/launcher/v2/register", - async (url, info, sessionID, _) => await launcherV2Callbacks.Register(info as RegisterData), - typeof(RegisterData) - ), - new RouteAction( - "/launcher/v2/passwordChange", - async (url, info, sessionID, _) => await launcherV2Callbacks.PasswordChange(info as ChangeRequestData), - typeof(ChangeRequestData) - ), - new RouteAction( - "/launcher/v2/remove", - async (url, info, sessionID, _) => await launcherV2Callbacks.Remove(info as LoginRequestData), - typeof(LoginRequestData) - ), - new RouteAction( - "/launcher/v2/version", - async (url, _, sessionID, _) => await launcherV2Callbacks.CompatibleVersion() - ), - new RouteAction( - "/launcher/v2/mods", - async (url, _, sessionID, _) => await launcherV2Callbacks.Mods() - ), - new RouteAction( - "/launcher/v2/profiles", - async (url, _, sessionID, _) => await launcherV2Callbacks.Profiles() - ), - new RouteAction( - "/launcher/v2/profile", - async (url, _, sessionID, _) => await launcherV2Callbacks.Profile(sessionID) - ) - ] - ) - { - } + public LauncherV2StaticRouter(LauncherV2Callbacks launcherV2Callbacks, JsonUtil jsonUtil) + : base( + jsonUtil, + [ + new RouteAction( + "/launcher/v2/ping", + async (url, _, sessionID, _) => await launcherV2Callbacks.Ping() + ), + new RouteAction( + "/launcher/v2/types", + async (url, _, sessionID, _) => await launcherV2Callbacks.Types() + ), + new RouteAction( + "/launcher/v2/login", + async (url, info, sessionID, _) => + await launcherV2Callbacks.Login(info as LoginRequestData), + typeof(LoginRequestData) + ), + new RouteAction( + "/launcher/v2/register", + async (url, info, sessionID, _) => + await launcherV2Callbacks.Register(info as RegisterData), + typeof(RegisterData) + ), + new RouteAction( + "/launcher/v2/passwordChange", + async (url, info, sessionID, _) => + await launcherV2Callbacks.PasswordChange(info as ChangeRequestData), + typeof(ChangeRequestData) + ), + new RouteAction( + "/launcher/v2/remove", + async (url, info, sessionID, _) => + await launcherV2Callbacks.Remove(info as LoginRequestData), + typeof(LoginRequestData) + ), + new RouteAction( + "/launcher/v2/version", + async (url, _, sessionID, _) => await launcherV2Callbacks.CompatibleVersion() + ), + new RouteAction( + "/launcher/v2/mods", + async (url, _, sessionID, _) => await launcherV2Callbacks.Mods() + ), + new RouteAction( + "/launcher/v2/profiles", + async (url, _, sessionID, _) => await launcherV2Callbacks.Profiles() + ), + new RouteAction( + "/launcher/v2/profile", + async (url, _, sessionID, _) => await launcherV2Callbacks.Profile(sessionID) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/LocationStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/LocationStaticRouter.cs index b966da5f..1555701b 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/LocationStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/LocationStaticRouter.cs @@ -10,33 +10,29 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class LocationStaticRouter : StaticRouter { - public LocationStaticRouter( - JsonUtil jsonUtil, - LocationCallbacks locationCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/locations", - async ( - url, - info, - sessionID, - output - ) => await locationCallbacks.GetLocationData(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/airdrop/loot", - async ( - url, - info, - sessionID, - output - ) => await locationCallbacks.GetAirdropLoot(url, info as GetAirdropLootRequest, sessionID), - typeof(GetAirdropLootRequest) - ) - ] - ) - { - } + public LocationStaticRouter(JsonUtil jsonUtil, LocationCallbacks locationCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/locations", + async (url, info, sessionID, output) => + await locationCallbacks.GetLocationData( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/airdrop/loot", + async (url, info, sessionID, output) => + await locationCallbacks.GetAirdropLoot( + url, + info as GetAirdropLootRequest, + sessionID + ), + typeof(GetAirdropLootRequest) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/MatchStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/MatchStaticRouter.cs index aea07151..e7de3fec 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/MatchStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/MatchStaticRouter.cs @@ -11,282 +11,246 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class MatchStaticRouter : StaticRouter { - public MatchStaticRouter( - JsonUtil jsonUtil, - MatchCallbacks matchCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/match/available", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.ServerAvailable(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/updatePing", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.UpdatePing(url, info as UpdatePingRequestData, sessionID), - typeof(UpdatePingRequestData) - ), - new RouteAction( - "/client/match/join", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.JoinMatch(url, info as MatchGroupStartGameRequest, sessionID), - typeof(MatchGroupStartGameRequest) - ), - new RouteAction( - "/client/match/exit", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.ExitMatch(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/delete", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.DeleteGroup(url, info as DeleteGroupRequest, sessionID) - ), - new RouteAction( - "/client/match/group/leave", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.LeaveGroup(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/status", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.GetGroupStatus(url, info as MatchGroupStatusRequest, sessionID), - typeof(MatchGroupStatusRequest) - ), - new RouteAction( - "/client/match/group/start_game", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.JoinMatch(url, info as MatchGroupStartGameRequest, sessionID), - typeof(MatchGroupStartGameRequest) - ), - new RouteAction( - "/client/match/group/exit_from_menu", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.ExitFromMenu(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/current", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.GroupCurrent(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/looking/start", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.StartGroupSearch(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/looking/stop", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.StopGroupSearch(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/invite/send", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.SendGroupInvite(url, info as MatchGroupInviteSendRequest, sessionID), - typeof(MatchGroupInviteSendRequest) - ), - new RouteAction( - "/client/match/group/invite/accept", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.AcceptGroupInvite(url, info as RequestIdRequest, sessionID), - typeof(RequestIdRequest) - ), - new RouteAction( - "/client/match/group/invite/decline", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.DeclineGroupInvite(url, info as RequestIdRequest, sessionID), - typeof(RequestIdRequest) - ), - new RouteAction( - "/client/match/group/invite/cancel", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.CancelGroupInvite(url, info as RequestIdRequest, sessionID), - typeof(RequestIdRequest) - ), - new RouteAction( - "/client/match/group/invite/cancel-all", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.CancelAllGroupInvite(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/transfer", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.TransferGroup(url, info as MatchGroupTransferRequest, sessionID), - typeof(MatchGroupTransferRequest) - ), - new RouteAction( - "/client/match/group/raid/ready", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.RaidReady(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/match/group/raid/not-ready", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.NotRaidReady(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/putMetrics", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.PutMetrics(url, info as PutMetricsRequestData, sessionID), - typeof(PutMetricsRequestData) - ), - new RouteAction( - "/client/analytics/event-disconnect", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.EventDisconnect(url, info as PutMetricsRequestData, sessionID), - typeof(PutMetricsRequestData) - ), - new RouteAction( - "/client/getMetricsConfig", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.GetMetrics(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/raid/configuration", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.GetRaidConfiguration(url, info as GetRaidConfigurationRequestData, sessionID), - typeof(GetRaidConfigurationRequestData) - ), - new RouteAction( - "/client/raid/configuration-by-profile", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.GetConfigurationByProfile(url, info as GetRaidConfigurationRequestData, sessionID), - typeof(GetRaidConfigurationRequestData) - ), - new RouteAction( - "/client/match/group/player/remove", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.RemovePlayerFromGroup(url, info as MatchGroupPlayerRemoveRequest, sessionID), - typeof(MatchGroupPlayerRemoveRequest) - ), - new RouteAction( - "/client/match/local/start", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.StartLocalRaid(url, info as StartLocalRaidRequestData, sessionID), - typeof(StartLocalRaidRequestData) - ), - new RouteAction( - "/client/match/local/end", - async ( - url, - info, - sessionID, - output - ) => await matchCallbacks.EndLocalRaid(url, info as EndLocalRaidRequestData, sessionID), - typeof(EndLocalRaidRequestData) - ) - ] - ) - { - } + public MatchStaticRouter(JsonUtil jsonUtil, MatchCallbacks matchCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/match/available", + async (url, info, sessionID, output) => + await matchCallbacks.ServerAvailable( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/match/updatePing", + async (url, info, sessionID, output) => + await matchCallbacks.UpdatePing( + url, + info as UpdatePingRequestData, + sessionID + ), + typeof(UpdatePingRequestData) + ), + new RouteAction( + "/client/match/join", + async (url, info, sessionID, output) => + await matchCallbacks.JoinMatch( + url, + info as MatchGroupStartGameRequest, + sessionID + ), + typeof(MatchGroupStartGameRequest) + ), + new RouteAction( + "/client/match/exit", + async (url, info, sessionID, output) => + await matchCallbacks.ExitMatch(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/delete", + async (url, info, sessionID, output) => + await matchCallbacks.DeleteGroup(url, info as DeleteGroupRequest, sessionID) + ), + new RouteAction( + "/client/match/group/leave", + async (url, info, sessionID, output) => + await matchCallbacks.LeaveGroup(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/status", + async (url, info, sessionID, output) => + await matchCallbacks.GetGroupStatus( + url, + info as MatchGroupStatusRequest, + sessionID + ), + typeof(MatchGroupStatusRequest) + ), + new RouteAction( + "/client/match/group/start_game", + async (url, info, sessionID, output) => + await matchCallbacks.JoinMatch( + url, + info as MatchGroupStartGameRequest, + sessionID + ), + typeof(MatchGroupStartGameRequest) + ), + new RouteAction( + "/client/match/group/exit_from_menu", + async (url, info, sessionID, output) => + await matchCallbacks.ExitFromMenu(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/current", + async (url, info, sessionID, output) => + await matchCallbacks.GroupCurrent(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/looking/start", + async (url, info, sessionID, output) => + await matchCallbacks.StartGroupSearch( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/match/group/looking/stop", + async (url, info, sessionID, output) => + await matchCallbacks.StopGroupSearch( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/match/group/invite/send", + async (url, info, sessionID, output) => + await matchCallbacks.SendGroupInvite( + url, + info as MatchGroupInviteSendRequest, + sessionID + ), + typeof(MatchGroupInviteSendRequest) + ), + new RouteAction( + "/client/match/group/invite/accept", + async (url, info, sessionID, output) => + await matchCallbacks.AcceptGroupInvite( + url, + info as RequestIdRequest, + sessionID + ), + typeof(RequestIdRequest) + ), + new RouteAction( + "/client/match/group/invite/decline", + async (url, info, sessionID, output) => + await matchCallbacks.DeclineGroupInvite( + url, + info as RequestIdRequest, + sessionID + ), + typeof(RequestIdRequest) + ), + new RouteAction( + "/client/match/group/invite/cancel", + async (url, info, sessionID, output) => + await matchCallbacks.CancelGroupInvite( + url, + info as RequestIdRequest, + sessionID + ), + typeof(RequestIdRequest) + ), + new RouteAction( + "/client/match/group/invite/cancel-all", + async (url, info, sessionID, output) => + await matchCallbacks.CancelAllGroupInvite( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/match/group/transfer", + async (url, info, sessionID, output) => + await matchCallbacks.TransferGroup( + url, + info as MatchGroupTransferRequest, + sessionID + ), + typeof(MatchGroupTransferRequest) + ), + new RouteAction( + "/client/match/group/raid/ready", + async (url, info, sessionID, output) => + await matchCallbacks.RaidReady(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/match/group/raid/not-ready", + async (url, info, sessionID, output) => + await matchCallbacks.NotRaidReady(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/putMetrics", + async (url, info, sessionID, output) => + await matchCallbacks.PutMetrics( + url, + info as PutMetricsRequestData, + sessionID + ), + typeof(PutMetricsRequestData) + ), + new RouteAction( + "/client/analytics/event-disconnect", + async (url, info, sessionID, output) => + await matchCallbacks.EventDisconnect( + url, + info as PutMetricsRequestData, + sessionID + ), + typeof(PutMetricsRequestData) + ), + new RouteAction( + "/client/getMetricsConfig", + async (url, info, sessionID, output) => + await matchCallbacks.GetMetrics(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/raid/configuration", + async (url, info, sessionID, output) => + await matchCallbacks.GetRaidConfiguration( + url, + info as GetRaidConfigurationRequestData, + sessionID + ), + typeof(GetRaidConfigurationRequestData) + ), + new RouteAction( + "/client/raid/configuration-by-profile", + async (url, info, sessionID, output) => + await matchCallbacks.GetConfigurationByProfile( + url, + info as GetRaidConfigurationRequestData, + sessionID + ), + typeof(GetRaidConfigurationRequestData) + ), + new RouteAction( + "/client/match/group/player/remove", + async (url, info, sessionID, output) => + await matchCallbacks.RemovePlayerFromGroup( + url, + info as MatchGroupPlayerRemoveRequest, + sessionID + ), + typeof(MatchGroupPlayerRemoveRequest) + ), + new RouteAction( + "/client/match/local/start", + async (url, info, sessionID, output) => + await matchCallbacks.StartLocalRaid( + url, + info as StartLocalRaidRequestData, + sessionID + ), + typeof(StartLocalRaidRequestData) + ), + new RouteAction( + "/client/match/local/end", + async (url, info, sessionID, output) => + await matchCallbacks.EndLocalRaid( + url, + info as EndLocalRaidRequestData, + sessionID + ), + typeof(EndLocalRaidRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/NotifierStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/NotifierStaticRouter.cs index a027cf3f..5c237692 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/NotifierStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/NotifierStaticRouter.cs @@ -10,33 +10,29 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class NotifierStaticRouter : StaticRouter { - public NotifierStaticRouter( - JsonUtil jsonUtil, - NotifierCallbacks notifierCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/notifier/channel/create", - async ( - url, - info, - sessionID, - output - ) => await notifierCallbacks.CreateNotifierChannel(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/game/profile/select", - async ( - url, - info, - sessionID, - output - ) => await notifierCallbacks.SelectProfile(url, info as UIDRequestData, sessionID), - typeof(UIDRequestData) - ) - ] - ) - { - } + public NotifierStaticRouter(JsonUtil jsonUtil, NotifierCallbacks notifierCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/notifier/channel/create", + async (url, info, sessionID, output) => + await notifierCallbacks.CreateNotifierChannel( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/game/profile/select", + async (url, info, sessionID, output) => + await notifierCallbacks.SelectProfile( + url, + info as UIDRequestData, + sessionID + ), + typeof(UIDRequestData) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/PrestigeStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/PrestigeStaticRouter.cs index ed14ea2d..2981ac9c 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/PrestigeStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/PrestigeStaticRouter.cs @@ -10,33 +10,29 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class PrestigeStaticRouter : StaticRouter { - public PrestigeStaticRouter( - JsonUtil jsonUtil, - PrestigeCallbacks prestigeCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/prestige/list", - async ( - url, - info, - sessionID, - output - ) => await prestigeCallbacks.GetPrestige(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/prestige/obtain", - async ( - url, - info, - sessionID, - output - ) => await prestigeCallbacks.ObtainPrestige(url, info as ObtainPrestigeRequestList, sessionID), - typeof(ObtainPrestigeRequestList) - ) - ] - ) - { - } + public PrestigeStaticRouter(JsonUtil jsonUtil, PrestigeCallbacks prestigeCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/prestige/list", + async (url, info, sessionID, output) => + await prestigeCallbacks.GetPrestige( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/prestige/obtain", + async (url, info, sessionID, output) => + await prestigeCallbacks.ObtainPrestige( + url, + info as ObtainPrestigeRequestList, + sessionID + ), + typeof(ObtainPrestigeRequestList) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/ProfileStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/ProfileStaticRouter.cs index 57f0a98e..74d11036 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/ProfileStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/ProfileStaticRouter.cs @@ -11,124 +11,135 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class ProfileStaticRouter : StaticRouter { - public ProfileStaticRouter(ProfileCallbacks profileCallbacks, JsonUtil jsonUtil) : base( - jsonUtil, - [ - new RouteAction( - "/client/game/profile/create", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.CreateProfile(url, info as ProfileCreateRequestData, sessionID), - typeof(ProfileCreateRequestData) - ), - new RouteAction( - "/client/game/profile/list", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.GetProfileData(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/game/profile/savage/regenerate", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.RegenerateScav(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/game/profile/voice/change", - async (url, info, sessionID, output) => - await profileCallbacks.ChangeVoice(url, info as ProfileChangeVoiceRequestData, sessionID), - typeof(ProfileChangeVoiceRequestData) - ), - new RouteAction( - "/client/game/profile/nickname/change", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.ChangeNickname(url, info as ProfileChangeNicknameRequestData, sessionID), - typeof(ProfileChangeNicknameRequestData) - ), - new RouteAction( - "/client/game/profile/nickname/validate", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.ValidateNickname(url, info as ValidateNicknameRequestData, sessionID), - typeof(ValidateNicknameRequestData) - ), - new RouteAction( - "/client/game/profile/nickname/reserved", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.GetReservedNickname(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/profile/status", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.GetProfileStatus(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/profile/view", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.GetOtherProfile(url, info as GetOtherProfileRequest, sessionID), - typeof(GetOtherProfileRequest) - ), - new RouteAction( - "/client/profile/settings", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.GetProfileSettings(url, info as GetProfileSettingsRequest, sessionID), - typeof(GetProfileSettingsRequest) - ), - new RouteAction( - "/client/game/profile/search", - async ( - url, - info, - sessionID, - output - ) => await profileCallbacks.SearchProfiles(url, info as SearchProfilesRequestData, sessionID), - typeof(SearchProfilesRequestData) - ), - new RouteAction( - "/launcher/profile/info", - async (url, info, sessionID, output) => - await profileCallbacks.GetMiniProfile(url, info as GetMiniProfileRequestData, sessionID), - typeof(GetMiniProfileRequestData) - ), - new RouteAction( - "/launcher/profiles", - async (url, info, sessionID, output) => - await profileCallbacks.GetAllMiniProfiles(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public ProfileStaticRouter(ProfileCallbacks profileCallbacks, JsonUtil jsonUtil) + : base( + jsonUtil, + [ + new RouteAction( + "/client/game/profile/create", + async (url, info, sessionID, output) => + await profileCallbacks.CreateProfile( + url, + info as ProfileCreateRequestData, + sessionID + ), + typeof(ProfileCreateRequestData) + ), + new RouteAction( + "/client/game/profile/list", + async (url, info, sessionID, output) => + await profileCallbacks.GetProfileData( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/game/profile/savage/regenerate", + async (url, info, sessionID, output) => + await profileCallbacks.RegenerateScav( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/game/profile/voice/change", + async (url, info, sessionID, output) => + await profileCallbacks.ChangeVoice( + url, + info as ProfileChangeVoiceRequestData, + sessionID + ), + typeof(ProfileChangeVoiceRequestData) + ), + new RouteAction( + "/client/game/profile/nickname/change", + async (url, info, sessionID, output) => + await profileCallbacks.ChangeNickname( + url, + info as ProfileChangeNicknameRequestData, + sessionID + ), + typeof(ProfileChangeNicknameRequestData) + ), + new RouteAction( + "/client/game/profile/nickname/validate", + async (url, info, sessionID, output) => + await profileCallbacks.ValidateNickname( + url, + info as ValidateNicknameRequestData, + sessionID + ), + typeof(ValidateNicknameRequestData) + ), + new RouteAction( + "/client/game/profile/nickname/reserved", + async (url, info, sessionID, output) => + await profileCallbacks.GetReservedNickname( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/profile/status", + async (url, info, sessionID, output) => + await profileCallbacks.GetProfileStatus( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/profile/view", + async (url, info, sessionID, output) => + await profileCallbacks.GetOtherProfile( + url, + info as GetOtherProfileRequest, + sessionID + ), + typeof(GetOtherProfileRequest) + ), + new RouteAction( + "/client/profile/settings", + async (url, info, sessionID, output) => + await profileCallbacks.GetProfileSettings( + url, + info as GetProfileSettingsRequest, + sessionID + ), + typeof(GetProfileSettingsRequest) + ), + new RouteAction( + "/client/game/profile/search", + async (url, info, sessionID, output) => + await profileCallbacks.SearchProfiles( + url, + info as SearchProfilesRequestData, + sessionID + ), + typeof(SearchProfilesRequestData) + ), + new RouteAction( + "/launcher/profile/info", + async (url, info, sessionID, output) => + await profileCallbacks.GetMiniProfile( + url, + info as GetMiniProfileRequestData, + sessionID + ), + typeof(GetMiniProfileRequestData) + ), + new RouteAction( + "/launcher/profiles", + async (url, info, sessionID, output) => + await profileCallbacks.GetAllMiniProfiles( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/QuestStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/QuestStaticRouter.cs index bc2c73b5..9347e158 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/QuestStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/QuestStaticRouter.cs @@ -10,33 +10,29 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class QuestStaticRouter : StaticRouter { - public QuestStaticRouter( - JsonUtil jsonUtil, - QuestCallbacks questCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/quest/list", - async ( - url, - info, - sessionID, - output - ) => await questCallbacks.ListQuests(url, info as ListQuestsRequestData, sessionID), - typeof(ListQuestsRequestData) - ), - new RouteAction( - "/client/repeatalbeQuests/activityPeriods", - async ( - url, - info, - sessionID, - output - ) => await questCallbacks.ActivityPeriods(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public QuestStaticRouter(JsonUtil jsonUtil, QuestCallbacks questCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/quest/list", + async (url, info, sessionID, output) => + await questCallbacks.ListQuests( + url, + info as ListQuestsRequestData, + sessionID + ), + typeof(ListQuestsRequestData) + ), + new RouteAction( + "/client/repeatalbeQuests/activityPeriods", + async (url, info, sessionID, output) => + await questCallbacks.ActivityPeriods( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/RagfairStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/RagfairStaticRouter.cs index 7ae099ce..046a4319 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/RagfairStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/RagfairStaticRouter.cs @@ -10,83 +10,71 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class RagfairStaticRouter : StaticRouter { - public RagfairStaticRouter( - JsonUtil jsonUtil, - RagfairCallbacks ragfairCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/ragfair/search", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.Search(url, info as SearchRequestData, sessionID), - typeof(SearchRequestData) - ), - new RouteAction( - "/client/ragfair/find", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.Search(url, info as SearchRequestData, sessionID), - typeof(SearchRequestData) - ), - new RouteAction( - "/client/ragfair/itemMarketPrice", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.GetMarketPrice(url, info as GetMarketPriceRequestData, sessionID), - typeof(GetMarketPriceRequestData) - ), - new RouteAction( - "/client/ragfair/offerfees", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.StorePlayerOfferTaxAmount(url, info as StorePlayerOfferTaxAmountRequestData, sessionID), - typeof(StorePlayerOfferTaxAmountRequestData) - ), - new RouteAction( - "/client/reports/ragfair/send", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.SendReport(url, info as SendRagfairReportRequestData, sessionID), - typeof(SendRagfairReportRequestData) - ), - new RouteAction( - "/client/items/prices", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.GetFleaPrices(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/ragfair/offer/findbyid", - async ( - url, - info, - sessionID, - output - ) => await ragfairCallbacks.GetFleaOfferById(url, info as GetRagfairOfferByIdRequest, sessionID), - typeof(GetRagfairOfferByIdRequest) - ) - ] - ) - { - } + public RagfairStaticRouter(JsonUtil jsonUtil, RagfairCallbacks ragfairCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/ragfair/search", + async (url, info, sessionID, output) => + await ragfairCallbacks.Search(url, info as SearchRequestData, sessionID), + typeof(SearchRequestData) + ), + new RouteAction( + "/client/ragfair/find", + async (url, info, sessionID, output) => + await ragfairCallbacks.Search(url, info as SearchRequestData, sessionID), + typeof(SearchRequestData) + ), + new RouteAction( + "/client/ragfair/itemMarketPrice", + async (url, info, sessionID, output) => + await ragfairCallbacks.GetMarketPrice( + url, + info as GetMarketPriceRequestData, + sessionID + ), + typeof(GetMarketPriceRequestData) + ), + new RouteAction( + "/client/ragfair/offerfees", + async (url, info, sessionID, output) => + await ragfairCallbacks.StorePlayerOfferTaxAmount( + url, + info as StorePlayerOfferTaxAmountRequestData, + sessionID + ), + typeof(StorePlayerOfferTaxAmountRequestData) + ), + new RouteAction( + "/client/reports/ragfair/send", + async (url, info, sessionID, output) => + await ragfairCallbacks.SendReport( + url, + info as SendRagfairReportRequestData, + sessionID + ), + typeof(SendRagfairReportRequestData) + ), + new RouteAction( + "/client/items/prices", + async (url, info, sessionID, output) => + await ragfairCallbacks.GetFleaPrices( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/client/ragfair/offer/findbyid", + async (url, info, sessionID, output) => + await ragfairCallbacks.GetFleaOfferById( + url, + info as GetRagfairOfferByIdRequest, + sessionID + ), + typeof(GetRagfairOfferByIdRequest) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/TraderStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/TraderStaticRouter.cs index 9d626032..a2484039 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/TraderStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/TraderStaticRouter.cs @@ -9,32 +9,28 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class TraderStaticRouter : StaticRouter { - public TraderStaticRouter( - JsonUtil jsonUtil, - TraderCallbacks traderCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/trading/api/traderSettings", - async ( - url, - info, - sessionID, - output - ) => await traderCallbacks.GetTraderSettings(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/singleplayer/moddedTraders", - async ( - url, - info, - sessionID, - output - ) => await traderCallbacks.GetModdedTraderData(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public TraderStaticRouter(JsonUtil jsonUtil, TraderCallbacks traderCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/trading/api/traderSettings", + async (url, info, sessionID, output) => + await traderCallbacks.GetTraderSettings( + url, + info as EmptyRequestData, + sessionID + ) + ), + new RouteAction( + "/singleplayer/moddedTraders", + async (url, info, sessionID, output) => + await traderCallbacks.GetModdedTraderData( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Routers/Static/WeatherStaticRouter.cs b/Libraries/SPTarkov.Server.Core/Routers/Static/WeatherStaticRouter.cs index 8632989a..53484b1b 100644 --- a/Libraries/SPTarkov.Server.Core/Routers/Static/WeatherStaticRouter.cs +++ b/Libraries/SPTarkov.Server.Core/Routers/Static/WeatherStaticRouter.cs @@ -9,32 +9,24 @@ namespace SPTarkov.Server.Core.Routers.Static; [Injectable] public class WeatherStaticRouter : StaticRouter { - public WeatherStaticRouter( - JsonUtil jsonUtil, - WeatherCallbacks weatherCallbacks - ) : base( - jsonUtil, - [ - new RouteAction( - "/client/weather", - async ( - url, - info, - sessionID, - output - ) => await weatherCallbacks.GetWeather(url, info as EmptyRequestData, sessionID) - ), - new RouteAction( - "/client/localGame/weather", - async ( - url, - info, - sessionID, - output - ) => await weatherCallbacks.GetLocalWeather(url, info as EmptyRequestData, sessionID) - ) - ] - ) - { - } + public WeatherStaticRouter(JsonUtil jsonUtil, WeatherCallbacks weatherCallbacks) + : base( + jsonUtil, + [ + new RouteAction( + "/client/weather", + async (url, info, sessionID, output) => + await weatherCallbacks.GetWeather(url, info as EmptyRequestData, sessionID) + ), + new RouteAction( + "/client/localGame/weather", + async (url, info, sessionID, output) => + await weatherCallbacks.GetLocalWeather( + url, + info as EmptyRequestData, + sessionID + ) + ), + ] + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj b/Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj index 0b03c214..c86a3248 100644 --- a/Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj +++ b/Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj @@ -1,7 +1,5 @@  - - SPTarkov.Server.Core Single Player Tarkov @@ -15,20 +13,16 @@ true false - - - - 4.0.0 @@ -37,15 +31,23 @@ LOCAL - - - + + - - + - diff --git a/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs b/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs index ea41ec13..0258ac20 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs @@ -16,11 +16,7 @@ public class ConfigServer protected ISptLogger _logger; private static Dictionary _configs = new(); - public ConfigServer( - ISptLogger logger, - JsonUtil jsonUtil, - FileUtil fileUtil - ) + public ConfigServer(ISptLogger logger, JsonUtil jsonUtil, FileUtil fileUtil) { _logger = logger; _jsonUtil = jsonUtil; @@ -32,12 +28,15 @@ public class ConfigServer } } - public T GetConfig() where T : BaseConfig + public T GetConfig() + where T : BaseConfig { var configKey = GetConfigKey(typeof(T)); if (!_configs.ContainsKey(configKey.GetValue())) { - throw new Exception($"Config: {configKey} is undefined. Ensure you have not broken it via editing"); + throw new Exception( + $"Config: {configKey} is undefined. Ensure you have not broken it via editing" + ); } return _configs[configKey.GetValue()] as T; @@ -54,7 +53,8 @@ public class ConfigServer return configEnumerable.First(); } - public T GetConfigByString(string configType) where T : BaseConfig + public T GetConfigByString(string configType) + where T : BaseConfig { return _configs[configType] as T; } @@ -80,8 +80,12 @@ public class ConfigServer if (deserializedContent == null) { - _logger.Error($"Config file: {file} is corrupt. Use a site like: https://jsonlint.com to find the issue."); - throw new Exception($"Server will not run until the: {file} config error mentioned above is fixed"); + _logger.Error( + $"Config file: {file} is corrupt. Use a site like: https://jsonlint.com to find the issue." + ); + throw new Exception( + $"Server will not run until the: {file} config error mentioned above is fixed" + ); } _configs[$"spt-{_fileUtil.StripExtension(file)}"] = deserializedContent; diff --git a/Libraries/SPTarkov.Server.Core/Servers/Http/RequestLogger.cs b/Libraries/SPTarkov.Server.Core/Servers/Http/RequestLogger.cs index ff1a7e43..c908a88d 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Http/RequestLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Http/RequestLogger.cs @@ -1,6 +1,4 @@ namespace SPTarkov.Server.Core.Servers.Http; // This is a dummy class to use for SourceContext in Serilog, do not remove! -public class RequestLogger -{ -} +public class RequestLogger { } diff --git a/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs b/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs index 48994868..63b39f8f 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs @@ -21,14 +21,13 @@ public class SptHttpListener( JsonUtil _jsonUtil, HttpResponseUtil _httpResponseUtil, LocalisationService _localisationService - ) : IHttpListener +) : IHttpListener { // We want to read 1KB at a time, for most request this is already big enough private const int BodyReadBufferSize = 1024 * 1; private static readonly ImmutableHashSet SupportedMethods = ["GET", "PUT", "POST"]; - protected readonly HttpRouter _router = _httpRouter; protected readonly IEnumerable _serializers = _serializers; @@ -42,72 +41,76 @@ public class SptHttpListener( switch (req.Method) { case "GET": - { - var response = await GetResponse(sessionId, req, null); - await SendResponse(sessionId, req, resp, null, response); - break; - } + { + var response = await GetResponse(sessionId, req, null); + await SendResponse(sessionId, req, resp, null, response); + break; + } // these are handled almost identically. case "POST": case "PUT": + { + // Contrary to reasonable expectations, the content-encoding is _not_ actually used to + // determine if the payload is compressed. All PUT requests are, and POST requests without + // debug = 1 are as well. This should be fixed. + // let compressed = req.headers["content-encoding"] === "deflate"; + var requestIsCompressed = + !req.Headers.TryGetValue("requestcompressed", out var compressHeader) + || compressHeader != "0"; + var requestCompressed = req.Method == "PUT" || requestIsCompressed; + + var body = string.Empty; + using MemoryStream bufferStream = new(); + + var buffer = new byte[BodyReadBufferSize]; + int bytesRead; + + while ((bytesRead = await req.Body.ReadAsync(buffer)) > 0) { - // Contrary to reasonable expectations, the content-encoding is _not_ actually used to - // determine if the payload is compressed. All PUT requests are, and POST requests without - // debug = 1 are as well. This should be fixed. - // let compressed = req.headers["content-encoding"] === "deflate"; - var requestIsCompressed = !req.Headers.TryGetValue("requestcompressed", out var compressHeader) || - compressHeader != "0"; - var requestCompressed = req.Method == "PUT" || requestIsCompressed; - - var body = string.Empty; - using MemoryStream bufferStream = new(); - - var buffer = new byte[BodyReadBufferSize]; - int bytesRead; - - while ((bytesRead = await req.Body.ReadAsync(buffer)) > 0) - { - await bufferStream.WriteAsync(buffer.AsMemory(0, bytesRead)); - } - - bufferStream.Position = 0; - - if (requestCompressed) - { - await using var deflateStream = new ZLibStream(bufferStream, CompressionMode.Decompress); - await using var decompressedStream = new MemoryStream(); - await deflateStream.CopyToAsync(decompressedStream); - decompressedStream.Position = 0; - - using var reader = new StreamReader(decompressedStream, Encoding.UTF8); - body = await reader.ReadToEndAsync(); - } - else - { - // No decompression needed, decode directly from the bufferStream's buffer - bufferStream.Position = 0; - using var reader = new StreamReader(bufferStream, Encoding.UTF8); - body = await reader.ReadToEndAsync(); - } - - if (!requestIsCompressed) - { - if (_logger.IsLogEnabled(LogLevel.Debug)) - { - _logger.Debug(body); - } - } - - var response = await GetResponse(sessionId, req, body); - await SendResponse(sessionId, req, resp, body, response); - break; + await bufferStream.WriteAsync(buffer.AsMemory(0, bytesRead)); } + bufferStream.Position = 0; + + if (requestCompressed) + { + await using var deflateStream = new ZLibStream( + bufferStream, + CompressionMode.Decompress + ); + await using var decompressedStream = new MemoryStream(); + await deflateStream.CopyToAsync(decompressedStream); + decompressedStream.Position = 0; + + using var reader = new StreamReader(decompressedStream, Encoding.UTF8); + body = await reader.ReadToEndAsync(); + } + else + { + // No decompression needed, decode directly from the bufferStream's buffer + bufferStream.Position = 0; + using var reader = new StreamReader(bufferStream, Encoding.UTF8); + body = await reader.ReadToEndAsync(); + } + + if (!requestIsCompressed) + { + if (_logger.IsLogEnabled(LogLevel.Debug)) + { + _logger.Debug(body); + } + } + + var response = await GetResponse(sessionId, req, body); + await SendResponse(sessionId, req, resp, body, response); + break; + } + default: - { - _logger.Warning($"{_localisationService.GetText("unknown_request")}: {req.Method}"); - break; - } + { + _logger.Warning($"{_localisationService.GetText("unknown_request")}: {req.Method}"); + break; + } } } @@ -193,7 +196,11 @@ public class SptHttpListener( if (string.IsNullOrEmpty(output)) { _logger.Error(_localisationService.GetText("unhandled_response", req.Path.ToString())); - output = _httpResponseUtil.GetBody(null, BackendErrorCodes.HTTPNotFound, $"UNHANDLED RESPONSE: {req.Path.ToString()}"); + output = _httpResponseUtil.GetBody( + null, + BackendErrorCodes.HTTPNotFound, + $"UNHANDLED RESPONSE: {req.Path.ToString()}" + ); } if (ProgramStatics.ENTRY_TYPE() != EntryType.RELEASE) diff --git a/Libraries/SPTarkov.Server.Core/Servers/HttpServer.cs b/Libraries/SPTarkov.Server.Core/Servers/HttpServer.cs index 8a261e14..5261fcee 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/HttpServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/HttpServer.cs @@ -42,15 +42,19 @@ public class HttpServer( _builder.WebHost.ConfigureKestrel(options => { - options.Listen(IPAddress.Parse(_httpConfig.Ip), _httpConfig.Port, listenOptions => - { - listenOptions.UseHttps(opts => + options.Listen( + IPAddress.Parse(_httpConfig.Ip), + _httpConfig.Port, + listenOptions => { - opts.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13; - opts.ServerCertificate = _certificateHelper.LoadOrGenerateCertificatePfx(); - opts.ClientCertificateMode = ClientCertificateMode.NoCertificate; - }); - }); + listenOptions.UseHttps(opts => + { + opts.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13; + opts.ServerCertificate = _certificateHelper.LoadOrGenerateCertificatePfx(); + opts.ClientCertificateMode = ClientCertificateMode.NoCertificate; + }); + } + ); }); _webApplication = _builder.Build(); @@ -61,13 +65,16 @@ public class HttpServer( } // Enable web socket - _webApplication.UseWebSockets(new WebSocketOptions - { - // Every minute a heartbeat is sent to keep the connection alive. - KeepAliveInterval = TimeSpan.FromSeconds(60) - }); + _webApplication.UseWebSockets( + new WebSocketOptions + { + // Every minute a heartbeat is sent to keep the connection alive. + KeepAliveInterval = TimeSpan.FromSeconds(60), + } + ); - _webApplication.Use(async (HttpContext req, RequestDelegate _) => + _webApplication.Use( + async (HttpContext req, RequestDelegate _) => { await HandleFallback(req); } @@ -81,7 +88,6 @@ public class HttpServer( _started = true; await _webApplication.RunAsync(); } - } private async Task HandleFallback(HttpContext context) @@ -109,7 +115,9 @@ public class HttpServer( try { - var listener = _httpListeners.FirstOrDefault(l => l.CanHandle(sessionId, context.Request)); + var listener = _httpListeners.FirstOrDefault(l => + l.CanHandle(sessionId, context.Request) + ); if (listener != null) { @@ -139,17 +147,16 @@ public class HttpServer( { if (isLocalRequest) { - _logger.Info(_localisationService.GetText("client_request", context.Request.Path.Value)); + _logger.Info( + _localisationService.GetText("client_request", context.Request.Path.Value) + ); } else { _logger.Info( _localisationService.GetText( - "client_request_ip", new - { - ip = clientIp, - url = context.Request.Path.Value - } + "client_request_ip", + new { ip = clientIp, url = context.Request.Path.Value } ) ); } @@ -180,9 +187,9 @@ public class HttpServer( return false; } - return remoteAddress.StartsWith("127.0.0") || - remoteAddress.StartsWith("192.168.") || - remoteAddress.StartsWith("localhost"); + return remoteAddress.StartsWith("127.0.0") + || remoteAddress.StartsWith("192.168.") + || remoteAddress.StartsWith("localhost"); } protected Dictionary GetCookies(HttpRequest req) diff --git a/Libraries/SPTarkov.Server.Core/Servers/RagfairServer.cs b/Libraries/SPTarkov.Server.Core/Servers/RagfairServer.cs index 004b1e3c..95f4a694 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/RagfairServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/RagfairServer.cs @@ -84,7 +84,11 @@ public class RagfairServer( List offers ) { - return _ragfairCategoriesService.GetCategoriesFromOffers(offers, searchRequestData, fleaUnlocked); + return _ragfairCategoriesService.GetCategoriesFromOffers( + offers, + searchRequestData, + fleaUnlocked + ); } /// @@ -98,7 +102,9 @@ public class RagfairServer( if (offer is null) { - _logger.Error(_localisationService.GetText("ragfair-offer_not_found_unable_to_hide", offerId)); + _logger.Error( + _localisationService.GetText("ragfair-offer_not_found_unable_to_hide", offerId) + ); return; } diff --git a/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs b/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs index 930f6c50..cd86ad67 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs @@ -26,7 +26,8 @@ public class SaveServer( protected const string profileFilepath = "user/profiles/"; // onLoad = require("../bindings/SaveLoad"); - protected readonly Dictionary> onBeforeSaveCallbacks = new(); + protected readonly Dictionary> onBeforeSaveCallbacks = + new(); protected ConcurrentDictionary profiles = new(); protected ConcurrentDictionary saveMd5 = new(); @@ -64,7 +65,9 @@ public class SaveServer( _fileUtil.CreateDirectory(profileFilepath); } - var files = _fileUtil.GetFiles(profileFilepath).Where(item => _fileUtil.GetFileExtension(item) == "json"); + var files = _fileUtil + .GetFiles(profileFilepath) + .Where(item => _fileUtil.GetFileExtension(item) == "json"); // load profiles var stopwatch = Stopwatch.StartNew(); @@ -76,7 +79,9 @@ public class SaveServer( stopwatch.Stop(); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"{files.Count()} Profiles took: {stopwatch.ElapsedMilliseconds}ms to load."); + _logger.Debug( + $"{files.Count()} Profiles took: {stopwatch.ElapsedMilliseconds}ms to load." + ); } } @@ -108,7 +113,9 @@ public class SaveServer( { if (string.IsNullOrEmpty(sessionId)) { - throw new Exception("session id provided was empty, did you restart the server while the game was running?"); + throw new Exception( + "session id provided was empty, did you restart the server while the game was running?" + ); } if (profiles == null || profiles.Count == 0) @@ -176,8 +183,8 @@ public class SaveServer( CharacterData = new Characters { PmcData = new PmcData(), - ScavData = new PmcData() - } + ScavData = new PmcData(), + }, } ); } @@ -201,14 +208,13 @@ public class SaveServer( var filename = $"{sessionID}.json"; var filePath = $"{profileFilepath}{filename}"; if (_fileUtil.FileExists(filePath)) - // File found, store in profiles[] + // File found, store in profiles[] { profiles[sessionID] = await _jsonUtil.DeserializeFromFileAsync(filePath); } // Run callbacks - foreach (var callback in - _saveLoadRouters) // HealthSaveLoadRouter, InraidSaveLoadRouter, InsuranceSaveLoadRouter, ProfileSaveLoadRouter. THESE SHOULD EXIST IN HERE + foreach (var callback in _saveLoadRouters) // HealthSaveLoadRouter, InraidSaveLoadRouter, InsuranceSaveLoadRouter, ProfileSaveLoadRouter. THESE SHOULD EXIST IN HERE { profiles[sessionID] = callback.HandleLoad(GetProfile(sessionID)); } @@ -237,11 +243,7 @@ public class SaveServer( _logger.Error( _localisationService.GetText( "profile_save_callback_error", - new - { - callback, - error = e - } + new { callback, error = e } ) ); profiles[sessionID] = previous; @@ -249,7 +251,10 @@ public class SaveServer( } var start = Stopwatch.StartNew(); - var jsonProfile = _jsonUtil.Serialize(profiles[sessionID], !_configServer.GetConfig().Features.CompressProfile); + var jsonProfile = _jsonUtil.Serialize( + profiles[sessionID], + !_configServer.GetConfig().Features.CompressProfile + ); var fmd5 = await _hashUtil.GenerateHashForDataAsync(HashingAlgorithm.MD5, jsonProfile); if (!saveMd5.TryGetValue(sessionID, out var currentMd5) || currentMd5 != fmd5) { @@ -277,7 +282,6 @@ public class SaveServer( { _logger.Error($"Unable to delete file, not found: {file}"); } - } return !_fileUtil.FileExists(file); diff --git a/Libraries/SPTarkov.Server.Core/Servers/WebSocketServer.cs b/Libraries/SPTarkov.Server.Core/Servers/WebSocketServer.cs index 4032ae5b..d21a1ab5 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/WebSocketServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/WebSocketServer.cs @@ -29,9 +29,14 @@ public class WebSocketServer( if (socketHandlers.Count == 0) { - var message = $"Socket connection received for url {context.Request.Path.Value}, but there is no websocket handler configured for it!"; + var message = + $"Socket connection received for url {context.Request.Path.Value}, but there is no websocket handler configured for it!"; _logger.Debug(message); - await webSocket.CloseAsync(WebSocketCloseStatus.ProtocolError, message, CancellationToken.None); + await webSocket.CloseAsync( + WebSocketCloseStatus.ProtocolError, + message, + CancellationToken.None + ); return; } @@ -39,7 +44,9 @@ public class WebSocketServer( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] Notifying handlers of new websocket connection opening with reference {webSocketIdContext}"); + _logger.Debug( + $"[WS] Notifying handlers of new websocket connection opening with reference {webSocketIdContext}" + ); } foreach (var wsh in socketHandlers) @@ -60,76 +67,100 @@ public class WebSocketServer( _logger.Debug($"[WS] Starting read loop for websocket reference {webSocketIdContext}"); } - var thread = Task.Factory.StartNew(async () => - { - var messageBuffer = new List(); - var receiveBuffer = new byte[1024 * 4]; - var socketClosing = false; - - while (!wsToken.IsCancellationRequested && !socketClosing) + var thread = Task.Factory.StartNew( + async () => { - var segment = new ArraySegment(receiveBuffer); + var messageBuffer = new List(); + var receiveBuffer = new byte[1024 * 4]; + var socketClosing = false; - WebSocketReceiveResult? result = null; + while (!wsToken.IsCancellationRequested && !socketClosing) + { + var segment = new ArraySegment(receiveBuffer); - try - { - result = await webSocket.ReceiveAsync(segment, wsToken); - } - catch (WebSocketException wsException) - { - if (wsException.WebSocketErrorCode == WebSocketError.ConnectionClosedPrematurely - || webSocket.State == WebSocketState.Aborted || webSocket.State == WebSocketState.Closed) + WebSocketReceiveResult? result = null; + + try { + result = await webSocket.ReceiveAsync(segment, wsToken); + } + catch (WebSocketException wsException) + { + if ( + wsException.WebSocketErrorCode + == WebSocketError.ConnectionClosedPrematurely + || webSocket.State == WebSocketState.Aborted + || webSocket.State == WebSocketState.Closed + ) + { + socketClosing = true; + break; + } + } + + // Continue handling here, the WebSocket is not closed so we should be good despite being null here + if (result == null) + { + continue; + } + + // Handle graceful close of the WebSocket + // WebsocketSharp requires this as when Close() is called it will send a message to the WS server that it's about to close. + // If this is not handled an exception is thrown on the client + if (result.MessageType == WebSocketMessageType.Close) + { + _logger.Debug( + $"[WS] WebSocket reference {webSocketIdContext} sent close frame, stopping." + ); + await webSocket.CloseOutputAsync( + WebSocketCloseStatus.NormalClosure, + "Closing..", + wsToken + ); socketClosing = true; break; } - } - // Continue handling here, the WebSocket is not closed so we should be good despite being null here - if (result == null) - { - continue; - } + messageBuffer.AddRange(segment.Take(result.Count)); - // Handle graceful close of the WebSocket - // WebsocketSharp requires this as when Close() is called it will send a message to the WS server that it's about to close. - // If this is not handled an exception is thrown on the client - if (result.MessageType == WebSocketMessageType.Close) - { - _logger.Debug($"[WS] WebSocket reference {webSocketIdContext} sent close frame, stopping."); - await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Closing..", wsToken); - socketClosing = true; - break; - } - - messageBuffer.AddRange(segment.Take(result.Count)); - - if (result.EndOfMessage) - { - if (_logger.IsLogEnabled(LogLevel.Debug)) + if (result.EndOfMessage) { - _logger.Debug($"[WS] Read loop for websocket reference {webSocketIdContext} received new message. Notifying socket handlers."); + if (_logger.IsLogEnabled(LogLevel.Debug)) + { + _logger.Debug( + $"[WS] Read loop for websocket reference {webSocketIdContext} received new message. Notifying socket handlers." + ); + } + + var message = messageBuffer.ToArray(); + + foreach (var wsh in socketHandlers) + { + await wsh.OnMessage( + message, + WebSocketMessageType.Text, + webSocket, + context + ); + } + + messageBuffer.Clear(); } - - var message = messageBuffer.ToArray(); - - foreach (var wsh in socketHandlers) - { - await wsh.OnMessage(message, WebSocketMessageType.Text, webSocket, context); - } - - messageBuffer.Clear(); } - } - }, wsToken, TaskCreationOptions.LongRunning, TaskScheduler.Default); + }, + wsToken, + TaskCreationOptions.LongRunning, + TaskScheduler.Default + ); var counter = 0; while (webSocket.State == WebSocketState.Open) { if (counter == 30 && _logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] Websocket keep alive for reference {webSocketIdContext}. Thread state {thread.Status}. Websocket state {webSocket.State}"); + _logger.Debug( + $"[WS] Websocket keep alive for reference {webSocketIdContext}. Thread state {thread.Status}. Websocket state {webSocket.State}" + ); counter = 0; } else @@ -143,7 +174,9 @@ public class WebSocketServer( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] State for websocket reference {webSocketIdContext} is now {webSocket.State}, closing"); + _logger.Debug( + $"[WS] State for websocket reference {webSocketIdContext} is now {webSocket.State}, closing" + ); } // Disconnect has been received, cancel the token and send OnClose to the relevant WebSockets. @@ -153,7 +186,9 @@ public class WebSocketServer( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] OnClose for websocket reference {webSocketIdContext} requested"); + _logger.Debug( + $"[WS] OnClose for websocket reference {webSocketIdContext} requested" + ); } await wsh.OnClose(webSocket, context, webSocketIdContext); diff --git a/Libraries/SPTarkov.Server.Core/Servers/Ws/IWebSocketConnectionHandler.cs b/Libraries/SPTarkov.Server.Core/Servers/Ws/IWebSocketConnectionHandler.cs index 494a048d..36230428 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Ws/IWebSocketConnectionHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Ws/IWebSocketConnectionHandler.cs @@ -7,7 +7,13 @@ public interface IWebSocketConnectionHandler string GetHookUrl(); string GetSocketId(); Task OnConnection(WebSocket ws, HttpContext context, string sessionIdContext); - Task OnMessage(byte[] rawData, WebSocketMessageType messageType, WebSocket ws, HttpContext context); + Task OnMessage( + byte[] rawData, + WebSocketMessageType messageType, + WebSocket ws, + HttpContext context + ); + /// /// OnClose event of a WebSocket, it should already be assumed here that the WebSocket is closed. /// diff --git a/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs b/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs index b1b2097a..61b1f8f6 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs @@ -17,8 +17,8 @@ public class SptWebSocketConnectionHandler( LocalisationService _localisationService, JsonUtil _jsonUtil, ProfileHelper _profileHelper, - IEnumerable _messageHandlers) - : IWebSocketConnectionHandler + IEnumerable _messageHandlers +) : IWebSocketConnectionHandler { protected Dictionary> _sockets = new(); protected Lock _socketsLock = new(); @@ -41,7 +41,9 @@ public class SptWebSocketConnectionHandler( var playerInfoText = $"{playerProfile.ProfileInfo.Username} ({sessionID})"; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] Websocket connect for player {playerInfoText} started with context {sessionIdContext}"); + _logger.Debug( + $"[WS] Websocket connect for player {playerInfoText} started with context {sessionIdContext}" + ); } lock (_socketsLock) @@ -52,7 +54,12 @@ public class SptWebSocketConnectionHandler( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug(_localisationService.GetText("websocket-player_reconnect", new {sessionId = playerInfoText, contextId = sessionIdContext })); + _logger.Debug( + _localisationService.GetText( + "websocket-player_reconnect", + new { sessionId = playerInfoText, contextId = sessionIdContext } + ) + ); } } } @@ -65,7 +72,12 @@ public class SptWebSocketConnectionHandler( sessionSockets.Add(sessionIdContext, ws); if (_logger.IsLogEnabled(LogLevel.Info)) { - _logger.Info(_localisationService.GetText("websocket-player_connected", new { sessionId = playerInfoText, contextId = sessionIdContext })); + _logger.Info( + _localisationService.GetText( + "websocket-player_connected", + new { sessionId = playerInfoText, contextId = sessionIdContext } + ) + ); } return Task.CompletedTask; @@ -83,7 +95,9 @@ public class SptWebSocketConnectionHandler( var sessionID = splitUrl.Last(); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[WS] Message for session {sessionID} received. Notifying message handlers."); + _logger.Debug( + $"[WS] Message for session {sessionID} received. Notifying message handlers." + ); } foreach (var sptWebSocketMessageHandler in _messageHandlers) @@ -101,7 +115,9 @@ public class SptWebSocketConnectionHandler( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Attempting to close websocket session {sessionID} with context {sessionIdContext}"); + _logger.Debug( + $"Attempting to close websocket session {sessionID} with context {sessionIdContext}" + ); } if (_sockets.TryGetValue(sessionID, out var sessionSockets) && sessionSockets.Any()) @@ -109,13 +125,18 @@ public class SptWebSocketConnectionHandler( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Websockets for session {sessionID} entry matched, attempting to find context {sessionIdContext}"); + $"Websockets for session {sessionID} entry matched, attempting to find context {sessionIdContext}" + ); } - if (!sessionSockets.TryGetValue(sessionIdContext, out _) && _logger.IsLogEnabled(LogLevel.Info)) + if ( + !sessionSockets.TryGetValue(sessionIdContext, out _) + && _logger.IsLogEnabled(LogLevel.Info) + ) { _logger.Info( - $"[ws] The websocket session {sessionID} with reference: {sessionIdContext} has already been removed or reconnected"); + $"[ws] The websocket session {sessionID} with reference: {sessionIdContext} has already been removed or reconnected" + ); } else { @@ -124,7 +145,9 @@ public class SptWebSocketConnectionHandler( { var playerProfile = _profileHelper.GetFullProfile(sessionID); var playerInfoText = $"{playerProfile.ProfileInfo.Username} ({sessionID})"; - _logger.Info($"[ws] player: {playerInfoText} {sessionIdContext} has disconnected"); + _logger.Info( + $"[ws] player: {playerInfoText} {sessionIdContext} has disconnected" + ); } } } @@ -133,7 +156,8 @@ public class SptWebSocketConnectionHandler( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Websocket for session {sessionID} with context {sessionIdContext} does not exist on the socket map, nothing was removed"); + $"Websocket for session {sessionID} with context {sessionIdContext} does not exist on the socket map, nothing was removed" + ); } } } @@ -150,7 +174,8 @@ public class SptWebSocketConnectionHandler( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"Send message for {sessionID} matched {webSockets.Count()} websockets. Messages being sent"); + $"Send message for {sessionID} matched {webSockets.Count()} websockets. Messages being sent" + ); } foreach (var webSocket in webSockets) @@ -182,13 +207,21 @@ public class SptWebSocketConnectionHandler( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug(_localisationService.GetText("websocket-not_ready_message_not_sent", sessionID)); + _logger.Debug( + _localisationService.GetText( + "websocket-not_ready_message_not_sent", + sessionID + ) + ); } } } catch (Exception err) { - _logger.Error(_localisationService.GetText("websocket-message_send_failed_with_error"), err); + _logger.Error( + _localisationService.GetText("websocket-message_send_failed_with_error"), + err + ); } } @@ -196,8 +229,8 @@ public class SptWebSocketConnectionHandler( { lock (_socketsLock) { - return _sockets.TryGetValue(sessionID, out var sockets) && - sockets.Any(s => s.Value.State == WebSocketState.Open); + return _sockets.TryGetValue(sessionID, out var sockets) + && sockets.Any(s => s.Value.State == WebSocketState.Open); } } @@ -205,7 +238,9 @@ public class SptWebSocketConnectionHandler( { lock (_socketsLock) { - return _sockets.GetValueOrDefault(sessionID)?.Values.Where(s => s.State == WebSocketState.Open) ?? []; + return _sockets + .GetValueOrDefault(sessionID) + ?.Values.Where(s => s.State == WebSocketState.Open) ?? []; } } } diff --git a/Libraries/SPTarkov.Server.Core/Services/AirdropService.cs b/Libraries/SPTarkov.Server.Core/Services/AirdropService.cs index 3cd39390..2477036f 100644 --- a/Libraries/SPTarkov.Server.Core/Services/AirdropService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/AirdropService.cs @@ -23,22 +23,32 @@ public class AirdropService( ContainerHelper _containerHelper, LocalisationService _localisationService, ItemFilterService _itemFilterService, - ItemHelper _itemHelper) + ItemHelper _itemHelper +) { protected readonly AirdropConfig _airdropConfig = configServer.GetConfig(); public GetAirdropLootResponse GenerateCustomAirdropLoot(GetAirdropLootRequest request) { - if (_airdropConfig.CustomAirdropMapping.TryGetValue(request.ContainerId, out var customAirdropInformation)) + if ( + _airdropConfig.CustomAirdropMapping.TryGetValue( + request.ContainerId, + out var customAirdropInformation + ) + ) { // Found container id, generate specific loot return GenerateAirdropLoot(customAirdropInformation); } - _logger.Warning(_localisationService.GetText("airdrop-unable_to_find_container_id_generating_random", request.ContainerId)); + _logger.Warning( + _localisationService.GetText( + "airdrop-unable_to_find_container_id_generating_random", + request.ContainerId + ) + ); return GenerateAirdropLoot(); - } /// @@ -80,7 +90,7 @@ public class AirdropService( foreach (var item in flattenedCrateLoot) { if (item.Id == airdropCrateItem.Id) - // Crate itself, skip + // Crate itself, skip { continue; } @@ -96,7 +106,7 @@ public class AirdropService( return new GetAirdropLootResponse { Icon = airdropConfig.Icon, - Container = flattenedCrateLoot + Container = flattenedCrateLoot, }; } @@ -106,7 +116,10 @@ public class AirdropService( /// Crate item to fit items into /// Item pool to try and fit into container /// Items that will fit container - protected List> GetLootThatFitsContainer(Item container, List> crateLootPool) + protected List> GetLootThatFitsContainer( + Item container, + List> crateLootPool + ) { // list of root item + children in list var lootResult = new List>(); @@ -121,7 +134,11 @@ public class AirdropService( var itemSize = _itemHelper.GetItemSize(itemAndChildren, itemAndChildren[0].Id); // Look for open slot to put chosen item into - var result = _containerHelper.FindSlotForItem(containerMap, itemSize.Width, itemSize.Height); + var result = _containerHelper.FindSlotForItem( + containerMap, + itemSize.Width, + itemSize.Height + ); if (result.Success.GetValueOrDefault(false)) { // It Fits, add item + children @@ -141,9 +158,11 @@ public class AirdropService( } if (failedToFitAttemptCount > 3) - // 3 attempts to fit an item, container is probably full, stop trying to add more + // 3 attempts to fit an item, container is probably full, stop trying to add more { - _logger.Debug($"Airdrop is too full of loot to add: {itemAndChildren[0].Template} after {failedToFitAttemptCount} attempts, stopped adding more"); + _logger.Debug( + $"Airdrop is too full of loot to add: {itemAndChildren[0].Template} after {failedToFitAttemptCount} attempts, stopped adding more" + ); break; } @@ -165,11 +184,7 @@ public class AirdropService( { Id = _hashUtil.Generate(), Template = string.Empty, // Chosen below later - Upd = new Upd - { - SpawnedInSession = true, - StackObjectsCount = 1 - } + Upd = new Upd { SpawnedInSession = true, StackObjectsCount = 1 }, }; switch (airdropType) @@ -187,7 +202,8 @@ public class AirdropService( airdropContainer.Template = ItemTpl.LOOTCONTAINER_AIRDROP_COMMON_SUPPLY_CRATE; break; case SptAirdropTypeEnum.radar: - airdropContainer.Template = ItemTpl.LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1; + airdropContainer.Template = + ItemTpl.LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1; break; default: airdropContainer.Template = ItemTpl.LOOTCONTAINER_AIRDROP_COMMON_SUPPLY_CRATE; @@ -218,7 +234,10 @@ public class AirdropService( if (!_airdropConfig.Loot.TryGetValue(airdropType.ToString(), out var lootSettingsByType)) { _logger.Error( - _localisationService.GetText("location-unable_to_find_airdrop_drop_config_of_type", airdropType) + _localisationService.GetText( + "location-unable_to_find_airdrop_drop_config_of_type", + airdropType + ) ); // TODO: Get Radar airdrop to work. Atm Radar will default to common supply drop (mixed) @@ -228,10 +247,14 @@ public class AirdropService( // Get all items that match the blacklisted types and fold into item blacklist var itemTypeBlacklist = _itemFilterService.GetItemRewardBaseTypeBlacklist(); - var itemsMatchingTypeBlacklist = _itemHelper.GetItems() + var itemsMatchingTypeBlacklist = _itemHelper + .GetItems() .Where(templateItem => !string.IsNullOrEmpty(templateItem.Parent)) - .Where(templateItem => _itemHelper.IsOfBaseclasses(templateItem.Parent, itemTypeBlacklist)) - .Select(templateItem => templateItem.Id).ToHashSet(); + .Where(templateItem => + _itemHelper.IsOfBaseclasses(templateItem.Parent, itemTypeBlacklist) + ) + .Select(templateItem => templateItem.Id) + .ToHashSet(); var itemBlacklist = new HashSet(); itemBlacklist.UnionWith(lootSettingsByType.ItemBlacklist); itemBlacklist.UnionWith(_itemFilterService.GetItemRewardBlacklist()); @@ -254,7 +277,7 @@ public class AirdropService( UseForcedLoot = lootSettingsByType.UseForcedLoot, ForcedLoot = lootSettingsByType.ForcedLoot, UseRewardItemBlacklist = lootSettingsByType.UseRewardItemBlacklist, - BlockSeasonalItemsOutOfSeason = lootSettingsByType.BlockSeasonalItemsOutOfSeason + BlockSeasonalItemsOutOfSeason = lootSettingsByType.BlockSeasonalItemsOutOfSeason, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Services/BackupService.cs b/Libraries/SPTarkov.Server.Core/Services/BackupService.cs index ce440c45..f432ff23 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BackupService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BackupService.cs @@ -57,8 +57,8 @@ public class BackupService return; } - _backupIntervalTimer = new Timer(async - _ => + _backupIntervalTimer = new Timer( + async _ => { try { @@ -97,7 +97,9 @@ public class BackupService } catch (Exception ex) { - _logger.Debug($"Skipping profile backup: Unable to read profiles directory, {ex.Message}"); + _logger.Debug( + $"Skipping profile backup: Unable to read profiles directory, {ex.Message}" + ); return; } @@ -125,12 +127,17 @@ public class BackupService var absoluteDestinationFilePath = Path.Combine(targetDir, profileFileName); if (!_fileUtil.CopyFile(relativeSourceFilePath, absoluteDestinationFilePath)) { - _logger.Error($"Source file not found: {relativeSourceFilePath}. Cannot copy to: {absoluteDestinationFilePath}"); + _logger.Error( + $"Source file not found: {relativeSourceFilePath}. Cannot copy to: {absoluteDestinationFilePath}" + ); } } // Write a copy of active mods. - await _fileUtil.WriteFileAsync(Path.Combine(targetDir, "activeMods.json"), _jsonUtil.Serialize(_activeServerMods)); + await _fileUtil.WriteFileAsync( + Path.Combine(targetDir, "activeMods.json"), + _jsonUtil.Serialize(_activeServerMods) + ); if (_logger.IsLogEnabled(LogLevel.Debug)) { @@ -205,7 +212,9 @@ public class BackupService } } - protected SortedDictionary GetBackupPathsWithCreationTimestamp(List backupPaths) + protected SortedDictionary GetBackupPathsWithCreationTimestamp( + List backupPaths + ) { var result = new SortedDictionary(); foreach (var backupPath in backupPaths) @@ -251,9 +260,9 @@ public class BackupService return 0; // Skip comparison if either date is invalid. } - return (int) (dateA.Value.ToFileTimeUtc() - dateB.Value.ToFileTimeUtc()); + return (int)(dateA.Value.ToFileTimeUtc() - dateB.Value.ToFileTimeUtc()); } - + /// /// Extracts a date from a folder name string formatted as `YYYY-MM-DD_hh-mm-ss`. /// @@ -264,7 +273,15 @@ public class BackupService var folderName = Path.GetFileName(folderPath); const string format = "yyyy-MM-dd_HH-mm-ss"; - if (DateTime.TryParseExact(folderName, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out var dateTime)) + if ( + DateTime.TryParseExact( + folderName, + format, + CultureInfo.InvariantCulture, + DateTimeStyles.None, + out var dateTime + ) + ) { return dateTime; } diff --git a/Libraries/SPTarkov.Server.Core/Services/BotEquipmentFilterService.cs b/Libraries/SPTarkov.Server.Core/Services/BotEquipmentFilterService.cs index ba3006c4..f7704d48 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotEquipmentFilterService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotEquipmentFilterService.cs @@ -24,7 +24,8 @@ public class BotEquipmentFilterService ISptLogger logger, BotHelper botHelper, ProfileHelper profileHelper, - ConfigServer configServer) + ConfigServer configServer + ) { _logger = logger; _profileHelper = profileHelper; @@ -41,7 +42,12 @@ public class BotEquipmentFilterService /// bots json data to filter /// Level of the bot /// details on how to generate a bot - public void FilterBotEquipment(string sessionId, BotType baseBotNode, int botLevel, BotGenerationDetails botGenerationDetails) + public void FilterBotEquipment( + string sessionId, + BotType baseBotNode, + int botLevel, + BotGenerationDetails botGenerationDetails + ) { var pmcProfile = _profileHelper.GetPmcProfile(sessionId); @@ -57,7 +63,10 @@ public class BotEquipmentFilterService RandomisationDetails? randomisationDetails = null; if (_botEquipmentConfig.TryGetValue(botRole.ToLower(), out var botEquipmentConfig)) { - randomisationDetails = _botHelper.GetBotRandomizationDetails(botLevel, botEquipmentConfig); + randomisationDetails = _botHelper.GetBotRandomizationDetails( + botLevel, + botEquipmentConfig + ); } if (botEquipmentBlacklist is not null || botEquipmentWhitelist is not null) @@ -77,15 +86,27 @@ public class BotEquipmentFilterService if (botWeightingAdjustmentsByPlayerLevel is not null) { - AdjustWeighting(botWeightingAdjustmentsByPlayerLevel.Equipment, baseBotNode.BotInventory.Equipment); - AdjustWeighting(botWeightingAdjustmentsByPlayerLevel.Ammo, baseBotNode.BotInventory.Ammo); + AdjustWeighting( + botWeightingAdjustmentsByPlayerLevel.Equipment, + baseBotNode.BotInventory.Equipment + ); + AdjustWeighting( + botWeightingAdjustmentsByPlayerLevel.Ammo, + baseBotNode.BotInventory.Ammo + ); } if (randomisationDetails is not null) { AdjustChances(randomisationDetails.Equipment, baseBotNode.BotChances.EquipmentChances); - AdjustChances(randomisationDetails.WeaponMods, baseBotNode.BotChances.WeaponModsChances); - AdjustChances(randomisationDetails.EquipmentMods, baseBotNode.BotChances.EquipmentModsChances); + AdjustChances( + randomisationDetails.WeaponMods, + baseBotNode.BotChances.WeaponModsChances + ); + AdjustChances( + randomisationDetails.EquipmentMods, + baseBotNode.BotChances.EquipmentModsChances + ); AdjustGenerationChances(randomisationDetails.Generation, baseBotNode.BotGeneration); } } @@ -97,7 +118,8 @@ public class BotEquipmentFilterService /// data to update protected void AdjustChances( Dictionary equipmentChanges, - Dictionary baseValues) + Dictionary baseValues + ) { if (equipmentChanges is null) { @@ -117,7 +139,8 @@ public class BotEquipmentFilterService /// dictionary to update protected void AdjustGenerationChances( Dictionary generationChanges, - Generation baseBotGeneration) + Generation baseBotGeneration + ) { if (generationChanges is null) { @@ -126,8 +149,10 @@ public class BotEquipmentFilterService foreach (var itemKey in generationChanges) { - baseBotGeneration.Items.GetByJsonProp(itemKey.Key).Weights = generationChanges.GetValueOrDefault(itemKey.Key).Weights; - baseBotGeneration.Items.GetByJsonProp(itemKey.Key).Whitelist = generationChanges.GetValueOrDefault(itemKey.Key).Whitelist; + baseBotGeneration.Items.GetByJsonProp(itemKey.Key).Weights = + generationChanges.GetValueOrDefault(itemKey.Key).Weights; + baseBotGeneration.Items.GetByJsonProp(itemKey.Key).Whitelist = + generationChanges.GetValueOrDefault(itemKey.Key).Whitelist; } } @@ -169,7 +194,8 @@ public class BotEquipmentFilterService var blacklistDetailsForBot = _botEquipmentConfig.GetValueOrDefault(botRole, null); return (blacklistDetailsForBot?.Blacklist ?? []).FirstOrDefault(equipmentFilter => - playerLevel >= equipmentFilter.LevelRange.Min && playerLevel <= equipmentFilter.LevelRange.Max + playerLevel >= equipmentFilter.LevelRange.Min + && playerLevel <= equipmentFilter.LevelRange.Max ); } @@ -184,7 +210,8 @@ public class BotEquipmentFilterService var whitelistDetailsForBot = _botEquipmentConfig.GetValueOrDefault(botRole, null); return (whitelistDetailsForBot?.Whitelist ?? []).FirstOrDefault(equipmentFilter => - playerLevel >= equipmentFilter.LevelRange.Min && playerLevel <= equipmentFilter.LevelRange.Max + playerLevel >= equipmentFilter.LevelRange.Min + && playerLevel <= equipmentFilter.LevelRange.Max ); } @@ -198,7 +225,8 @@ public class BotEquipmentFilterService { var weightingDetailsForBot = _botEquipmentConfig.GetValueOrDefault(botRole, null); - return (weightingDetailsForBot?.WeightingAdjustmentsByBotLevel ?? []).FirstOrDefault(x => botLevel >= x.LevelRange.Min && botLevel <= x.LevelRange.Max + return (weightingDetailsForBot?.WeightingAdjustmentsByBotLevel ?? []).FirstOrDefault(x => + botLevel >= x.LevelRange.Min && botLevel <= x.LevelRange.Max ); } @@ -208,7 +236,10 @@ public class BotEquipmentFilterService /// Bot type to get adjustments for /// Level of bot /// Weighting adjustments for bot items - protected WeightingAdjustmentDetails? GetBotWeightingAdjustmentsByPlayerLevel(string botRole, int playerLevel) + protected WeightingAdjustmentDetails? GetBotWeightingAdjustmentsByPlayerLevel( + string botRole, + int playerLevel + ) { var weightingDetailsForBot = _botEquipmentConfig.GetValueOrDefault(botRole, null); @@ -224,7 +255,11 @@ public class BotEquipmentFilterService /// bot .json file to update /// equipment blacklist /// Filtered bot file - protected void FilterEquipment(BotType baseBotNode, EquipmentFilterDetails? blacklist, EquipmentFilterDetails? whitelist) + protected void FilterEquipment( + BotType baseBotNode, + EquipmentFilterDetails? blacklist, + EquipmentFilterDetails? whitelist + ) { if (whitelist is not null) { @@ -233,19 +268,23 @@ public class BotEquipmentFilterService var botEquipment = baseBotNode.BotInventory.Equipment[equipmentSlotKey.Key]; // Skip equipment slot if whitelist doesn't exist / is empty - var whitelistEquipmentForSlot = whitelist.Equipment[equipmentSlotKey.Key.ToString()]; + var whitelistEquipmentForSlot = whitelist.Equipment[ + equipmentSlotKey.Key.ToString() + ]; if (whitelistEquipmentForSlot is null || whitelistEquipmentForSlot.Count == 0) { continue; } // Filter equipment slot items to just items in whitelist - baseBotNode.BotInventory.Equipment[equipmentSlotKey.Key] = new Dictionary(); + baseBotNode.BotInventory.Equipment[equipmentSlotKey.Key] = + new Dictionary(); foreach (var dict in botEquipment) { if (whitelistEquipmentForSlot.Contains(dict.Key)) { - baseBotNode.BotInventory.Equipment[equipmentSlotKey.Key][dict.Key] = botEquipment[dict.Key]; + baseBotNode.BotInventory.Equipment[equipmentSlotKey.Key][dict.Key] = + botEquipment[dict.Key]; } } } @@ -260,7 +299,12 @@ public class BotEquipmentFilterService var botEquipment = baseBotNode.BotInventory.Equipment[equipmentSlotKvP.Key]; // Skip equipment slot if blacklist doesn't exist / is empty - if (!blacklist.Equipment.TryGetValue(equipmentSlotKvP.Key.ToString(), out var equipmentSlotBlacklist)) + if ( + !blacklist.Equipment.TryGetValue( + equipmentSlotKvP.Key.ToString(), + out var equipmentSlotBlacklist + ) + ) { continue; } @@ -289,7 +333,8 @@ public class BotEquipmentFilterService protected void FilterCartridges( BotType baseBotNode, EquipmentFilterDetails? blacklist, - EquipmentFilterDetails? whitelist) + EquipmentFilterDetails? whitelist + ) { if (whitelist is not null) { @@ -297,7 +342,7 @@ public class BotEquipmentFilterService foreach (var (caliber, cartridges) in baseBotNode.BotInventory.Ammo) { if (!whitelist.Cartridge.TryGetValue(caliber, out var matchingWhitelist)) - // No cartridge whitelist, move to next cartridge + // No cartridge whitelist, move to next cartridge { continue; } @@ -305,10 +350,10 @@ public class BotEquipmentFilterService // Loop over each cartridge + weight // Clear all cartridges ready for whitelist to be added foreach (var ammoKvP in cartridges) - // Cartridge not on whitelist + // Cartridge not on whitelist { if (!matchingWhitelist.Contains(ammoKvP.Key)) - // Remove + // Remove { cartridges.Remove(ammoKvP.Key); } @@ -330,8 +375,11 @@ public class BotEquipmentFilterService } // Filter cartridge slot items to just items not in blacklist - foreach (var blacklistedTpl in cartridgeCaliberBlacklist - .Where(blacklistedTpl => cartridgesAndWeights.ContainsKey(blacklistedTpl))) + foreach ( + var blacklistedTpl in cartridgeCaliberBlacklist.Where(blacklistedTpl => + cartridgesAndWeights.ContainsKey(blacklistedTpl) + ) + ) { cartridgesAndWeights.Remove(blacklistedTpl); } @@ -347,7 +395,8 @@ public class BotEquipmentFilterService protected void AdjustWeighting( AdjustmentDetails? weightingAdjustments, Dictionary> botItemPool, - bool showEditWarnings = true) + bool showEditWarnings = true + ) { // TODO: bad typing by key with method below due to, EquipmentSlots if (weightingAdjustments is null) @@ -359,7 +408,9 @@ public class BotEquipmentFilterService { foreach (var poolAdjustmentKvP in weightingAdjustments.Add) { - var locationToUpdate = botItemPool[Enum.Parse(poolAdjustmentKvP.Key)]; + var locationToUpdate = botItemPool[ + Enum.Parse(poolAdjustmentKvP.Key) + ]; foreach (var itemToAddKvP in poolAdjustmentKvP.Value) { locationToUpdate[itemToAddKvP.Key] = itemToAddKvP.Value; @@ -371,11 +422,16 @@ public class BotEquipmentFilterService { foreach (var poolAdjustmentKvP in weightingAdjustments.Edit) { - var locationToUpdate = botItemPool[Enum.Parse(poolAdjustmentKvP.Key)]; + var locationToUpdate = botItemPool[ + Enum.Parse(poolAdjustmentKvP.Key) + ]; foreach (var itemToEditKvP in poolAdjustmentKvP.Value) - // Only make change if item exists as we're editing, not adding + // Only make change if item exists as we're editing, not adding { - if (locationToUpdate[itemToEditKvP.Key] != null || locationToUpdate[itemToEditKvP.Key] == 0) + if ( + locationToUpdate[itemToEditKvP.Key] != null + || locationToUpdate[itemToEditKvP.Key] == 0 + ) { locationToUpdate[itemToEditKvP.Key] = itemToEditKvP.Value; } @@ -385,7 +441,9 @@ public class BotEquipmentFilterService { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}"); + _logger.Debug( + $"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}" + ); } } } @@ -403,7 +461,8 @@ public class BotEquipmentFilterService protected void AdjustWeighting( AdjustmentDetails? weightingAdjustments, Dictionary> botItemPool, - bool showEditWarnings = true) + bool showEditWarnings = true + ) { if (weightingAdjustments is null) { @@ -428,9 +487,12 @@ public class BotEquipmentFilterService { var locationToUpdate = botItemPool[poolAdjustmentKvP.Key]; foreach (var itemToEditKvP in poolAdjustmentKvP.Value) - // Only make change if item exists as we're editing, not adding + // Only make change if item exists as we're editing, not adding { - if (locationToUpdate.GetValueOrDefault(itemToEditKvP.Key) != null || locationToUpdate[itemToEditKvP.Key] == 0) + if ( + locationToUpdate.GetValueOrDefault(itemToEditKvP.Key) != null + || locationToUpdate[itemToEditKvP.Key] == 0 + ) { locationToUpdate[itemToEditKvP.Key] = itemToEditKvP.Value; } @@ -440,7 +502,9 @@ public class BotEquipmentFilterService { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}"); + _logger.Debug( + $"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}" + ); } } } @@ -458,7 +522,8 @@ public class BotEquipmentFilterService protected void AdjustWeighting( AdjustmentDetails? weightingAdjustments, Appearance botItemPool, - bool showEditWarnings = true) + bool showEditWarnings = true + ) { if (weightingAdjustments is null) { @@ -469,7 +534,9 @@ public class BotEquipmentFilterService { foreach (var poolAdjustmentKvP in weightingAdjustments.Add) { - var locationToUpdate = botItemPool.GetByJsonProp>(poolAdjustmentKvP.Key); + var locationToUpdate = botItemPool.GetByJsonProp>( + poolAdjustmentKvP.Key + ); if (locationToUpdate is null) { continue; @@ -486,14 +553,16 @@ public class BotEquipmentFilterService { foreach (var poolAdjustmentKvP in weightingAdjustments.Edit) { - var locationToUpdate = botItemPool.GetByJsonProp>(poolAdjustmentKvP.Key); + var locationToUpdate = botItemPool.GetByJsonProp>( + poolAdjustmentKvP.Key + ); if (locationToUpdate is null) { continue; } foreach (var itemToEditKvP in poolAdjustmentKvP.Value) - // Only make change if item exists as we're editing, not adding + // Only make change if item exists as we're editing, not adding { if (locationToUpdate.ContainsKey(itemToEditKvP.Key)) { @@ -507,7 +576,9 @@ public class BotEquipmentFilterService { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}"); + _logger.Debug( + $"Tried to edit a non - existent item for slot: {poolAdjustmentKvP} {itemToEditKvP}" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Services/BotEquipmentModPoolService.cs b/Libraries/SPTarkov.Server.Core/Services/BotEquipmentModPoolService.cs index 8a29cd49..2326365f 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotEquipmentModPoolService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotEquipmentModPoolService.cs @@ -12,18 +12,31 @@ public class BotEquipmentModPoolService( ISptLogger logger, ItemHelper itemHelper, DatabaseService databaseService, - LocalisationService localisationService) + LocalisationService localisationService +) { private readonly Lock _lockObject = new(); - private ConcurrentDictionary>>? _gearModPool; - protected ConcurrentDictionary>> GearModPool + private ConcurrentDictionary< + string, + ConcurrentDictionary> + >? _gearModPool; + protected ConcurrentDictionary< + string, + ConcurrentDictionary> + > GearModPool { get { return _gearModPool ??= GenerateGearPool(); } } - private ConcurrentDictionary>>? _weaponModPool; - protected ConcurrentDictionary>> WeaponModPool + private ConcurrentDictionary< + string, + ConcurrentDictionary> + >? _weaponModPool; + protected ConcurrentDictionary< + string, + ConcurrentDictionary> + > WeaponModPool { get { return _weaponModPool ??= GenerateWeaponPool(); } } @@ -33,16 +46,22 @@ public class BotEquipmentModPoolService( /// /// Items to find related mods and store in modPool /// Mod pool to choose from e.g. "weapon" for weaponModPool - protected ConcurrentDictionary>> GeneratePool(IEnumerable? inputItems, string poolType) + protected ConcurrentDictionary< + string, + ConcurrentDictionary> + > GeneratePool(IEnumerable? inputItems, string poolType) { if (inputItems is null || !inputItems.Any()) { - logger.Error(localisationService.GetText("bot-unable_to_generate_item_pool_no_items", poolType)); + logger.Error( + localisationService.GetText("bot-unable_to_generate_item_pool_no_items", poolType) + ); return []; } - var pool = new ConcurrentDictionary>>(); + var pool = + new ConcurrentDictionary>>(); foreach (var item in inputItems) { if (item.Properties is null) @@ -50,11 +69,7 @@ public class BotEquipmentModPoolService( logger.Error( localisationService.GetText( "bot-item_missing_props_property", - new - { - itemTpl = item.Id, - name = item.Name - } + new { itemTpl = item.Id, name = item.Name } ) ); @@ -86,7 +101,7 @@ public class BotEquipmentModPoolService( // Does tpl exist inside mod_slots hashset if (!SetContainsTpl(itemModPool[slot.Name], itemToAddTpl)) - // Keyed by mod slot + // Keyed by mod slot { AddTplToSet(itemModPool[slot.Name], itemToAddTpl); } @@ -94,7 +109,7 @@ public class BotEquipmentModPoolService( var subItemDetails = itemHelper.GetItem(itemToAddTpl).Value; var hasSubItemsToAdd = (subItemDetails?.Properties?.Slots?.Count ?? 0) > 0; if (hasSubItemsToAdd && !pool.ContainsKey(subItemDetails.Id)) - // Recursive call + // Recursive call { GeneratePool([subItemDetails], poolType); } @@ -121,7 +136,10 @@ public class BotEquipmentModPoolService( } } - private bool InitSetInDict(ConcurrentDictionary> dictionary, string slotName) + private bool InitSetInDict( + ConcurrentDictionary> dictionary, + string slotName + ) { lock (_lockObject) { @@ -145,7 +163,7 @@ public class BotEquipmentModPoolService( /// Hashset of tpls that fit the slot public HashSet GetCompatibleModsForWeaponSlot(string itemTpl, string slotName) { - if(WeaponModPool.TryGetValue(itemTpl, out var value)) + if (WeaponModPool.TryGetValue(itemTpl, out var value)) { if (value.TryGetValue(slotName, out var tplsForSlotHashSet)) { @@ -164,9 +182,7 @@ public class BotEquipmentModPoolService( /// Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value public ConcurrentDictionary> GetModsForGearSlot(string itemTpl) { - return GearModPool.TryGetValue(itemTpl, out var value) - ? value - : []; + return GearModPool.TryGetValue(itemTpl, out var value) ? value : []; } /// @@ -176,9 +192,7 @@ public class BotEquipmentModPoolService( /// Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value public ConcurrentDictionary> GetModsForWeaponSlot(string itemTpl) { - return WeaponModPool.TryGetValue(itemTpl, out var value) - ? value - : []; + return WeaponModPool.TryGetValue(itemTpl, out var value) ? value : []; } /// @@ -193,9 +207,13 @@ public class BotEquipmentModPoolService( // Get item from db var itemDb = itemHelper.GetItem(itemTpl).Value; if (itemDb.Properties.Slots is not null) - // Loop over slots flagged as 'required' + // Loop over slots flagged as 'required' { - foreach (var slot in itemDb.Properties.Slots.Where(slot => slot.Required.GetValueOrDefault(false))) + foreach ( + var slot in itemDb.Properties.Slots.Where(slot => + slot.Required.GetValueOrDefault(false) + ) + ) { // Create dict entry for mod slot result.TryAdd(slot.Name, []); @@ -214,11 +232,16 @@ public class BotEquipmentModPoolService( /// /// Create weapon mod pool and set generated flag to true /// - protected ConcurrentDictionary>> GenerateWeaponPool() + protected ConcurrentDictionary< + string, + ConcurrentDictionary> + > GenerateWeaponPool() { - var weapons = databaseService.GetItems() - .Values.Where(item => string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase) && - itemHelper.IsOfBaseclass(item.Id, BaseClasses.WEAPON) + var weapons = databaseService + .GetItems() + .Values.Where(item => + string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase) + && itemHelper.IsOfBaseclass(item.Id, BaseClasses.WEAPON) ); return GeneratePool(weapons, "weapon"); @@ -227,19 +250,24 @@ public class BotEquipmentModPoolService( /// /// Create gear mod pool and set generated flag to true /// - protected ConcurrentDictionary>> GenerateGearPool() + protected ConcurrentDictionary< + string, + ConcurrentDictionary> + > GenerateGearPool() { - var gear = databaseService.GetItems() - .Values.Where(item => string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase) && - itemHelper.IsOfBaseclasses( - item.Id, - [ - BaseClasses.ARMORED_EQUIPMENT, - BaseClasses.VEST, - BaseClasses.ARMOR, - BaseClasses.HEADWEAR - ] - ) + var gear = databaseService + .GetItems() + .Values.Where(item => + string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase) + && itemHelper.IsOfBaseclasses( + item.Id, + [ + BaseClasses.ARMORED_EQUIPMENT, + BaseClasses.VEST, + BaseClasses.ARMOR, + BaseClasses.HEADWEAR, + ] + ) ); return GeneratePool(gear, "gear"); diff --git a/Libraries/SPTarkov.Server.Core/Services/BotGenerationCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/BotGenerationCacheService.cs index 5c4f95a7..42eab3ea 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotGenerationCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotGenerationCacheService.cs @@ -15,7 +15,6 @@ public class BotGenerationCacheService( protected Queue _activeBotsInRaid = []; protected ConcurrentDictionary> _storedBots = new(); - /// /// Store list of bots in cache, shuffle results before storage /// @@ -50,12 +49,19 @@ public class BotGenerationCacheService( } catch (Exception e) { - _logger.Error(_localisationService.GetText("bot-cache_has_zero_bots_of_requested_type", key)); + _logger.Error( + _localisationService.GetText( + "bot-cache_has_zero_bots_of_requested_type", + key + ) + ); _logger.Error(e.StackTrace); } } - _logger.Error(_localisationService.GetText("bot-cache_has_zero_bots_of_requested_type", key)); + _logger.Error( + _localisationService.GetText("bot-cache_has_zero_bots_of_requested_type", key) + ); return null; } diff --git a/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs index 8d81188a..7176c965 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs @@ -53,7 +53,8 @@ public class BotLootCacheService( bool isPmc, string lootType, BotType botJsonTemplate, - MinMax? itemPriceMinMax = null) + MinMax? itemPriceMinMax = null + ) { if (!BotRoleExistsInCache(botRole)) { @@ -61,7 +62,7 @@ public class BotLootCacheService( AddLootToCache(botRole, isPmc, botJsonTemplate); } - if(!_lootCache.TryGetValue(botRole, out var botRoleCache)) + if (!_lootCache.TryGetValue(botRole, out var botRoleCache)) { _logger.Error($"Unable to find: {botRole} in loot cache"); return []; @@ -117,7 +118,7 @@ public class BotLootCacheService( { lootType, botRole, - isPmc + isPmc, } ) ); @@ -139,29 +140,27 @@ public class BotLootCacheService( // Filter the loot pool prior to returning var filteredResult = result.Where(i => + { + var itemPrice = _itemHelper.GetItemPrice(i.Key); + if (itemPriceMinMax?.Min is not null && itemPriceMinMax?.Max is not null) { - var itemPrice = _itemHelper.GetItemPrice(i.Key); - if (itemPriceMinMax?.Min is not null && itemPriceMinMax?.Max is not null) - { - return itemPrice >= itemPriceMinMax?.Min && itemPrice <= itemPriceMinMax?.Max; - } - - if (itemPriceMinMax?.Min is not null && itemPriceMinMax?.Max is null) - { - return itemPrice >= itemPriceMinMax?.Min; - } - - if (itemPriceMinMax?.Min is null && itemPriceMinMax?.Max is not null) - { - return itemPrice <= itemPriceMinMax?.Max; - } - - return false; + return itemPrice >= itemPriceMinMax?.Min && itemPrice <= itemPriceMinMax?.Max; } - ); + + if (itemPriceMinMax?.Min is not null && itemPriceMinMax?.Max is null) + { + return itemPrice >= itemPriceMinMax?.Min; + } + + if (itemPriceMinMax?.Min is null && itemPriceMinMax?.Max is not null) + { + return itemPrice <= itemPriceMinMax?.Max; + } + + return false; + }); return _cloner.Clone(filteredResult.ToDictionary(pair => pair.Key, pair => pair.Value)); - } /// @@ -186,22 +185,24 @@ public class BotLootCacheService( if (isPmc) { // Replace lootPool from bot json with our own generated list for PMCs - lootPool.Backpack = _cloner.Clone(_pmcLootGenerator.GeneratePMCBackpackLootPool(botRole)); + lootPool.Backpack = _cloner.Clone( + _pmcLootGenerator.GeneratePMCBackpackLootPool(botRole) + ); lootPool.Pockets = _cloner.Clone(_pmcLootGenerator.GeneratePMCPocketLootPool(botRole)); - lootPool.TacticalVest = _cloner.Clone(_pmcLootGenerator.GeneratePMCVestLootPool(botRole)); + lootPool.TacticalVest = _cloner.Clone( + _pmcLootGenerator.GeneratePMCVestLootPool(botRole) + ); } // Backpack/Pockets etc - var poolsToProcess = - new Dictionary> - { - { "Backpack", lootPool.Backpack }, - { "Pockets", lootPool.Pockets }, - { "SecuredContainer", lootPool.SecuredContainer }, - { "SpecialLoot", lootPool.SpecialLoot }, - { "TacticalVest", lootPool.TacticalVest } - }; - + var poolsToProcess = new Dictionary> + { + { "Backpack", lootPool.Backpack }, + { "Pockets", lootPool.Pockets }, + { "SecuredContainer", lootPool.SecuredContainer }, + { "SpecialLoot", lootPool.SpecialLoot }, + { "TacticalVest", lootPool.TacticalVest }, + }; foreach (var (containerType, itemPool) in poolsToProcess) { @@ -235,7 +236,10 @@ public class BotLootCacheService( } // If pool has items and items were going into a non-secure container pool, add to combined - if (itemPool.Count > 0 && !containerType.Equals("securedcontainer", StringComparison.OrdinalIgnoreCase)) + if ( + itemPool.Count > 0 + && !containerType.Equals("securedcontainer", StringComparison.OrdinalIgnoreCase) + ) { // fill up 'combined' pool of all loot AddItemsToPool(combinedLootPool, itemPool); @@ -243,14 +247,21 @@ public class BotLootCacheService( } // Assign whitelisted special items to bot if any exist - var (specialLootItems, addSpecialLootItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.SpecialItems?.Whitelist); + var (specialLootItems, addSpecialLootItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.SpecialItems?.Whitelist + ); if (addSpecialLootItems) // key = tpl, value = weight { // No whitelist, find and assign from combined item pool foreach (var itemKvP in specialLootPool) { var itemTemplate = _itemHelper.GetItem(itemKvP.Key).Value; - if (!(IsBulletOrGrenade(itemTemplate.Properties) || IsMagazine(itemTemplate.Properties))) + if ( + !( + IsBulletOrGrenade(itemTemplate.Properties) + || IsMagazine(itemTemplate.Properties) + ) + ) { lock (_specialLock) { @@ -260,13 +271,27 @@ public class BotLootCacheService( } } - var (healingItemsInWhitelist, addHealingItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Healing?.Whitelist); - var (drugItemsInWhitelist, addDrugItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Drugs?.Whitelist); - var (foodItemsInWhitelist, addFoodItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Food?.Whitelist); - var (drinkItemsInWhitelist, addDrinkItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Food?.Whitelist); - var (currencyItemsInWhitelist, addCurrencyItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Currency?.Whitelist); - var (stimItemsInWhitelist, addStimItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Stims?.Whitelist); - var (grenadeItemsInWhitelist, addGrenadeItems) = GetGenerationWeights(botJsonTemplate.BotGeneration?.Items?.Grenades?.Whitelist); + var (healingItemsInWhitelist, addHealingItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Healing?.Whitelist + ); + var (drugItemsInWhitelist, addDrugItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Drugs?.Whitelist + ); + var (foodItemsInWhitelist, addFoodItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Food?.Whitelist + ); + var (drinkItemsInWhitelist, addDrinkItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Food?.Whitelist + ); + var (currencyItemsInWhitelist, addCurrencyItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Currency?.Whitelist + ); + var (stimItemsInWhitelist, addStimItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Stims?.Whitelist + ); + var (grenadeItemsInWhitelist, addGrenadeItems) = GetGenerationWeights( + botJsonTemplate.BotGeneration?.Items?.Grenades?.Whitelist + ); foreach (var itemKvP in combinedLootPool) { @@ -280,9 +305,9 @@ public class BotLootCacheService( { // Whitelist has no healing items, hydrate it using items from combinedLootPool that meet criteria if ( - IsMedicalItem(itemTemplate.Properties) && - itemTemplate.Parent != BaseClasses.STIMULATOR && - itemTemplate.Parent != BaseClasses.DRUGS + IsMedicalItem(itemTemplate.Properties) + && itemTemplate.Parent != BaseClasses.STIMULATOR + && itemTemplate.Parent != BaseClasses.DRUGS ) { lock (_healingLock) @@ -294,7 +319,10 @@ public class BotLootCacheService( if (addDrugItems) { - if (itemTemplate.Parent == BaseClasses.DRUGS && IsMedicalItem(itemTemplate.Properties)) + if ( + itemTemplate.Parent == BaseClasses.DRUGS + && IsMedicalItem(itemTemplate.Properties) + ) { lock (_drugLock) { @@ -338,7 +366,10 @@ public class BotLootCacheService( if (addStimItems) { - if (itemTemplate.Parent == BaseClasses.STIMULATOR && IsMedicalItem(itemTemplate.Properties)) + if ( + itemTemplate.Parent == BaseClasses.STIMULATOR + && IsMedicalItem(itemTemplate.Properties) + ) { lock (_stimLock) { @@ -360,26 +391,33 @@ public class BotLootCacheService( } // Get backpack loot (excluding magazines, bullets, grenades, drink, food and healing/stim items) - var filteredBackpackItems = FilterItemPool(backpackLootPool, (itemTemplate) => - IsBulletOrGrenade(itemTemplate.Properties) || - IsMagazine(itemTemplate.Properties) || - IsMedicalItem(itemTemplate.Properties) || - IsGrenade(itemTemplate.Properties) || - IsFood(itemTemplate.Id) || - IsDrink(itemTemplate.Id) || - IsCurrency(itemTemplate.Id)); + var filteredBackpackItems = FilterItemPool( + backpackLootPool, + (itemTemplate) => + IsBulletOrGrenade(itemTemplate.Properties) + || IsMagazine(itemTemplate.Properties) + || IsMedicalItem(itemTemplate.Properties) + || IsGrenade(itemTemplate.Properties) + || IsFood(itemTemplate.Id) + || IsDrink(itemTemplate.Id) + || IsCurrency(itemTemplate.Id) + ); // Get pocket loot (excluding magazines, bullets, grenades, drink, food medical and healing/stim items) - var filteredPocketItems = FilterItemPool(pocketLootPool, (itemTemplate) => - IsBulletOrGrenade(itemTemplate.Properties) || - IsMagazine(itemTemplate.Properties) || - IsMedicalItem(itemTemplate.Properties) || - IsGrenade(itemTemplate.Properties) || - IsFood(itemTemplate.Id) || - IsDrink(itemTemplate.Id) || - IsCurrency(itemTemplate.Id) || - itemTemplate.Properties.Height is null || // lacks height - itemTemplate.Properties.Width is null); // lacks width + var filteredPocketItems = FilterItemPool( + pocketLootPool, + (itemTemplate) => + IsBulletOrGrenade(itemTemplate.Properties) + || IsMagazine(itemTemplate.Properties) + || IsMedicalItem(itemTemplate.Properties) + || IsGrenade(itemTemplate.Properties) + || IsFood(itemTemplate.Id) + || IsDrink(itemTemplate.Id) + || IsCurrency(itemTemplate.Id) + || itemTemplate.Properties.Height is null + || // lacks height + itemTemplate.Properties.Width is null + ); // lacks width // Get vest loot (excluding magazines, bullets, grenades, medical and healing/stim items) var filteredVestItems = new Dictionary(); @@ -393,13 +431,13 @@ public class BotLootCacheService( var itemTemplate = itemResult.Value; if ( - IsBulletOrGrenade(itemTemplate.Properties) || - IsMagazine(itemTemplate.Properties) || - IsMedicalItem(itemTemplate.Properties) || - IsGrenade(itemTemplate.Properties) || - IsFood(itemTemplate.Id) || - IsDrink(itemTemplate.Id) || - IsCurrency(itemTemplate.Id) + IsBulletOrGrenade(itemTemplate.Properties) + || IsMagazine(itemTemplate.Properties) + || IsMedicalItem(itemTemplate.Properties) + || IsGrenade(itemTemplate.Properties) + || IsFood(itemTemplate.Id) + || IsDrink(itemTemplate.Id) + || IsCurrency(itemTemplate.Id) ) { continue; @@ -409,11 +447,13 @@ public class BotLootCacheService( } // Get secure loot (excluding magazines, bullets) - var filteredSecureLoot = FilterItemPool(secureLootPool, (itemTemplate) => - IsBulletOrGrenade(itemTemplate.Properties) || - IsMagazine(itemTemplate.Properties)); + var filteredSecureLoot = FilterItemPool( + secureLootPool, + (itemTemplate) => + IsBulletOrGrenade(itemTemplate.Properties) || IsMagazine(itemTemplate.Properties) + ); - if(!_lootCache.TryGetValue(botRole, out var cacheForRole)) + if (!_lootCache.TryGetValue(botRole, out var cacheForRole)) { _logger.Error($"Unable to get loot cache value using key: {botRole}"); @@ -440,7 +480,10 @@ public class BotLootCacheService( /// Pool to filter /// Delegate to filter pool by /// - protected Dictionary FilterItemPool(Dictionary lootPool, Func shouldBeSkipped) + protected Dictionary FilterItemPool( + Dictionary lootPool, + Func shouldBeSkipped + ) { var filteredItems = new Dictionary(); foreach (var (itemTpl, itemWeight) in lootPool) @@ -467,7 +510,10 @@ public class BotLootCacheService( /// /// Weights to return /// Dictionary and should pool be hydrated by items in combined loot pool - protected static (Dictionary, bool populateFromCombinedPool) GetGenerationWeights(Dictionary? weights) + protected static ( + Dictionary, + bool populateFromCombinedPool + ) GetGenerationWeights(Dictionary? weights) { var result = weights ?? []; return (result, !result.Any()); // empty dict = should be populated from combined pool @@ -479,7 +525,10 @@ public class BotLootCacheService( /// /// Dictionary to add item to /// Dictionary of items to add - protected void AddItemsToPool(Dictionary poolToAddTo, Dictionary poolOfItemsToAdd) + protected void AddItemsToPool( + Dictionary poolToAddTo, + Dictionary poolOfItemsToAdd + ) { foreach (var (tpl, weight) in poolOfItemsToAdd) { diff --git a/Libraries/SPTarkov.Server.Core/Services/BotNameService.cs b/Libraries/SPTarkov.Server.Core/Services/BotNameService.cs index fe4682a9..e849e5f1 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotNameService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotNameService.cs @@ -44,12 +44,15 @@ public class BotNameService( BotType botJsonTemplate, BotGenerationDetails botGenerationDetails, string botRole, - HashSet? uniqueRoles = null) + HashSet? uniqueRoles = null + ) { var isPmc = botGenerationDetails.IsPmc; // Never show for players - var showTypeInNickname = !botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) && _botConfig.ShowTypeInNickname; + var showTypeInNickname = + !botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) + && _botConfig.ShowTypeInNickname; var roleShouldBeUnique = uniqueRoles?.Contains(botRole.ToLower()); var attempts = 0; @@ -57,7 +60,10 @@ public class BotNameService( { // Get bot name with leading/trailing whitespace removed var name = isPmc.GetValueOrDefault(false) // Explicit handling of PMCs, all other bots will get "first_name last_name" - ? _botHelper.GetPmcNicknameOfMaxLength(_botConfig.BotNameLengthLimit, botGenerationDetails.Side) + ? _botHelper.GetPmcNicknameOfMaxLength( + _botConfig.BotNameLengthLimit, + botGenerationDetails.Side + ) : $"{_randomUtil.GetArrayValue(botJsonTemplate.FirstNames)} {(botJsonTemplate.LastNames.Count > 0 ? _randomUtil.GetArrayValue(botJsonTemplate.LastNames) : "")}"; name = name.Trim(); @@ -69,15 +75,20 @@ public class BotNameService( } // Replace pmc bot names with player name + prefix - if (botGenerationDetails.IsPmc.GetValueOrDefault(false) && botGenerationDetails.AllPmcsHaveSameNameAsPlayer.GetValueOrDefault(false)) + if ( + botGenerationDetails.IsPmc.GetValueOrDefault(false) + && botGenerationDetails.AllPmcsHaveSameNameAsPlayer.GetValueOrDefault(false) + ) { - var prefix = _localisationService.GetRandomTextThatMatchesPartialKey("pmc-name_prefix_"); + var prefix = _localisationService.GetRandomTextThatMatchesPartialKey( + "pmc-name_prefix_" + ); name = $"{prefix} {name}"; } // Is this a role that must be unique if (roleShouldBeUnique.GetValueOrDefault(false)) - // Check name in cache + // Check name in cache { if (CacheContainsName(name)) { @@ -85,10 +96,13 @@ public class BotNameService( if (attempts >= 5) { // 5 attempts to generate a name, pool probably isn't big enough - var genericName = $"{botGenerationDetails.Side} {_randomUtil.GetInt(100000, 999999)}"; + var genericName = + $"{botGenerationDetails.Side} {_randomUtil.GetInt(100000, 999999)}"; if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Failed to find unique name for: {botRole} {botGenerationDetails.Side} after 5 attempts, using: {genericName}"); + _logger.Debug( + $"Failed to find unique name for: {botRole} {botGenerationDetails.Side} after 5 attempts, using: {genericName}" + ); } return genericName; diff --git a/Libraries/SPTarkov.Server.Core/Services/BotWeaponModLimitService.cs b/Libraries/SPTarkov.Server.Core/Services/BotWeaponModLimitService.cs index 1eaf775c..833f33dc 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotWeaponModLimitService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotWeaponModLimitService.cs @@ -28,10 +28,7 @@ public class BotWeaponModLimitService( { return new BotModLimits { - Scope = new ItemCount - { - Count = 0 - }, + Scope = new ItemCount { Count = 0 }, ScopeMax = _botConfig.Equipment[botRole]?.WeaponModLimits?.ScopeLimit, ScopeBaseTypes = [ @@ -39,19 +36,16 @@ public class BotWeaponModLimitService( BaseClasses.ASSAULT_SCOPE, BaseClasses.COLLIMATOR, BaseClasses.COMPACT_COLLIMATOR, - BaseClasses.SPECIAL_SCOPE + BaseClasses.SPECIAL_SCOPE, ], - FlashlightLaser = new ItemCount - { - Count = 0 - }, + FlashlightLaser = new ItemCount { Count = 0 }, FlashlightLaserMax = _botConfig.Equipment[botRole]?.WeaponModLimits?.LightLaserLimit, FlashlightLaserBaseTypes = [ BaseClasses.TACTICAL_COMBO, BaseClasses.FLASHLIGHT, - BaseClasses.PORTABLE_RANGE_FINDER - ] + BaseClasses.PORTABLE_RANGE_FINDER, + ], }; } @@ -73,22 +67,28 @@ public class BotWeaponModLimitService( TemplateItem modTemplate, BotModLimits modLimits, TemplateItem modsParent, - List weapon) + List weapon + ) { // If mod or mods parent is the NcSTAR MPR45 Backup mount, allow it as it looks cool - if (modsParent.Id == ItemTpl.MOUNT_NCSTAR_MPR45_BACKUP || modTemplate.Id == ItemTpl.MOUNT_NCSTAR_MPR45_BACKUP) + if ( + modsParent.Id == ItemTpl.MOUNT_NCSTAR_MPR45_BACKUP + || modTemplate.Id == ItemTpl.MOUNT_NCSTAR_MPR45_BACKUP + ) { // If weapon already has a longer ranged scope on it, allow ncstar to be spawned - if (weapon.Any(item => + if ( + weapon.Any(item => _itemHelper.IsOfBaseclasses( item.Template, [ BaseClasses.ASSAULT_SCOPE, BaseClasses.OPTIC_SCOPE, - BaseClasses.SPECIAL_SCOPE + BaseClasses.SPECIAL_SCOPE, ] ) - )) + ) + ) { return false; } @@ -106,7 +106,12 @@ public class BotWeaponModLimitService( // If mod is a scope , Exit early if (modIsScope) { - return WeaponModLimitReached(modTemplate.Id, modLimits.Scope, modLimits.ScopeMax ?? 0, botRole); + return WeaponModLimitReached( + modTemplate.Id, + modLimits.Scope, + modLimits.ScopeMax ?? 0, + botRole + ); } // Don't allow multple mounts on a weapon (except when mount is on another mount) @@ -114,18 +119,22 @@ public class BotWeaponModLimitService( // Over or at scope limit on weapon // Item being added is a mount but the parent item is NOT a mount (Allows red dot sub-mounts on mounts) // Mount has one slot and its for a mod_scope - if (modLimits.Scope.Count >= modLimits.ScopeMax && - modTemplate.Properties.Slots?.Count == 1 && - _itemHelper.IsOfBaseclass(modTemplate.Id, BaseClasses.MOUNT) && - !_itemHelper.IsOfBaseclass(modsParent.Id, BaseClasses.MOUNT) && - modTemplate.Properties.Slots.Any(slot => slot.Name == "mod_scope") - ) + if ( + modLimits.Scope.Count >= modLimits.ScopeMax + && modTemplate.Properties.Slots?.Count == 1 + && _itemHelper.IsOfBaseclass(modTemplate.Id, BaseClasses.MOUNT) + && !_itemHelper.IsOfBaseclass(modsParent.Id, BaseClasses.MOUNT) + && modTemplate.Properties.Slots.Any(slot => slot.Name == "mod_scope") + ) { return true; } // If mod is a light/laser, return if limit reached - var modIsLightOrLaser = _itemHelper.IsOfBaseclasses(modTemplate.Id, modLimits.FlashlightLaserBaseTypes); + var modIsLightOrLaser = _itemHelper.IsOfBaseclasses( + modTemplate.Id, + modLimits.FlashlightLaserBaseTypes + ); if (modIsLightOrLaser) { return WeaponModLimitReached( @@ -137,11 +146,12 @@ public class BotWeaponModLimitService( } // Mod is a mount that can hold only flashlights ad limit is reached (don't want to add empty mounts if limit is reached) - if (modLimits.Scope.Count >= modLimits.ScopeMax && - modTemplate.Properties.Slots?.Count == 1 && - _itemHelper.IsOfBaseclass(modTemplate.Id, BaseClasses.MOUNT) && - modTemplate.Properties.Slots.Any(slot => slot.Name == "mod_flashlight") - ) + if ( + modLimits.Scope.Count >= modLimits.ScopeMax + && modTemplate.Properties.Slots?.Count == 1 + && _itemHelper.IsOfBaseclass(modTemplate.Id, BaseClasses.MOUNT) + && modTemplate.Properties.Slots.Any(slot => slot.Name == "mod_flashlight") + ) { return true; } @@ -161,7 +171,8 @@ public class BotWeaponModLimitService( string modTpl, ItemCount currentCount, int? maxLimit, - string botRole) + string botRole + ) { // No value or 0 if (maxLimit is null || maxLimit is 0) @@ -174,7 +185,9 @@ public class BotWeaponModLimitService( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"[{botRole}] scope limit reached! tried to add {modTpl} but scope count is {currentCount.Count}"); + _logger.Debug( + $"[{botRole}] scope limit reached! tried to add {modTpl} but scope count is {currentCount.Count}" + ); } return true; diff --git a/Libraries/SPTarkov.Server.Core/Services/BtrDeliveryService.cs b/Libraries/SPTarkov.Server.Core/Services/BtrDeliveryService.cs index f26d195f..36ada693 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BtrDeliveryService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BtrDeliveryService.cs @@ -27,11 +27,7 @@ public class BtrDeliveryService( protected BtrDeliveryConfig _btrDeliveryConfig = _configServer.GetConfig(); protected TraderConfig _traderConfig = _configServer.GetConfig(); - protected static List _transferTypes = new() - { - "btr", - "transit" - }; + protected static List _transferTypes = new() { "btr", "transit" }; /// /// Check if player used BTR or transit item sending service and send items to player via mail if found @@ -70,8 +66,8 @@ public class BtrDeliveryService( // Remove any items that were returned by the item delivery, but also insured, from the player's insurance list // This is to stop items being duplicated by being returned from both item delivery and insurance var deliveredItemIds = items.Select(item => item.Id); - pmcData.InsuredItems = pmcData.InsuredItems - .Where(insuredItem => !deliveredItemIds.Contains(insuredItem.ItemId)) + pmcData.InsuredItems = pmcData + .InsuredItems.Where(insuredItem => !deliveredItemIds.Contains(insuredItem.ItemId)) .ToList(); if (_saveServer.GetProfile(sessionId).BtrDeliveryList == null) @@ -80,12 +76,14 @@ public class BtrDeliveryService( } // Store delivery to send to player later in profile - _saveServer.GetProfile(sessionId).BtrDeliveryList.Add( + _saveServer + .GetProfile(sessionId) + .BtrDeliveryList.Add( new BtrDelivery { Id = _hashUtil.Generate(), - ScheduledTime = (int) GetBTRDeliveryReturnTimestamp(), - Items = items + ScheduledTime = (int)GetBTRDeliveryReturnTimestamp(), + Items = items, } ); } @@ -95,19 +93,31 @@ public class BtrDeliveryService( var dialogueTemplates = _databaseService.GetTrader(Traders.BTR).Dialogue; if (dialogueTemplates is null) { - _logger.Error(_localisationService.GetText("inraid-unable_to_deliver_item_no_trader_found", Traders.BTR)); + _logger.Error( + _localisationService.GetText( + "inraid-unable_to_deliver_item_no_trader_found", + Traders.BTR + ) + ); return; } if (!dialogueTemplates.TryGetValue("itemsDelivered", out var itemsDelivered)) { - _logger.Error(_localisationService.GetText("btr-unable_to_find_items_in_dialog_template", sessionId)); + _logger.Error( + _localisationService.GetText( + "btr-unable_to_find_items_in_dialog_template", + sessionId + ) + ); return; } var messageId = _randomUtil.GetArrayValue(itemsDelivered); - var messageStoreTime = _timeUtil.GetHoursAsSeconds(_traderConfig.Fence.BtrDeliveryExpireHours); + var messageStoreTime = _timeUtil.GetHoursAsSeconds( + _traderConfig.Fence.BtrDeliveryExpireHours + ); // Send the items to the player _mailSendService.SendLocalisedNpcMessageToPlayer( @@ -128,13 +138,15 @@ public class BtrDeliveryService( public void RemoveBTRDeliveryPackageFromProfile(string sessionId, BtrDelivery delivery) { var profile = _saveServer.GetProfile(sessionId); - profile.BtrDeliveryList = profile.BtrDeliveryList - .Where(package => package.Id != delivery.Id) + profile.BtrDeliveryList = profile + .BtrDeliveryList.Where(package => package.Id != delivery.Id) .ToList(); if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Removed processed BTR delivery package. Remaining packages: {profile.BtrDeliveryList.Count}"); + _logger.Debug( + $"Removed processed BTR delivery package. Remaining packages: {profile.BtrDeliveryList.Count}" + ); } } @@ -149,7 +161,9 @@ public class BtrDeliveryService( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"BTR delivery override used: returning in {_btrDeliveryConfig.ReturnTimeOverrideSeconds} seconds"); + _logger.Debug( + $"BTR delivery override used: returning in {_btrDeliveryConfig.ReturnTimeOverrideSeconds} seconds" + ); } return _timeUtil.GetTimeStamp() + _btrDeliveryConfig.ReturnTimeOverrideSeconds; diff --git a/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs index ac355d13..4f60b342 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs @@ -19,7 +19,8 @@ public class BundleHashCacheService ISptLogger logger, JsonUtil jsonUtil, HashUtil hashUtil, - FileUtil fileUtil) + FileUtil fileUtil + ) { _logger = logger; _jsonUtil = jsonUtil; @@ -46,7 +47,10 @@ public class BundleHashCacheService Directory.CreateDirectory(_bundleHashCachePath); } - _fileUtil.WriteFile(Path.Join(_bundleHashCachePath, _cacheName), _jsonUtil.Serialize(_bundleHashes)); + _fileUtil.WriteFile( + Path.Join(_bundleHashCachePath, _cacheName), + _jsonUtil.Serialize(_bundleHashes) + ); _logger.Debug($"Bundle: {bundlePath} hash stored in: ${_bundleHashCachePath}"); } diff --git a/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs b/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs index 01d222d0..1ec06090 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs @@ -61,7 +61,9 @@ public class CircleOfCultistService( { var output = _eventOutputHolder.GetOutput(sessionId); - var cultistCircleStashId = pmcData.Inventory?.HideoutAreaStashes?.GetValueOrDefault(((int)HideoutAreas.CircleOfCultists).ToString()); + var cultistCircleStashId = pmcData.Inventory?.HideoutAreaStashes?.GetValueOrDefault( + ((int)HideoutAreas.CircleOfCultists).ToString() + ); if (cultistCircleStashId is null) { _logger.Error(localisationService.GetText("cultistcircle-unable_to_find_stash_id")); @@ -70,21 +72,32 @@ public class CircleOfCultistService( } // `cultistRecipes` just has single recipeId - var cultistCraftData = _databaseService.GetHideout().Production.CultistRecipes.FirstOrDefault(); + var cultistCraftData = _databaseService + .GetHideout() + .Production.CultistRecipes.FirstOrDefault(); var sacrificedItems = GetSacrificedItems(pmcData); var sacrificedItemCostRoubles = sacrificedItems.Aggregate( 0D, (sum, curr) => sum + (_itemHelper.GetItemPrice(curr.Template) ?? 0) ); - var rewardAmountMultiplier = GetRewardAmountMultiplier(pmcData, _hideoutConfig.CultistCircle); + var rewardAmountMultiplier = GetRewardAmountMultiplier( + pmcData, + _hideoutConfig.CultistCircle + ); // Get the rouble amount we generate rewards with from cost of sacrificed items * above multiplier var rewardAmountRoubles = Math.Round(sacrificedItemCostRoubles * rewardAmountMultiplier); // Check if it matches any direct swap recipes - var directRewardsCache = GenerateSacrificedItemsCache(_hideoutConfig.CultistCircle.DirectRewards); - var directRewardSettings = CheckForDirectReward(sessionId, sacrificedItems, directRewardsCache); + var directRewardsCache = GenerateSacrificedItemsCache( + _hideoutConfig.CultistCircle.DirectRewards + ); + var directRewardSettings = CheckForDirectReward( + sessionId, + sacrificedItems, + directRewardsCache + ); var hasDirectReward = directRewardSettings?.Reward.Count > 0; // Get craft time and bonus status @@ -115,18 +128,32 @@ public class CircleOfCultistService( var rewards = hasDirectReward ? GetDirectRewards(sessionId, directRewardSettings, cultistCircleStashId) : GetRewardsWithinBudget( - GetCultistCircleRewardPool(sessionId, pmcData, craftingInfo, _hideoutConfig.CultistCircle), + GetCultistCircleRewardPool( + sessionId, + pmcData, + craftingInfo, + _hideoutConfig.CultistCircle + ), rewardAmountRoubles, cultistCircleStashId, _hideoutConfig.CultistCircle ); // Get the container grid for cultist stash area - var cultistStashDbItem = _itemHelper.GetItem(ItemTpl.HIDEOUTAREACONTAINER_CIRCLEOFCULTISTS_STASH_1); + var cultistStashDbItem = _itemHelper.GetItem( + ItemTpl.HIDEOUTAREACONTAINER_CIRCLEOFCULTISTS_STASH_1 + ); // Ensure rewards fit into container var containerGrid = _inventoryHelper.GetContainerSlotMap(cultistStashDbItem.Value.Id); - AddRewardsToCircleContainer(sessionId, pmcData, rewards, containerGrid, cultistCircleStashId, output); + AddRewardsToCircleContainer( + sessionId, + pmcData, + rewards, + containerGrid, + cultistCircleStashId, + output + ); return output; } @@ -137,7 +164,10 @@ public class CircleOfCultistService( /// Player profile /// Circle config settings /// Reward Amount Multiplier - private double GetRewardAmountMultiplier(PmcData pmcData, CultistCircleSettings cultistCircleSettings) + private double GetRewardAmountMultiplier( + PmcData pmcData, + CultistCircleSettings cultistCircleSettings + ) { // Get a randomised value to multiply the sacrificed rouble cost by var rewardAmountMultiplier = _randomUtil.GetDouble( @@ -146,11 +176,13 @@ public class CircleOfCultistService( ); // Adjust value generated by the players hideout management skill - var hideoutManagementSkill = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.HideoutManagement); + var hideoutManagementSkill = _profileHelper.GetSkillFromProfile( + pmcData, + SkillTypes.HideoutManagement + ); if (hideoutManagementSkill is not null) { - rewardAmountMultiplier *= - (float) (1 + hideoutManagementSkill.Progress / 10000); // 5100 becomes 0.51, add 1 to it, 1.51, multiply the bonus by it (e.g. 1.2 x 1.51) + rewardAmountMultiplier *= (float)(1 + hideoutManagementSkill.Progress / 10000); // 5100 becomes 0.51, add 1 to it, 1.51, multiply the bonus by it (e.g. 1.2 x 1.51) } return rewardAmountMultiplier; @@ -203,8 +235,8 @@ public class CircleOfCultistService( { Time = -1, RewardType = CircleRewardType.RANDOM, - RewardAmountRoubles = (int) rewardAmountRoubles, - RewardDetails = null + RewardAmountRoubles = (int)rewardAmountRoubles, + RewardDetails = null, }; // Direct reward edge case @@ -218,10 +250,13 @@ public class CircleOfCultistService( var random = new Random(); // Get a threshold where sacrificed amount is between thresholds min and max - var matchingThreshold = GetMatchingThreshold(circleConfig.CraftTimeThreshholds, rewardAmountRoubles); + var matchingThreshold = GetMatchingThreshold( + circleConfig.CraftTimeThreshholds, + rewardAmountRoubles + ); if ( - rewardAmountRoubles >= circleConfig.HideoutCraftSacrificeThresholdRub && - random.Next(0, 1) <= circleConfig.BonusChanceMultiplier + rewardAmountRoubles >= circleConfig.HideoutCraftSacrificeThresholdRub + && random.Next(0, 1) <= circleConfig.BonusChanceMultiplier ) { // Sacrifice amount is enough + passed 25% check to get hideout/task rewards @@ -236,7 +271,9 @@ public class CircleOfCultistService( // Edge case, check if override exists, Otherwise use matching threshold craft time result.Time = - circleConfig.CraftTimeOverride != -1 ? circleConfig.CraftTimeOverride : matchingThreshold.CraftTimeSeconds; + circleConfig.CraftTimeOverride != -1 + ? circleConfig.CraftTimeOverride + : matchingThreshold.CraftTimeSeconds; result.RewardDetails = matchingThreshold; @@ -257,19 +294,24 @@ public class CircleOfCultistService( { // None found, use a default _logger.Warning( - localisationService.GetText("cultistcircle-no_matching_threshhold_found", new { rewardAmountRoubles = rewardAmountRoubles })); + localisationService.GetText( + "cultistcircle-no_matching_threshhold_found", + new { rewardAmountRoubles = rewardAmountRoubles } + ) + ); // Use first threshold value (cheapest) from parameter array, otherwise use 12 hours var firstThreshold = thresholds.FirstOrDefault(); - var craftTime = firstThreshold?.CraftTimeSeconds > 0 - ? firstThreshold.CraftTimeSeconds - : _timeUtil.GetHoursAsSeconds(12); + var craftTime = + firstThreshold?.CraftTimeSeconds > 0 + ? firstThreshold.CraftTimeSeconds + : _timeUtil.GetHoursAsSeconds(12); return new CraftTimeThreshold { Min = firstThreshold?.Min ?? 1, Max = firstThreshold?.Max ?? 34999, - CraftTimeSeconds = craftTime + CraftTimeSeconds = craftTime, }; } @@ -284,7 +326,8 @@ public class CircleOfCultistService( protected List GetSacrificedItems(PmcData pmcData) { // Get root items that are in the cultist sacrifice window - var inventoryRootItemsInCultistGrid = pmcData.Inventory.Items.Where(item => item.SlotId == CircleOfCultistSlotId + var inventoryRootItemsInCultistGrid = pmcData.Inventory.Items.Where(item => + item.SlotId == CircleOfCultistSlotId ); // Get rootitem + its children @@ -323,14 +366,16 @@ public class CircleOfCultistService( var rewardItemCount = 0; var failedAttempts = 0; while ( - totalRewardCost < rewardBudget && - rewardItemTplPool.Count > 0 && - rewardItemCount < circleConfig.MaxRewardItemCount + totalRewardCost < rewardBudget + && rewardItemTplPool.Count > 0 + && rewardItemCount < circleConfig.MaxRewardItemCount ) { if (failedAttempts > circleConfig.MaxAttemptsToPickRewardsWithinBudget) { - _logger.Warning($"Exiting reward generation after {failedAttempts} failed attempts"); + _logger.Warning( + $"Exiting reward generation after {failedAttempts} failed attempts" + ); break; } @@ -340,14 +385,16 @@ public class CircleOfCultistService( // Is weapon/armor, handle differently if ( - _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(randomItemTplFromPool) || - _itemHelper.IsOfBaseclass(randomItemTplFromPool, BaseClasses.WEAPON) + _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(randomItemTplFromPool) + || _itemHelper.IsOfBaseclass(randomItemTplFromPool, BaseClasses.WEAPON) ) { var defaultPreset = _presetHelper.GetDefaultPreset(randomItemTplFromPool); if (defaultPreset is null) { - _logger.Warning($"Reward tpl: {randomItemTplFromPool} lacks a default preset, skipping reward"); + _logger.Warning( + $"Reward tpl: {randomItemTplFromPool} lacks a default preset, skipping reward" + ); failedAttempts++; continue; @@ -361,7 +408,7 @@ public class CircleOfCultistService( _itemHelper.SetFoundInRaid(presetAndMods); rewardItemCount++; - totalRewardCost += (int) _itemHelper.GetItemPrice(randomItemTplFromPool); + totalRewardCost += (int)_itemHelper.GetItemPrice(randomItemTplFromPool); rewards.Add(presetAndMods); continue; @@ -370,7 +417,7 @@ public class CircleOfCultistService( // Some items can have variable stack size, e.g. ammo / currency var stackSize = GetRewardStackSize( randomItemTplFromPool, - (int) (rewardBudget / (rewardItemCount == 0 ? 1 : rewardItemCount)) // Remaining rouble budget + (int)(rewardBudget / (rewardItemCount == 0 ? 1 : rewardItemCount)) // Remaining rouble budget ); // Not a weapon/armor, standard single item @@ -382,11 +429,8 @@ public class CircleOfCultistService( Template = randomItemTplFromPool, ParentId = cultistCircleStashId, SlotId = CircleOfCultistSlotId, - Upd = new Upd - { - StackObjectsCount = stackSize - } - } + Upd = new Upd { StackObjectsCount = stackSize }, + }, ]; _itemHelper.SetFoundInRaid(rewardItem); @@ -402,7 +446,7 @@ public class CircleOfCultistService( rewardItemCount++; var singleItemPrice = _itemHelper.GetItemPrice(randomItemTplFromPool); var itemPrice = singleItemPrice * stackSize; - totalRewardCost += (int) itemPrice; + totalRewardCost += (int)itemPrice; rewards.Add(rewardItem); } @@ -437,14 +481,16 @@ public class CircleOfCultistService( { // Is weapon/armor, handle differently if ( - _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(rewardTpl) || - _itemHelper.IsOfBaseclass(rewardTpl, BaseClasses.WEAPON) + _itemHelper.ArmorItemHasRemovableOrSoftInsertSlots(rewardTpl) + || _itemHelper.IsOfBaseclass(rewardTpl, BaseClasses.WEAPON) ) { var defaultPreset = _presetHelper.GetDefaultPreset(rewardTpl); if (defaultPreset is null) { - _logger.Warning($"Reward tpl: {rewardTpl} lacks a default preset, skipping reward"); + _logger.Warning( + $"Reward tpl: {rewardTpl} lacks a default preset, skipping reward" + ); continue; } @@ -471,11 +517,8 @@ public class CircleOfCultistService( Template = rewardTpl, ParentId = cultistCircleStashId, SlotId = CircleOfCultistSlotId, - Upd = new Upd - { - StackObjectsCount = stackSize - } - } + Upd = new Upd { StackObjectsCount = stackSize }, + }, ]; _itemHelper.SetFoundInRaid(rewardItem); @@ -512,13 +555,15 @@ public class CircleOfCultistService( ) { // Get sacrificed tpls - IEnumerable sacrificedItemTpls = sacrificedItems.Select(item => item.Template).Where(item => item != null); + IEnumerable sacrificedItemTpls = sacrificedItems + .Select(item => item.Template) + .Where(item => item != null); // Create md5 key of the items player sacrificed so we can compare against the direct reward cache string sacrificedItemsKey = CreateSacrificeCacheKey(sacrificedItemTpls); var matchingDirectReward = directRewardsCache.GetValueOrDefault(sacrificedItemsKey); if (matchingDirectReward is null) - // No direct reward + // No direct reward { return null; } @@ -526,7 +571,7 @@ public class CircleOfCultistService( var fullProfile = _profileHelper.GetFullProfile(sessionId); var directRewardHash = GetDirectRewardHashKey(matchingDirectReward); if (fullProfile.SptData.CultistRewards?.ContainsKey(directRewardHash) ?? false) - // Player has already received this direct reward + // Player has already received this direct reward { return null; } @@ -568,7 +613,9 @@ public class CircleOfCultistService( } // Look for parent in dict - var settings = _hideoutConfig.CultistCircle.DirectRewardStackSize.GetValueOrDefault(itemDetails.Value.Parent); + var settings = _hideoutConfig.CultistCircle.DirectRewardStackSize.GetValueOrDefault( + itemDetails.Value.Parent + ); if (settings is null) { return 1; @@ -582,17 +629,21 @@ public class CircleOfCultistService( /// /// Session id /// Reward sent to player - protected void FlagDirectRewardAsAcceptedInProfile(string sessionId, DirectRewardSettings directReward) + protected void FlagDirectRewardAsAcceptedInProfile( + string sessionId, + DirectRewardSettings directReward + ) { var fullProfile = _profileHelper.GetFullProfile(sessionId); var dataToStoreInProfile = new AcceptedCultistReward { Timestamp = _timeUtil.GetTimeStamp(), SacrificeItems = directReward.RequiredItems, - RewardItems = directReward.Reward + RewardItems = directReward.Reward, }; - fullProfile.SptData.CultistRewards[GetDirectRewardHashKey(directReward)] = dataToStoreInProfile; + fullProfile.SptData.CultistRewards[GetDirectRewardHashKey(directReward)] = + dataToStoreInProfile; } /// @@ -619,7 +670,10 @@ public class CircleOfCultistService( var percentOfPoolToUse = _randomUtil.GetDouble(settings.Min, settings.Max); // Rouble amount of pool we want to reward as currency - var roubleAmountToFill = _randomUtil.GetPercentOfValue(percentOfPoolToUse, rewardPoolRemaining); + var roubleAmountToFill = _randomUtil.GetPercentOfValue( + percentOfPoolToUse, + rewardPoolRemaining + ); // Convert currency to roubles var currencyPriceAsRouble = _itemHelper.GetItemPrice(itemTpl); @@ -627,7 +681,7 @@ public class CircleOfCultistService( // How many items can we fit into chosen pool var itemCountToReward = Math.Round(roubleAmountToFill / currencyPriceAsRouble ?? 0); - return (int) itemCountToReward; + return (int)itemCountToReward; } return 1; @@ -645,7 +699,8 @@ public class CircleOfCultistService( string sessionId, PmcData pmcData, CircleCraftDetails craftingInfo, - CultistCircleSettings cultistCircleConfig) + CultistCircleSettings cultistCircleConfig + ) { var rewardPool = new HashSet(); var hideoutDbData = _databaseService.GetHideout(); @@ -669,27 +724,41 @@ public class CircleOfCultistService( switch (craftingInfo.RewardType) { case CircleRewardType.RANDOM: - { - // Does reward pass the high value threshold - var isHighValueReward = craftingInfo.RewardAmountRoubles >= cultistCircleConfig.HighValueThresholdRub; - GenerateRandomisedItemsAndAddToRewardPool(rewardPool, itemRewardBlacklist, isHighValueReward); + { + // Does reward pass the high value threshold + var isHighValueReward = + craftingInfo.RewardAmountRoubles >= cultistCircleConfig.HighValueThresholdRub; + GenerateRandomisedItemsAndAddToRewardPool( + rewardPool, + itemRewardBlacklist, + isHighValueReward + ); - break; - } + break; + } case CircleRewardType.HIDEOUT_TASK: + { + // Hideout/Task loot + AddHideoutUpgradeRequirementsToRewardPool( + hideoutDbData, + pmcData, + itemRewardBlacklist, + rewardPool + ); + AddTaskItemRequirementsToRewardPool(pmcData, itemRewardBlacklist, rewardPool); + + // If we have no tasks or hideout stuff left or need more loot to fill it out, default to high value + if (rewardPool.Count < cultistCircleConfig.MaxRewardItemCount + 2) { - // Hideout/Task loot - AddHideoutUpgradeRequirementsToRewardPool(hideoutDbData, pmcData, itemRewardBlacklist, rewardPool); - AddTaskItemRequirementsToRewardPool(pmcData, itemRewardBlacklist, rewardPool); - - // If we have no tasks or hideout stuff left or need more loot to fill it out, default to high value - if (rewardPool.Count < cultistCircleConfig.MaxRewardItemCount + 2) - { - GenerateRandomisedItemsAndAddToRewardPool(rewardPool, itemRewardBlacklist, true); - } - - break; + GenerateRandomisedItemsAndAddToRewardPool( + rewardPool, + itemRewardBlacklist, + true + ); } + + break; + } } // Add custom rewards from config @@ -719,18 +788,22 @@ public class CircleOfCultistService( protected void AddTaskItemRequirementsToRewardPool( PmcData pmcData, HashSet itemRewardBlacklist, - HashSet rewardPool) + HashSet rewardPool + ) { var activeTasks = pmcData.Quests.Where(quest => quest.Status == QuestStatusEnum.Started); foreach (var task in activeTasks) { var questData = _questHelper.GetQuestFromDb(task.QId, pmcData); - var handoverConditions = questData.Conditions.AvailableForFinish.Where(condition => condition.ConditionType == "HandoverItem" + var handoverConditions = questData.Conditions.AvailableForFinish.Where(condition => + condition.ConditionType == "HandoverItem" ); foreach (var condition in handoverConditions) foreach (var neededItem in condition.Target.List) { - if (itemRewardBlacklist.Contains(neededItem) || !_itemHelper.IsValidItem(neededItem)) + if ( + itemRewardBlacklist.Contains(neededItem) || !_itemHelper.IsValidItem(neededItem) + ) { continue; } @@ -756,7 +829,8 @@ public class CircleOfCultistService( Hideout hideoutDbData, PmcData pmcData, HashSet itemRewardBlacklist, - HashSet rewardPool) + HashSet rewardPool + ) { var dbAreas = hideoutDbData.Areas; foreach (var profileArea in GetPlayerAccessibleHideoutAreas(pmcData.Hideout.Areas)) @@ -774,17 +848,19 @@ public class CircleOfCultistService( foreach (var rewardToAdd in itemRequirements) { if ( - itemRewardBlacklist.Contains(rewardToAdd.TemplateId) || - !_itemHelper.IsValidItem(rewardToAdd.TemplateId) - ) - // Dont reward items sacrificed + itemRewardBlacklist.Contains(rewardToAdd.TemplateId) + || !_itemHelper.IsValidItem(rewardToAdd.TemplateId) + ) + // Dont reward items sacrificed { continue; } if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Added Hideout Loot: {_itemHelper.GetItemName(rewardToAdd.TemplateId)}"); + _logger.Debug( + $"Added Hideout Loot: {_itemHelper.GetItemName(rewardToAdd.TemplateId)}" + ); } rewardPool.Add(rewardToAdd.TemplateId); @@ -800,17 +876,20 @@ public class CircleOfCultistService( /// Active area array protected List GetPlayerAccessibleHideoutAreas(List areas) { - return areas.Where(area => + return areas + .Where(area => + { + if ( + area.Type == HideoutAreas.ChristmasIllumination + && !_seasonalEventService.ChristmasEventEnabled() + ) + // Christmas tree area and not Christmas, skip { - if (area.Type == HideoutAreas.ChristmasIllumination && !_seasonalEventService.ChristmasEventEnabled()) - // Christmas tree area and not Christmas, skip - { - return false; - } - - return true; + return false; } - ) + + return true; + }) .ToList(); } @@ -824,20 +903,24 @@ public class CircleOfCultistService( protected HashSet GenerateRandomisedItemsAndAddToRewardPool( HashSet rewardPool, HashSet itemRewardBlacklist, - bool itemsShouldBeHighValue) + bool itemsShouldBeHighValue + ) { var allItems = _itemHelper.GetItems(); var currentItemCount = 0; var attempts = 0; // `currentItemCount` var will look for the correct number of items, `attempts` var will keep this from never stopping if the highValueThreshold is too high while ( - currentItemCount < _hideoutConfig.CultistCircle.MaxRewardItemCount + 2 && - attempts < allItems.Count + currentItemCount < _hideoutConfig.CultistCircle.MaxRewardItemCount + 2 + && attempts < allItems.Count ) { attempts++; var randomItem = _randomUtil.GetArrayValue(allItems); - if (itemRewardBlacklist.Contains(randomItem.Id) || !_itemHelper.IsValidItem(randomItem.Id)) + if ( + itemRewardBlacklist.Contains(randomItem.Id) + || !_itemHelper.IsValidItem(randomItem.Id) + ) { continue; } @@ -895,7 +978,9 @@ public class CircleOfCultistService( /// /// Direct rewards array from hideout config /// Dictionary - protected Dictionary GenerateSacrificedItemsCache(List directRewards) + protected Dictionary GenerateSacrificedItemsCache( + List directRewards + ) { var result = new Dictionary(); foreach (var rewardSettings in directRewards) diff --git a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs index 9ead0f0f..b5e41013 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs @@ -14,7 +14,6 @@ using SPTarkov.Server.Core.Utils; using SPTarkov.Server.Core.Utils.Cloners; using Vitality = SPTarkov.Server.Core.Models.Eft.Profile.Vitality; - namespace SPTarkov.Server.Core.Services; [Injectable] @@ -42,7 +41,9 @@ public class CreateProfileService( public async ValueTask CreateProfile(string sessionId, ProfileCreateRequestData request) { var account = _cloner.Clone(_saveServer.GetProfile(sessionId)); - var profileTemplateClone = _cloner.Clone(_profileHelper.GetProfileTemplateForSide(account.ProfileInfo.Edition, request.Side)); + var profileTemplateClone = _cloner.Clone( + _profileHelper.GetProfileTemplateForSide(account.ProfileInfo.Edition, request.Side) + ); var pmcData = profileTemplateClone.Character; @@ -55,7 +56,7 @@ public class CreateProfileService( pmcData.SessionId = sessionId; pmcData.Info.Nickname = request.Nickname; pmcData.Info.LowerNickname = request.Nickname.ToLower(); - pmcData.Info.RegistrationDate = (int) _timeUtil.GetTimeStamp(); + pmcData.Info.RegistrationDate = (int)_timeUtil.GetTimeStamp(); pmcData.Info.Voice = _databaseService.GetCustomization()[request.VoiceId].Name; pmcData.Stats = _profileHelper.GetDefaultCounters(); pmcData.Info.NeedWipeOptions = []; @@ -85,16 +86,18 @@ public class CreateProfileService( { if (pmcData.Stats.Eft is not null) { - pmcData.Stats.Eft.TotalInGameTime = account.CharacterData.PmcData.Stats.Eft.TotalInGameTime; + pmcData.Stats.Eft.TotalInGameTime = account + .CharacterData + .PmcData + .Stats + .Eft + .TotalInGameTime; } } UpdateInventoryEquipmentId(pmcData); - pmcData.UnlockedInfo ??= new UnlockedInfo - { - UnlockedProductionRecipe = [] - }; + pmcData.UnlockedInfo ??= new UnlockedInfo { UnlockedProductionRecipe = [] }; // Add required items to pmc stash AddMissingInternalContainersToProfile(pmcData); @@ -106,11 +109,7 @@ public class CreateProfileService( var profileDetails = new SptProfile { ProfileInfo = account.ProfileInfo, - CharacterData = new Characters - { - PmcData = pmcData, - ScavData = new PmcData() - }, + CharacterData = new Characters { PmcData = pmcData, ScavData = new PmcData() }, UserBuildData = profileTemplateClone.UserBuilds, DialogueRecords = profileTemplateClone.Dialogues, SptData = _profileHelper.GetDefaultSptDataObject(), @@ -120,7 +119,7 @@ public class CreateProfileService( BtrDeliveryList = [], TraderPurchases = new Dictionary?>(), FriendProfileIds = [], - CustomisationUnlocks = [] + CustomisationUnlocks = [], }; AddCustomisationUnlocksToProfile(profileDetails); @@ -136,19 +135,24 @@ public class CreateProfileService( foreach (var (achievementId, _) in profileDetails.CharacterData.PmcData.Achievements) { - var rewards = achievementsDb.FirstOrDefault(achievementDb => achievementDb.Id == achievementId)?.Rewards; + var rewards = achievementsDb + .FirstOrDefault(achievementDb => achievementDb.Id == achievementId) + ?.Rewards; if (rewards is null) { continue; } - achievementRewardItemsToSend.AddRange(_rewardHelper.ApplyRewards( - rewards, - CustomisationSource.ACHIEVEMENT, - profileDetails, - profileDetails.CharacterData.PmcData, - achievementId)); + achievementRewardItemsToSend.AddRange( + _rewardHelper.ApplyRewards( + rewards, + CustomisationSource.ACHIEVEMENT, + profileDetails, + profileDetails.CharacterData.PmcData, + achievementId + ) + ); } if (achievementRewardItemsToSend.Count > 0) @@ -158,19 +162,20 @@ public class CreateProfileService( "670547bb5fa0b1a7c30d5836 0", achievementRewardItemsToSend, [], - 31536000); + 31536000 + ); } } // Process handling if the account is forced to prestige, or if the account currently has any pending prestiges - if (request.SptForcePrestigeLevel is not null || account.SptData?.PendingPrestige is not null) + if ( + request.SptForcePrestigeLevel is not null + || account.SptData?.PendingPrestige is not null + ) { var pendingPrestige = account.SptData.PendingPrestige is not null ? account.SptData.PendingPrestige - : new PendingPrestige - { - PrestigeLevel = request.SptForcePrestigeLevel - }; + : new PendingPrestige { PrestigeLevel = request.SptForcePrestigeLevel }; _prestigeHelper.ProcessPendingPrestige(account, profileDetails, pendingPrestige); } @@ -179,7 +184,10 @@ public class CreateProfileService( if (profileTemplateClone.Trader.SetQuestsAvailableForStart ?? false) { - _questHelper.AddAllQuestsToProfile(profileDetails.CharacterData.PmcData, [QuestStatusEnum.AvailableForStart]); + _questHelper.AddAllQuestsToProfile( + profileDetails.CharacterData.PmcData, + [QuestStatusEnum.AvailableForStart] + ); } // Profile is flagged as wanting quests set to ready to hand in and collect rewards @@ -190,7 +198,7 @@ public class CreateProfileService( [ QuestStatusEnum.AvailableForStart, QuestStatusEnum.Started, - QuestStatusEnum.AvailableForFinish + QuestStatusEnum.AvailableForFinish, ] ); @@ -203,7 +211,9 @@ public class CreateProfileService( ResetAllTradersInProfile(sessionId); - _saveServer.GetProfile(sessionId).CharacterData.ScavData = _playerScavGenerator.Generate(sessionId); + _saveServer.GetProfile(sessionId).CharacterData.ScavData = _playerScavGenerator.Generate( + sessionId + ); // Store minimal profile and reload it await _saveServer.SaveProfileAsync(sessionId); @@ -229,7 +239,10 @@ public class CreateProfileService( else { _logger.Warning( - _localisationService.GetText("profile-unable_to_find_profile_by_id_cannot_delete", sessionID) + _localisationService.GetText( + "profile-unable_to_find_profile_by_id_cannot_delete", + sessionID + ) ); } } @@ -277,13 +290,17 @@ public class CreateProfileService( /// Profile to check protected void AddMissingInternalContainersToProfile(PmcData pmcData) { - if (!pmcData.Inventory.Items.Any(item => item.Id == pmcData.Inventory.HideoutCustomizationStashId)) + if ( + !pmcData.Inventory.Items.Any(item => + item.Id == pmcData.Inventory.HideoutCustomizationStashId + ) + ) { pmcData.Inventory.Items.Add( new Item { Id = pmcData.Inventory.HideoutCustomizationStashId, - Template = ItemTpl.HIDEOUTAREACONTAINER_CUSTOMIZATION + Template = ItemTpl.HIDEOUTAREACONTAINER_CUSTOMIZATION, } ); } @@ -294,7 +311,7 @@ public class CreateProfileService( new Item { Id = pmcData.Inventory.SortingTable, - Template = ItemTpl.SORTINGTABLE_SORTING_TABLE + Template = ItemTpl.SORTINGTABLE_SORTING_TABLE, } ); } @@ -305,7 +322,7 @@ public class CreateProfileService( new Item { Id = pmcData.Inventory.QuestStashItems, - Template = ItemTpl.STASH_QUESTOFFLINE + Template = ItemTpl.STASH_QUESTOFFLINE, } ); } @@ -316,7 +333,7 @@ public class CreateProfileService( new Item { Id = pmcData.Inventory.QuestRaidItems, - Template = ItemTpl.STASH_QUESTRAID + Template = ItemTpl.STASH_QUESTRAID, } ); } @@ -332,7 +349,9 @@ public class CreateProfileService( var gameEdition = GetGameEdition(fullProfile); if (gameEdition is null) { - _logger.Error($"Unable to get Game edition of profile: {fullProfile.ProfileInfo.ProfileId}, skipping customisation unlocks"); + _logger.Error( + $"Unable to get Game edition of profile: {fullProfile.ProfileInfo.ProfileId}, skipping customisation unlocks" + ); return; } @@ -345,7 +364,7 @@ public class CreateProfileService( { Id = "6746fd09bafff85008048838", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -354,7 +373,7 @@ public class CreateProfileService( { Id = "67471938bafff850080488b7", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -366,7 +385,7 @@ public class CreateProfileService( { Id = "6746fd09bafff85008048838", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -375,7 +394,7 @@ public class CreateProfileService( { Id = "67471938bafff850080488b7", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -384,7 +403,7 @@ public class CreateProfileService( { Id = "67471928d17d6431550563b5", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -393,7 +412,7 @@ public class CreateProfileService( { Id = "6747193f170146228c0d2226", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); @@ -403,7 +422,7 @@ public class CreateProfileService( { Id = "666841a02537107dc508b704", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.SUITE + Type = CustomisationType.SUITE, } ); @@ -413,7 +432,7 @@ public class CreateProfileService( { Id = "675850ba33627edb710b0592", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.ENVIRONMENT + Type = CustomisationType.ENVIRONMENT, } ); @@ -430,7 +449,7 @@ public class CreateProfileService( { Id = "674dbf593bee1152d407f005", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); } @@ -442,7 +461,7 @@ public class CreateProfileService( { Id = "675dcfea7ae1a8792107ca99", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG + Type = CustomisationType.DOG_TAG, } ); } @@ -450,14 +469,14 @@ public class CreateProfileService( // Dev profile additions if (fullProfile.ProfileInfo.Edition.ToLower().Contains("developer")) - // CyberTark background + // CyberTark background { fullProfile.CustomisationUnlocks.Add( new CustomisationStorage { Id = "67585108def253bd97084552", Source = CustomisationSource.DEFAULT, - Type = CustomisationType.ENVIRONMENT + Type = CustomisationType.ENVIRONMENT, } ); } @@ -502,7 +521,10 @@ public class CreateProfileService( { foreach (var quest in profileDetails.CharacterData.PmcData.Quests) { - var questFromDb = _questHelper.GetQuestFromDb(quest.QId, profileDetails.CharacterData.PmcData); + var questFromDb = _questHelper.GetQuestFromDb( + quest.QId, + profileDetails.CharacterData.PmcData + ); // Get messageId of text to send to player as text message in game // Copy of code from QuestController.acceptQuest() @@ -510,7 +532,8 @@ public class CreateProfileService( questFromDb.StartedMessageText, questFromDb.Description ); - var itemRewards = _questRewardHelper.ApplyQuestReward( + var itemRewards = _questRewardHelper + .ApplyQuestReward( profileDetails.CharacterData.PmcData, quest.QId, QuestStatusEnum.Started, @@ -519,7 +542,6 @@ public class CreateProfileService( ) .ToList(); - _mailSendService.SendLocalisedNpcMessageToPlayer( sessionID, questFromDb.TraderId, diff --git a/Libraries/SPTarkov.Server.Core/Services/CustomLocationWaveService.cs b/Libraries/SPTarkov.Server.Core/Services/CustomLocationWaveService.cs index 5a41c348..adb29329 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CustomLocationWaveService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CustomLocationWaveService.cs @@ -11,7 +11,8 @@ namespace SPTarkov.Server.Core.Services; public class CustomLocationWaveService( ISptLogger _logger, DatabaseService _databaseService, - ConfigServer _configServer) + ConfigServer _configServer +) { protected LocationConfig _locationConfig = _configServer.GetConfig(); @@ -66,7 +67,9 @@ public class CustomLocationWaveService( var locationBase = _databaseService.GetLocation(mapKvP.Key).Base; if (locationBase is null) { - _logger.Warning($"Unable to add custom boss wave to location: {mapKvP}, location not found"); + _logger.Warning( + $"Unable to add custom boss wave to location: {mapKvP}, location not found" + ); continue; } @@ -74,7 +77,7 @@ public class CustomLocationWaveService( foreach (var bossWave in mapKvP.Value) { if (locationBase.BossLocationSpawn.Any(x => x.SptId == bossWave.SptId)) - // Already exists, skip + // Already exists, skip { continue; } @@ -94,7 +97,9 @@ public class CustomLocationWaveService( var locationBase = _databaseService.GetLocation(mapKvP.Key).Base; if (locationBase is null) { - _logger.Warning($"Unable to add custom wave to location: {mapKvP}, location not found"); + _logger.Warning( + $"Unable to add custom wave to location: {mapKvP}, location not found" + ); continue; } @@ -102,7 +107,7 @@ public class CustomLocationWaveService( foreach (var normalWave in mapKvP.Value) { if (locationBase.Waves.Any(x => x.SptId == normalWave.SptId)) - // Already exists, skip + // Already exists, skip { continue; } diff --git a/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs b/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs index d2303c7e..53ded218 100644 --- a/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs @@ -39,7 +39,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Bots == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/bots")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/bots" + ) + ); } return _databaseServer.GetTables().Bots!; @@ -67,7 +72,10 @@ public class DatabaseService( if (_databaseServer.GetTables().Hideout == null) { throw new Exception( - _localisationService.GetText("database-data_at_path_missing", "assets/database/hideout") + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/hideout" + ) ); } @@ -80,7 +88,10 @@ public class DatabaseService( if (_databaseServer.GetTables().Locales == null) { throw new Exception( - _localisationService.GetText("database-data_at_path_missing", "assets/database/locales") + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/locales" + ) ); } @@ -93,7 +104,10 @@ public class DatabaseService( if (_databaseServer.GetTables().Locations == null) { throw new Exception( - _localisationService.GetText("database-data_at_path_missing", "assets/database/locations") + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/locations" + ) ); } @@ -111,7 +125,9 @@ public class DatabaseService( var desiredLocation = locations.GetByJsonProp(locationId.ToLower()); if (desiredLocation == null) { - _logger.Error(_localisationService.GetText("database-no_location_found_with_id", locationId)); + _logger.Error( + _localisationService.GetText("database-no_location_found_with_id", locationId) + ); return null; } @@ -125,7 +141,10 @@ public class DatabaseService( if (_databaseServer.GetTables().Match == null) { throw new Exception( - _localisationService.GetText("database-data_at_path_missing", "assets/database/locales") + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/locales" + ) ); } @@ -233,7 +252,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.Handbook == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/templates/handbook.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/templates/handbook.json" + ) + ); } return _databaseServer.GetTables().Templates?.Handbook!; @@ -244,7 +268,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.Items == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/templates/items.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/templates/items.json" + ) + ); } return _databaseServer.GetTables().Templates?.Items!; @@ -255,7 +284,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.Prices == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/templates/prices.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/templates/prices.json" + ) + ); } return _databaseServer.GetTables().Templates?.Prices!; @@ -266,7 +300,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.Profiles == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/templates/profiles.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/templates/profiles.json" + ) + ); } return _databaseServer.GetTables().Templates?.Profiles!; @@ -277,7 +316,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.Quests == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/templates/quests.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/templates/quests.json" + ) + ); } return _databaseServer.GetTables().Templates?.Quests!; @@ -288,7 +332,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Traders == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/traders")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/traders" + ) + ); } return _databaseServer.GetTables().Traders!; @@ -304,7 +353,9 @@ public class DatabaseService( var traders = GetTraders(); if (!traders.TryGetValue(traderId, out var desiredTrader)) { - _logger.Error(_localisationService.GetText("database-no_trader_found_with_id", traderId)); + _logger.Error( + _localisationService.GetText("database-no_trader_found_with_id", traderId) + ); return null; } @@ -317,7 +368,12 @@ public class DatabaseService( { if (_databaseServer.GetTables().Templates?.LocationServices == null) { - throw new Exception(_localisationService.GetText("database-data_at_path_missing", "assets/database/locationServices.json")); + throw new Exception( + _localisationService.GetText( + "database-data_at_path_missing", + "assets/database/locationServices.json" + ) + ); } return _databaseServer.GetTables().Templates?.LocationServices!; @@ -331,10 +387,10 @@ public class DatabaseService( var start = Stopwatch.StartNew(); _isDataValid = - ValidateTable(GetQuests(), "quest") && - ValidateTable(GetTraders(), "trader") && - ValidateTable(GetItems(), "item") && - ValidateTable(GetCustomization(), "customization"); + ValidateTable(GetQuests(), "quest") + && ValidateTable(GetTraders(), "trader") + && ValidateTable(GetItems(), "item") + && ValidateTable(GetCustomization(), "customization"); if (!_isDataValid) { diff --git a/Libraries/SPTarkov.Server.Core/Services/FenceService.cs b/Libraries/SPTarkov.Server.Core/Services/FenceService.cs index 611da877..02429611 100644 --- a/Libraries/SPTarkov.Server.Core/Services/FenceService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/FenceService.cs @@ -53,7 +53,7 @@ public class FenceService( "MedKit", "FoodDrink", "Dogtag", - "RepairKit" + "RepairKit", ]; /// @@ -63,7 +63,6 @@ public class FenceService( protected TraderConfig traderConfig = configServer.GetConfig(); - /// /// Replace main fence assort with new assort /// @@ -110,7 +109,7 @@ public class FenceService( public TraderAssort GetFenceAssorts(PmcData pmcProfile) { if (traderConfig.Fence.RegenerateAssortsOnRefresh) - // Using base assorts made earlier, do some alterations and store in fenceAssort + // Using base assorts made earlier, do some alterations and store in fenceAssort { GenerateFenceAssorts(); } @@ -145,7 +144,9 @@ public class FenceService( { // HUGE THANKS TO LACYWAY AND LEAVES FOR PROVIDING THIS SOLUTION FOR SPT TO IMPLEMENT!! // Copy the item and its children - var clonedItems = _cloner.Clone(itemHelper.FindAndReturnChildrenAsItems(items, mainItem.Id)); + var clonedItems = _cloner.Clone( + itemHelper.FindAndReturnChildrenAsItems(items, mainItem.Id) + ); // I BLAME LACY FOR THIS ISSUE, I SPENT HOURS FIXING IT /s // i think on node the one with hideout usually came first var root = clonedItems.FirstOrDefault(x => x.SlotId == "hideout"); @@ -168,17 +169,11 @@ public class FenceService( { SptItems = [], BarterScheme = new Dictionary>>(), - LoyalLevelItems = new Dictionary() + LoyalLevelItems = new Dictionary(), }; createAssort.BarterScheme[root.Id] = [ - [ - new BarterScheme - { - Count = cost, - Template = Money.ROUBLES - } - ] + [new BarterScheme { Count = cost, Template = Money.ROUBLES }], ]; createAssort.SptItems.Add(clonedItems); createAssort.LoyalLevelItems[root.Id] = 1; @@ -212,7 +207,9 @@ public class FenceService( { if (itemHelper.IsOfBaseclass(item.Template, BaseClasses.AMMO)) { - total += handbookHelper.GetTemplatePrice(item.Template) * (item.Upd?.StackObjectsCount ?? 1); + total += + handbookHelper.GetTemplatePrice(item.Template) + * (item.Upd?.StackObjectsCount ?? 1); } } @@ -281,7 +278,9 @@ public class FenceService( { if (assort?.BarterScheme is null) { - logger.Warning($"Unable to adjust item: {item.Id} on assort as it lacks a barterScheme object"); + logger.Warning( + $"Unable to adjust item: {item.Id} on assort as it lacks a barterScheme object" + ); return; } @@ -304,7 +303,9 @@ public class FenceService( } else { - logger.Warning($"adjustItemPriceByModifier() - no action taken for item: {item.Template}"); + logger.Warning( + $"adjustItemPriceByModifier() - no action taken for item: {item.Template}" + ); } } @@ -373,13 +374,17 @@ public class FenceService( // Add new barter items to fence assorts discounted barter scheme foreach (var barterItemKey in newDiscountItems.BarterScheme.Keys) { - fenceDiscountAssort.BarterScheme[barterItemKey] = newDiscountItems.BarterScheme[barterItemKey]; + fenceDiscountAssort.BarterScheme[barterItemKey] = newDiscountItems.BarterScheme[ + barterItemKey + ]; } // Add loyalty items to fence discount assorts loyalty object foreach (var loyaltyItemKey in newDiscountItems.LoyalLevelItems.Keys) { - fenceDiscountAssort.LoyalLevelItems[loyaltyItemKey] = newDiscountItems.LoyalLevelItems[loyaltyItemKey]; + fenceDiscountAssort.LoyalLevelItems[loyaltyItemKey] = newDiscountItems.LoyalLevelItems[ + loyaltyItemKey + ]; } // Reset the clock @@ -410,7 +415,8 @@ public class FenceService( } // Find a matching root item with same tpl in existing assort - var existingRootItem = existingFenceAssorts.Items.FirstOrDefault(item => item.Template == newRootItem.Template && item.SlotId == "hideout" + var existingRootItem = existingFenceAssorts.Items.FirstOrDefault(item => + item.Template == newRootItem.Template && item.SlotId == "hideout" ); // Check if same type of item exists + its on list of item types to always stack @@ -420,7 +426,13 @@ public class FenceService( existingFenceAssorts.Items, existingRootItem.Id ); - if (itemHelper.IsSameItems(itemWithChildren, existingFullItemTree, fenceItemUpdCompareProperties)) + if ( + itemHelper.IsSameItems( + itemWithChildren, + existingFullItemTree, + fenceItemUpdCompareProperties + ) + ) { // Guard against a missing stack count if (existingRootItem.Upd?.StackObjectsCount == null) @@ -430,22 +442,24 @@ public class FenceService( } // Merge new items count into existing, don't add new loyalty/barter data as it already exists - existingRootItem.Upd.StackObjectsCount += newRootItem?.Upd?.StackObjectsCount ?? 1; + existingRootItem.Upd.StackObjectsCount += + newRootItem?.Upd?.StackObjectsCount ?? 1; continue; } } // if the Upd doesn't exist just initialize it - newRootItem.Upd ??= new Upd - { - StackObjectsCount = 1 - }; + newRootItem.Upd ??= new Upd { StackObjectsCount = 1 }; // New assort to be added to existing assorts existingFenceAssorts.Items.AddRange(itemWithChildren); - existingFenceAssorts.BarterScheme[newRootItem.Id] = newFenceAssorts.BarterScheme[newRootItem.Id]; - existingFenceAssorts.LoyalLevelItems[newRootItem.Id] = newFenceAssorts.LoyalLevelItems[newRootItem.Id]; + existingFenceAssorts.BarterScheme[newRootItem.Id] = newFenceAssorts.BarterScheme[ + newRootItem.Id + ]; + existingFenceAssorts.LoyalLevelItems[newRootItem.Id] = newFenceAssorts.LoyalLevelItems[ + newRootItem.Id + ]; } } @@ -454,7 +468,8 @@ public class FenceService( /// protected void IncrementPartialRefreshTime() { - nextPartialRefreshTimestamp = timeUtil.GetTimeStamp() + traderConfig.Fence.PartialRefreshTimeSeconds; + nextPartialRefreshTimestamp = + timeUtil.GetTimeStamp() + traderConfig.Fence.PartialRefreshTimeSeconds; } /// @@ -474,7 +489,8 @@ public class FenceService( // Get count of weapons var currentWeaponPresetCount = rootPresetItems.Aggregate( 0, - (count, item) => itemHelper.IsOfBaseclass(item.Template, BaseClasses.WEAPON) ? count + 1 : count + (count, item) => + itemHelper.IsOfBaseclass(item.Template, BaseClasses.WEAPON) ? count + 1 : count ); // Get count of equipment @@ -484,11 +500,18 @@ public class FenceService( ); // Normal item count is total count minus weapon + armor count - var nonPresetItemAssortCount = allRootItems.Count() - (currentWeaponPresetCount + currentEquipmentPresetCount); + var nonPresetItemAssortCount = + allRootItems.Count() - (currentWeaponPresetCount + currentEquipmentPresetCount); // Get counts of items to generate, never var values fall below 0 - var itemCountToGenerate = Math.Max(generationValues.Item.Value - nonPresetItemAssortCount, 0); - var weaponCountToGenerate = Math.Max(generationValues.WeaponPreset.Value - currentWeaponPresetCount, 0); + var itemCountToGenerate = Math.Max( + generationValues.Item.Value - nonPresetItemAssortCount, + 0 + ); + var weaponCountToGenerate = Math.Max( + generationValues.WeaponPreset.Value - currentWeaponPresetCount, + 0 + ); var equipmentCountToGenerate = Math.Max( generationValues.EquipmentPreset.Value - currentEquipmentPresetCount, 0 @@ -498,7 +521,7 @@ public class FenceService( { Item = itemCountToGenerate, WeaponPreset = weaponCountToGenerate, - EquipmentPreset = equipmentCountToGenerate + EquipmentPreset = equipmentCountToGenerate, }; } @@ -543,7 +566,9 @@ public class FenceService( { if (rootItemToAdjust.Upd == null) { - logger.Warning($"Fence Item: {rootItemToAdjust.Template} lacks a Upd object, adding"); + logger.Warning( + $"Fence Item: {rootItemToAdjust.Template} lacks a Upd object, adding" + ); rootItemToAdjust.Upd = new Upd(); } @@ -554,9 +579,12 @@ public class FenceService( } // Remove item + child mods (if any) - var itemWithChildren = itemHelper.FindAndReturnChildrenAsItems(assort.Items, rootItemToAdjust.Id); + var itemWithChildren = itemHelper.FindAndReturnChildrenAsItems( + assort.Items, + rootItemToAdjust.Id + ); foreach (var itemToDelete in itemWithChildren) - // Delete item from assort items array + // Delete item from assort items array { assort.Items.Remove(itemToDelete); } @@ -575,7 +603,8 @@ public class FenceService( /// Rounded int of items to replace protected int GetCountOfItemsToReplace(int totalItemCount) { - return (int) Math.Round(totalItemCount * (traderConfig.Fence.PartialRefreshChangePercent / 100)); + return (int) + Math.Round(totalItemCount * (traderConfig.Fence.PartialRefreshChangePercent / 100)); } /// @@ -648,14 +677,14 @@ public class FenceService( { Item = 0, WeaponPreset = 0, - EquipmentPreset = 0 + EquipmentPreset = 0, }, Discount = new GenerationAssortValues { Item = 0, WeaponPreset = 0, - EquipmentPreset = 0 - } + EquipmentPreset = 0, + }, }; result.Normal.Item = traderConfig.Fence.AssortSize; @@ -696,7 +725,7 @@ public class FenceService( Items = [], BarterScheme = new Dictionary>>(), LoyalLevelItems = new Dictionary(), - NextResupply = GetNextFenceUpdateTimestamp() + NextResupply = GetNextFenceUpdateTimestamp(), }; } @@ -706,13 +735,16 @@ public class FenceService( /// Number of items to generate per type (Item, WeaponPreset, EquipmentPreset) /// Loyalty level to set new item to /// CreateFenceAssortResult object - protected CreateFenceAssortsResult CreateAssorts(GenerationAssortValues itemCounts, int loyaltyLevel) + protected CreateFenceAssortsResult CreateAssorts( + GenerationAssortValues itemCounts, + int loyaltyLevel + ) { var result = new CreateFenceAssortsResult { SptItems = [], BarterScheme = new Dictionary>>(), - LoyalLevelItems = new Dictionary() + LoyalLevelItems = new Dictionary(), }; var baseFenceAssortClone = _cloner.Clone(databaseService.GetTrader(Traders.FENCE).Assort); @@ -720,12 +752,17 @@ public class FenceService( if (itemCounts.Item > 0) { - AddItemAssorts(itemCounts.Item, result, baseFenceAssortClone, itemTypeLimitCounts, loyaltyLevel); + AddItemAssorts( + itemCounts.Item, + result, + baseFenceAssortClone, + itemTypeLimitCounts, + loyaltyLevel + ); } if (itemCounts.WeaponPreset > 0 || itemCounts.EquipmentPreset > 0) { - AddPresetsToAssort( itemCounts.WeaponPreset, itemCounts.EquipmentPreset, @@ -755,8 +792,11 @@ public class FenceService( ) { var priceLimits = traderConfig.Fence.ItemCategoryRoublePriceLimit; - var assortRootItems = baseFenceAssortClone.Items - .Where(item => string.Equals(item.ParentId, "hideout", StringComparison.OrdinalIgnoreCase) && item.Upd?.SptPresetId == null) + var assortRootItems = baseFenceAssortClone + .Items.Where(item => + string.Equals(item.ParentId, "hideout", StringComparison.OrdinalIgnoreCase) + && item.Upd?.SptPresetId == null + ) .ToList(); if (assortRootItems.Count == 0) { @@ -775,12 +815,18 @@ public class FenceService( } // Filter out root items from pool - var childItemsAndSingleRoot = baseFenceAssortClone.Items.Where(item => - !string.Equals(item.ParentId, "hideout", StringComparison.Ordinal) - || string.Equals(item.Id, chosenBaseAssortRoot.Id, StringComparison.Ordinal)).ToList(); + var childItemsAndSingleRoot = baseFenceAssortClone + .Items.Where(item => + !string.Equals(item.ParentId, "hideout", StringComparison.Ordinal) + || string.Equals(item.Id, chosenBaseAssortRoot.Id, StringComparison.Ordinal) + ) + .ToList(); var desiredAssortItemAndChildrenClone = _cloner.Clone( - itemHelper.FindAndReturnChildrenAsItems(childItemsAndSingleRoot, chosenBaseAssortRoot.Id) + itemHelper.FindAndReturnChildrenAsItems( + childItemsAndSingleRoot, + chosenBaseAssortRoot.Id + ) ); var itemDbDetails = itemHelper.GetItem(chosenBaseAssortRoot.Template).Value; @@ -802,7 +848,10 @@ public class FenceService( continue; } - if (priceLimits.ContainsKey(itemDbDetails.Parent) && price > priceLimits[itemDbDetails.Parent]) + if ( + priceLimits.ContainsKey(itemDbDetails.Parent) + && price > priceLimits[itemDbDetails.Parent] + ) { // Too expensive for fence, try another item i--; @@ -817,7 +866,9 @@ public class FenceService( } // MUST randomise Ids as its possible to add the same base fence assort twice = duplicate IDs = dead client - desiredAssortItemAndChildrenClone = itemHelper.ReplaceIDs(_cloner.Clone(desiredAssortItemAndChildrenClone)); + desiredAssortItemAndChildrenClone = itemHelper.ReplaceIDs( + _cloner.Clone(desiredAssortItemAndChildrenClone) + ); itemHelper.RemapRootItemId(desiredAssortItemAndChildrenClone); var rootItemBeingAdded = desiredAssortItemAndChildrenClone[0]; @@ -826,14 +877,19 @@ public class FenceService( rootItemBeingAdded.Upd.StackObjectsCount = GetSingleItemStackCount(itemDbDetails); // Only randomise Upd values for single - var isSingleStack = Math.Abs((rootItemBeingAdded.Upd?.StackObjectsCount ?? 0) - 1) < 0.1; + var isSingleStack = + Math.Abs((rootItemBeingAdded.Upd?.StackObjectsCount ?? 0) - 1) < 0.1; if (isSingleStack) { RandomiseItemUpdProperties(itemDbDetails, rootItemBeingAdded); } // Skip items already in the assort if it exists in the 'prevent duplicate' list - var existingItemThatMatches = GetMatchingItem(rootItemBeingAdded, itemDbDetails, assorts.SptItems); + var existingItemThatMatches = GetMatchingItem( + rootItemBeingAdded, + itemDbDetails, + assorts.SptItems + ); var shouldBeStacked = ItemShouldBeForceStacked(existingItemThatMatches, itemDbDetails); if (shouldBeStacked && existingItemThatMatches != null) { @@ -852,8 +908,9 @@ public class FenceService( assorts.SptItems.Add(desiredAssortItemAndChildrenClone); - assorts.BarterScheme[rootItemBeingAdded.Id] = - _cloner.Clone(baseFenceAssortClone.BarterScheme[chosenBaseAssortRoot.Id]); + assorts.BarterScheme[rootItemBeingAdded.Id] = _cloner.Clone( + baseFenceAssortClone.BarterScheme[chosenBaseAssortRoot.Id] + ); // Only adjust item price by quality for solo items, never multi-stack if (isSingleStack) @@ -881,35 +938,30 @@ public class FenceService( { // Get matching root items var matchingItems = itemsWithChildren - .Where(itemWithChildren => itemWithChildren.FirstOrDefault(item => item.Template == rootItemBeingAdded.Template && - string.Equals(item.ParentId, "hideout", StringComparison.OrdinalIgnoreCase) - ) != - null + .Where(itemWithChildren => + itemWithChildren.FirstOrDefault(item => + item.Template == rootItemBeingAdded.Template + && string.Equals(item.ParentId, "hideout", StringComparison.OrdinalIgnoreCase) + ) != null ) .SelectMany(i => i) .ToList(); if (matchingItems.Count == 0) - // Nothing matches by tpl and is root item, exit early + // Nothing matches by tpl and is root item, exit early { return null; } var isMedical = itemHelper.IsOfBaseclasses( rootItemBeingAdded.Template, - [ - BaseClasses.MEDICAL, - BaseClasses.MEDKIT - ] + [BaseClasses.MEDICAL, BaseClasses.MEDKIT] ); var isGearAndHasSlots = itemHelper.IsOfBaseclasses( rootItemBeingAdded.Template, - [ - BaseClasses.ARMORED_EQUIPMENT, - BaseClasses.SEARCHABLE_ITEM - ] - ) && - (itemDbDetails.Properties.Slots?.Count ?? 0) > 0; + [BaseClasses.ARMORED_EQUIPMENT, BaseClasses.SEARCHABLE_ITEM] + ) + && (itemDbDetails.Properties.Slots?.Count ?? 0) > 0; // Only one match and it's not medical or armored gear if (matchingItems.Count == 1 && !(isMedical || isGearAndHasSlots)) @@ -920,18 +972,22 @@ public class FenceService( // Items have sub properties that need to be checked against foreach (var item in matchingItems) { - if (isMedical && rootItemBeingAdded.Upd?.MedKit?.HpResource == item.Upd?.MedKit?.HpResource) - // e.g. bandages with multiple use - // Both undefined === both max resoruce left + if ( + isMedical + && rootItemBeingAdded.Upd?.MedKit?.HpResource == item.Upd?.MedKit?.HpResource + ) + // e.g. bandages with multiple use + // Both undefined === both max resoruce left { return item; } // Armors/helmets etc if ( - isGearAndHasSlots && - rootItemBeingAdded.Upd.Repairable?.Durability == item.Upd.Repairable?.Durability && - rootItemBeingAdded.Upd.Repairable?.MaxDurability == item.Upd.Repairable?.MaxDurability + isGearAndHasSlots + && rootItemBeingAdded.Upd.Repairable?.Durability == item.Upd.Repairable?.Durability + && rootItemBeingAdded.Upd.Repairable?.MaxDurability + == item.Upd.Repairable?.MaxDurability ) { return item; @@ -1004,11 +1060,16 @@ public class FenceService( } // Adjust price based on durability - if (itemRoot.Upd?.Repairable != null || itemHelper.IsOfBaseclass(itemRoot.Template, BaseClasses.KEY_MECHANICAL)) + if ( + itemRoot.Upd?.Repairable != null + || itemHelper.IsOfBaseclass(itemRoot.Template, BaseClasses.KEY_MECHANICAL) + ) { var itemQualityModifier = itemHelper.GetItemQualityModifier(itemRoot); var basePrice = barterSchemes[itemRoot.Id][0][0].Count; - barterSchemes[itemRoot.Id][0][0].Count = Math.Round((double) basePrice * itemQualityModifier); + barterSchemes[itemRoot.Id][0][0].Count = Math.Round( + (double)basePrice * itemQualityModifier + ); } } @@ -1059,7 +1120,10 @@ public class FenceService( var rootItemDb = itemHelper.GetItem(randomPresetRoot.Template).Value; var presetWithChildrenClone = _cloner.Clone( - itemHelper.FindAndReturnChildrenAsItems(baseFenceAssort.Items, randomPresetRoot.Id) + itemHelper.FindAndReturnChildrenAsItems( + baseFenceAssort.Items, + randomPresetRoot.Id + ) ); RandomiseItemUpdProperties(rootItemDb, presetWithChildrenClone[0]); @@ -1068,27 +1132,37 @@ public class FenceService( RemoveRandomModsOfItem(presetWithChildrenClone); // Check chosen preset is below listing cap in config - var presetPrice = handbookHelper.GetTemplatePriceForItems(presetWithChildrenClone) * - itemHelper.GetItemQualityModifierForItems(presetWithChildrenClone); - if (traderConfig.Fence.ItemCategoryRoublePriceLimit.TryGetValue(rootItemDb.Parent, out var priceLimitRouble)) + var presetPrice = + handbookHelper.GetTemplatePriceForItems(presetWithChildrenClone) + * itemHelper.GetItemQualityModifierForItems(presetWithChildrenClone); + if ( + traderConfig.Fence.ItemCategoryRoublePriceLimit.TryGetValue( + rootItemDb.Parent, + out var priceLimitRouble + ) + ) { if (presetPrice > priceLimitRouble) - // Too expensive, try again + // Too expensive, try again { failedAttemptsCount++; if (failedAttemptsCount > 25) { - logger.Warning($"Unable to add: {desiredWeaponPresetsCount} presets to Fence as all presets found after 25 attempts were too expensive."); + logger.Warning( + $"Unable to add: {desiredWeaponPresetsCount} presets to Fence as all presets found after 25 attempts were too expensive." + ); break; } continue; - } } // MUST randomise Ids as its possible to add the same base fence assort twice = duplicate IDs = dead client - itemHelper.ReparentItemAndChildren(presetWithChildrenClone[0], presetWithChildrenClone); + itemHelper.ReparentItemAndChildren( + presetWithChildrenClone[0], + presetWithChildrenClone + ); itemHelper.RemapRootItemId(presetWithChildrenClone); // Remapping IDs causes parentId to be altered, fix @@ -1104,9 +1178,9 @@ public class FenceService( new BarterScheme { Template = Money.ROUBLES, - Count = Math.Round(presetPrice) - } - ] + Count = Math.Round(presetPrice), + }, + ], ]; assorts.LoyalLevelItems[presetWithChildrenClone[0].Id] = loyaltyLevel; @@ -1120,7 +1194,8 @@ public class FenceService( return; } - var equipmentPresetRootItems = baseFenceAssort.Items.Where(item => item.Upd?.SptPresetId != null && itemHelper.ArmorItemCanHoldMods(item.Template) + var equipmentPresetRootItems = baseFenceAssort.Items.Where(item => + item.Upd?.SptPresetId != null && itemHelper.ArmorItemCanHoldMods(item.Template) ); while (equipmentPresetsAddedCount < desiredEquipmentPresetsCount) { @@ -1140,14 +1215,16 @@ public class FenceService( RemoveRandomModsOfItem(presetWithChildrenClone); // Check chosen item is below price cap - var priceLimitRouble = traderConfig.Fence.ItemCategoryRoublePriceLimit[rootItemDb.Parent]; + var priceLimitRouble = traderConfig.Fence.ItemCategoryRoublePriceLimit[ + rootItemDb.Parent + ]; var itemPrice = - handbookHelper.GetTemplatePriceForItems(presetWithChildrenClone) * - itemHelper.GetItemQualityModifierForItems(presetWithChildrenClone); + handbookHelper.GetTemplatePriceForItems(presetWithChildrenClone) + * itemHelper.GetItemQualityModifierForItems(presetWithChildrenClone); if (priceLimitRouble != null) { if (itemPrice > priceLimitRouble) - // Too expensive, try again + // Too expensive, try again { continue; } @@ -1166,13 +1243,7 @@ public class FenceService( // Must be careful to use correct id as the item has had its IDs regenerated assorts.BarterScheme[presetWithChildrenClone[0].Id] = [ - [ - new BarterScheme - { - Template = Money.ROUBLES, - Count = Math.Round(itemPrice) - } - ] + [new BarterScheme { Template = Money.ROUBLES, Count = Math.Round(itemPrice) }], ]; assorts.LoyalLevelItems[presetWithChildrenClone[0].Id] = loyaltyLevel; @@ -1194,14 +1265,17 @@ public class FenceService( } // Check for and adjust soft insert durability values - var requiredSlots = itemDbDetails.Properties.Slots?.Where(slot => slot.Required ?? false).ToList(); + var requiredSlots = itemDbDetails + .Properties.Slots?.Where(slot => slot.Required ?? false) + .ToList(); if ((requiredSlots?.Count ?? 0) > 1) { RandomiseArmorSoftInsertDurabilities(requiredSlots, armor); } // Check for and adjust plate durability values - var plateSlots = itemDbDetails.Properties.Slots?.Where(slot => itemHelper.IsRemovablePlateSlot(slot.Name)) + var plateSlots = itemDbDetails + .Properties.Slots?.Where(slot => itemHelper.IsRemovablePlateSlot(slot.Name)) .ToList(); if ((plateSlots?.Count ?? 0) > 1) { @@ -1214,7 +1288,10 @@ public class FenceService( /// /// Slots of items to randomise /// Array of armor + inserts to get items from - protected void RandomiseArmorSoftInsertDurabilities(List softInsertSlots, List armorItemAndMods) + protected void RandomiseArmorSoftInsertDurabilities( + List softInsertSlots, + List armorItemAndMods + ) { foreach (var requiredSlot in softInsertSlots) { @@ -1224,18 +1301,21 @@ public class FenceService( modItemDbDetails, traderConfig.Fence.ArmorMaxDurabilityPercentMinMax ); - var plateTpl = - requiredSlot.Props.Filters[0].Plate ?? - string.Empty; // "Plate" property appears to be the 'default' item for slot + var plateTpl = requiredSlot.Props.Filters[0].Plate ?? string.Empty; // "Plate" property appears to be the 'default' item for slot if (plateTpl == "") - // Some bsg plate properties are empty, skip mod + // Some bsg plate properties are empty, skip mod { continue; } // Find items mod to apply dura changes to - var modItemToAdjust = - armorItemAndMods.FirstOrDefault(mod => string.Equals(mod.SlotId, requiredSlot.Name.ToLower(), StringComparison.OrdinalIgnoreCase)); + var modItemToAdjust = armorItemAndMods.FirstOrDefault(mod => + string.Equals( + mod.SlotId, + requiredSlot.Name.ToLower(), + StringComparison.OrdinalIgnoreCase + ) + ); itemHelper.AddUpdObjectToItem(modItemToAdjust); @@ -1243,22 +1323,25 @@ public class FenceService( modItemToAdjust.Upd.Repairable ??= new UpdRepairable { Durability = modItemDbDetails.Properties.MaxDurability, - MaxDurability = modItemDbDetails.Properties.MaxDurability + MaxDurability = modItemDbDetails.Properties.MaxDurability, }; modItemToAdjust.Upd.Repairable.Durability = durabilityValues.Durability; modItemToAdjust.Upd.Repairable.MaxDurability = durabilityValues.MaxDurability; // 25% chance to add shots to visor items when its below max durability - if (randomUtil.GetChance100(25) && - modItemToAdjust.ParentId == BaseClasses.ARMORED_EQUIPMENT && - modItemToAdjust.SlotId == "mod_equipment_000" && - modItemToAdjust.Upd.Repairable.Durability < modItemDbDetails.Properties.MaxDurability) - // Is damaged + if ( + randomUtil.GetChance100(25) + && modItemToAdjust.ParentId == BaseClasses.ARMORED_EQUIPMENT + && modItemToAdjust.SlotId == "mod_equipment_000" + && modItemToAdjust.Upd.Repairable.Durability + < modItemDbDetails.Properties.MaxDurability + ) + // Is damaged { modItemToAdjust.Upd.FaceShield = new UpdFaceShield { - Hits = randomUtil.GetInt(1, 3) + Hits = randomUtil.GetInt(1, 3), }; } } @@ -1270,13 +1353,16 @@ public class FenceService( /// /// Slots of items to randomise /// Array of armor + inserts to get items from - protected void RandomiseArmorInsertsDurabilities(List plateSlots, List armorItemAndMods) + protected void RandomiseArmorInsertsDurabilities( + List plateSlots, + List armorItemAndMods + ) { foreach (var plateSlot in plateSlots) { var plateTpl = plateSlot.Props.Filters[0].Plate; if (string.IsNullOrEmpty(plateTpl)) - // Bsg data lacks a default plate, skip randomisng for this mod + // Bsg data lacks a default plate, skip randomisng for this mod { continue; } @@ -1286,11 +1372,20 @@ public class FenceService( var modItemDbDetails = itemHelper.GetItem(plateTpl).Value; // Chance to remove plate - var plateExistsChance = traderConfig.Fence.ChancePlateExistsInArmorPercent[modItemDbDetails?.Properties?.ArmorClass?.ToString() ?? "3"]; + var plateExistsChance = traderConfig.Fence.ChancePlateExistsInArmorPercent[ + modItemDbDetails?.Properties?.ArmorClass?.ToString() ?? "3" + ]; if (!randomUtil.GetChance100(plateExistsChance)) { // Remove plate from armor - armorItemAndMods = armorItemAndMods.Where(item => !string.Equals(item.SlotId, plateSlot.Name, StringComparison.CurrentCultureIgnoreCase)) + armorItemAndMods = armorItemAndMods + .Where(item => + !string.Equals( + item.SlotId, + plateSlot.Name, + StringComparison.CurrentCultureIgnoreCase + ) + ) .ToList(); continue; @@ -1302,11 +1397,8 @@ public class FenceService( ); // Find items mod to apply durability changes to - var modItemToAdjust = armorWithMods.FirstOrDefault(mod => string.Equals( - mod.SlotId, - plateSlot.Name, - StringComparison.OrdinalIgnoreCase - ) + var modItemToAdjust = armorWithMods.FirstOrDefault(mod => + string.Equals(mod.SlotId, plateSlot.Name, StringComparison.OrdinalIgnoreCase) ); if (modItemToAdjust == null) @@ -1324,7 +1416,7 @@ public class FenceService( modItemToAdjust.Upd.Repairable = new UpdRepairable { Durability = modItemDbDetails.Properties.MaxDurability, - MaxDurability = modItemDbDetails.Properties.MaxDurability + MaxDurability = modItemDbDetails.Properties.MaxDurability, }; } @@ -1359,13 +1451,23 @@ public class FenceService( } // Check for override in config, use values if exists - if (traderConfig.Fence.ItemStackSizeOverrideMinMax.TryGetValue(itemDbDetails.Id, out overrideValues)) + if ( + traderConfig.Fence.ItemStackSizeOverrideMinMax.TryGetValue( + itemDbDetails.Id, + out overrideValues + ) + ) { return randomUtil.GetInt(overrideValues.Min, overrideValues.Max); } // Check for parent override - if (traderConfig.Fence.ItemStackSizeOverrideMinMax.TryGetValue(itemDbDetails.Parent, out overrideValues)) + if ( + traderConfig.Fence.ItemStackSizeOverrideMinMax.TryGetValue( + itemDbDetails.Parent, + out overrideValues + ) + ) { return randomUtil.GetInt(overrideValues.Min, overrideValues.Max); } @@ -1395,7 +1497,9 @@ public class FenceService( } // Remove item and its sub-items to prevent orphans - toDelete.UnionWith(itemHelper.FindAndReturnChildrenByItems(itemAndMods, itemMod.Id)); + toDelete.UnionWith( + itemHelper.FindAndReturnChildrenByItems(itemAndMods, itemMod.Id) + ); } } @@ -1418,7 +1522,10 @@ public class FenceService( protected bool PresetModItemWillBeRemoved(Item weaponMod, HashSet itemsBeingDeleted) { var slotIdsThatCanFail = traderConfig.Fence.PresetSlotsToRemoveChancePercent; - if (!slotIdsThatCanFail.TryGetValue(weaponMod.SlotId, out var removalChance) || removalChance == 0.0) + if ( + !slotIdsThatCanFail.TryGetValue(weaponMod.SlotId, out var removalChance) + || removalChance == 0.0 + ) { return false; } @@ -1445,17 +1552,23 @@ public class FenceService( } // Randomise hp resource of med items - if (itemDetails.Properties.MaxHpResource != null && (itemDetails.Properties.MaxHpResource ?? 0) > 0) + if ( + itemDetails.Properties.MaxHpResource != null + && (itemDetails.Properties.MaxHpResource ?? 0) > 0 + ) { itemToAdjust.Upd.MedKit = new UpdMedKit { - HpResource = randomUtil.GetInt(1, itemDetails.Properties.MaxHpResource.Value) + HpResource = randomUtil.GetInt(1, itemDetails.Properties.MaxHpResource.Value), }; } // Randomise armor durability if ( - itemDetails.Parent is BaseClasses.ARMORED_EQUIPMENT or BaseClasses.FACECOVER or BaseClasses.ARMOR_PLATE + itemDetails.Parent + is BaseClasses.ARMORED_EQUIPMENT + or BaseClasses.FACECOVER + or BaseClasses.ARMOR_PLATE && itemDetails.Properties.MaxDurability.GetValueOrDefault(0) > 0 ) { @@ -1466,7 +1579,7 @@ public class FenceService( itemToAdjust.Upd.Repairable = new UpdRepairable { Durability = values.Durability, - MaxDurability = values.MaxDurability + MaxDurability = values.MaxDurability, }; return; @@ -1476,12 +1589,16 @@ public class FenceService( if (itemHelper.IsOfBaseclass(itemDetails.Id, BaseClasses.WEAPON)) { var weaponDurabilityLimits = traderConfig.Fence.WeaponDurabilityPercentMinMax; - var maxDuraMin = weaponDurabilityLimits.Max.Min / 100 * itemDetails.Properties.MaxDurability; - var maxDuraMax = weaponDurabilityLimits.Max.Max / 100 * itemDetails.Properties.MaxDurability; + var maxDuraMin = + weaponDurabilityLimits.Max.Min / 100 * itemDetails.Properties.MaxDurability; + var maxDuraMax = + weaponDurabilityLimits.Max.Max / 100 * itemDetails.Properties.MaxDurability; var chosenMaxDurability = randomUtil.GetDouble(maxDuraMin.Value, maxDuraMax.Value); - var currentDuraMin = weaponDurabilityLimits.Current.Min / 100 * itemDetails.Properties.MaxDurability; - var currentDuraMax = weaponDurabilityLimits.Current.Max / 100 * itemDetails.Properties.MaxDurability; + var currentDuraMin = + weaponDurabilityLimits.Current.Min / 100 * itemDetails.Properties.MaxDurability; + var currentDuraMax = + weaponDurabilityLimits.Current.Max / 100 * itemDetails.Properties.MaxDurability; var currentDurability = Math.Min( randomUtil.GetDouble(currentDuraMin.Value, currentDuraMax.Value), chosenMaxDurability @@ -1490,7 +1607,7 @@ public class FenceService( itemToAdjust.Upd.Repairable = new UpdRepairable { Durability = currentDurability, - MaxDurability = chosenMaxDurability + MaxDurability = chosenMaxDurability, }; return; @@ -1500,19 +1617,24 @@ public class FenceService( { itemToAdjust.Upd.RepairKit = new UpdRepairKit { - Resource = randomUtil.GetDouble(1, itemDetails.Properties.MaxRepairResource.Value) + Resource = randomUtil.GetDouble(1, itemDetails.Properties.MaxRepairResource.Value), }; return; } // Mechanical key + has limited uses - if (itemHelper.IsOfBaseclass(itemDetails.Id, BaseClasses.KEY_MECHANICAL) && - (itemDetails.Properties.MaximumNumberOfUsage ?? 0) > 1) + if ( + itemHelper.IsOfBaseclass(itemDetails.Id, BaseClasses.KEY_MECHANICAL) + && (itemDetails.Properties.MaximumNumberOfUsage ?? 0) > 1 + ) { itemToAdjust.Upd.Key = new UpdKey { - NumberOfUsages = randomUtil.GetInt(0, itemDetails.Properties.MaximumNumberOfUsage.Value - 1) + NumberOfUsages = randomUtil.GetInt( + 0, + itemDetails.Properties.MaximumNumberOfUsage.Value - 1 + ), }; return; @@ -1527,7 +1649,7 @@ public class FenceService( itemToAdjust.Upd.Resource = new UpdResource { Value = resourceMax - resourceCurrent, - UnitsConsumed = resourceCurrent + UnitsConsumed = resourceCurrent, }; } } @@ -1543,12 +1665,16 @@ public class FenceService( ItemDurabilityCurrentMax equipmentDurabilityLimits ) { - var maxDuraMin = equipmentDurabilityLimits.Max.Min / 100 * itemDetails.Properties.MaxDurability; - var maxDuraMax = equipmentDurabilityLimits.Max.Max / 100 * itemDetails.Properties.MaxDurability; + var maxDuraMin = + equipmentDurabilityLimits.Max.Min / 100 * itemDetails.Properties.MaxDurability; + var maxDuraMax = + equipmentDurabilityLimits.Max.Max / 100 * itemDetails.Properties.MaxDurability; var chosenMaxDurability = randomUtil.GetDouble(maxDuraMin.Value, maxDuraMax.Value); - var currentDuraMin = equipmentDurabilityLimits.Current.Min / 100 * itemDetails.Properties.MaxDurability; - var currentDuraMax = equipmentDurabilityLimits.Current.Max / 100 * itemDetails.Properties.MaxDurability; + var currentDuraMin = + equipmentDurabilityLimits.Current.Min / 100 * itemDetails.Properties.MaxDurability; + var currentDuraMax = + equipmentDurabilityLimits.Current.Max / 100 * itemDetails.Properties.MaxDurability; var chosenCurrentDurability = Math.Min( randomUtil.GetDouble(currentDuraMin.Value, currentDuraMax.Value), chosenMaxDurability @@ -1557,7 +1683,7 @@ public class FenceService( return new UpdRepairable { Durability = chosenCurrentDurability, - MaxDurability = chosenMaxDurability + MaxDurability = chosenMaxDurability, }; } @@ -1566,7 +1692,9 @@ public class FenceService( /// /// Limits as defined in config /// Record, key: item tplId, value: current/max item count allowed - protected Dictionary InitItemLimitCounter(Dictionary limits) + protected Dictionary InitItemLimitCounter( + Dictionary limits + ) { var itemTypeCounts = new Dictionary(); @@ -1595,7 +1723,9 @@ public class FenceService( /// Refresh time in seconds protected int GetFenceRefreshTime() { - var fence = traderConfig.UpdateTime.FirstOrDefault(x => x.TraderId == Traders.FENCE).Seconds; + var fence = traderConfig + .UpdateTime.FirstOrDefault(x => x.TraderId == Traders.FENCE) + .Seconds; return randomUtil.GetInt(fence.Min, fence.Max); } @@ -1646,7 +1776,9 @@ public class FenceService( fenceAssortItem = fenceDiscountAssort.Items.FirstOrDefault(item => item.Id == assortId); if (fenceAssortItem == null) { - logger.Error(localisationService.GetText("fence-unable_to_find_offer_by_id", assortId)); + logger.Error( + localisationService.GetText("fence-unable_to_find_offer_by_id", assortId) + ); return; } @@ -1676,7 +1808,9 @@ public class FenceService( // No offer found in main assort, check discount items if (indexToRemove == -1) { - indexToRemove = fenceDiscountAssort.Items.FindIndex(item => item.Id == itemToRemove.Id); + indexToRemove = fenceDiscountAssort.Items.FindIndex(item => + item.Id == itemToRemove.Id + ); fenceDiscountAssort.Items.Splice(indexToRemove, 1); if (indexToRemove == -1) diff --git a/Libraries/SPTarkov.Server.Core/Services/GiftService.cs b/Libraries/SPTarkov.Server.Core/Services/GiftService.cs index 6de68593..70025678 100644 --- a/Libraries/SPTarkov.Server.Core/Services/GiftService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/GiftService.cs @@ -19,7 +19,8 @@ public class GiftService( HashUtil _hashUtil, TimeUtil _timeUtil, ProfileHelper _profileHelper, - ConfigServer _configServer) + ConfigServer _configServer +) { protected GiftsConfig _giftConfig = _configServer.GetConfig(); @@ -86,7 +87,9 @@ public class GiftService( if (giftData.Items?.Count > 0 && giftData.CollectionTimeHours is null) { - _logger.Warning($"Gift {giftId} has items but no collection time limit, defaulting to 48 hours"); + _logger.Warning( + $"Gift {giftId} has items but no collection time limit, defaulting to 48 hours" + ); } // Handle system messages @@ -162,11 +165,13 @@ public class GiftService( { Id = GetSenderId(giftData), Aid = 1234567, // TODO - pass proper aid value - Info = null + Info = null, }, MessageText = giftData.MessageText, Items = giftData.Items, - ItemsMaxStorageLifetimeSeconds = _timeUtil.GetHoursAsSeconds(giftData.CollectionTimeHours ?? 0) + ItemsMaxStorageLifetimeSeconds = _timeUtil.GetHoursAsSeconds( + giftData.CollectionTimeHours ?? 0 + ), }; if (giftData.Trader is not null) @@ -218,7 +223,12 @@ public class GiftService( case GiftSenderType.User: return MessageType.UserMessage; default: - _logger.Error(_localisationService.GetText("gift-unable_to_handle_message_type_command", giftData.Sender)); + _logger.Error( + _localisationService.GetText( + "gift-unable_to_handle_message_type_command", + giftData.Sender + ) + ); return null; } } @@ -234,7 +244,7 @@ public class GiftService( { 1 => "PraporGiftDay1", 2 => "PraporGiftDay2", - _ => null + _ => null, }; if (giftId is not null) diff --git a/Libraries/SPTarkov.Server.Core/Services/I18nService.cs b/Libraries/SPTarkov.Server.Core/Services/I18nService.cs index fc662858..47746c45 100644 --- a/Libraries/SPTarkov.Server.Core/Services/I18nService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/I18nService.cs @@ -12,7 +12,8 @@ public class I18nService private readonly FileUtil _fileUtil; private readonly JsonUtil _jsonUtil; - private readonly Dictionary>> _loadedLocales = new(); + private readonly Dictionary>> _loadedLocales = + new(); private readonly LocaleService _localeService; private HashSet _locales; private string? _setLocale; @@ -40,7 +41,10 @@ public class I18nService private void Initialize() { - var files = _fileUtil.GetFiles(_directory, true).Where(f => _fileUtil.GetFileExtension(f) == "json").ToList(); + var files = _fileUtil + .GetFiles(_directory, true) + .Where(f => _fileUtil.GetFileExtension(f) == "json") + .ToList(); if (files.Count == 0) { throw new Exception($"Localisation files in directory {_directory} not found."); @@ -50,15 +54,18 @@ public class I18nService { _loadedLocales.Add( _fileUtil.StripExtension(file), - new LazyLoad>(() => _jsonUtil.DeserializeFromFile>(file) ?? - new Dictionary() + new LazyLoad>(() => + _jsonUtil.DeserializeFromFile>(file) + ?? new Dictionary() ) ); } if (!_loadedLocales.ContainsKey(_defaultLocale)) { - throw new Exception($"The default locale '{_defaultLocale}' does not exist on the loaded locales."); + throw new Exception( + $"The default locale '{_defaultLocale}' does not exist on the loaded locales." + ); } } @@ -105,7 +112,10 @@ public class I18nService _loadedLocales.TryGetValue(_defaultLocale, out var defaults); if (!defaults.Value.TryGetValue(key, out value)) { - value = _localeService.GetLocaleDb(_defaultLocale).FirstOrDefault(x => x.Key == key).Value; + value = _localeService + .GetLocaleDb(_defaultLocale) + .FirstOrDefault(x => x.Key == key) + .Value; } return value ?? key; @@ -136,14 +146,18 @@ public class I18nService var localizedName = $"{{{{{propertyInfo.GetJsonName()}}}}}"; if (rawLocalizedString.Contains(localizedName)) { - rawLocalizedString = rawLocalizedString.Replace(localizedName, propertyInfo.GetValue(args)?.ToString() ?? string.Empty); + rawLocalizedString = rawLocalizedString.Replace( + localizedName, + propertyInfo.GetValue(args)?.ToString() ?? string.Empty + ); } } return rawLocalizedString; } - public string GetLocalised(string key, T? value) where T : IConvertible + public string GetLocalised(string key, T? value) + where T : IConvertible { var rawLocalizedString = GetLocalisedValue(key); return rawLocalizedString.Replace("%s", value?.ToString()); diff --git a/Libraries/SPTarkov.Server.Core/Services/InMemoryCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/InMemoryCacheService.cs index 93c704a9..7d849602 100644 --- a/Libraries/SPTarkov.Server.Core/Services/InMemoryCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/InMemoryCacheService.cs @@ -4,9 +4,7 @@ using SPTarkov.Server.Core.Utils.Cloners; namespace SPTarkov.Server.Core.Services; [Injectable(InjectionType.Singleton)] -public class InMemoryCacheService( - ICloner _cloner -) +public class InMemoryCacheService(ICloner _cloner) { protected Dictionary _cacheData = new(); @@ -29,7 +27,7 @@ public class InMemoryCacheService( { if (_cacheData.ContainsKey(key)) { - return (T) _cacheData[key]; + return (T)_cacheData[key]; } return default; diff --git a/Libraries/SPTarkov.Server.Core/Services/InsuranceService.cs b/Libraries/SPTarkov.Server.Core/Services/InsuranceService.cs index b4f3b44a..a466bd28 100644 --- a/Libraries/SPTarkov.Server.Core/Services/InsuranceService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/InsuranceService.cs @@ -79,7 +79,12 @@ public class InsuranceService( var traderBase = _traderHelper.GetTrader(traderKvP.Key, sessionID); if (traderBase is null) { - _logger.Error(_localisationService.GetText("insurance-unable_to_find_trader_by_id", traderKvP.Key)); + _logger.Error( + _localisationService.GetText( + "insurance-unable_to_find_trader_by_id", + traderKvP.Key + ) + ); continue; } @@ -87,7 +92,12 @@ public class InsuranceService( var dialogueTemplates = _databaseService.GetTrader(traderKvP.Key).Dialogue; if (dialogueTemplates is null) { - _logger.Error(_localisationService.GetText("insurance-trader_lacks_dialogue_property", traderKvP.Key)); + _logger.Error( + _localisationService.GetText( + "insurance-trader_lacks_dialogue_property", + traderKvP.Key + ) + ); continue; } @@ -96,7 +106,7 @@ public class InsuranceService( { Date = _timeUtil.GetDateMailFormat(), Time = _timeUtil.GetTimeMailFormat(), - Location = mapId + Location = mapId, }; // Send "i will go look for your stuff" message from trader to player @@ -104,25 +114,32 @@ public class InsuranceService( sessionID, traderKvP.Key, MessageType.NpcTraderMessage, - _randomUtil.GetArrayValue(dialogueTemplates["insuranceStart"] ?? ["INSURANCE START MESSAGE MISSING"]), + _randomUtil.GetArrayValue( + dialogueTemplates["insuranceStart"] ?? ["INSURANCE START MESSAGE MISSING"] + ), null, - _timeUtil.GetHoursAsSeconds((int) globals.Configuration?.Insurance?.MaxStorageTimeInHour), + _timeUtil.GetHoursAsSeconds( + (int)globals.Configuration?.Insurance?.MaxStorageTimeInHour + ), systemData ); // Store insurance to send to player later in profile // Store insurance return details in profile + "hey i found your stuff, here you go!" message details to send to player at a later date - _saveServer.GetProfile(sessionID) + _saveServer + .GetProfile(sessionID) .InsuranceList.Add( new Insurance { - ScheduledTime = (int) GetInsuranceReturnTimestamp(pmcData, traderBase), + ScheduledTime = (int)GetInsuranceReturnTimestamp(pmcData, traderBase), TraderId = traderKvP.Key, - MaxStorageTime = (int) GetMaxInsuranceStorageTime(traderBase), + MaxStorageTime = (int)GetMaxInsuranceStorageTime(traderBase), SystemData = systemData, MessageType = MessageType.InsuranceReturn, - MessageTemplateId = _randomUtil.GetArrayValue(dialogueTemplates["insuranceFound"]), - Items = GetInsurance(sessionID)[traderKvP.Key] + MessageTemplateId = _randomUtil.GetArrayValue( + dialogueTemplates["insuranceFound"] + ), + Items = GetInsurance(sessionID)[traderKvP.Key], } ); } @@ -144,7 +161,9 @@ public class InsuranceService( { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Insurance override used: returning in {_insuranceConfig.ReturnTimeOverrideSeconds} seconds"); + _logger.Debug( + $"Insurance override used: returning in {_insuranceConfig.ReturnTimeOverrideSeconds} seconds" + ); } return _timeUtil.GetTimeStamp() + _insuranceConfig.ReturnTimeOverrideSeconds; @@ -160,7 +179,10 @@ public class InsuranceService( var traderMinReturnAsSeconds = trader.Insurance.MinReturnHour * TimeUtil.OneHourAsSeconds; var traderMaxReturnAsSeconds = trader.Insurance.MaxReturnHour * TimeUtil.OneHourAsSeconds; - var randomisedReturnTimeSeconds = _randomUtil.GetDouble(traderMinReturnAsSeconds.Value, traderMaxReturnAsSeconds.Value); + var randomisedReturnTimeSeconds = _randomUtil.GetDouble( + traderMinReturnAsSeconds.Value, + traderMaxReturnAsSeconds.Value + ); // Check for Mark of The Unheard in players special slots (only slot item can fit) var globals = _databaseService.GetGlobals(); @@ -170,38 +192,51 @@ public class InsuranceService( "SpecialSlot" ); if (hasMarkOfUnheard) - // Reduce return time by globals multiplier value + // Reduce return time by globals multiplier value { - randomisedReturnTimeSeconds *= globals.Configuration.Insurance.CoefOfHavingMarkOfUnknown.Value; + randomisedReturnTimeSeconds *= globals + .Configuration + .Insurance + .CoefOfHavingMarkOfUnknown + .Value; } // EoD has 30% faster returns - if (globals.Configuration.Insurance.EditionSendingMessageTime.TryGetValue(pmcData.Info.GameVersion, out var editionModifier)) + if ( + globals.Configuration.Insurance.EditionSendingMessageTime.TryGetValue( + pmcData.Info.GameVersion, + out var editionModifier + ) + ) { randomisedReturnTimeSeconds *= editionModifier.Multiplier.Value; } // Calculate the final return time based on our bonus percent - var finalReturnTimeSeconds = randomisedReturnTimeSeconds * (1d - insuranceReturnTimeBonusPercent); + var finalReturnTimeSeconds = + randomisedReturnTimeSeconds * (1d - insuranceReturnTimeBonusPercent); return _timeUtil.GetTimeStamp() + finalReturnTimeSeconds; } protected double GetMaxInsuranceStorageTime(TraderBase traderBase) { if (_insuranceConfig.StorageTimeOverrideSeconds > 0) - // Override exists, use instead of traders value + // Override exists, use instead of traders value { return _insuranceConfig.StorageTimeOverrideSeconds; } - return _timeUtil.GetHoursAsSeconds((int) traderBase.Insurance.MaxStorageTime); + return _timeUtil.GetHoursAsSeconds((int)traderBase.Insurance.MaxStorageTime); } /// /// Store lost gear post-raid inside profile, ready for later code to pick it up and mail it /// /// Gear to store - generated by GetGearLostInRaid() - public void StoreGearLostInRaidToSendLater(string sessionID, List equipmentPkg) + public void StoreGearLostInRaidToSendLater( + string sessionID, + List equipmentPkg + ) { // Process all insured items lost in-raid foreach (var gear in equipmentPkg) @@ -217,16 +252,24 @@ public class InsuranceService( /// Insured items lost in a raid /// Player profile /// InsuranceEquipmentPkg list - public List MapInsuredItemsToTrader(string sessionId, List lostInsuredItems, PmcData pmcProfile) + public List MapInsuredItemsToTrader( + string sessionId, + List lostInsuredItems, + PmcData pmcProfile + ) { List result = []; foreach (var lostItem in lostInsuredItems) { - var insuranceDetails = pmcProfile.InsuredItems.FirstOrDefault(insuredItem => insuredItem.ItemId == lostItem.Id); + var insuranceDetails = pmcProfile.InsuredItems.FirstOrDefault(insuredItem => + insuredItem.ItemId == lostItem.Id + ); if (insuranceDetails is null) { - _logger.Error($"unable to find insurance details for item id: {lostItem.Id} with tpl: {lostItem.Template}"); + _logger.Error( + $"unable to find insurance details for item id: {lostItem.Id} with tpl: {lostItem.Template}" + ); continue; } @@ -243,7 +286,7 @@ public class InsuranceService( SessionId = sessionId, ItemToReturnToPlayer = lostItem, PmcData = pmcProfile, - TraderId = insuranceDetails.TId + TraderId = insuranceDetails.TId, } ); } @@ -299,11 +342,11 @@ public class InsuranceService( AddInsuranceItemToArray(sessionId, traderId, itemToReturnToPlayer); // Remove item from insured items array as its been processed - pmcData.InsuredItems = pmcData.InsuredItems.Where(item => - { - return item.ItemId != itemToReturnToPlayer.Id; - } - ) + pmcData.InsuredItems = pmcData + .InsuredItems.Where(item => + { + return item.ItemId != itemToReturnToPlayer.Id; + }) .ToList(); } @@ -346,10 +389,15 @@ public class InsuranceService( /// Item to be insured /// Trader item is insured with /// price in roubles - public double GetRoublePriceToInsureItemWithTrader(PmcData? pmcData, Item inventoryItem, string traderId) + public double GetRoublePriceToInsureItemWithTrader( + PmcData? pmcData, + Item inventoryItem, + string traderId + ) { - var price = _itemHelper.GetStaticItemPrice(inventoryItem.Template) * - (_traderHelper.GetLoyaltyLevel(traderId, pmcData).InsurancePriceCoefficient / 100); + var price = + _itemHelper.GetStaticItemPrice(inventoryItem.Template) + * (_traderHelper.GetLoyaltyLevel(traderId, pmcData).InsurancePriceCoefficient / 100); return Math.Ceiling(price ?? 1); } diff --git a/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs b/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs index ce9472cb..b3e2e1c5 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs @@ -28,7 +28,9 @@ public class ItemBaseClassService( _itemBaseClassesCache = new Dictionary>(); var items = _databaseService.GetItems(); - var filteredDbItems = items.Where(x => string.Equals(x.Value.Type, "Item", StringComparison.OrdinalIgnoreCase)); + var filteredDbItems = items.Where(x => + string.Equals(x.Value.Type, "Item", StringComparison.OrdinalIgnoreCase) + ); foreach (var item in filteredDbItems) { var itemIdToUpdate = item.Value.Id; @@ -117,7 +119,11 @@ public class ItemBaseClassService( /// True if item is of type Item private bool CachedItemIsOfItemType(string itemTemplateId) { - return string.Equals(_databaseService.GetItems()[itemTemplateId]?.Type, "Item", StringComparison.OrdinalIgnoreCase); + return string.Equals( + _databaseService.GetItems()[itemTemplateId]?.Type, + "Item", + StringComparison.OrdinalIgnoreCase + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Services/LocaleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocaleService.cs index 63c28014..1814e333 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocaleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocaleService.cs @@ -21,12 +21,13 @@ public class LocaleService( /// Dictionary of locales for desired language - en/fr/cn public Dictionary GetLocaleDb(string? language = null) { - var languageToUse = string.IsNullOrEmpty(language) - ? GetDesiredGameLocale() - : language; + var languageToUse = string.IsNullOrEmpty(language) ? GetDesiredGameLocale() : language; // if it can't get locales for language provided, default to en - if (TryGetLocaleDb(languageToUse, out var localeToReturn) || TryGetLocaleDb("en", out localeToReturn)) + if ( + TryGetLocaleDb(languageToUse, out var localeToReturn) + || TryGetLocaleDb("en", out localeToReturn) + ) { return localeToReturn; } @@ -40,10 +41,17 @@ public class LocaleService( /// The language key for which the locale database should be retrieved. /// The resulting locale database as a dictionary, or null if the operation fails. /// True if the locale database was successfully retrieved, otherwise false. - protected bool TryGetLocaleDb(string languageKey, out Dictionary? localeToReturn) + protected bool TryGetLocaleDb( + string languageKey, + out Dictionary? localeToReturn + ) { localeToReturn = null; - if (!_databaseServer.GetTables().Locales.Global.TryGetValue(languageKey, out var keyedLocales)) + if ( + !_databaseServer + .GetTables() + .Locales.Global.TryGetValue(languageKey, out var keyedLocales) + ) { return false; } @@ -72,7 +80,11 @@ public class LocaleService( /// Locale e.g en/ge/cz/cn public string GetDesiredServerLocale() { - return string.Equals(_localeConfig.ServerLocale, "system", StringComparison.OrdinalIgnoreCase) + return string.Equals( + _localeConfig.ServerLocale, + "system", + StringComparison.OrdinalIgnoreCase + ) ? GetPlatformForServerLocale() : _localeConfig.ServerLocale.ToLower(); // Use custom locale value } @@ -120,7 +132,7 @@ public class LocaleService( if (_localeConfig.ServerSupportedLocales.Contains(languageCode)) { if (baseNameCode == "zh") - // Handle edge case of zh + // Handle edge case of zh { return "zh-cn"; } @@ -129,12 +141,14 @@ public class LocaleService( } if (baseNameCode == "pt") - // Handle edge case of pt + // Handle edge case of pt { return "pt-pt"; } - _logger.Warning($"Unsupported system language found: {baseNameCode}, langCode: {languageCode} falling back to english for server locale"); + _logger.Warning( + $"Unsupported system language found: {baseNameCode}, langCode: {languageCode} falling back to english for server locale" + ); return "en"; } @@ -178,12 +192,14 @@ public class LocaleService( } if (baseNameCode == "zh") - // Handle edge case of zh + // Handle edge case of zh { return "cn"; } - _logger.Warning($"Unsupported system language found: {languageCode} baseLocale: {baseNameCode}, falling back to english for client locale"); + _logger.Warning( + $"Unsupported system language found: {languageCode} baseLocale: {baseNameCode}, falling back to english for client locale" + ); return "en"; } @@ -204,7 +220,9 @@ public class LocaleService( /// /// Blank out the "test" mail message from prapor /// - protected Dictionary RemovePraporTestMessage(Dictionary dbLocales) + protected Dictionary RemovePraporTestMessage( + Dictionary dbLocales + ) { dbLocales["61687e2c3e526901fa76baf9"] = ""; return dbLocales; diff --git a/Libraries/SPTarkov.Server.Core/Services/LocalisationService.cs b/Libraries/SPTarkov.Server.Core/Services/LocalisationService.cs index be50f9b1..f8b2da59 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocalisationService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocalisationService.cs @@ -63,7 +63,8 @@ public class LocalisationService /// Key to look up locale for /// Value to localize /// Localised string - public string GetText(string key, T value) where T : IConvertible? + public string GetText(string key, T value) + where T : IConvertible? { return _i18nService.GetLocalised(key, value); } diff --git a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs index 7e1b9a8c..d8fc4b98 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs @@ -128,16 +128,21 @@ public class LocationLifecycleService /// /// Handle client/match/local/start /// - public virtual StartLocalRaidResponseData StartLocalRaid(string sessionId, StartLocalRaidRequestData request) + public virtual StartLocalRaidResponseData StartLocalRaid( + string sessionId, + StartLocalRaidRequestData request + ) { _logger.Debug($"Starting: {request.Location}"); var playerProfile = _profileHelper.GetFullProfile(sessionId); // Remove skill fatigue values - ResetSkillPointsEarnedDuringRaid(string.Equals(request.PlayerSide, "pmc", StringComparison.OrdinalIgnoreCase) - ? playerProfile.CharacterData.PmcData.Skills.Common - : playerProfile.CharacterData.ScavData.Skills.Common); + ResetSkillPointsEarnedDuringRaid( + string.Equals(request.PlayerSide, "pmc", StringComparison.OrdinalIgnoreCase) + ? playerProfile.CharacterData.PmcData.Skills.Common + : playerProfile.CharacterData.ScavData.Skills.Common + ); // Raid is starting, adjust run times to reduce server load while player is in raid _ragfairConfig.RunIntervalSeconds = _ragfairConfig.RunIntervalValues.InRaid; @@ -149,28 +154,34 @@ public class LocationLifecycleService ServerSettings = _databaseService.GetLocationServices(), // TODO - is this per map or global? Profile = new ProfileInsuredItems { - InsuredItems = playerProfile.CharacterData.PmcData.InsuredItems + InsuredItems = playerProfile.CharacterData.PmcData.InsuredItems, }, - LocationLoot = GenerateLocationAndLoot(sessionId, request.Location, !request.ShouldSkipLootGeneration ?? true), + LocationLoot = GenerateLocationAndLoot( + sessionId, + request.Location, + !request.ShouldSkipLootGeneration ?? true + ), TransitionType = TransitionType.NONE, Transition = new Transition { TransitionType = TransitionType.NONE, TransitionRaidId = _hashUtil.Generate(), TransitionCount = 0, - VisitedLocations = [] - } + VisitedLocations = [], + }, }; // Only has value when transitioning into map from previous one if (request.Transition is not null) - // TODO - why doesn't the raid after transit have any transit data? + // TODO - why doesn't the raid after transit have any transit data? { result.Transition = request.Transition; } // Get data stored at end of previous raid (if any) - var transitionData = _profileActivityService.GetProfileActivityRaidData(sessionId)?.LocationTransit; + var transitionData = _profileActivityService + .GetProfileActivityRaidData(sessionId) + ?.LocationTransit; if (transitionData is not null) { @@ -224,9 +235,13 @@ public class LocationLifecycleService } // Find only scav extracts and overwrite existing exits with them - var scavExtracts = mapExtracts.Where(extract => string.Equals(extract.Side, "scav", StringComparison.OrdinalIgnoreCase)).ToList(); + var scavExtracts = mapExtracts + .Where(extract => + string.Equals(extract.Side, "scav", StringComparison.OrdinalIgnoreCase) + ) + .ToList(); if (scavExtracts.Count > 0) - // Scav extracts found, use them + // Scav extracts found, use them { locationData.Exits.AddRange(scavExtracts); } @@ -241,14 +256,22 @@ public class LocationLifecycleService foreach (var botId in _pmcConfig.HostilitySettings) { var configHostilityChanges = _pmcConfig.HostilitySettings[botId.Key]; - var locationBotHostilityDetails = location.BotLocationModifier.AdditionalHostilitySettings.FirstOrDefault(botSettings => - string.Equals(botSettings.BotRole, botId.Key, StringComparison.OrdinalIgnoreCase) - ); + var locationBotHostilityDetails = + location.BotLocationModifier.AdditionalHostilitySettings.FirstOrDefault( + botSettings => + string.Equals( + botSettings.BotRole, + botId.Key, + StringComparison.OrdinalIgnoreCase + ) + ); // No matching bot in config, skip if (locationBotHostilityDetails is null) { - _logger.Warning($"No bot: {botId} hostility values found on: {location.Id}, can only edit existing. Skipping"); + _logger.Warning( + $"No bot: {botId} hostility values found on: {location.Id}, can only edit existing. Skipping" + ); continue; } @@ -271,15 +294,17 @@ public class LocationLifecycleService locationBotHostilityDetails.ChancedEnemies = []; foreach (var chanceDetailsToApply in configHostilityChanges.ChancedEnemies) { - var locationBotDetails = locationBotHostilityDetails.ChancedEnemies.FirstOrDefault(botChance => botChance.Role == chanceDetailsToApply.Role - ); + var locationBotDetails = + locationBotHostilityDetails.ChancedEnemies.FirstOrDefault(botChance => + botChance.Role == chanceDetailsToApply.Role + ); if (locationBotDetails is not null) - // Existing + // Existing { locationBotDetails.EnemyChance = chanceDetailsToApply.EnemyChance; } else - // Add new + // Add new { locationBotHostilityDetails.ChancedEnemies.Add(chanceDetailsToApply); } @@ -302,25 +327,29 @@ public class LocationLifecycleService // Adjust vs bear hostility chance if (configHostilityChanges.BearEnemyChance is not null) { - locationBotHostilityDetails.BearEnemyChance = configHostilityChanges.BearEnemyChance; + locationBotHostilityDetails.BearEnemyChance = + configHostilityChanges.BearEnemyChance; } // Adjust vs usec hostility chance if (configHostilityChanges.UsecEnemyChance is not null) { - locationBotHostilityDetails.UsecEnemyChance = configHostilityChanges.UsecEnemyChance; + locationBotHostilityDetails.UsecEnemyChance = + configHostilityChanges.UsecEnemyChance; } // Adjust vs savage hostility chance if (configHostilityChanges.SavageEnemyChance is not null) { - locationBotHostilityDetails.SavageEnemyChance = configHostilityChanges.SavageEnemyChance; + locationBotHostilityDetails.SavageEnemyChance = + configHostilityChanges.SavageEnemyChance; } // Adjust vs scav hostility behaviour if (configHostilityChanges.SavagePlayerBehaviour is not null) { - locationBotHostilityDetails.SavagePlayerBehaviour = configHostilityChanges.SavagePlayerBehaviour; + locationBotHostilityDetails.SavagePlayerBehaviour = + configHostilityChanges.SavagePlayerBehaviour; } } } @@ -337,7 +366,11 @@ public class LocationLifecycleService /// /// Generate a maps base location (cloned) and loot /// - public virtual LocationBase GenerateLocationAndLoot(string sessionId, string name, bool generateLoot = true) + public virtual LocationBase GenerateLocationAndLoot( + string sessionId, + string name, + bool generateLoot = true + ) { var location = _databaseService.GetLocation(name); var locationBaseClone = _cloner.Clone(location.Base); @@ -362,7 +395,9 @@ public class LocationLifecycleService // Adjust raid based on whether this is a scav run LocationConfig? locationConfigClone = null; - var raidAdjustments = _profileActivityService.GetProfileActivityRaidData(sessionId).RaidAdjustments; + var raidAdjustments = _profileActivityService + .GetProfileActivityRaidData(sessionId) + .RaidAdjustments; if (raidAdjustments is not null) { locationConfigClone = _cloner.Clone(_locationConfig); // Clone values so they can be used to reset originals later @@ -372,7 +407,10 @@ public class LocationLifecycleService var staticAmmoDist = _cloner.Clone(location.StaticAmmo); // Create containers and add loot to them - var staticLoot = _locationLootGenerator.GenerateStaticContainers(locationBaseClone, staticAmmoDist); + var staticLoot = _locationLootGenerator.GenerateStaticContainers( + locationBaseClone, + staticAmmoDist + ); locationBaseClone.Loot.AddRange(staticLoot); // Add dynamic loot to output loot @@ -391,7 +429,10 @@ public class LocationLifecycleService // Done generating, log results _logger.Success( - _localisationService.GetText("location-dynamic_items_spawned_success", dynamicSpawnPoints.Count) + _localisationService.GetText( + "location-dynamic_items_spawned_success", + dynamicSpawnPoints.Count + ) ); _logger.Success(_localisationService.GetText("location-generated_success", name)); @@ -449,7 +490,8 @@ public class LocationLifecycleService // TODO - Persist each players last visited location history over multiple transits, e.g using InMemoryCacheService, need to take care to not let data get stored forever // Store transfer data for later use in `startLocalRaid()` when next raid starts request.LocationTransit.SptExitName = request.Results.ExitName; - _profileActivityService.GetProfileActivityRaidData(sessionId).LocationTransit = request.LocationTransit; + _profileActivityService.GetProfileActivityRaidData(sessionId).LocationTransit = + request.LocationTransit; } if (!isPmc) @@ -461,7 +503,8 @@ public class LocationLifecycleService isDead, isTransfer, isSurvived, - request); + request + ); return; } @@ -485,9 +528,9 @@ public class LocationLifecycleService // Handle coop exit if ( - request.Results.ExitName is not null && - ExtractTakenWasCoop(request.Results.ExitName) && - _traderConfig.Fence.CoopExtractGift.SendGift + request.Results.ExitName is not null + && ExtractTakenWasCoop(request.Results.ExitName) + && _traderConfig.Fence.CoopExtractGift.SendGift ) { HandleCoopExtract(sessionId, pmcProfile, request.Results.ExitName); @@ -512,7 +555,7 @@ public class LocationLifecycleService } // Flatten - List mailableLoot = [..loot.SelectMany(x => x)]; + List mailableLoot = [.. loot.SelectMany(x => x)]; // Send message from fence giving player reward generated above _mailSendService.SendLocalisedNpcMessageToPlayer( @@ -570,9 +613,14 @@ public class LocationLifecycleService // Check if new standing has leveled up trader _traderHelper.LevelUp(fenceId, pmcData); - pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max((int) pmcData.TradersInfo[fenceId].LoyaltyLevel, 1); + pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max( + (int)pmcData.TradersInfo[fenceId].LoyaltyLevel, + 1 + ); - _logger.Debug($"Car extract: {extractName} used, total times taken: {pmcData.CarExtractCounts[extractName]}"); + _logger.Debug( + $"Car extract: {extractName} used, total times taken: {pmcData.CarExtractCounts[extractName]}" + ); // Copy updated fence rep values into scav profile to ensure consistency var scavData = _profileHelper.GetScavProfile(sessionId); @@ -603,7 +651,10 @@ public class LocationLifecycleService // Check if new standing has leveled up trader _traderHelper.LevelUp(fenceId, pmcData); - pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max((int) pmcData.TradersInfo[fenceId].LoyaltyLevel, 1); + pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max( + (int)pmcData.TradersInfo[fenceId].LoyaltyLevel, + 1 + ); _logger.Debug($"COOP extract: {extractName} used"); @@ -620,7 +671,11 @@ public class LocationLifecycleService /// Amount gained for the first extract /// Number of times extract was taken /// Fence standing after taking extract - protected double GetFenceStandingAfterExtract(PmcData pmcData, double baseGain, double extractCount) + protected double GetFenceStandingAfterExtract( + PmcData pmcData, + double baseGain, + double extractCount + ) { const string fenceId = Traders.FENCE; var fenceStanding = pmcData.TradersInfo[fenceId].Standing; @@ -629,8 +684,10 @@ public class LocationLifecycleService fenceStanding += Math.Max(baseGain / extractCount, 0.01); // Ensure fence loyalty level is not above/below the range -7 to 15 - var newFenceStanding = Math.Min(Math.Max((double) fenceStanding, -7), 15); - _logger.Debug($"Old vs new fence standing: {pmcData.TradersInfo[fenceId].Standing}, {newFenceStanding}"); + var newFenceStanding = Math.Min(Math.Max((double)fenceStanding, -7), 15); + _logger.Debug( + $"Old vs new fence standing: {pmcData.TradersInfo[fenceId].Standing}, {newFenceStanding}" + ); return Math.Round(newFenceStanding, 2); } @@ -668,7 +725,8 @@ public class LocationLifecycleService bool isDead, bool isTransfer, bool isSurvived, - EndLocalRaidRequestData request) + EndLocalRaidRequestData request + ) { var postRaidProfile = request.Results.Profile; @@ -682,7 +740,13 @@ public class LocationLifecycleService // We want scav inventory to persist into next raid when pscav is moving between maps // Also adjust FiR status when exit was runthrough - _inRaidHelper.SetInventory(sessionId, scavProfile, postRaidProfile, isSurvived, isTransfer); + _inRaidHelper.SetInventory( + sessionId, + scavProfile, + postRaidProfile, + isSurvived, + isTransfer + ); } scavProfile.Info.Level = postRaidProfile.Info.Level; @@ -710,19 +774,26 @@ public class LocationLifecycleService _logger.Error($"post raid fence data not found for: {sessionId}"); } - scavProfile.TradersInfo[Traders.FENCE].Standing = Math.Min(Math.Max(postRaidFenceData.Standing.Value, fenceMin), fenceMax); + scavProfile.TradersInfo[Traders.FENCE].Standing = Math.Min( + Math.Max(postRaidFenceData.Standing.Value, fenceMin), + fenceMax + ); // Successful extract as scav, give some rep - if (IsPlayerSurvived(request.Results) && scavProfile.TradersInfo[Traders.FENCE].Standing < fenceMax) + if ( + IsPlayerSurvived(request.Results) + && scavProfile.TradersInfo[Traders.FENCE].Standing < fenceMax + ) { - scavProfile.TradersInfo[Traders.FENCE].Standing += _inRaidConfig.ScavExtractStandingGain; + scavProfile.TradersInfo[Traders.FENCE].Standing += + _inRaidConfig.ScavExtractStandingGain; } // Copy scav fence values to PMC profile pmcProfile.TradersInfo[Traders.FENCE] = scavProfile.TradersInfo[Traders.FENCE]; if (ProfileHasConditionCounters(scavProfile)) - // Scav quest progress needs to be moved to pmc so player can see it in menu / hand them in + // Scav quest progress needs to be moved to pmc so player can see it in menu / hand them in { MigrateScavQuestProgressToPmcProfile(scavProfile, pmcProfile); } @@ -765,7 +836,8 @@ public class LocationLifecycleService } // Get counters related to scav quest - var matchingCounters = scavProfile.TaskConditionCounters.Where(counter => counter.Value.SourceId == scavQuest.QId + var matchingCounters = scavProfile.TaskConditionCounters.Where(counter => + counter.Value.SourceId == scavQuest.QId ); if (matchingCounters is null) @@ -803,13 +875,16 @@ public class LocationLifecycleService // Check each body part foreach (var (_, hpValues) in profileHealth.BodyParts) { - if (transitSettings.AdjustLimbHealthPoints.GetValueOrDefault() - && hpValues.Health.Minimum <= 0) + if ( + transitSettings.AdjustLimbHealthPoints.GetValueOrDefault() + && hpValues.Health.Minimum <= 0 + ) { - // Limb has been destroyed, reset - hpValues.Health.Current = _randomUtil.GetPercentOfValue( - transitSettings.LimbHealPercent.GetValueOrDefault(30), - hpValues.Health.Maximum.Value); + // Limb has been destroyed, reset + hpValues.Health.Current = _randomUtil.GetPercentOfValue( + transitSettings.LimbHealPercent.GetValueOrDefault(30), + hpValues.Health.Maximum.Value + ); } if (!(hpValues.Effects?.Count > 0)) @@ -819,8 +894,8 @@ public class LocationLifecycleService } // Limb has effects, check for blacklisted values and remove - var keysToRemove = hpValues.Effects.Keys - .Where(key => transitSettings.EffectsToRemove.Contains(key)) + var keysToRemove = hpValues + .Effects.Keys.Where(key => transitSettings.EffectsToRemove.Contains(key)) .ToHashSet(); foreach (var key in keysToRemove) @@ -864,7 +939,8 @@ public class LocationLifecycleService bool isSurvived, bool isTransfer, EndLocalRaidRequestData request, - string locationName) + string locationName + ) { var pmcProfile = fullProfile.CharacterData.PmcData; var postRaidProfile = request.Results.Profile; @@ -891,7 +967,12 @@ public class LocationLifecycleService pmcProfile.Quests = ProcessPostRaidQuests(postRaidProfile.Quests); // Handle edge case - must occur AFTER processPostRaidQuests() - LightkeeperQuestWorkaround(sessionId, postRaidProfile.Quests, preRaidProfileQuestDataClone, pmcProfile); + LightkeeperQuestWorkaround( + sessionId, + postRaidProfile.Quests, + preRaidProfileQuestDataClone, + pmcProfile + ); pmcProfile.WishList = postRaidProfile.WishList; @@ -906,8 +987,10 @@ public class LocationLifecycleService // Clamp fence standing var currentFenceStanding = postRaidProfile.TradersInfo[fenceId].Standing; - pmcProfile.TradersInfo[fenceId].Standing = - Math.Min(Math.Max((double) currentFenceStanding, -7), 15); // Ensure it stays between -7 and 15 + pmcProfile.TradersInfo[fenceId].Standing = Math.Min( + Math.Max((double)currentFenceStanding, -7), + 15 + ); // Ensure it stays between -7 and 15 // Copy fence values to Scav scavProfile.TradersInfo[fenceId] = pmcProfile.TradersInfo[fenceId]; @@ -916,7 +999,12 @@ public class LocationLifecycleService MergePmcAndScavEncyclopedias(pmcProfile, scavProfile); // Handle temp, hydration, limb hp/effects - _healthHelper.UpdateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead); + _healthHelper.UpdateProfileHealthPostRaid( + pmcProfile, + postRaidProfile.Health, + sessionId, + isDead + ); if (isTransfer) { @@ -930,8 +1018,8 @@ public class LocationLifecycleService if (isDead) { if (lostQuestItems.Count > 0) - // MUST occur AFTER quests have post raid quest data has been merged "processPostRaidQuests()" - // Player is dead + had quest items, check and fix any broken find item quests + // MUST occur AFTER quests have post raid quest data has been merged "processPostRaidQuests()" + // Player is dead + had quest items, check and fix any broken find item quests { CheckForAndFixPickupQuestsAfterDeath(sessionId, lostQuestItems, pmcProfile.Quests); } @@ -940,28 +1028,32 @@ public class LocationLifecycleService { // get the aggressor ID from the client request body postRaidProfile.Stats.Eft.Aggressor.ProfileId = request.Results.KillerId; - _pmcChatResponseService.SendKillerResponse(sessionId, pmcProfile, postRaidProfile.Stats.Eft.Aggressor); + _pmcChatResponseService.SendKillerResponse( + sessionId, + pmcProfile, + postRaidProfile.Stats.Eft.Aggressor + ); } _inRaidHelper.DeleteInventory(pmcProfile, sessionId); - _inRaidHelper.RemoveFiRStatusFromItemsInContainer(sessionId, pmcProfile, "SecuredContainer"); + _inRaidHelper.RemoveFiRStatusFromItemsInContainer( + sessionId, + pmcProfile, + "SecuredContainer" + ); } // Must occur AFTER killer messages have been sent _matchBotDetailsCacheService.ClearCache(); - var roles = new List - { - "pmcbear", - "pmcusec" - }; + var roles = new List { "pmcbear", "pmcusec" }; - var victims = postRaidProfile.Stats.Eft.Victims.Where(victim => roles.Contains(victim.Role.ToLower()) - ) + var victims = postRaidProfile + .Stats.Eft.Victims.Where(victim => roles.Contains(victim.Role.ToLower())) .ToList(); if (victims?.Count > 0) - // Player killed PMCs, send some mail responses to them + // Player killed PMCs, send some mail responses to them { _pmcChatResponseService.SendVictimResponse(sessionId, victims, pmcProfile); } @@ -982,65 +1074,74 @@ public class LocationLifecycleService { // Exclude completed quests var activeQuestIdsInProfile = profileQuests - .Where(quest => quest.Status is not QuestStatusEnum.AvailableForStart and not QuestStatusEnum.Success) + .Where(quest => + quest.Status + is not QuestStatusEnum.AvailableForStart + and not QuestStatusEnum.Success + ) .Select(status => status.QId); // Get db details of quests we found above - var questDb = _databaseService.GetQuests() - .Values.Where(quest => - activeQuestIdsInProfile.Contains(quest.Id) - ); + var questDb = _databaseService + .GetQuests() + .Values.Where(quest => activeQuestIdsInProfile.Contains(quest.Id)); foreach (var lostItem in lostQuestItems) { var matchingConditionId = string.Empty; // Find a quest that has a FindItem condition that has the list items tpl as a target - var matchingQuests = questDb.Where(quest => + var matchingQuests = questDb + .Where(quest => + { + var matchingCondition = quest.Conditions.AvailableForFinish.FirstOrDefault( + questCondition => + questCondition.ConditionType == "FindItem" + && ( + questCondition.Target.IsList + ? questCondition.Target.List + : [questCondition.Target.Item] + ).Contains(lostItem.Template) + ); + if (matchingCondition is null) + // Quest doesnt have a matching condition { - var matchingCondition = quest.Conditions.AvailableForFinish.FirstOrDefault(questCondition => - questCondition.ConditionType == "FindItem" && - (questCondition.Target.IsList - ? questCondition.Target.List - : [questCondition.Target.Item]).Contains(lostItem.Template) - ); - if (matchingCondition is null) - // Quest doesnt have a matching condition - { - return false; - } - - // We found a condition, save id for later - matchingConditionId = matchingCondition.Id; - return true; + return false; } - ) + + // We found a condition, save id for later + matchingConditionId = matchingCondition.Id; + return true; + }) .ToList(); // Fail if multiple were found if (matchingQuests.Count != 1) { - _logger.Error($"Unable to fix quest item: {lostItem}, {matchingQuests.Count} matching quests found, expected 1"); + _logger.Error( + $"Unable to fix quest item: {lostItem}, {matchingQuests.Count} matching quests found, expected 1" + ); continue; } var matchingQuest = matchingQuests[0]; // We have a match, remove the condition id from profile to reset progress and let player pick item up again - var profileQuestToUpdate = profileQuests.FirstOrDefault(questStatus => questStatus.QId == matchingQuest.Id); + var profileQuestToUpdate = profileQuests.FirstOrDefault(questStatus => + questStatus.QId == matchingQuest.Id + ); if (profileQuestToUpdate is null) - // Profile doesnt have a matching quest + // Profile doesnt have a matching quest { continue; } // Filter out the matching condition we found - profileQuestToUpdate.CompletedConditions = profileQuestToUpdate.CompletedConditions.Where(conditionId => conditionId != matchingConditionId - ) + profileQuestToUpdate.CompletedConditions = profileQuestToUpdate + .CompletedConditions.Where(conditionId => conditionId != matchingConditionId) .ToList(); } } - /// /// In 0.15 Lightkeeper quests do not give rewards in PvE, this issue also occurs in spt. /// We check for newly completed Lk quests and run them through the servers `CompleteQuest` process. @@ -1060,17 +1161,19 @@ public class LocationLifecycleService // LK quests that were not completed before raid but now are var newlyCompletedLightkeeperQuests = postRaidQuests .Where(postRaidQuest => - postRaidQuest.Status == QuestStatusEnum.Success && // Quest is complete + postRaidQuest.Status == QuestStatusEnum.Success + && // Quest is complete preRaidQuests.Any(preRaidQuest => - preRaidQuest.QId == postRaidQuest.QId && // Get matching pre-raid quest + preRaidQuest.QId == postRaidQuest.QId + && // Get matching pre-raid quest preRaidQuest.Status != QuestStatusEnum.Success - ) && // Completed quest was not completed before raid started - _databaseService.GetQuests().TryGetValue(postRaidQuest.QId, out var quest) && - quest?.TraderId == Traders.LIGHTHOUSEKEEPER + ) + && // Completed quest was not completed before raid started + _databaseService.GetQuests().TryGetValue(postRaidQuest.QId, out var quest) + && quest?.TraderId == Traders.LIGHTHOUSEKEEPER ) // Quest is from LK .ToList(); - // Run server complete quest process to ensure player gets rewards foreach (var questToComplete in newlyCompletedLightkeeperQuests) { @@ -1080,7 +1183,7 @@ public class LocationLifecycleService { Action = "CompleteQuest", QuestId = questToComplete.QId, - RemoveExcessItems = false + RemoveExcessItems = false, }, sessionId ); @@ -1095,7 +1198,9 @@ public class LocationLifecycleService /// List of adjusted QuestStatus post-raid protected List ProcessPostRaidQuests(List questsToProcess) { - var failedQuests = questsToProcess.Where(quest => quest.Status == QuestStatusEnum.MarkedAsFailed); + var failedQuests = questsToProcess.Where(quest => + quest.Status == QuestStatusEnum.MarkedAsFailed + ); foreach (var failedQuest in failedQuests) { var dbQuest = _databaseService.GetQuests()[failedQuest.QId]; @@ -1125,15 +1230,19 @@ public class LocationLifecycleService { foreach (var traderId in tradersClientProfile) { - var serverProfileTrader = tradersServerProfile.FirstOrDefault(x => x.Key == traderId.Key).Value; - var clientProfileTrader = tradersClientProfile.FirstOrDefault(x => x.Key == traderId.Key).Value; + var serverProfileTrader = tradersServerProfile + .FirstOrDefault(x => x.Key == traderId.Key) + .Value; + var clientProfileTrader = tradersClientProfile + .FirstOrDefault(x => x.Key == traderId.Key) + .Value; if (serverProfileTrader is null || clientProfileTrader is null) { continue; } if (clientProfileTrader.Standing != serverProfileTrader.Standing) - // Difference found, update server profile with values from client profile + // Difference found, update server profile with values from client profile { tradersServerProfile[traderId.Key].Standing = clientProfileTrader.Standing; } @@ -1163,7 +1272,11 @@ public class LocationLifecycleService _insuranceService.StoreGearLostInRaidToSendLater(sessionId, mappedItems); - _insuranceService.StartPostRaidInsuranceLostProcess(preRaidPmcProfile, sessionId, locationName); + _insuranceService.StartPostRaidInsuranceLostProcess( + preRaidPmcProfile, + sessionId, + locationName + ); } } @@ -1188,7 +1301,7 @@ public class LocationLifecycleService { ExitStatus.KILLED, ExitStatus.MISSINGINACTION, - ExitStatus.LEFT + ExitStatus.LEFT, }; return deathEnums.Contains(results.Result.Value); } @@ -1223,12 +1336,10 @@ public class LocationLifecycleService /// Secondary dictionary protected void MergePmcAndScavEncyclopedias(PmcData primary, PmcData secondary) { - var mergedDicts = primary.Encyclopedia?.Union(secondary.Encyclopedia) + var mergedDicts = primary + .Encyclopedia?.Union(secondary.Encyclopedia) .GroupBy(kvp => kvp.Key) - .ToDictionary( - g => g.Key, - g => g.Any(kvp => kvp.Value) - ); + .ToDictionary(g => g.Key, g => g.Any(kvp => kvp.Value)); primary.Encyclopedia = mergedDicts; secondary.Encyclopedia = mergedDicts; @@ -1239,13 +1350,17 @@ public class LocationLifecycleService /// /// Profile to add customisations to /// All profile achievements at the end of a raid - protected void ProcessAchievementRewards(SptProfile fullProfile, Dictionary? postRaidAchievements) + protected void ProcessAchievementRewards( + SptProfile fullProfile, + Dictionary? postRaidAchievements + ) { var sessionId = fullProfile.ProfileInfo.ProfileId; var pmcProfile = fullProfile.CharacterData.PmcData; var preRaidAchievementIds = fullProfile.CharacterData.PmcData.Achievements; var postRaidAchievementIds = postRaidAchievements; - var achievementIdsAcquiredThisRaid = postRaidAchievementIds.Where(id => !preRaidAchievementIds.Contains(id) + var achievementIdsAcquiredThisRaid = postRaidAchievementIds.Where(id => + !preRaidAchievementIds.Contains(id) ); // Get achievement data from db @@ -1256,7 +1371,7 @@ public class LocationLifecycleService achievementsDb.FirstOrDefault(achievementDb => achievementDb.Id == achievementId.Key) ); if (achievements is null) - // No achievements found + // No achievements found { return; } diff --git a/Libraries/SPTarkov.Server.Core/Services/MailSendService.cs b/Libraries/SPTarkov.Server.Core/Services/MailSendService.cs index 09d9bd36..fe6cfe0c 100644 --- a/Libraries/SPTarkov.Server.Core/Services/MailSendService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/MailSendService.cs @@ -29,7 +29,11 @@ public class MailSendService( ) { private const string _systemSenderId = "59e7125688a45068a6249071"; - protected HashSet _messageTypes = [MessageType.NpcTraderMessage, MessageType.FleamarketMessage]; + protected HashSet _messageTypes = + [ + MessageType.NpcTraderMessage, + MessageType.FleamarketMessage, + ]; protected HashSet _slotNames = ["hideout", "main"]; /// @@ -59,11 +63,7 @@ public class MailSendService( _logger.Error( _localisationService.GetText( "mailsend-missing_trader", - new - { - messageType, - sessionId - } + new { messageType, sessionId } ) ); @@ -77,7 +77,7 @@ public class MailSendService( DialogType = MessageType.NpcTraderMessage, Trader = trader, MessageText = message, - Items = [] + Items = [], }; // Add items to message @@ -127,11 +127,7 @@ public class MailSendService( _logger.Error( _localisationService.GetText( "mailsend-missing_trader", - new - { - messageType, - sessionId - } + new { messageType, sessionId } ) ); @@ -145,7 +141,7 @@ public class MailSendService( DialogType = MessageType.NpcTraderMessage, Trader = trader, TemplateId = messageLocaleId, - Items = [] + Items = [], }; // add items to message @@ -153,9 +149,8 @@ public class MailSendService( if (items?.Count > 0) { details.Items.AddRange(items); - details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds > 0 - ? maxStorageTimeSeconds - : 172800; + details.ItemsMaxStorageLifetimeSeconds = + maxStorageTimeSeconds > 0 ? maxStorageTimeSeconds : 172800; } if (systemData is not null) @@ -184,14 +179,15 @@ public class MailSendService( string message, List? items, long? maxStorageTimeSeconds = 172800, - List? profileChangeEvents = null) + List? profileChangeEvents = null + ) { SendMessageDetails details = new() { RecipientId = sessionId, Sender = MessageType.SystemMessage, MessageText = message, - Items = new List() + Items = new List(), }; // add items to message @@ -232,7 +228,7 @@ public class MailSendService( RecipientId = sessionId, Sender = MessageType.SystemMessage, TemplateId = messageLocaleId, - Items = new List() + Items = new List(), }; // add items to message @@ -272,7 +268,7 @@ public class MailSendService( Sender = MessageType.UserMessage, SenderDetails = senderDetails, MessageText = message, - Items = new List() + Items = new List(), }; // add items to message @@ -312,7 +308,11 @@ public class MailSendService( } // Store reward items inside message and set appropriate flags inside message - AddRewardItemsToMessage(message, itemsToSendToPlayer, messageDetails.ItemsMaxStorageLifetimeSeconds); + AddRewardItemsToMessage( + message, + itemsToSendToPlayer, + messageDetails.ItemsMaxStorageLifetimeSeconds + ); if (messageDetails.ProfileChangeEvents is not null) { @@ -324,9 +324,10 @@ public class MailSendService( // TODO: clean up old code here // Offer Sold notifications are now separate from the main notification - if (_messageTypes.Contains(senderDialog.Type ?? MessageType.SystemMessage) && - messageDetails?.RagfairDetails is not null - ) + if ( + _messageTypes.Contains(senderDialog.Type ?? MessageType.SystemMessage) + && messageDetails?.RagfairDetails is not null + ) { var offerSoldMessage = _notifierHelper.CreateRagfairOfferSoldNotification( message, @@ -350,8 +351,10 @@ public class MailSendService( public void SendPlayerMessageToNpc(string sessionId, string targetNpcId, string message) { var playerProfile = _saveServer.GetProfile(sessionId); - if (playerProfile.DialogueRecords is null || - !playerProfile.DialogueRecords.TryGetValue(targetNpcId, out var dialogWithNpc)) + if ( + playerProfile.DialogueRecords is null + || !playerProfile.DialogueRecords.TryGetValue(targetNpcId, out var dialogWithNpc) + ) { _logger.Error(_localisationService.GetText("mailsend-missing_npc_dialog", targetNpcId)); return; @@ -366,7 +369,7 @@ public class MailSendService( UserId = playerProfile.CharacterData.PmcData.Id, MessageType = MessageType.UserMessage, RewardCollected = false, - Text = message + Text = message, } ); } @@ -390,13 +393,20 @@ public class MailSendService( HasRewards = false, RewardCollected = false, SystemData = messageDetails.SystemData is not null ? messageDetails.SystemData : null, - ProfileChangeEvents = messageDetails.ProfileChangeEvents?.Count == 0 ? messageDetails.ProfileChangeEvents : null + ProfileChangeEvents = + messageDetails.ProfileChangeEvents?.Count == 0 + ? messageDetails.ProfileChangeEvents + : null, }; // Handle replyTo if (messageDetails.ReplyTo is not null) { - var replyMessage = GetMessageToReplyTo(messageDetails.RecipientId, messageDetails.ReplyTo, dialogId); + var replyMessage = GetMessageToReplyTo( + messageDetails.RecipientId, + messageDetails.ReplyTo, + dialogId + ); if (replyMessage is not null) { message.ReplyTo = replyMessage; @@ -423,7 +433,9 @@ public class MailSendService( return null; } - var messageToReplyTo = currentDialogue.Messages?.FirstOrDefault(message => message.Id == replyToId); + var messageToReplyTo = currentDialogue.Messages?.FirstOrDefault(message => + message.Id == replyToId + ); if (messageToReplyTo is null) { return null; @@ -435,7 +447,7 @@ public class MailSendService( DateTime = messageToReplyTo.DateTime, MessageType = messageToReplyTo.MessageType, UserId = messageToReplyTo.UserId, - Text = messageToReplyTo.Text + Text = messageToReplyTo.Text, }; } @@ -445,7 +457,11 @@ public class MailSendService( /// Message to add items to /// Items to add to message /// Total time the items are stored in mail before being deleted - private void AddRewardItemsToMessage(Message message, MessageItems? itemsToSendToPlayer, long? maxStorageTimeSeconds) + private void AddRewardItemsToMessage( + Message message, + MessageItems? itemsToSendToPlayer, + long? maxStorageTimeSeconds + ) { if ((itemsToSendToPlayer?.Data?.Count ?? 0) > 0) { @@ -462,7 +478,10 @@ public class MailSendService( /// The type of the dialog that will hold the reward items being processed /// Details fo the message e.g. Text, items it has etc. /// Sanitised items - private MessageItems ProcessItemsBeforeAddingToMail(MessageType? dialogType, SendMessageDetails messageDetails) + private MessageItems ProcessItemsBeforeAddingToMail( + MessageType? dialogType, + SendMessageDetails messageDetails + ) { var items = _databaseService.GetItems(); @@ -475,11 +494,7 @@ public class MailSendService( { _localisationService.GetText( "mailsend-missing_parent", - new - { - traderId = messageDetails.Trader, - sender = messageDetails.Sender - } + new { traderId = messageDetails.Trader, sender = messageDetails.Sender } ); return itemsToSendToPlayer; @@ -495,7 +510,7 @@ public class MailSendService( itemsToSendToPlayer = new MessageItems { Stash = parentItem.ParentId, - Data = new List() + Data = new List(), }; // Ensure Ids are unique and cont collide with items in player inventory later @@ -510,11 +525,7 @@ public class MailSendService( _logger.Error( _localisationService.GetText( "dialog-missing_item_template", - new - { - tpl = reward.Template, - type = dialogType - } + new { tpl = reward.Template, type = dialogType } ) ); @@ -522,7 +533,11 @@ public class MailSendService( } // Ensure every 'base/root' item has the same parentId + has a slotId of 'main' - if (reward.SlotId is null || reward.SlotId == "hideout" || reward.ParentId == parentItem.ParentId) + if ( + reward.SlotId is null + || reward.SlotId == "hideout" + || reward.ParentId == parentItem.ParentId + ) { // Reward items NEED a parent id + slotId reward.ParentId = parentItem.ParentId; @@ -537,10 +552,7 @@ public class MailSendService( if (childItems is null || !childItems.Any()) { // No cartridges found, generate and add to rewards - var boxAndCartridges = new List - { - reward - }; + var boxAndCartridges = new List { reward }; _itemHelper.AddCartridgesToAmmoBox(boxAndCartridges, itemTemplate); // Push box + cartridge children into array @@ -556,7 +568,12 @@ public class MailSendService( { if (itemTemplate.Properties.StackSlots is not null) { - _logger.Error(_localisationService.GetText("mail-unable_to_give_gift_not_handled", itemTemplate.Id)); + _logger.Error( + _localisationService.GetText( + "mail-unable_to_give_gift_not_handled", + itemTemplate.Id + ) + ); } // Item is sanitised and ready to be pushed into holding array @@ -616,14 +633,19 @@ public class MailSendService( var senderId = GetMessageSenderIdByType(messageDetails); if (senderId is null) { - throw new Exception(_localisationService.GetText("mail-unable_to_find_message_sender_by_id", messageDetails.Sender)); + throw new Exception( + _localisationService.GetText( + "mail-unable_to_find_message_sender_by_id", + messageDetails.Sender + ) + ); } var dialogsInProfile = _dialogueHelper.GetDialogsForProfile(messageDetails.RecipientId); // Does dialog exist if (!dialogsInProfile.ContainsKey(senderId)) - // Doesn't exist, create + // Doesn't exist, create { dialogsInProfile[senderId] = new Dialogue { @@ -632,7 +654,7 @@ public class MailSendService( Messages = [], Pinned = false, New = 0, - AttachmentsNew = 0 + AttachmentsNew = 0, }; } @@ -651,7 +673,10 @@ public class MailSendService( return _systemSenderId; } - if (messageDetails.Sender == MessageType.NpcTraderMessage || messageDetails.DialogType == MessageType.NpcTraderMessage) + if ( + messageDetails.Sender == MessageType.NpcTraderMessage + || messageDetails.DialogType == MessageType.NpcTraderMessage + ) { if (messageDetails.Trader == null && _logger.IsLogEnabled(LogLevel.Debug)) { diff --git a/Libraries/SPTarkov.Server.Core/Services/MapMarkerService.cs b/Libraries/SPTarkov.Server.Core/Services/MapMarkerService.cs index a8f6178d..bb727262 100644 --- a/Libraries/SPTarkov.Server.Core/Services/MapMarkerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/MapMarkerService.cs @@ -8,9 +8,7 @@ using SPTarkov.Server.Core.Models.Utils; namespace SPTarkov.Server.Core.Services; [Injectable] -public class MapMarkerService( - ISptLogger _logger -) +public class MapMarkerService(ISptLogger _logger) { /// /// Add note to a map item in player inventory @@ -24,11 +22,7 @@ public class MapMarkerService( var mapItem = pmcData?.Inventory?.Items?.FirstOrDefault(i => i?.Id == request?.Item); // add marker to map item - mapItem.Upd.Map = mapItem?.Upd?.Map ?? - new UpdMap - { - Markers = new List() - }; + mapItem.Upd.Map = mapItem?.Upd?.Map ?? new UpdMap { Markers = new List() }; // Update request note with text, then add to maps upd request.MapMarker.Note = SanitiseMapMarkerText(request.MapMarker.Note); @@ -49,11 +43,11 @@ public class MapMarkerService( var mapItem = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == request.Item); // remove marker - var markers = mapItem.Upd.Map.Markers.Where(marker => - { - return marker.X != request.X && marker.Y != request.Y; - } - ) + var markers = mapItem + .Upd.Map.Markers.Where(marker => + { + return marker.X != request.X && marker.Y != request.Y; + }) .ToList(); mapItem.Upd.Map.Markers = markers; @@ -74,7 +68,9 @@ public class MapMarkerService( // edit marker // the only thing that is consistent between the old and edit is the X and Y // find the marker where X and Y match - var markerToRemove = mapItem.Upd.Map.Markers.FirstOrDefault(x => x.X == request.X && x.Y == request.Y); + var markerToRemove = mapItem.Upd.Map.Markers.FirstOrDefault(x => + x.X == request.X && x.Y == request.Y + ); if (markerToRemove is null) { diff --git a/Libraries/SPTarkov.Server.Core/Services/MatchBotDetailsCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/MatchBotDetailsCacheService.cs index 73806767..b7842063 100644 --- a/Libraries/SPTarkov.Server.Core/Services/MatchBotDetailsCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/MatchBotDetailsCacheService.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -using SPTarkov.Server.Core.Constants; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Enums; using SPTarkov.Server.Core.Models.Spt.Bots; @@ -12,17 +12,12 @@ namespace SPTarkov.Server.Core.Services; /// Cache bots in a dictionary, keyed by the bots ID /// [Injectable(InjectionType.Singleton)] -public class MatchBotDetailsCacheService( - ISptLogger _logger -) +public class MatchBotDetailsCacheService(ISptLogger _logger) { - private static readonly HashSet _sidesToCache = - [ - Sides.PmcUsec, - Sides.PmcBear - ]; + private static readonly HashSet _sidesToCache = [Sides.PmcUsec, Sides.PmcBear]; - protected readonly ConcurrentDictionary BotDetailsCache = new(); + protected readonly ConcurrentDictionary BotDetailsCache = + new(); /// /// Store a bot in the cache, keyed by its ID. @@ -37,24 +32,32 @@ public class MatchBotDetailsCacheService( if (botToCache.Info?.Nickname is null) { - _logger.Warning($"Unable to cache: {botToCache.Info?.Settings?.Role} bot with id: {botToCache.Id} as it lacks a nickname"); + _logger.Warning( + $"Unable to cache: {botToCache.Info?.Settings?.Role} bot with id: {botToCache.Id} as it lacks a nickname" + ); return; } // If bot isn't a PMC, skip - if (botToCache.Info?.Settings?.Role is null || !_sidesToCache.Contains(botToCache.Info.Settings.Role)) + if ( + botToCache.Info?.Settings?.Role is null + || !_sidesToCache.Contains(botToCache.Info.Settings.Role) + ) { return; } - BotDetailsCache.TryAdd(botToCache.Id, new BotDetailsForChatMessages() - { - Nickname = botToCache.Info.Nickname.Trim(), - Side = botToCache.Info.Side == Sides.PmcUsec ? DogtagSide.Usec : DogtagSide.Bear, - Aid = botToCache.Aid, - Type = botToCache.Info.MemberCategory, - Level = botToCache.Info.Level, - }); + BotDetailsCache.TryAdd( + botToCache.Id, + new BotDetailsForChatMessages() + { + Nickname = botToCache.Info.Nickname.Trim(), + Side = botToCache.Info.Side == Sides.PmcUsec ? DogtagSide.Usec : DogtagSide.Bear, + Aid = botToCache.Aid, + Type = botToCache.Info.MemberCategory, + Level = botToCache.Info.Level, + } + ); } /// diff --git a/Libraries/SPTarkov.Server.Core/Services/MatchLocationService.cs b/Libraries/SPTarkov.Server.Core/Services/MatchLocationService.cs index 6de418fb..d8c8113c 100644 --- a/Libraries/SPTarkov.Server.Core/Services/MatchLocationService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/MatchLocationService.cs @@ -30,20 +30,12 @@ public class MatchLocationService public class MatchGroup { [JsonPropertyName("groups")] - public List Groups - { - get; - set; - } + public List Groups { get; set; } } public class DeleteGroupRequest { [JsonPropertyName("groupId")] - public string GroupId - { - get; - set; - } + public string GroupId { get; set; } } } diff --git a/Libraries/SPTarkov.Server.Core/Services/Mod/CustomItemService.cs b/Libraries/SPTarkov.Server.Core/Services/Mod/CustomItemService.cs index 33108ecd..f103bd50 100644 --- a/Libraries/SPTarkov.Server.Core/Services/Mod/CustomItemService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/Mod/CustomItemService.cs @@ -60,7 +60,11 @@ public class CustomItemService( AddToItemsDb(newItemId, itemClone); - AddToHandbookDb(newItemId, newItemDetails.HandbookParentId, newItemDetails.HandbookPriceRoubles); + AddToHandbookDb( + newItemId, + newItemDetails.HandbookParentId, + newItemDetails.HandbookPriceRoubles + ); AddToLocaleDbs(newItemDetails.Locales, newItemId); @@ -104,7 +108,11 @@ public class CustomItemService( AddToItemsDb(newItem.Id, newItem); - AddToHandbookDb(newItem.Id, newItemDetails.HandbookParentId, newItemDetails.HandbookPriceRoubles); + AddToHandbookDb( + newItem.Id, + newItemDetails.HandbookParentId, + newItemDetails.HandbookPriceRoubles + ); AddToLocaleDbs(newItemDetails.Locales, newItem.Id); @@ -138,9 +146,13 @@ public class CustomItemService( /// /// New properties to apply /// Item to update - protected void UpdateBaseItemPropertiesWithOverrides(Props? overrideProperties, TemplateItem itemClone) + protected void UpdateBaseItemPropertiesWithOverrides( + Props? overrideProperties, + TemplateItem itemClone + ) { - if (overrideProperties is null || itemClone?.Properties is null) return; + if (overrideProperties is null || itemClone?.Properties is null) + return; var target = itemClone.Properties; var targetType = target.GetType(); @@ -151,7 +163,7 @@ public class CustomItemService( { MemberTypes.Property => ((PropertyInfo)member).GetValue(overrideProperties), MemberTypes.Field => ((FieldInfo)member).GetValue(overrideProperties), - _ => null + _ => null, }; if (value is null) @@ -216,7 +228,7 @@ public class CustomItemService( { Id = newItemId, ParentId = parentId, - Price = priceRoubles + Price = priceRoubles, } ); // TODO: would we want to keep this the same or get them to send a HandbookItem @@ -278,7 +290,7 @@ public class CustomItemService( [ ItemTpl.HIDEOUTAREACONTAINER_WEAPONSTAND_STASH_1, ItemTpl.HIDEOUTAREACONTAINER_WEAPONSTAND_STASH_2, - ItemTpl.HIDEOUTAREACONTAINER_WEAPONSTAND_STASH_3 + ItemTpl.HIDEOUTAREACONTAINER_WEAPONSTAND_STASH_3, ]; foreach (var wallId in wallStashIds) { @@ -301,7 +313,9 @@ public class CustomItemService( var weapon = itemHelper.GetItem(weaponTpl); if (!weapon.Key) { - logger.Warning($"Unable to add custom weapon {weaponTpl} to PMCs as it cannot be found in the Item db"); + logger.Warning( + $"Unable to add custom weapon {weaponTpl} to PMCs as it cannot be found in the Item db" + ); return; } @@ -312,7 +326,7 @@ public class CustomItemService( var weaponSlots = weapon.Value.Properties.Slots; foreach (var slot in weaponSlots) { - baseWeaponModObject[slot.Name] = [..slot.Props.Filters[0].Filter]; + baseWeaponModObject[slot.Name] = [.. slot.Props.Filters[0].Filter]; } // Get PMCs @@ -323,7 +337,9 @@ public class CustomItemService( botTypes["bear"].BotInventory.Mods[weaponTpl] = baseWeaponModObject; // Add weapon to array of allowed weapons + weighting to be picked - botTypes["usec"].BotInventory.Equipment[Enum.Parse(weaponSlot)][weaponTpl] = weaponWeight; - botTypes["bear"].BotInventory.Equipment[Enum.Parse(weaponSlot)][weaponTpl] = weaponWeight; + botTypes["usec"].BotInventory.Equipment[Enum.Parse(weaponSlot)][weaponTpl] = + weaponWeight; + botTypes["bear"].BotInventory.Equipment[Enum.Parse(weaponSlot)][weaponTpl] = + weaponWeight; } } diff --git a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs index 08fdaab5..476392e7 100644 --- a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs @@ -6,7 +6,11 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Services.Mod; [Injectable(InjectionType.Singleton)] -public class ProfileDataService(ISptLogger logger, FileUtil fileUtil, JsonUtil jsonUtil) +public class ProfileDataService( + ISptLogger logger, + FileUtil fileUtil, + JsonUtil jsonUtil +) { protected const string ProfileDataFilepath = "user/profileData/"; private readonly ConcurrentDictionary _profileDataCache = new(); @@ -23,12 +27,12 @@ public class ProfileDataService(ISptLogger logger, FileUtil { if (fileUtil.FileExists($"{ProfileDataFilepath}{profileId}/{modKey}.json")) { - value = jsonUtil.Deserialize(fileUtil.ReadFile($"{ProfileDataFilepath}{profileId}/{modKey}.json")); + value = jsonUtil.Deserialize( + fileUtil.ReadFile($"{ProfileDataFilepath}{profileId}/{modKey}.json") + ); if (value != null) { - while (!_profileDataCache.TryAdd(profileDataKey, value)) - { - } + while (!_profileDataCache.TryAdd(profileDataKey, value)) { } } } else @@ -37,7 +41,7 @@ public class ProfileDataService(ISptLogger logger, FileUtil } } - return (T?) value; + return (T?)value; } public void SaveProfileData(string profileId, string modKey, T profileData) @@ -50,9 +54,7 @@ public class ProfileDataService(ISptLogger logger, FileUtil throw new Exception("The profile data when serialized resulted in a null value"); } - while (!_profileDataCache.TryAdd($"{profileId}:{modKey}", data)) - { - } + while (!_profileDataCache.TryAdd($"{profileId}:{modKey}", data)) { } fileUtil.WriteFile($"{ProfileDataFilepath}{profileId}/{modKey}.json", data); } diff --git a/Libraries/SPTarkov.Server.Core/Services/OpenZoneService.cs b/Libraries/SPTarkov.Server.Core/Services/OpenZoneService.cs index 61511357..836d8ada 100644 --- a/Libraries/SPTarkov.Server.Core/Services/OpenZoneService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/OpenZoneService.cs @@ -52,7 +52,11 @@ public class OpenZoneService( // Convert openzones string into list, easier to work wih var mapOpenZonesArray = dbLocations[mapKvP.Key].Base.OpenZones.Split(",").ToList(); - foreach (var zoneToAdd in zonesToAdd.Where(zoneToAdd => !mapOpenZonesArray.Contains(zoneToAdd))) + foreach ( + var zoneToAdd in zonesToAdd.Where(zoneToAdd => + !mapOpenZonesArray.Contains(zoneToAdd) + ) + ) { // Add new zone to array and convert array back into comma separated string mapOpenZonesArray.Add(zoneToAdd); diff --git a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs index 8078e9d2..7f2533f9 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs @@ -37,7 +37,12 @@ public class PaymentService( /// Buy item request /// Session ID /// Client response - public void PayMoney(PmcData pmcData, ProcessBuyTradeRequestData request, string sessionID, ItemEventRouterResponse output) + public void PayMoney( + PmcData pmcData, + ProcessBuyTradeRequestData request, + string sessionID, + ItemEventRouterResponse output + ) { // May need to convert to trader currency var trader = _traderHelper.GetTrader(request.TransactionId, sessionID); @@ -59,7 +64,7 @@ public class PaymentService( _inventoryHelper.RemoveItemByCount( pmcData, item.Id, - (int) itemRequest.Count, + (int)itemRequest.Count, sessionID, output ); @@ -158,7 +163,10 @@ public class PaymentService( /// Handbook rouble price of the item private double? GetTraderItemHandbookPriceRouble(string? traderAssortId, string traderId) { - var purchasedAssortItem = _traderHelper.GetTraderAssortItemByAssortId(traderId, traderAssortId); + var purchasedAssortItem = _traderHelper.GetTraderAssortItemByAssortId( + traderId, + traderAssortId + ); if (purchasedAssortItem is null) { return 1; @@ -167,7 +175,9 @@ public class PaymentService( var assortItemPriceRouble = _handbookHelper.GetTemplatePrice(purchasedAssortItem.Template); if (assortItemPriceRouble == 0) { - _logger.Debug($"No item price found for {purchasedAssortItem.Template} on trader: {traderId} in assort: {traderAssortId}"); + _logger.Debug( + $"No item price found for {purchasedAssortItem.Template} on trader: {traderId} in assort: {traderAssortId}" + ); return 1; } @@ -183,23 +193,35 @@ public class PaymentService( /// Sell Trade request data /// Client response /// Session ID - public void GiveProfileMoney(PmcData pmcData, double? amountToSend, ProcessSellTradeRequestData request, - ItemEventRouterResponse output, string sessionID) + public void GiveProfileMoney( + PmcData pmcData, + double? amountToSend, + ProcessSellTradeRequestData request, + ItemEventRouterResponse output, + string sessionID + ) { var trader = _traderHelper.GetTrader(request.TransactionId, sessionID); if (trader is null) { - _logger.Error($"Unable to add currency to profile as trader: {request.TransactionId} does not exist"); + _logger.Error( + $"Unable to add currency to profile as trader: {request.TransactionId} does not exist" + ); return; } var currencyTpl = _paymentHelper.GetCurrency(trader.Currency); - var calcAmount = _handbookHelper.FromRUB(_handbookHelper.InRUB(amountToSend ?? 0, currencyTpl), currencyTpl); + var calcAmount = _handbookHelper.FromRUB( + _handbookHelper.InRUB(amountToSend ?? 0, currencyTpl), + currencyTpl + ); var currencyMaxStackSize = _itemHelper.GetItem(currencyTpl).Value.Properties?.StackMaxSize; if (currencyMaxStackSize is null) { - _logger.Error($"Unable to add currency: {currencyTpl} to profile as it lacks a _props property"); + _logger.Error( + $"Unable to add currency: {currencyTpl} to profile as it lacks a _props property" + ); return; } @@ -226,7 +248,7 @@ public class PaymentService( if (item.Upd.StackObjectsCount + calcAmount > currencyMaxStackSize) { // calculate difference - calcAmount -= (int) (currencyMaxStackSize - item.Upd.StackObjectsCount ?? 0); + calcAmount -= (int)(currencyMaxStackSize - item.Upd.StackObjectsCount ?? 0); item.Upd.StackObjectsCount = currencyMaxStackSize; } else @@ -250,10 +272,7 @@ public class PaymentService( { Id = _hashUtil.Generate(), Template = currencyTpl, - Upd = new Upd - { - StackObjectsCount = Math.Round(calcAmount) - } + Upd = new Upd { StackObjectsCount = Math.Round(calcAmount) }, }; // Ensure money is properly split to follow its max stack size limit @@ -266,7 +285,7 @@ public class PaymentService( ItemsWithModsToAdd = rewards, FoundInRaid = false, Callback = null, - UseSortingTable = true + UseSortingTable = true, }; _inventoryHelper.AddItemsToStash(sessionID, addItemToStashRequest, pmcData, output); } @@ -303,10 +322,7 @@ public class PaymentService( //Ensure all money items found have a upd foreach (var moneyStack in moneyItemsInInventory) { - moneyStack.Upd ??= new Upd - { - StackObjectsCount = 1 - }; + moneyStack.Upd ??= new Upd { StackObjectsCount = 1 }; } var amountAvailable = moneyItemsInInventory.Aggregate( @@ -320,16 +336,15 @@ public class PaymentService( _logger.Error( _localisationService.GetText( "payment-not_enough_money_to_complete_transation", // Typo, needs locale updated if fixed - new - { - amountToPay, - amountAvailable - } + new { amountToPay, amountAvailable } ) ); _httpResponseUtil.AppendErrorToOutput( output, - _localisationService.GetText("payment-not_enough_money_to_complete_transation_short", amountToPay), // Typo, needs locale updated if fixed + _localisationService.GetText( + "payment-not_enough_money_to_complete_transation_short", + amountToPay + ), // Typo, needs locale updated if fixed BackendErrorCodes.UnknownTradingError ); @@ -369,10 +384,18 @@ public class PaymentService( /// Players stash ID /// List of sorted money items // TODO - ensure money in containers inside secure container are LAST - protected List GetSortedMoneyItemsInInventory(PmcData pmcData, string currencyTpl, string playerStashId) + protected List GetSortedMoneyItemsInInventory( + PmcData pmcData, + string currencyTpl, + string playerStashId + ) { // Get money stacks player has - var moneyItemsInInventory = _itemHelper.FindBarterItems("tpl", pmcData.Inventory.Items, currencyTpl); + var moneyItemsInInventory = _itemHelper.FindBarterItems( + "tpl", + pmcData.Inventory.Items, + currencyTpl + ); if (moneyItemsInInventory.Count == 0) { _logger.Debug($"No {currencyTpl} money items found in inventory"); @@ -384,7 +407,9 @@ public class PaymentService( var itemsInStashCache = GetItemInStashCache(pmcData.Inventory.Items, playerStashId); // Filter out 'Locked' money stacks as they cannot be used - var noLocked = moneyItemsInInventory.Where(moneyItem => moneyItem.Upd.PinLockState != PinLockState.Locked); + var noLocked = moneyItemsInInventory.Where(moneyItem => + moneyItem.Upd.PinLockState != PinLockState.Locked + ); if (noLocked.Any()) { // We found unlocked money @@ -392,7 +417,9 @@ public class PaymentService( } // Prioritise items in stash to top of array - moneyItemsInInventory.Sort((a, b) => PrioritiseStashSort(a, b, pmcData.Inventory.Items, itemsInStashCache)); + moneyItemsInInventory.Sort( + (a, b) => PrioritiseStashSort(a, b, pmcData.Inventory.Items, itemsInStashCache) + ); return moneyItemsInInventory; } @@ -403,12 +430,18 @@ public class PaymentService( /// Inventory items to check /// Id of players stash /// Dictionary - protected IReadOnlyDictionary GetItemInStashCache(List items, string playerStashId) + protected IReadOnlyDictionary GetItemInStashCache( + List items, + string playerStashId + ) { var itemsInStashCache = new Dictionary(); foreach (var inventoryItem in items) { - itemsInStashCache.TryAdd(inventoryItem.Id, GetItemLocation(inventoryItem.Id, items, playerStashId)); + itemsInStashCache.TryAdd( + inventoryItem.Id, + GetItemLocation(inventoryItem.Id, items, playerStashId) + ); } return itemsInStashCache; @@ -429,7 +462,8 @@ public class PaymentService( Item a, Item b, List inventoryItems, - IReadOnlyDictionary itemInStashCache) + IReadOnlyDictionary itemInStashCache + ) { // Get the location of A and B itemInStashCache.TryGetValue(a.Id, out var aLocation); @@ -447,8 +481,16 @@ public class PaymentService( if (bothInStash) { // Determine if they're in containers - var aInContainer = string.Equals(a.SlotId, "main", StringComparison.InvariantCultureIgnoreCase); - var bInContainer = string.Equals(b.SlotId, "main", StringComparison.InvariantCultureIgnoreCase); + var aInContainer = string.Equals( + a.SlotId, + "main", + StringComparison.InvariantCultureIgnoreCase + ); + var bInContainer = string.Equals( + b.SlotId, + "main", + StringComparison.InvariantCultureIgnoreCase + ); // Return item not in container var compare = aInContainer.CompareTo(bInContainer); @@ -458,30 +500,27 @@ public class PaymentService( } // Both in containers, deprioritized item in 'bad' container - if (aInContainer - && bInContainer) + if (aInContainer && bInContainer) { // Containers where taking money from would inconvenience player var aImmediateParent = inventoryItems.FirstOrDefault(item => item.Id == a.ParentId); var bImmediateParent = inventoryItems.FirstOrDefault(item => item.Id == b.ParentId); - var aInDeprioContainer = _inventoryConfig.DeprioritisedMoneyContainers.Contains(aImmediateParent.Template); - var bInDeprioContainer = _inventoryConfig.DeprioritisedMoneyContainers.Contains(bImmediateParent.Template); + var aInDeprioContainer = _inventoryConfig.DeprioritisedMoneyContainers.Contains( + aImmediateParent.Template + ); + var bInDeprioContainer = _inventoryConfig.DeprioritisedMoneyContainers.Contains( + bImmediateParent.Template + ); // Prioritize B - if ( - !aInDeprioContainer - && bInDeprioContainer - ) + if (!aInDeprioContainer && bInDeprioContainer) { return -1; } // Prioritize A - if ( - aInDeprioContainer - && !bInDeprioContainer - ) + if (aInDeprioContainer && !bInDeprioContainer) { return 1; } @@ -548,7 +587,11 @@ public class PaymentService( /// Player inventory /// Players stash ID /// True if it's in inventory - protected InventoryLocation GetItemLocation(string itemId, List inventoryItems, string playerStashId) + protected InventoryLocation GetItemLocation( + string itemId, + List inventoryItems, + string playerStashId + ) { var inventoryItem = inventoryItems.FirstOrDefault(item => item.Id == itemId); if (inventoryItem is null) @@ -582,6 +625,6 @@ public class PaymentService( { Other = 0, Stash = 1, - Secure = 2 + Secure = 2, } } diff --git a/Libraries/SPTarkov.Server.Core/Services/PlayerService.cs b/Libraries/SPTarkov.Server.Core/Services/PlayerService.cs index 5e5b0373..dd187fbc 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PlayerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PlayerService.cs @@ -4,9 +4,7 @@ using SPTarkov.Server.Core.Models.Eft.Common; namespace SPTarkov.Server.Core.Services; [Injectable(InjectionType.Singleton)] -public class PlayerService( - DatabaseService _databaseService -) +public class PlayerService(DatabaseService _databaseService) { /// /// Calculates the current level of a player based on their accumulated experience points. diff --git a/Libraries/SPTarkov.Server.Core/Services/PmcChatResponseService.cs b/Libraries/SPTarkov.Server.Core/Services/PmcChatResponseService.cs index e0675846..ff53260a 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PmcChatResponseService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PmcChatResponseService.cs @@ -24,7 +24,8 @@ public class PmcChatResponseService( GiftService _giftService, LocaleService _localeService, MatchBotDetailsCacheService _matchBotDetailsCacheService, - ConfigServer _configServer) + ConfigServer _configServer +) { protected GiftsConfig _giftConfig = _configServer.GetConfig(); protected PmcChatResponse _pmcResponsesConfig = _configServer.GetConfig(); @@ -46,7 +47,9 @@ public class PmcChatResponseService( if (string.IsNullOrEmpty(victim.Name)) { - _logger.Warning($"Victim: {victim.ProfileId} does not have a nickname, skipping pmc response message send"); + _logger.Warning( + $"Victim: {victim.ProfileId} does not have a nickname, skipping pmc response message send" + ); continue; } @@ -103,8 +106,8 @@ public class PmcChatResponseService( Nickname = killerDetailsInCache.Nickname, Side = side, Level = killerDetailsInCache.Level, - MemberCategory = killerDetailsInCache.Type - } + MemberCategory = killerDetailsInCache.Type, + }, }; var message = ChooseMessage(false, pmcData); @@ -113,7 +116,12 @@ public class PmcChatResponseService( return; } - _notificationSendHelper.SendMessageToPlayer(sessionId, killerDetails, message, MessageType.UserMessage); + _notificationSendHelper.SendMessageToPlayer( + sessionId, + killerDetails, + message, + MessageType.UserMessage + ); } /// @@ -132,7 +140,9 @@ public class PmcChatResponseService( var possibleResponseLocaleKeys = GetResponseLocaleKeys(responseType, isVictim); if (possibleResponseLocaleKeys.Count == 0) { - _logger.Warning(_localisationService.GetText("pmcresponse-unable_to_find_key", responseType)); + _logger.Warning( + _localisationService.GetText("pmcresponse-unable_to_find_key", responseType) + ); return null; } @@ -145,7 +155,9 @@ public class PmcChatResponseService( playerName = pmcData.Info.Nickname, playerLevel = pmcData.Info.Level, playerSide = pmcData.Info.Side, - victimDeathLocation = victimData is not null ? GetLocationName(victimData.Location) : "" + victimDeathLocation = victimData is not null + ? GetLocationName(victimData.Location) + : "", } ); @@ -160,7 +172,9 @@ public class PmcChatResponseService( if (AppendSuffixToMessageEnd(isVictim)) { - var suffixText = _localisationService.GetText(_randomUtil.GetArrayValue(GetResponseSuffixLocaleKeys())); + var suffixText = _localisationService.GetText( + _randomUtil.GetArrayValue(GetResponseSuffixLocaleKeys()) + ); responseText += $" {suffixText}"; } @@ -299,7 +313,7 @@ public class PmcChatResponseService( MemberCategory.Default, MemberCategory.Default, MemberCategory.Sherpa, - MemberCategory.Developer + MemberCategory.Developer, }; var chosenCategory = _randomUtil.GetArrayValue(categories); @@ -314,8 +328,8 @@ public class PmcChatResponseService( Level = pmcVictim.Level, Side = pmcVictim.Side, MemberCategory = chosenCategory, - SelectedMemberCategory = chosenCategory - } + SelectedMemberCategory = chosenCategory, + }, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs index e779be6d..15d3fa83 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs @@ -195,7 +195,7 @@ public class PostDbLoadService( private void RemovePraporTestMessage() { - foreach((var locale, var lazyLoad) in _databaseService.GetLocales().Global) + foreach ((var locale, var lazyLoad) in _databaseService.GetLocales().Global) { lazyLoad.AddTransformer(lazyloadedData => { @@ -279,38 +279,47 @@ public class PostDbLoadService( continue; } - _databaseService.GetLocation(mapId).LooseLoot.AddTransformer(looselootData => - { - if (looselootData is null) + _databaseService + .GetLocation(mapId) + .LooseLoot.AddTransformer(looselootData => { - _logger.Warning( - _localisationService.GetText("location-map_has_no_loose_loot_data", mapId) - ); - - return looselootData; - } - - foreach (var positionToAdd in positionsToAdd) - { - // Exists already, add new items to existing positions pool - var existingLootPosition = looselootData.Spawnpoints.FirstOrDefault(x => - x.Template.Id == positionToAdd.Template.Id - ); - - if (existingLootPosition is not null) + if (looselootData is null) { - existingLootPosition.Template.Items.AddRange(positionToAdd.Template.Items); - existingLootPosition.ItemDistribution.AddRange(positionToAdd.ItemDistribution); + _logger.Warning( + _localisationService.GetText( + "location-map_has_no_loose_loot_data", + mapId + ) + ); - continue; + return looselootData; } - // New position, add entire object - looselootData.Spawnpoints.Add(positionToAdd); - } + foreach (var positionToAdd in positionsToAdd) + { + // Exists already, add new items to existing positions pool + var existingLootPosition = looselootData.Spawnpoints.FirstOrDefault(x => + x.Template.Id == positionToAdd.Template.Id + ); - return looselootData; - }); + if (existingLootPosition is not null) + { + existingLootPosition.Template.Items.AddRange( + positionToAdd.Template.Items + ); + existingLootPosition.ItemDistribution.AddRange( + positionToAdd.ItemDistribution + ); + + continue; + } + + // New position, add entire object + looselootData.Spawnpoints.Add(positionToAdd); + } + + return looselootData; + }); } } @@ -415,39 +424,44 @@ public class PostDbLoadService( foreach (var (mapId, mapAdjustments) in _lootConfig.LooseLootSpawnPointAdjustments) { - _databaseService.GetLocation(mapId).LooseLoot.AddTransformer(looselootData => - { - if (looselootData is null) + _databaseService + .GetLocation(mapId) + .LooseLoot.AddTransformer(looselootData => { - _logger.Warning( - _localisationService.GetText("location-map_has_no_loose_loot_data", mapId) - ); - - return looselootData; - } - - foreach (var (lootKey, newChanceValue) in mapAdjustments) - { - var lootPostionToAdjust = looselootData.Spawnpoints.FirstOrDefault(spawnPoint => - spawnPoint.Template.Id == lootKey - ); - if (lootPostionToAdjust is null) + if (looselootData is null) { _logger.Warning( _localisationService.GetText( - "location-unable_to_adjust_loot_position_on_map", - new { lootKey, mapId } + "location-map_has_no_loose_loot_data", + mapId ) ); - continue; + return looselootData; } - lootPostionToAdjust.Probability = newChanceValue; - } + foreach (var (lootKey, newChanceValue) in mapAdjustments) + { + var lootPostionToAdjust = looselootData.Spawnpoints.FirstOrDefault( + spawnPoint => spawnPoint.Template.Id == lootKey + ); + if (lootPostionToAdjust is null) + { + _logger.Warning( + _localisationService.GetText( + "location-unable_to_adjust_loot_position_on_map", + new { lootKey, mapId } + ) + ); - return looselootData; - }); + continue; + } + + lootPostionToAdjust.Probability = newChanceValue; + } + + return looselootData; + }); } } @@ -541,11 +555,11 @@ public class PostDbLoadService( } foreach (var area in _databaseService.GetHideout().Areas) - foreach (var (_, stage) in area.Stages) - // Only adjust crafts ABOVE the override - { - stage.ConstructionTime = Math.Min(stage.ConstructionTime.Value, overrideSeconds); - } + foreach (var (_, stage) in area.Stages) + // Only adjust crafts ABOVE the override + { + stage.ConstructionTime = Math.Min(stage.ConstructionTime.Value, overrideSeconds); + } } protected void UnlockHideoutLootCrateCrafts() diff --git a/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs b/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs index 5b17d768..31815589 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs @@ -6,30 +6,29 @@ using SPTarkov.Server.Core.Utils; namespace SPTarkov.Server.Core.Services; [Injectable(InjectionType.Singleton)] -public class ProfileActivityService( - TimeUtil timeUtil -) +public class ProfileActivityService(TimeUtil timeUtil) { private readonly ConcurrentDictionary _activeProfiles = []; public void AddActiveProfile(string sessionId, long clientStartedTimestamp) { _activeProfiles.AddOrUpdate( - sessionId, - // On add value - key => new ProfileActivityData - { - ClientStartedTimestamp = clientStartedTimestamp, - LastActive = timeUtil.GetTimeStamp() - }, - // On Update value, client was started before but crashed or user restarted - (key, existingValue) => - { - existingValue.ClientStartedTimestamp = clientStartedTimestamp; - existingValue.LastActive = timeUtil.GetTimeStamp(); - existingValue.RaidData = null; - return existingValue; - }); + sessionId, + // On add value + key => new ProfileActivityData + { + ClientStartedTimestamp = clientStartedTimestamp, + LastActive = timeUtil.GetTimeStamp(), + }, + // On Update value, client was started before but crashed or user restarted + (key, existingValue) => + { + existingValue.ClientStartedTimestamp = clientStartedTimestamp; + existingValue.LastActive = timeUtil.GetTimeStamp(); + existingValue.RaidData = null; + return existingValue; + } + ); } // Yes this is terrible, the other alternative is re-doing half of bot-gen which is currently doing guess-work anyway @@ -100,7 +99,7 @@ public class ProfileActivityService( /// Profile to update public void SetActivityTimestamp(string sessionId) { - if(_activeProfiles.TryGetValue(sessionId, out var currentActiveProfile)) + if (_activeProfiles.TryGetValue(sessionId, out var currentActiveProfile)) { currentActiveProfile.LastActive = timeUtil.GetTimeStamp(); } diff --git a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs index 67188ace..7ce9ae5a 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs @@ -78,14 +78,19 @@ public class ProfileFixerService( } // Skip any messages that don't have a stashId collision with the player's equipment ID - if (message.Items?.Stash != fullProfile.CharacterData?.PmcData?.Inventory?.Equipment) + if ( + message.Items?.Stash != fullProfile.CharacterData?.PmcData?.Inventory?.Equipment + ) { continue; } // Otherwise we need to generate a new unique stash ID for this message's attachments message.Items.Stash = _hashUtil.Generate(); - message.Items.Data = _itemHelper.AdoptOrphanedItems(message.Items.Stash, message.Items.Data); + message.Items.Data = _itemHelper.AdoptOrphanedItems( + message.Items.Stash, + message.Items.Data + ); // Because `adoptOrphanedItems` sets the slotId to `hideout`, we need to re-set it to `main` to work with mail foreach (var item in message.Items.Data.Where(item => item.SlotId == "hideout")) @@ -103,8 +108,8 @@ public class ProfileFixerService( public void FixProfileBreakingInventoryItemIssues(PmcData pmcProfile) { // Create a mapping of all inventory items, keyed by _id value - var itemMapping = pmcProfile.Inventory.Items - .GroupBy(item => item.Id) + var itemMapping = pmcProfile + .Inventory.Items.GroupBy(item => item.Id) .ToDictionary(x => x.Key, x => x.ToList()); foreach (var mappingKvP in itemMapping) @@ -115,7 +120,9 @@ public class ProfileFixerService( continue; } - _logger.Warning($"{mappingKvP.Value.Count - 1} duplicate(s) found for item: {mappingKvP.Key}"); + _logger.Warning( + $"{mappingKvP.Value.Count - 1} duplicate(s) found for item: {mappingKvP.Key}" + ); var itemAJson = _jsonUtil.Serialize(mappingKvP.Value[0]); var itemBJson = _jsonUtil.Serialize(mappingKvP.Value[1]); if (itemAJson == itemBJson) @@ -129,12 +136,18 @@ public class ProfileFixerService( { // Items are different, replace ID with unique value // Only replace ID if items have no children, we dont want orphaned children - var itemsHaveChildren = pmcProfile.Inventory.Items.Any(x => x.ParentId == mappingKvP.Key); + var itemsHaveChildren = pmcProfile.Inventory.Items.Any(x => + x.ParentId == mappingKvP.Key + ); if (!itemsHaveChildren) { - var itemToAdjust = pmcProfile.Inventory.Items.FirstOrDefault(x => x.Id == mappingKvP.Key); + var itemToAdjust = pmcProfile.Inventory.Items.FirstOrDefault(x => + x.Id == mappingKvP.Key + ); itemToAdjust.Id = _hashUtil.Generate(); - _logger.Warning($"Replace duplicate item Id: {mappingKvP.Key} with {itemToAdjust.Id}"); + _logger.Warning( + $"Replace duplicate item Id: {mappingKvP.Key} with {itemToAdjust.Id}" + ); } } } @@ -143,7 +156,7 @@ public class ProfileFixerService( foreach (var item in pmcProfile.Inventory.Items.Where(x => x.SlotId is not null)) { if (item.Upd is null) - // Ignore items without a upd object + // Ignore items without a upd object { continue; } @@ -159,7 +172,9 @@ public class ProfileFixerService( // Check items with StackObjectsCount (undefined) if (item.Upd.StackObjectsCount is null) { - _logger.Warning($"Fixed item: {item.Id}s undefined StackObjectsCount value, now set to 1"); + _logger.Warning( + $"Fixed item: {item.Id}s undefined StackObjectsCount value, now set to 1" + ); item.Upd.StackObjectsCount = 1; } } @@ -167,7 +182,11 @@ public class ProfileFixerService( // Iterate over clothing var customizationDb = _databaseService.GetTemplates().Customization; var customizationDbArray = customizationDb.Values; - var playerIsUsec = string.Equals(pmcProfile.Info.Side, "usec", StringComparison.OrdinalIgnoreCase); + var playerIsUsec = string.Equals( + pmcProfile.Info.Side, + "usec", + StringComparison.OrdinalIgnoreCase + ); // Check Head if (customizationDb[pmcProfile.Customization.Head] is null) @@ -218,8 +237,11 @@ public class ProfileFixerService( return; } - foreach (var counterKvP in pmcProfile.TaskConditionCounters - .Where(counterKvP => counterKvP.Value.SourceId is null)) + foreach ( + var counterKvP in pmcProfile.TaskConditionCounters.Where(counterKvP => + counterKvP.Value.SourceId is null + ) + ) { pmcProfile.TaskConditionCounters.Remove(counterKvP.Key); } @@ -242,15 +264,18 @@ public class ProfileFixerService( // Loop over TaskConditionCounters objects and add once we want to remove to counterKeysToRemove foreach (var TaskConditionCounterKvP in pmcProfile.TaskConditionCounters) - // Only check if profile has repeatable quests + // Only check if profile has repeatable quests { if (pmcProfile.RepeatableQuests is not null && activeRepeatableQuests.Count > 0) { - var existsInActiveRepeatableQuests = activeRepeatableQuests.Any(quest => quest.Id == TaskConditionCounterKvP.Value.SourceId + var existsInActiveRepeatableQuests = activeRepeatableQuests.Any(quest => + quest.Id == TaskConditionCounterKvP.Value.SourceId ); - var existsInQuests = pmcProfile.Quests.Any(quest => quest.QId == TaskConditionCounterKvP.Value.SourceId + var existsInQuests = pmcProfile.Quests.Any(quest => + quest.QId == TaskConditionCounterKvP.Value.SourceId ); - var isAchievementTracker = achievements.Any(quest => quest.Id == TaskConditionCounterKvP.Value.SourceId + var isAchievementTracker = achievements.Any(quest => + quest.Id == TaskConditionCounterKvP.Value.SourceId ); // If task conditions id is neither in activeQuests, quests or achievements - it's stale and should be cleaned up @@ -272,11 +297,17 @@ public class ProfileFixerService( } } - protected List GetActiveRepeatableQuests(List repeatableQuests) + protected List GetActiveRepeatableQuests( + List repeatableQuests + ) { var activeQuests = new List(); - foreach (var repeatableQuest in repeatableQuests.Where(questType => questType.ActiveQuests?.Count > 0)) - // daily/weekly collection has active quests in them, add to array and return + foreach ( + var repeatableQuest in repeatableQuests.Where(questType => + questType.ActiveQuests?.Count > 0 + ) + ) + // daily/weekly collection has active quests in them, add to array and return { activeQuests.AddRange(repeatableQuest.ActiveQuests); } @@ -297,9 +328,16 @@ public class ProfileFixerService( for (var i = profileQuests.Count - 1; i >= 0; i--) { - if (!(quests.ContainsKey(profileQuests[i].QId) || activeRepeatableQuests.Any(x => x.Id == profileQuests[i].QId))) + if ( + !( + quests.ContainsKey(profileQuests[i].QId) + || activeRepeatableQuests.Any(x => x.Id == profileQuests[i].QId) + ) + ) { - _logger.Info($"Successfully removed orphaned quest: {profileQuests[i].QId} that doesn't exist in quest data"); + _logger.Info( + $"Successfully removed orphaned quest: {profileQuests[i].QId} that doesn't exist in quest data" + ); profileQuests.RemoveAt(i); } } @@ -325,7 +363,8 @@ public class ProfileFixerService( // For started or successful quests, check for unlocks in the `Started` rewards if (profileQuest.Status is QuestStatusEnum.Started or QuestStatusEnum.Success) { - var productionRewards = quest.Rewards.Started?.Where(reward => reward.Type == RewardType.ProductionScheme + var productionRewards = quest.Rewards.Started?.Where(reward => + reward.Type == RewardType.ProductionScheme ); if (productionRewards is not null) @@ -340,7 +379,8 @@ public class ProfileFixerService( // For successful quests, check for unlocks in the `Success` rewards if (profileQuest.Status is QuestStatusEnum.Success) { - var productionRewards = quest.Rewards.Success?.Where(reward => reward.Type == RewardType.ProductionScheme + var productionRewards = quest.Rewards.Success?.Where(reward => + reward.Type == RewardType.ProductionScheme ); if (productionRewards is not null) @@ -360,7 +400,11 @@ public class ProfileFixerService( /// Profile to check /// The quest reward to validate /// The quest the reward belongs to - protected void VerifyQuestProductionUnlock(PmcData pmcProfile, Reward productionUnlockReward, Quest questDetails) + protected void VerifyQuestProductionUnlock( + PmcData pmcProfile, + Reward productionUnlockReward, + Quest questDetails + ) { var matchingProductions = _rewardHelper.GetRewardProductionMatch( productionUnlockReward, @@ -375,7 +419,7 @@ public class ProfileFixerService( new { questName = questDetails.QuestName, - matchCount = matchingProductions.Count + matchCount = matchingProductions.Count, } ) ); @@ -391,7 +435,9 @@ public class ProfileFixerService( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Added production: {matchingProductionId} to unlocked production recipes for: {questDetails.QuestName}"); + _logger.Debug( + $"Added production: {matchingProductionId} to unlocked production recipes for: {questDetails.QuestName}" + ); } } } @@ -404,8 +450,10 @@ public class ProfileFixerService( protected void FixOrphanedInsurance(PmcData pmcProfile) { // Check if the player inventory contains this item - pmcProfile.InsuredItems = pmcProfile.InsuredItems - .Where(insuredItem => pmcProfile.Inventory.Items.Any(item => item.Id == insuredItem.ItemId)) + pmcProfile.InsuredItems = pmcProfile + .InsuredItems.Where(insuredItem => + pmcProfile.Inventory.Items.Any(item => item.Id == insuredItem.ItemId) + ) .ToList(); } @@ -418,68 +466,122 @@ public class ProfileFixerService( { var globals = _databaseService.GetGlobals(); - var generator = pmcProfile.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.Generator); + var generator = pmcProfile.Hideout.Areas.FirstOrDefault(area => + area.Type == HideoutAreas.Generator + ); if (generator is not null) { var genSlots = generator.Slots.Count; - var extraGenSlots = globals.Configuration.SkillsSettings.HideoutManagement.EliteSlots.Generator.Slots; + var extraGenSlots = globals + .Configuration + .SkillsSettings + .HideoutManagement + .EliteSlots + .Generator + .Slots; if (genSlots < 6 + extraGenSlots) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug("Updating generator area slots to a size of 6 + hideout management skill"); + _logger.Debug( + "Updating generator area slots to a size of 6 + hideout management skill" + ); } - AddEmptyObjectsToHideoutAreaSlots(HideoutAreas.Generator, (int) (6 + extraGenSlots ?? 0), pmcProfile); + AddEmptyObjectsToHideoutAreaSlots( + HideoutAreas.Generator, + (int)(6 + extraGenSlots ?? 0), + pmcProfile + ); } } - var waterCollSlots = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.WaterCollector) - .Slots - .Count; - var extraWaterCollSlots = globals.Configuration.SkillsSettings.HideoutManagement.EliteSlots.WaterCollector.Slots; + var waterCollSlots = pmcProfile + .Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.WaterCollector) + .Slots.Count; + var extraWaterCollSlots = globals + .Configuration + .SkillsSettings + .HideoutManagement + .EliteSlots + .WaterCollector + .Slots; if (waterCollSlots < 1 + extraWaterCollSlots) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug("Updating water collector area slots to a size of 1 + hideout management skill"); + _logger.Debug( + "Updating water collector area slots to a size of 1 + hideout management skill" + ); } - AddEmptyObjectsToHideoutAreaSlots(HideoutAreas.WaterCollector, (int) (1 + extraWaterCollSlots ?? 0), pmcProfile); + AddEmptyObjectsToHideoutAreaSlots( + HideoutAreas.WaterCollector, + (int)(1 + extraWaterCollSlots ?? 0), + pmcProfile + ); } - var filterSlots = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.AirFilteringUnit).Slots.Count; - var extraFilterSlots = globals.Configuration.SkillsSettings.HideoutManagement.EliteSlots.AirFilteringUnit.Slots; + var filterSlots = pmcProfile + .Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.AirFilteringUnit) + .Slots.Count; + var extraFilterSlots = globals + .Configuration + .SkillsSettings + .HideoutManagement + .EliteSlots + .AirFilteringUnit + .Slots; if (filterSlots < 3 + extraFilterSlots) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug("Updating air filter area slots to a size of 3 + hideout management skill"); + _logger.Debug( + "Updating air filter area slots to a size of 3 + hideout management skill" + ); } - AddEmptyObjectsToHideoutAreaSlots(HideoutAreas.AirFilteringUnit, (int) (3 + extraFilterSlots ?? 0), pmcProfile); + AddEmptyObjectsToHideoutAreaSlots( + HideoutAreas.AirFilteringUnit, + (int)(3 + extraFilterSlots ?? 0), + pmcProfile + ); } - var btcFarmSlots = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.BitcoinFarm).Slots.Count; - var extraBtcSlots = globals.Configuration.SkillsSettings.HideoutManagement.EliteSlots.BitcoinFarm.Slots; + var btcFarmSlots = pmcProfile + .Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.BitcoinFarm) + .Slots.Count; + var extraBtcSlots = globals + .Configuration + .SkillsSettings + .HideoutManagement + .EliteSlots + .BitcoinFarm + .Slots; // BTC Farm doesnt have extra slots for hideout management, but we still check for modded stuff!! if (btcFarmSlots < 50 + extraBtcSlots) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug("Updating bitcoin farm area slots to a size of 50 + hideout management skill"); + _logger.Debug( + "Updating bitcoin farm area slots to a size of 50 + hideout management skill" + ); } - AddEmptyObjectsToHideoutAreaSlots(HideoutAreas.BitcoinFarm, (int) (50 + extraBtcSlots ?? 0), pmcProfile); + AddEmptyObjectsToHideoutAreaSlots( + HideoutAreas.BitcoinFarm, + (int)(50 + extraBtcSlots ?? 0), + pmcProfile + ); } - var cultistAreaSlots = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.CircleOfCultists) - .Slots - .Count; + var cultistAreaSlots = pmcProfile + .Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.CircleOfCultists) + .Slots.Count; if (cultistAreaSlots < 1) { if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -497,7 +599,11 @@ public class ProfileFixerService( /// area to check /// area to update /// profile to update - protected void AddEmptyObjectsToHideoutAreaSlots(HideoutAreas areaType, int emptyItemCount, PmcData pmcProfile) + protected void AddEmptyObjectsToHideoutAreaSlots( + HideoutAreas areaType, + int emptyItemCount, + PmcData pmcProfile + ) { var area = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == areaType); area.Slots = AddObjectsToList(emptyItemCount, area.Slots); @@ -509,12 +615,7 @@ public class ProfileFixerService( { if (!slots.Any(x => x.LocationIndex == i)) { - slots.Add( - new HideoutSlot - { - LocationIndex = i - } - ); + slots.Add(new HideoutSlot { LocationIndex = i }); } } @@ -547,19 +648,25 @@ public class ProfileFixerService( // Get items placed in root of stash // TODO: extend to other areas / sub items - var inventoryItemsToCheck = pmcProfile.Inventory.Items.Where(item => _areas.Contains(item.SlotId ?? "")); + var inventoryItemsToCheck = pmcProfile.Inventory.Items.Where(item => + _areas.Contains(item.SlotId ?? "") + ); if (inventoryItemsToCheck is not null) - // Check each item in inventory to ensure item exists in itemdb + // Check each item in inventory to ensure item exists in itemdb { foreach (var item in inventoryItemsToCheck) { if (!itemsDb.ContainsKey(item.Template)) { - _logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template)); + _logger.Error( + _localisationService.GetText("fixer-mod_item_found", item.Template) + ); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { - _logger.Success($"Deleting item from inventory and insurance with id: {item.Id} tpl: {item.Template}"); + _logger.Success( + $"Deleting item from inventory and insurance with id: {item.Id} tpl: {item.Template}" + ); // also deletes from insured array _inventoryHelper.RemoveItem(pmcProfile, item.Id, sessionId); @@ -572,29 +679,29 @@ public class ProfileFixerService( { // Remove invalid builds from weapon, equipment and magazine build lists var weaponBuilds = fullProfile.UserBuildData?.WeaponBuilds ?? new List(); - fullProfile.UserBuildData.WeaponBuilds = - weaponBuilds.Where(build => - { - return !ShouldRemoveWeaponEquipmentBuild("weapon", build, itemsDb); - } - ) - .ToList(); + fullProfile.UserBuildData.WeaponBuilds = weaponBuilds + .Where(build => + { + return !ShouldRemoveWeaponEquipmentBuild("weapon", build, itemsDb); + }) + .ToList(); - var equipmentBuilds = fullProfile.UserBuildData.EquipmentBuilds ?? new List(); - fullProfile.UserBuildData.EquipmentBuilds = - equipmentBuilds.Where(build => - { - return !ShouldRemoveWeaponEquipmentBuild("equipment", build, itemsDb); - } - ) - .ToList(); + var equipmentBuilds = + fullProfile.UserBuildData.EquipmentBuilds ?? new List(); + fullProfile.UserBuildData.EquipmentBuilds = equipmentBuilds + .Where(build => + { + return !ShouldRemoveWeaponEquipmentBuild("equipment", build, itemsDb); + }) + .ToList(); - var magazineBuild = fullProfile.UserBuildData.MagazineBuilds ?? new List(); - fullProfile.UserBuildData.MagazineBuilds = magazineBuild.Where(build => - { - return !ShouldRemoveMagazineBuild(build, itemsDb); - } - ) + var magazineBuild = + fullProfile.UserBuildData.MagazineBuilds ?? new List(); + fullProfile.UserBuildData.MagazineBuilds = magazineBuild + .Where(build => + { + return !ShouldRemoveMagazineBuild(build, itemsDb); + }) .ToList(); } @@ -627,13 +734,17 @@ public class ProfileFixerService( // Check item exists in itemsDb if (!itemsDb.ContainsKey(item.Template)) { - _logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template)); + _logger.Error( + _localisationService.GetText("fixer-mod_item_found", item.Template) + ); } if (_coreConfig.Fixes.RemoveModItemsFromProfile) { dialog.Value.Messages.Remove(message); - _logger.Warning($"Item: {item.Template} has resulted in the deletion of message: {message.Id} from dialog {dialog}"); + _logger.Warning( + $"Item: {item.Template} has resulted in the deletion of message: {message.Id} from dialog {dialog}" + ); } break; @@ -642,22 +753,33 @@ public class ProfileFixerService( } var clothingDb = _databaseService.GetTemplates().Customization; - foreach (var clothingItem in fullProfile.CustomisationUnlocks.Where(customisation => customisation.Type == CustomisationType.SUITE)) + foreach ( + var clothingItem in fullProfile.CustomisationUnlocks.Where(customisation => + customisation.Type == CustomisationType.SUITE + ) + ) { if (!clothingDb.ContainsKey(clothingItem.Id)) { // Item in profile not found in db, not good - _logger.Error(_localisationService.GetText("fixer-clothing_item_found", clothingItem)); + _logger.Error( + _localisationService.GetText("fixer-clothing_item_found", clothingItem) + ); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { fullProfile.CustomisationUnlocks.Remove(clothingItem); - _logger.Warning($"Non-default clothing purchase: {clothingItem} removed from profile"); + _logger.Warning( + $"Non-default clothing purchase: {clothingItem} removed from profile" + ); } } } - foreach (var repeatable in fullProfile.CharacterData.PmcData.RepeatableQuests ?? new List()) + foreach ( + var repeatable in fullProfile.CharacterData.PmcData.RepeatableQuests + ?? new List() + ) { if (repeatable.ActiveQuests is null) { @@ -668,7 +790,9 @@ public class ProfileFixerService( { if (!_traderHelper.TraderExists(activeQuest.TraderId)) { - _logger.Error(_localisationService.GetText("fixer-trader_found", activeQuest.TraderId)); + _logger.Error( + _localisationService.GetText("fixer-trader_found", activeQuest.TraderId) + ); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { _logger.Warning( @@ -686,7 +810,11 @@ public class ProfileFixerService( } // Get Item rewards only - foreach (var successReward in activeQuest.Rewards.Success.Where(reward => reward.Type == RewardType.Item)) + foreach ( + var successReward in activeQuest.Rewards.Success.Where(reward => + reward.Type == RewardType.Item + ) + ) foreach (var item in successReward.Items) { if (!itemsDb.ContainsKey(item.Template)) @@ -700,13 +828,20 @@ public class ProfileFixerService( } } - foreach (var TraderPurchaseKvP in fullProfile.TraderPurchases - .Where(TraderPurchase => !_traderHelper.TraderExists(TraderPurchase.Key))) + foreach ( + var TraderPurchaseKvP in fullProfile.TraderPurchases.Where(TraderPurchase => + !_traderHelper.TraderExists(TraderPurchase.Key) + ) + ) { - _logger.Error(_localisationService.GetText("fixer-trader_found", TraderPurchaseKvP.Key)); + _logger.Error( + _localisationService.GetText("fixer-trader_found", TraderPurchaseKvP.Key) + ); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { - _logger.Warning($"Non-default trader: {TraderPurchaseKvP.Key} purchase removed from traderPurchases list in profile"); + _logger.Warning( + $"Non-default trader: {TraderPurchaseKvP.Key} purchase removed from traderPurchases list in profile" + ); fullProfile.TraderPurchases.Remove(TraderPurchaseKvP.Key); } } @@ -722,18 +857,25 @@ public class ProfileFixerService( protected bool ShouldRemoveWeaponEquipmentBuild( string buildType, UserBuild build, - Dictionary itemsDb) + Dictionary itemsDb + ) { if (buildType == "weapon") - // Get items not found in items db + // Get items not found in items db { - foreach (var item in (build as WeaponBuild).Items.Where(item => !itemsDb.ContainsKey(item.Template))) + foreach ( + var item in (build as WeaponBuild).Items.Where(item => + !itemsDb.ContainsKey(item.Template) + ) + ) { _logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template)); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { - _logger.Warning($"Item: {item.Template} has resulted in the deletion of {buildType} build: {build.Name}"); + _logger.Warning( + $"Item: {item.Template} has resulted in the deletion of {buildType} build: {build.Name}" + ); return true; } @@ -745,15 +887,21 @@ public class ProfileFixerService( // TODO: refactor to be generic if (buildType == "equipment") - // Get items not found in items db + // Get items not found in items db { - foreach (var item in (build as EquipmentBuild).Items.Where(item => !itemsDb.ContainsKey(item.Template))) + foreach ( + var item in (build as EquipmentBuild).Items.Where(item => + !itemsDb.ContainsKey(item.Template) + ) + ) { _logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template)); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { - _logger.Warning($"Item: {item.Template} has resulted in the deletion of {buildType} build: {build.Name}"); + _logger.Warning( + $"Item: {item.Template} has resulted in the deletion of {buildType} build: {build.Name}" + ); return true; } @@ -774,7 +922,8 @@ public class ProfileFixerService( /// True if the build should be removed from the build list, false otherwise protected bool ShouldRemoveMagazineBuild( MagazineBuild magazineBuild, - Dictionary itemsDb) + Dictionary itemsDb + ) { foreach (var item in magazineBuild.Items) { @@ -787,11 +936,15 @@ public class ProfileFixerService( // Check item exists in itemsDb if (!itemsDb.ContainsKey(item.TemplateId)) { - _logger.Error(_localisationService.GetText("fixer-mod_item_found", item.TemplateId)); + _logger.Error( + _localisationService.GetText("fixer-mod_item_found", item.TemplateId) + ); if (_coreConfig.Fixes.RemoveModItemsFromProfile) { - _logger.Warning($"Item: {item.TemplateId} has resulted in the deletion of magazine build: {magazineBuild.Name}"); + _logger.Warning( + $"Item: {item.TemplateId} has resulted in the deletion of magazine build: {magazineBuild.Name}" + ); return true; } @@ -826,7 +979,7 @@ public class ProfileFixerService( // Zero indexed var areaLevelsToCheck = new List(); for (var index = 0; index < level + 1; index++) - // Stage key is saved as string in db + // Stage key is saved as string in db { areaLevelsToCheck.Add(index.ToString()); } @@ -855,7 +1008,9 @@ public class ProfileFixerService( if (profileBonus is null) { // no bonus, add to profile - _logger.Debug($"Profile has level {level} area {profileArea.Type} but no bonus found, adding {bonus.Type}"); + _logger.Debug( + $"Profile has level {level} area {profileArea.Type} but no bonus found, adding {bonus.Type}" + ); _hideoutHelper.ApplyPlayerUpgradesBonuses(pmcProfile, bonus); } } @@ -879,12 +1034,15 @@ public class ProfileFixerService( return bonus.Type switch { - BonusType.StashSize => profileBonuses?.FirstOrDefault(x => x.Type == bonus.Type && x.TemplateId == bonus.TemplateId + BonusType.StashSize => profileBonuses?.FirstOrDefault(x => + x.Type == bonus.Type && x.TemplateId == bonus.TemplateId ), BonusType.AdditionalSlots => profileBonuses?.FirstOrDefault(x => x.Type == bonus.Type && x?.Value == bonus?.Value && x?.IsVisible == bonus?.IsVisible ), - _ => profileBonuses?.FirstOrDefault(x => x.Type == bonus.Type && x.Value == bonus.Value) + _ => profileBonuses?.FirstOrDefault(x => + x.Type == bonus.Type && x.Value == bonus.Value + ), }; } @@ -898,7 +1056,9 @@ public class ProfileFixerService( _logger.Error(_localisationService.GetText("fixer-trader_found", traderId)); if (_coreConfig.Fixes.RemoveInvalidTradersFromProfile) { - _logger.Warning($"Non - default trader: {traderId} removed from PMC TradersInfo in: {fullProfile.ProfileInfo?.ProfileId} profile"); + _logger.Warning( + $"Non - default trader: {traderId} removed from PMC TradersInfo in: {fullProfile.ProfileInfo?.ProfileId} profile" + ); fullProfile.CharacterData.PmcData.TradersInfo.Remove(traderId); } } @@ -912,7 +1072,9 @@ public class ProfileFixerService( _logger.Error(_localisationService.GetText("fixer-trader_found", traderId)); if (_coreConfig.Fixes.RemoveInvalidTradersFromProfile) { - _logger.Warning($"Non - default trader: {traderId} removed from Scav TradersInfo in: {fullProfile.ProfileInfo?.ProfileId} profile"); + _logger.Warning( + $"Non - default trader: {traderId} removed from Scav TradersInfo in: {fullProfile.ProfileInfo?.ProfileId} profile" + ); fullProfile.CharacterData.ScavData.TradersInfo.Remove(traderId); } } diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairCategoriesService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairCategoriesService.cs index 54c8ca90..b42fd63a 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairCategoriesService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairCategoriesService.cs @@ -22,49 +22,58 @@ public class RagfairCategoriesService( public Dictionary GetCategoriesFromOffers( List offers, SearchRequestData searchRequestData, - bool fleaUnlocked) + bool fleaUnlocked + ) { // Get offers valid for search request, then reduce them down to just the counts return offers .Where(offer => + { + var isTraderOffer = offer.User.MemberType == MemberCategory.Trader; + + // Not level 15 and offer is from player, skip + if (!fleaUnlocked && !isTraderOffer) { - var isTraderOffer = offer.User.MemberType == MemberCategory.Trader; - - // Not level 15 and offer is from player, skip - if (!fleaUnlocked && !isTraderOffer) - { - return false; - } - - // Skip when: - // Not a 'required' search - // Remove barters checkbox checked - // Offer requirement has children or requirement is not money - if ( - string.IsNullOrEmpty(searchRequestData.NeededSearchId) && - searchRequestData.RemoveBartering.GetValueOrDefault(false) && - (offer.Requirements.Count > 1 || !_paymentHelper.IsMoneyTpl(offer.Requirements.FirstOrDefault().Template)) - ) - { - return false; - } - - // Remove when filter set to players only + offer is from trader - if (searchRequestData.OfferOwnerType == OfferOwnerType.PLAYEROWNERTYPE && isTraderOffer) - { - return false; - } - - // Remove when filter set to traders only + offer is not from trader - if (searchRequestData.OfferOwnerType == OfferOwnerType.TRADEROWNERTYPE && !isTraderOffer) - { - return false; - } - - // Passed checks, it's a valid offer to process - return true; + return false; } - ) + + // Skip when: + // Not a 'required' search + // Remove barters checkbox checked + // Offer requirement has children or requirement is not money + if ( + string.IsNullOrEmpty(searchRequestData.NeededSearchId) + && searchRequestData.RemoveBartering.GetValueOrDefault(false) + && ( + offer.Requirements.Count > 1 + || !_paymentHelper.IsMoneyTpl(offer.Requirements.FirstOrDefault().Template) + ) + ) + { + return false; + } + + // Remove when filter set to players only + offer is from trader + if ( + searchRequestData.OfferOwnerType == OfferOwnerType.PLAYEROWNERTYPE + && isTraderOffer + ) + { + return false; + } + + // Remove when filter set to traders only + offer is not from trader + if ( + searchRequestData.OfferOwnerType == OfferOwnerType.TRADEROWNERTYPE + && !isTraderOffer + ) + { + return false; + } + + // Passed checks, it's a valid offer to process + return true; + }) .GroupBy(x => x.Items.FirstOrDefault().Template) .ToDictionary(group => group.Key, group => group.Count()); } diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairLinkedItemService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairLinkedItemService.cs index bcbc0fea..29cb7d01 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairLinkedItemService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairLinkedItemService.cs @@ -69,7 +69,8 @@ public class RagfairLinkedItemService( var itemLinkedSet = linkedItems[item.Id]; // Slots - foreach (var linkedItemId in GetSlotFilters(item)) { + foreach (var linkedItemId in GetSlotFilters(item)) + { itemLinkedSet.Add(linkedItemId); linkedItems.TryAdd(linkedItemId, []); @@ -88,7 +89,6 @@ public class RagfairLinkedItemService( // Cartridges foreach (var linkedItemId in GetCartridgeFilters(item)) { - itemLinkedSet.Add(linkedItemId); linkedItems.TryAdd(linkedItemId, []); @@ -97,7 +97,7 @@ public class RagfairLinkedItemService( // Edge case, ensure ammo for revolvers is included if (item.Parent == BaseClasses.REVOLVER) - // Find magazine for revolver + // Find magazine for revolver { AddRevolverCylinderAmmoToLinkedItems(item, itemLinkedSet); } @@ -115,7 +115,10 @@ public class RagfairLinkedItemService( /// /// Revolvers cylinder /// Set to add to - protected void AddRevolverCylinderAmmoToLinkedItems(TemplateItem cylinder, HashSet itemLinkedSet) + protected void AddRevolverCylinderAmmoToLinkedItems( + TemplateItem cylinder, + HashSet itemLinkedSet + ) { var cylinderMod = cylinder.Properties.Slots?.FirstOrDefault(x => x.Name == "mod_magazine"); if (cylinderMod == null) diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairOfferService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairOfferService.cs index df552cfc..f73c04ea 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairOfferService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairOfferService.cs @@ -140,7 +140,7 @@ public class RagfairOfferService( { var pmcData = saveServer.GetProfile(sessionId)?.CharacterData?.PmcData; if (pmcData?.RagfairInfo?.Offers == null) - // Profile has been wiped, ignore + // Profile has been wiped, ignore { continue; } @@ -221,21 +221,32 @@ public class RagfairOfferService( var offerCreatorProfile = profileHelper.GetProfileByPmcId(offerCreatorId); if (offerCreatorProfile == null) { - logger.Error($"Unable to return flea offer: {playerOffer.Id} as the profile: {offerCreatorId} could not be found"); + logger.Error( + $"Unable to return flea offer: {playerOffer.Id} as the profile: {offerCreatorId} could not be found" + ); return; } - var indexOfOfferInProfile = offerCreatorProfile.RagfairInfo.Offers.FindIndex(o => o.Id == playerOffer.Id); + var indexOfOfferInProfile = offerCreatorProfile.RagfairInfo.Offers.FindIndex(o => + o.Id == playerOffer.Id + ); if (indexOfOfferInProfile == -1) { - logger.Warning(localisationService.GetText("ragfair-unable_to_find_offer_to_remove", playerOffer.Id)); + logger.Warning( + localisationService.GetText( + "ragfair-unable_to_find_offer_to_remove", + playerOffer.Id + ) + ); return; } // Reduce player ragfair rep - offerCreatorProfile.RagfairInfo.Rating -= databaseService.GetGlobals().Configuration.RagFair.RatingDecreaseCount; + offerCreatorProfile.RagfairInfo.Rating -= databaseService + .GetGlobals() + .Configuration.RagFair.RatingDecreaseCount; offerCreatorProfile.RagfairInfo.IsRatingGrowing = false; // Increment players 'notSellSum' value @@ -270,7 +281,8 @@ public class RagfairOfferService( // Send toast notification to player var notificationMessage = notifierHelper.CreateRagfairNewRatingNotification( offerCreatorProfile.RagfairInfo.Rating.Value, - offerCreatorProfile.RagfairInfo.IsRatingGrowing.GetValueOrDefault(false)); + offerCreatorProfile.RagfairInfo.IsRatingGrowing.GetValueOrDefault(false) + ); notificationSendHelper.SendMessage(offerCreatorId, notificationMessage); ragfairServerHelper.ReturnItems(offerCreatorProfile.SessionId, unstackedItems); @@ -347,6 +359,7 @@ public class RagfairOfferService( /// True if enough offers have expired public bool EnoughExpiredOffersExistToProcess() { - return ragfairOfferHolder.GetExpiredOfferCount() >= _ragfairConfig.Dynamic.ExpiredOfferThreshold; + return ragfairOfferHolder.GetExpiredOfferCount() + >= _ragfairConfig.Dynamic.ExpiredOfferThreshold; } } diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairPriceService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairPriceService.cs index b8862d3a..e4a07a2f 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairPriceService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairPriceService.cs @@ -51,7 +51,13 @@ public class RagfairPriceService( public void RefreshStaticPrices() { _staticPrices = new Dictionary(); - foreach (var item in _databaseService.GetItems().Values.Where(item => string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase))) + foreach ( + var item in _databaseService + .GetItems() + .Values.Where(item => + string.Equals(item.Type, "Item", StringComparison.OrdinalIgnoreCase) + ) + ) { _staticPrices[item.Id] = _handbookHelper.GetTemplatePrice(item.Id); } @@ -81,11 +87,7 @@ public class RagfairPriceService( _logger.Warning( _localisationService.GetText( "ragfair-unable_to_find_item_price_for_item_in_flea_handbook", - new - { - tpl = tplId, - name = itemFromDb.Value.Name ?? "" - } + new { tpl = tplId, name = itemFromDb.Value.Name ?? "" } ) ); } @@ -146,7 +148,8 @@ public class RagfairPriceService( { var dynamicPrices = _databaseService.GetPrices(); // Use dynamic prices first, fill in any gaps with data from static prices (handbook) - return dynamicPrices.Concat(_staticPrices) + return dynamicPrices + .Concat(_staticPrices) .GroupBy(x => x.Key) .ToDictionary(x => x.Key, x => x.First().Value); } @@ -197,7 +200,11 @@ public class RagfairPriceService( /// Currency price desired in /// Price is for a pack type offer /// cost of item in desired currency - public double GetDynamicOfferPriceForOffer(List offerItems, string desiredCurrency, bool isPackOffer) + public double GetDynamicOfferPriceForOffer( + List offerItems, + string desiredCurrency, + bool isPackOffer + ) { // Price to return. var price = 0d; @@ -211,16 +218,22 @@ public class RagfairPriceService( continue; } - price += GetDynamicItemPrice(item.Template, desiredCurrency, item, offerItems, isPackOffer).Value; + price += GetDynamicItemPrice( + item.Template, + desiredCurrency, + item, + offerItems, + isPackOffer + ).Value; // Check if the item is a weapon preset. if ( - item?.Upd?.SptPresetId is not null && - _presetHelper.IsPresetBaseClass(item.Upd.SptPresetId, BaseClasses.WEAPON) - ) - // This is a weapon preset, which has it's own price calculation that takes into account the mods in the - // preset. Since we've already calculated the price for the preset entire preset in - // `getDynamicItemPrice`, we can skip the rest of the items in the offer. + item?.Upd?.SptPresetId is not null + && _presetHelper.IsPresetBaseClass(item.Upd.SptPresetId, BaseClasses.WEAPON) + ) + // This is a weapon preset, which has it's own price calculation that takes into account the mods in the + // preset. Since we've already calculated the price for the preset entire preset in + // `getDynamicItemPrice`, we can skip the rest of the items in the offer. { break; } @@ -237,7 +250,13 @@ public class RagfairPriceService( /// /// /// - public double? GetDynamicItemPrice(string itemTemplateId, string desiredCurrency, Item item = null, List offerItems = null, bool? isPackOffer = null) + public double? GetDynamicItemPrice( + string itemTemplateId, + string desiredCurrency, + Item item = null, + List offerItems = null, + bool? isPackOffer = null + ) { var isPreset = false; var price = GetFleaPriceForItem(itemTemplateId); @@ -260,9 +279,9 @@ public class RagfairPriceService( // Prices for weapon presets are handled differently. if ( - item?.Upd?.SptPresetId is not null && - offerItems is not null && - _presetHelper.IsPresetBaseClass(item.Upd.SptPresetId, BaseClasses.WEAPON) + item?.Upd?.SptPresetId is not null + && offerItems is not null + && _presetHelper.IsPresetBaseClass(item.Upd.SptPresetId, BaseClasses.WEAPON) ) { price = GetWeaponPresetPrice(item, offerItems, price); @@ -270,13 +289,21 @@ public class RagfairPriceService( } // Check for existence of manual price adjustment multiplier - if (_ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue(itemTemplateId, out var multiplier)) + if ( + _ragfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue( + itemTemplateId, + out var multiplier + ) + ) { price *= multiplier; } // The quality of the item affects the price + not on the ignore list - if (item is not null && !_ragfairConfig.Dynamic.IgnoreQualityPriceVarianceBlacklist.Contains(itemTemplateId)) + if ( + item is not null + && !_ragfairConfig.Dynamic.IgnoreQualityPriceVarianceBlacklist.Contains(itemTemplateId) + ) { var qualityModifier = _itemHelper.GetItemQualityModifier(item); price *= qualityModifier; @@ -290,11 +317,7 @@ public class RagfairPriceService( continue; } - price = AdjustUnreasonablePrice( - value, - itemTemplateId, - price - ); + price = AdjustUnreasonablePrice(value, itemTemplateId, price); } // Vary the price based on the type of offer. @@ -325,7 +348,8 @@ public class RagfairPriceService( protected double AdjustUnreasonablePrice( UnreasonableModPrices unreasonableItemChange, string itemTpl, - double price) + double price + ) { var itemHandbookPrice = _handbookHelper.GetTemplatePrice(itemTpl); if (itemHandbookPrice > 0) @@ -386,14 +410,15 @@ public class RagfairPriceService( // Only adjust price if difference is > a percent AND item price passes threshold set in config if ( - priceDifferencePercent > - offerAdjustmentSettings.MaxPriceDifferenceBelowHandbookPercent && - itemPrice >= offerAdjustmentSettings.PriceThresholdRub - ) - // var itemDetails = this.itemHelper.getItem(itemTpl); - // this.logger.debug(`item below handbook price {itemDetails[1]._name} handbook: {itemHandbookPrice} flea: ${itemPrice} {priceDifferencePercent}%`); + priceDifferencePercent > offerAdjustmentSettings.MaxPriceDifferenceBelowHandbookPercent + && itemPrice >= offerAdjustmentSettings.PriceThresholdRub + ) + // var itemDetails = this.itemHelper.getItem(itemTpl); + // this.logger.debug(`item below handbook price {itemDetails[1]._name} handbook: {itemHandbookPrice} flea: ${itemPrice} {priceDifferencePercent}%`); { - return Math.Round(itemHandbookPrice.Value * offerAdjustmentSettings.HandbookPriceMultiplier); + return Math.Round( + itemHandbookPrice.Value * offerAdjustmentSettings.HandbookPriceMultiplier + ); } return itemPrice; @@ -408,7 +433,12 @@ public class RagfairPriceService( protected double RandomiseOfferPrice(double existingPrice, MinMax rangeValues) { // Multiply by 100 to get 2 decimal places of precision - var multiplier = _randomUtil.GetBiasedRandomNumber(rangeValues.Min * 100, rangeValues.Max * 100, 2, 2); + var multiplier = _randomUtil.GetBiasedRandomNumber( + rangeValues.Min * 100, + rangeValues.Max * 100, + 2, + 2 + ); // return multiplier back to its original decimal place location return existingPrice * (multiplier / 100); @@ -421,7 +451,11 @@ public class RagfairPriceService( /// weapon plus mods /// price of existing base weapon /// price of weapon in roubles - protected double GetWeaponPresetPrice(Item weaponRootItem, List weaponWithChildren, double existingPrice) + protected double GetWeaponPresetPrice( + Item weaponRootItem, + List weaponWithChildren, + double existingPrice + ) { // Get the default preset for this weapon var presetResult = GetWeaponPreset(weaponRootItem); @@ -431,12 +465,14 @@ public class RagfairPriceService( } // Get mods on current gun not in default preset - var newOrReplacedModsInPresetVsDefault = weaponWithChildren.Where(x => !presetResult.Preset.Items.Any(y => y.Template == x.Template)); + var newOrReplacedModsInPresetVsDefault = weaponWithChildren.Where(x => + !presetResult.Preset.Items.Any(y => y.Template == x.Template) + ); // Add up extra mods price var extraModsPrice = 0d; foreach (var mod in newOrReplacedModsInPresetVsDefault) - // Use handbook or trader price, whatever is higher (dont use dynamic flea price as purchased item cannot be relisted) + // Use handbook or trader price, whatever is higher (dont use dynamic flea price as purchased item cannot be relisted) { extraModsPrice += GetHighestHandbookOrTraderPriceAsRouble(mod.Template).Value; } @@ -453,7 +489,9 @@ public class RagfairPriceService( var replacedModsPrice = 0d; foreach (var replacedMod in modsReplacedByNewMods) { - replacedModsPrice += GetHighestHandbookOrTraderPriceAsRouble(replacedMod.Template).Value; + replacedModsPrice += GetHighestHandbookOrTraderPriceAsRouble( + replacedMod.Template + ).Value; } // Subtract replaced mods total from extra mods total @@ -492,11 +530,7 @@ public class RagfairPriceService( var defaultPreset = _presetHelper.GetDefaultPreset(weapon.Template); if (defaultPreset is not null) { - return new WeaponPreset - { - IsDefault = true, - Preset = defaultPreset - }; + return new WeaponPreset { IsDefault = true, Preset = defaultPreset }; } var nonDefaultPresets = _presetHelper.GetPresets(weapon.Template); @@ -510,25 +544,13 @@ public class RagfairPriceService( ); } - return new WeaponPreset - { - IsDefault = false, - Preset = nonDefaultPresets[0] - }; + return new WeaponPreset { IsDefault = false, Preset = nonDefaultPresets[0] }; } public record WeaponPreset { - public bool IsDefault - { - get; - set; - } + public bool IsDefault { get; set; } - public Preset Preset - { - get; - set; - } + public Preset Preset { get; set; } } } diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairRequiredItemsService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairRequiredItemsService.cs index 3252813f..3ad94a2b 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairRequiredItemsService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairRequiredItemsService.cs @@ -7,7 +7,8 @@ namespace SPTarkov.Server.Core.Services; [Injectable(InjectionType.Singleton)] public class RagfairRequiredItemsService( RagfairOfferService ragfairOfferService, - PaymentHelper paymentHelper) + PaymentHelper paymentHelper +) { /// /// Key = tpl @@ -39,7 +40,7 @@ public class RagfairRequiredItemsService( foreach (var requirement in offer.Requirements) { if (paymentHelper.IsMoneyTpl(requirement.Template)) - // This would just be too noisy + // This would just be too noisy { continue; } diff --git a/Libraries/SPTarkov.Server.Core/Services/RagfairTaxService.cs b/Libraries/SPTarkov.Server.Core/Services/RagfairTaxService.cs index 44ab8a61..c97260e0 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RagfairTaxService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RagfairTaxService.cs @@ -22,7 +22,10 @@ public class RagfairTaxService( { protected Dictionary _playerOfferTaxCache = new(); - public void StoreClientOfferTaxValue(string sessionId, StorePlayerOfferTaxAmountRequestData offer) + public void StoreClientOfferTaxValue( + string sessionId, + StorePlayerOfferTaxAmountRequestData offer + ) { _playerOfferTaxCache[offer.Id] = offer; } @@ -32,7 +35,9 @@ public class RagfairTaxService( _playerOfferTaxCache.Remove(offerIdToRemove); } - public StorePlayerOfferTaxAmountRequestData GetStoredClientOfferTaxValueById(string offerIdToGet) + public StorePlayerOfferTaxAmountRequestData GetStoredClientOfferTaxValueById( + string offerIdToGet + ) { return _playerOfferTaxCache[offerIdToGet]; } @@ -52,7 +57,8 @@ public class RagfairTaxService( PmcData pmcData, double? requirementsValue, int? offerItemCount, - bool sellInOnePiece) + bool sellInOnePiece + ) { if (requirementsValue is null) { @@ -96,7 +102,8 @@ public class RagfairTaxService( var taxDiscountPercent = -(hideoutFleaTaxDiscountBonusSum / 100.0); var tax = - itemWorth * itemTaxMult * itemPriceMult + requirementsPrice * requirementTaxMult * requirementPriceMult; + itemWorth * itemTaxMult * itemPriceMult + + requirementsPrice * requirementTaxMult * requirementPriceMult; var discountedTax = tax * (1.0 - taxDiscountPercent); var itemComissionMult = itemTemplate.Properties.RagFairCommissionModifier.HasValue ? itemTemplate.Properties.RagFairCommissionModifier.Value @@ -105,14 +112,24 @@ public class RagfairTaxService( if (item.Upd.Buff is not null) { var buffType = item.Upd.Buff.BuffType; - var itemEnhancementSettings = - _databaseService.GetGlobals().Configuration.RepairSettings.ItemEnhancementSettings; + var itemEnhancementSettings = _databaseService + .GetGlobals() + .Configuration.RepairSettings.ItemEnhancementSettings; var priceModiferValue = buffType switch { - BuffType.DamageReduction => itemEnhancementSettings.DamageReduction.PriceModifierValue.Value, - BuffType.MalfunctionProtections => itemEnhancementSettings.MalfunctionProtections.PriceModifierValue.Value, - BuffType.WeaponSpread => itemEnhancementSettings.WeaponSpread.PriceModifierValue.Value, - _ => 1d + BuffType.DamageReduction => itemEnhancementSettings + .DamageReduction + .PriceModifierValue + .Value, + BuffType.MalfunctionProtections => itemEnhancementSettings + .MalfunctionProtections + .PriceModifierValue + .Value, + BuffType.WeaponSpread => itemEnhancementSettings + .WeaponSpread + .PriceModifierValue + .Value, + _ => 1d, }; discountedTax *= 1.0 + Math.Abs(item.Upd.Buff.Value.Value - 1.0) * priceModiferValue; } @@ -142,7 +159,8 @@ public class RagfairTaxService( TemplateItem itemTemplate, int itemCount, PmcData pmcData, - bool isRootItem = true) + bool isRootItem = true + ) { var worth = _ragfairPriceService.GetFleaPriceForItem(item.Template); @@ -150,7 +168,10 @@ public class RagfairTaxService( if (isRootItem) { // Since we get a flat list of all child items, we only want to recurse from parent item - var itemChildren = _itemHelper.FindAndReturnChildrenAsItems(pmcData.Inventory.Items, item.Id); + var itemChildren = _itemHelper.FindAndReturnChildrenAsItems( + pmcData.Inventory.Items, + item.Id + ); if (itemChildren.Count > 1) { var itemChildrenClone = _cloner.Clone(itemChildren); // Clone is expensive, only run if necessary @@ -161,7 +182,7 @@ public class RagfairTaxService( worth += CalculateItemWorth( child, _itemHelper.GetItem(child.Template).Value, - (int) (child.Upd.StackObjectsCount ?? 1), + (int)(child.Upd.StackObjectsCount ?? 1), pmcData, false ); @@ -178,7 +199,9 @@ public class RagfairTaxService( if (itemTemplate.Properties is null) { - _logger.Warning($"Item: {item.Id} lacks _props and cannot have its worth calculated properly"); + _logger.Warning( + $"Item: {item.Id} lacks _props and cannot have its worth calculated properly" + ); return worth; } @@ -186,41 +209,55 @@ public class RagfairTaxService( if (upd.Key is not null && (itemTemplate.Properties.MaximumNumberOfUsage ?? 0) > 0) { worth = - worth / - (itemTemplate.Properties.MaximumNumberOfUsage ?? 1) * - ((itemTemplate.Properties.MaximumNumberOfUsage ?? 1) - upd.Key.NumberOfUsages.Value); + worth + / (itemTemplate.Properties.MaximumNumberOfUsage ?? 1) + * ( + (itemTemplate.Properties.MaximumNumberOfUsage ?? 1) + - upd.Key.NumberOfUsages.Value + ); } if (upd.Resource is not null && (itemTemplate.Properties.MaxResource ?? 0) > 0) { - worth = (double) (worth * 0.1 + - worth * 0.9 / (itemTemplate.Properties.MaxResource ?? 1) * upd.Resource.Value); + worth = (double)( + worth * 0.1 + + worth * 0.9 / (itemTemplate.Properties.MaxResource ?? 1) * upd.Resource.Value + ); } if (upd.SideEffect is not null && (itemTemplate.Properties.MaxResource ?? 0) > 0) { - worth = (double) (worth * 0.1 + - worth * 0.9 / (itemTemplate.Properties.MaxResource ?? 1) * upd.SideEffect.Value); + worth = (double)( + worth * 0.1 + + worth * 0.9 / (itemTemplate.Properties.MaxResource ?? 1) * upd.SideEffect.Value + ); } if (upd.MedKit is not null && (itemTemplate.Properties.MaxHpResource ?? 0) > 0) { - worth = worth / (itemTemplate.Properties.MaxHpResource ?? 1) * upd.MedKit.HpResource.Value; + worth = + worth / (itemTemplate.Properties.MaxHpResource ?? 1) * upd.MedKit.HpResource.Value; } if (upd.FoodDrink is not null && (itemTemplate.Properties.MaxResource ?? 0) > 0) { - worth = worth / (itemTemplate.Properties.MaxResource ?? 1) * upd.FoodDrink.HpPercent.Value; + worth = + worth / (itemTemplate.Properties.MaxResource ?? 1) * upd.FoodDrink.HpPercent.Value; } if (upd.Repairable is not null && (itemTemplate.Properties.ArmorClass ?? 0) > 0) { var num2 = 0.01 * Math.Pow(0.0, upd.Repairable.MaxDurability.Value); worth = - worth * (upd.Repairable.MaxDurability.Value / (itemTemplate.Properties.Durability ?? 1) - num2) - - Math.Floor( - (itemTemplate.Properties.RepairCost ?? 0) * - (upd.Repairable.MaxDurability.Value - upd.Repairable.Durability.Value) + worth + * ( + upd.Repairable.MaxDurability.Value + / (itemTemplate.Properties.Durability ?? 1) + - num2 + ) + - Math.Floor( + (itemTemplate.Properties.RepairCost ?? 0) + * (upd.Repairable.MaxDurability.Value - upd.Repairable.Durability.Value) ); } diff --git a/Libraries/SPTarkov.Server.Core/Services/RaidTimeAdjustmentService.cs b/Libraries/SPTarkov.Server.Core/Services/RaidTimeAdjustmentService.cs index f6998a95..266148ef 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RaidTimeAdjustmentService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RaidTimeAdjustmentService.cs @@ -41,12 +41,18 @@ public class RaidTimeAdjustmentService( // Change loot multiplier values before they're used below if (raidAdjustments.DynamicLootPercent < 100) { - AdjustLootMultipliers(_locationConfig.LooseLootMultiplier, raidAdjustments.DynamicLootPercent); + AdjustLootMultipliers( + _locationConfig.LooseLootMultiplier, + raidAdjustments.DynamicLootPercent + ); } if (raidAdjustments.StaticLootPercent < 100) { - AdjustLootMultipliers(_locationConfig.StaticLootMultiplier, raidAdjustments.StaticLootPercent); + AdjustLootMultipliers( + _locationConfig.StaticLootMultiplier, + raidAdjustments.StaticLootPercent + ); } // Adjust the escape time limit @@ -92,11 +98,17 @@ public class RaidTimeAdjustmentService( /// /// Multipliers to adjust /// Percent to change values to - protected void AdjustLootMultipliers(Dictionary mapLootMultipliers, double? loosePercent) + protected void AdjustLootMultipliers( + Dictionary mapLootMultipliers, + double? loosePercent + ) { foreach (var location in mapLootMultipliers) { - mapLootMultipliers[location.Key] = _randomUtil.GetPercentOfValue(mapLootMultipliers[location.Key], loosePercent ?? 1); + mapLootMultipliers[location.Key] = _randomUtil.GetPercentOfValue( + mapLootMultipliers[location.Key], + loosePercent ?? 1 + ); } } @@ -109,15 +121,17 @@ public class RaidTimeAdjustmentService( { // Remove waves that spawned before the player joined var originalWaveCount = mapBase.Waves.Count; - mapBase.Waves = mapBase.Waves.Where(x => x.TimeMax > raidAdjustments.SimulatedRaidStartSeconds).ToList(); + mapBase.Waves = mapBase + .Waves.Where(x => x.TimeMax > raidAdjustments.SimulatedRaidStartSeconds) + .ToList(); // Adjust wave min/max times to match new simulated start var startSeconds = raidAdjustments.SimulatedRaidStartSeconds.GetValueOrDefault(1); foreach (var wave in mapBase.Waves) { // Don't let time fall below 0 - wave.TimeMin -= (int) Math.Max(startSeconds, 0); - wave.TimeMax -= (int) Math.Max(startSeconds, 0); + wave.TimeMin -= (int)Math.Max(startSeconds, 0); + wave.TimeMax -= (int)Math.Max(startSeconds, 0); } _logger.Debug( @@ -141,12 +155,16 @@ public class RaidTimeAdjustmentService( var result = new RaidChanges { NewSurviveTimeSeconds = globals.Configuration.Exp.MatchEnd.SurvivedSecondsRequirement, - OriginalSurvivalTimeSeconds = globals.Configuration.Exp.MatchEnd.SurvivedSecondsRequirement, + OriginalSurvivalTimeSeconds = globals + .Configuration + .Exp + .MatchEnd + .SurvivedSecondsRequirement, DynamicLootPercent = 100, StaticLootPercent = 100, SimulatedRaidStartSeconds = 0, RaidTimeMinutes = baseEscapeTimeMinutes, - ExitChanges = [] + ExitChanges = [], }; // Pmc raid, send default @@ -160,7 +178,7 @@ public class RaidTimeAdjustmentService( // Chance of reducing raid time for scav, not guaranteed if (!_randomUtil.GetChance100(mapSettings.ReducedChancePercent)) - // Send default + // Send default { return result; } @@ -182,19 +200,32 @@ public class RaidTimeAdjustmentService( result.RaidTimeMinutes = newRaidTimeMinutes; // Calculate how long player needs to be in raid to get a `survived` extract status - result.NewSurviveTimeSeconds = Math.Max(result.OriginalSurvivalTimeSeconds.Value - (baseEscapeTimeMinutes.Value - newRaidTimeMinutes) * 60, 0); + result.NewSurviveTimeSeconds = Math.Max( + result.OriginalSurvivalTimeSeconds.Value + - (baseEscapeTimeMinutes.Value - newRaidTimeMinutes) * 60, + 0 + ); if (mapSettings.ReduceLootByPercent) { - result.DynamicLootPercent = Math.Max(raidTimeRemainingPercent, mapSettings.MinDynamicLootPercent); - result.StaticLootPercent = Math.Max(raidTimeRemainingPercent, mapSettings.MinStaticLootPercent); + result.DynamicLootPercent = Math.Max( + raidTimeRemainingPercent, + mapSettings.MinDynamicLootPercent + ); + result.StaticLootPercent = Math.Max( + raidTimeRemainingPercent, + mapSettings.MinStaticLootPercent + ); } - _logger.Debug($"Reduced: {request.Location} raid time by: {chosenRaidReductionPercent}% to {newRaidTimeMinutes} minutes"); + _logger.Debug( + $"Reduced: {request.Location} raid time by: {chosenRaidReductionPercent}% to {newRaidTimeMinutes} minutes" + ); // Calculate how long player needs to be in raid to get a `survived` extract status result.NewSurviveTimeSeconds = Math.Max( - result.OriginalSurvivalTimeSeconds - (baseEscapeTimeMinutes - newRaidTimeMinutes) * 60 ?? 0, + result.OriginalSurvivalTimeSeconds - (baseEscapeTimeMinutes - newRaidTimeMinutes) * 60 + ?? 0, 0D ); @@ -220,7 +251,9 @@ public class RaidTimeAdjustmentService( var mapSettings = _locationConfig.ScavRaidTimeSettings.Maps?[location.ToLower()]; if (mapSettings is null) { - _logger.Warning($"Unable to find scav raid time settings for map: {location}, using defaults"); + _logger.Warning( + $"Unable to find scav raid time settings for map: {location}, using defaults" + ); return new ScavRaidTimeLocationSettings(); } @@ -233,7 +266,10 @@ public class RaidTimeAdjustmentService( /// Map base file player is on /// How long raid is in minutes /// List of exit changes to send to client - protected List GetExitAdjustments(LocationBase mapBase, double newRaidTimeMinutes) + protected List GetExitAdjustments( + LocationBase mapBase, + double newRaidTimeMinutes + ) { List result = []; // Adjust train exits only @@ -250,7 +286,7 @@ public class RaidTimeAdjustmentService( Name = exit.Name, MinTime = null, MaxTime = null, - Chance = null + Chance = null, }; // At what minute we simulate the player joining the raid @@ -273,15 +309,18 @@ public class RaidTimeAdjustmentService( // // I added 2 seconds just to be safe... // - var trainArrivalDelaySeconds = - _locationConfig.ScavRaidTimeSettings.Settings.TrainArrivalDelayObservedSeconds; + var trainArrivalDelaySeconds = _locationConfig + .ScavRaidTimeSettings + .Settings + .TrainArrivalDelayObservedSeconds; // Determine the earliest possible time in the raid when the train would leave var earliestPossibleDepartureMinutes = (exit.MinTime + exit.Count + exit.ExfiltrationTime + trainArrivalDelaySeconds) / 60; // If raid is after last moment train can leave, assume train has already left, disable extract - var mostPossibleTimeRemainingAfterDeparture = mapBase.EscapeTimeLimit - earliestPossibleDepartureMinutes; + var mostPossibleTimeRemainingAfterDeparture = + mapBase.EscapeTimeLimit - earliestPossibleDepartureMinutes; if (newRaidTimeMinutes < mostPossibleTimeRemainingAfterDeparture) { exitChange.Chance = 0; @@ -299,7 +338,9 @@ public class RaidTimeAdjustmentService( exitChange.MinTime = Math.Max(exit.MinTime - reductionSeconds ?? 0, 0); exitChange.MaxTime = Math.Max(exit.MaxTime - reductionSeconds ?? 0, 0); - _logger.Debug($"Train appears between: {exitChange.MinTime} and {exitChange.MaxTime} seconds raid time"); + _logger.Debug( + $"Train appears between: {exitChange.MinTime} and {exitChange.MaxTime} seconds raid time" + ); result.Add(exitChange); } diff --git a/Libraries/SPTarkov.Server.Core/Services/RaidWeatherService.cs b/Libraries/SPTarkov.Server.Core/Services/RaidWeatherService.cs index 81923195..891af91f 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RaidWeatherService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RaidWeatherService.cs @@ -31,13 +31,17 @@ public class RaidWeatherService( // How far into future do we generate weather var futureTimestampToReach = - staringTimestamp + _timeUtil.GetHoursAsSeconds(_weatherConfig.Weather.GenerateWeatherAmountHours ?? 1); + staringTimestamp + + _timeUtil.GetHoursAsSeconds(_weatherConfig.Weather.GenerateWeatherAmountHours ?? 1); // Keep adding new weather until we have reached desired future date var nextTimestamp = staringTimestamp; while (nextTimestamp <= futureTimestampToReach) { - var newWeatherToAddToCache = _weatherGenerator.GenerateWeather(currentSeason, nextTimestamp); + var newWeatherToAddToCache = _weatherGenerator.GenerateWeather( + currentSeason, + nextTimestamp + ); // Add generated weather for time period to cache _weatherForecast.Add(newWeatherToAddToCache); @@ -53,7 +57,8 @@ public class RaidWeatherService( /// milliseconds protected long GetWeightedWeatherTimePeriod() { - var chosenTimePeriodMinutes = _weightedRandomHelper.WeightedRandom( + var chosenTimePeriodMinutes = _weightedRandomHelper + .WeightedRandom( _weatherConfig.Weather.TimePeriod.Values, _weatherConfig.Weather.TimePeriod.Weights ) @@ -93,7 +98,9 @@ public class RaidWeatherService( _weatherForecast.RemoveAll(weather => weather.Timestamp < _timeUtil.GetTimeStamp()); // Check data exists for current time - var result = _weatherForecast.Where(weather => weather.Timestamp >= _timeUtil.GetTimeStamp()); + var result = _weatherForecast.Where(weather => + weather.Timestamp >= _timeUtil.GetTimeStamp() + ); if (!result.Any()) { GenerateWeather(currentSeason); diff --git a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs index 2dbd4815..441f4952 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs @@ -30,11 +30,11 @@ public class RepairService( RepairHelper _repairHelper, LocalisationService _localisationService, ConfigServer _configServer, - WeightedRandomHelper _weightedRandomHelper) + WeightedRandomHelper _weightedRandomHelper +) { protected RepairConfig _repairConfig = _configServer.GetConfig(); - /// /// Use trader to repair an items durability /// @@ -50,7 +50,9 @@ public class RepairService( string traderId ) { - var itemToRepair = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == repairItemDetails.Id); + var itemToRepair = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == repairItemDetails.Id + ); if (itemToRepair is null) { _logger.Error( @@ -65,7 +67,9 @@ public class RepairService( var traderRepairDetails = _traderHelper.GetTrader(traderId, sessionID)?.Repair; if (traderRepairDetails is null) { - _logger.Error(_localisationService.GetText("repair-unable_to_find_trader_details_by_id", traderId)); + _logger.Error( + _localisationService.GetText("repair-unable_to_find_trader_details_by_id", traderId) + ); } var repairQualityMultiplier = traderRepairDetails.Quality; @@ -90,12 +94,18 @@ public class RepairService( if (itemRepairCost is null) { _logger.Error( - _localisationService.GetText("repair-unable_to_find_item_repair_cost", itemToRepair.Template) + _localisationService.GetText( + "repair-unable_to_find_item_repair_cost", + itemToRepair.Template + ) ); } var repairCost = Math.Round( - itemRepairCost.Value * repairItemDetails.Count.Value * repairRate.Value * _repairConfig.PriceMultiplier + itemRepairCost.Value + * repairItemDetails.Count.Value + * repairRate.Value + * _repairConfig.PriceMultiplier ); if (_logger.IsLogEnabled(LogLevel.Debug)) @@ -111,7 +121,7 @@ public class RepairService( RepairedItem = itemToRepair, RepairedItemIsArmor = repairItemIsArmor, RepairAmount = repairItemDetails.Count, - RepairedByKit = false + RepairedByKit = false, }; } @@ -134,20 +144,13 @@ public class RepairService( { var options = new ProcessBuyTradeRequestData { - SchemeItems = - [ - new IdWithCount - { - Count = Math.Round(repairCost), - Id = Money.ROUBLES - } - ], + SchemeItems = [new IdWithCount { Count = Math.Round(repairCost), Id = Money.ROUBLES }], TransactionId = traderId, Action = "SptRepair", Type = "", ItemId = "", Count = 0, - SchemeId = 0 + SchemeId = 0, }; _paymentService.PayMoney(pmcData, options, sessionID, output); @@ -163,8 +166,8 @@ public class RepairService( { // Handle kit repair of weapon if ( - repairDetails.RepairedByKit.GetValueOrDefault(false) && - _itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON) + repairDetails.RepairedByKit.GetValueOrDefault(false) + && _itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON) ) { var skillPoints = GetWeaponRepairSkillPoints(repairDetails); @@ -172,19 +175,21 @@ public class RepairService( if (skillPoints > 0) { _logger.Debug($"Added: {skillPoints} WEAPON_TREATMENT points to skill"); - _profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.WeaponTreatment, skillPoints, true); + _profileHelper.AddSkillPointsToPlayer( + pmcData, + SkillTypes.WeaponTreatment, + skillPoints, + true + ); } } // Handle kit repair of armor if ( - repairDetails.RepairedByKit.GetValueOrDefault(false) && - _itemHelper.IsOfBaseclasses( + repairDetails.RepairedByKit.GetValueOrDefault(false) + && _itemHelper.IsOfBaseclasses( repairDetails.RepairedItem.Template, - [ - BaseClasses.ARMOR_PLATE, - BaseClasses.BUILT_IN_INSERTS - ] + [BaseClasses.ARMOR_PLATE, BaseClasses.BUILT_IN_INSERTS] ) ) { @@ -215,10 +220,15 @@ public class RepairService( } var pointsToAddToVestSkill = - repairDetails.RepairPoints * _repairConfig.ArmorKitSkillPointGainPerRepairPointMultiplier; + repairDetails.RepairPoints + * _repairConfig.ArmorKitSkillPointGainPerRepairPointMultiplier; _logger.Debug($"Added: {pointsToAddToVestSkill} {vestSkillToLevel} skill"); - _profileHelper.AddSkillPointsToPlayer(pmcData, vestSkillToLevel, pointsToAddToVestSkill); + _profileHelper.AddSkillPointsToPlayer( + pmcData, + vestSkillToLevel, + pointsToAddToVestSkill + ); } // Handle giving INT to player - differs if using kit/trader and weapon vs armor @@ -226,7 +236,11 @@ public class RepairService( if (intellectGainedFromRepair > 0) { _logger.Debug($"Added: {intellectGainedFromRepair} intellect skill"); - _profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Intellect, intellectGainedFromRepair); + _profileHelper.AddSkillPointsToPlayer( + pmcData, + SkillTypes.Intellect, + intellectGainedFromRepair + ); } } @@ -235,7 +249,10 @@ public class RepairService( if (repairDetails.RepairedByKit.GetValueOrDefault(false)) { // Weapons/armor have different multipliers - var intRepairMultiplier = _itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON) + var intRepairMultiplier = _itemHelper.IsOfBaseclass( + repairDetails.RepairedItem.Template, + BaseClasses.WEAPON + ) ? _repairConfig.RepairKitIntellectGainMultiplier.Weapon : _repairConfig.RepairKitIntellectGainMultiplier.Armor; @@ -257,7 +274,10 @@ public class RepairService( } // Trader repair - Not as accurate as kit, needs data from live - return Math.Min(repairDetails.RepairAmount.Value / 10, _repairConfig.MaxIntellectGainPerRepair.Trader); + return Math.Min( + repairDetails.RepairAmount.Value / 10, + _repairConfig.MaxIntellectGainPerRepair.Trader + ); } /// @@ -317,13 +337,19 @@ public class RepairService( var itemToRepair = pmcData.Inventory.Items.FirstOrDefault(x => x.Id == itemToRepairId); if (itemToRepair is null) { - _logger.Error(_localisationService.GetText("repair-item_not_found_unable_to_repair", itemToRepairId)); + _logger.Error( + _localisationService.GetText( + "repair-item_not_found_unable_to_repair", + itemToRepairId + ) + ); } var itemsDb = _databaseService.GetItems(); var itemToRepairDetails = itemsDb[itemToRepair.Template]; var repairItemIsArmor = itemToRepairDetails.Properties.ArmorMaterial is not null; - var repairAmount = repairKits[0].Count / GetKitDivisor(itemToRepairDetails, repairItemIsArmor, pmcData); + var repairAmount = + repairKits[0].Count / GetKitDivisor(itemToRepairDetails, repairItemIsArmor, pmcData); var shouldApplyDurabilityLoss = ShouldRepairKitApplyDurabilityLoss( pmcData, _repairConfig.ApplyRandomizeDurabilityLoss @@ -342,11 +368,16 @@ public class RepairService( // Find and use repair kit defined in body foreach (var repairKit in repairKits) { - var repairKitInInventory = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == repairKit.Id); + var repairKitInInventory = pmcData.Inventory.Items.FirstOrDefault(item => + item.Id == repairKit.Id + ); if (repairKitInInventory is null) { _logger.Error( - _localisationService.GetText("repair-repair_kit_not_found_in_inventory", repairKit.Id) + _localisationService.GetText( + "repair-repair_kit_not_found_in_inventory", + repairKit.Id + ) ); } @@ -367,7 +398,7 @@ public class RepairService( RepairedItem = itemToRepair, RepairedItemIsArmor = repairItemIsArmor, RepairAmount = repairAmount, - RepairedByKit = true + RepairedByKit = true, }; } @@ -384,10 +415,14 @@ public class RepairService( var globalConfig = globals.Configuration; var globalRepairSettings = globalConfig.RepairSettings; - var intellectRepairPointsPerLevel = globalConfig.SkillsSettings.Intellect.RepairPointsCostReduction; + var intellectRepairPointsPerLevel = globalConfig + .SkillsSettings + .Intellect + .RepairPointsCostReduction; var profileIntellectLevel = _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.Intellect)?.Progress ?? 0; - var intellectPointReduction = intellectRepairPointsPerLevel * Math.Truncate(profileIntellectLevel / 100); + var intellectPointReduction = + intellectRepairPointsPerLevel * Math.Truncate(profileIntellectLevel / 100); if (isArmor) { @@ -401,10 +436,10 @@ public class RepairService( var armorClassDivisor = globals.Configuration.RepairSettings.ArmorClassDivisor; var armorClassMultiplier = 1.0 + armorClass / armorClassDivisor; - return durabilityPointCostArmor.Value * - armorBonus.Value * - destructability.Value * - armorClassMultiplier.Value; + return durabilityPointCostArmor.Value + * armorBonus.Value + * destructability.Value + * armorClassMultiplier.Value; } var repairWeaponBonus = GetBonusMultiplierValue(BonusType.RepairWeaponBonus, pmcData) - 1; @@ -439,7 +474,10 @@ public class RepairService( /// Player profile /// Value from repair config /// True if loss should be applied - protected bool ShouldRepairKitApplyDurabilityLoss(PmcData pmcData, bool applyRandomizeDurabilityLoss) + protected bool ShouldRepairKitApplyDurabilityLoss( + PmcData pmcData, + bool applyRandomizeDurabilityLoss + ) { var shouldApplyDurabilityLoss = applyRandomizeDurabilityLoss; if (shouldApplyDurabilityLoss) @@ -447,7 +485,7 @@ public class RepairService( // Random loss not disabled via config, perform charisma check var hasEliteCharisma = _profileHelper.HasEliteSkillLevel(SkillTypes.Charisma, pmcData); if (hasEliteCharisma) - // 50/50 chance of loss being ignored at elite level + // 50/50 chance of loss being ignored at elite level { shouldApplyDurabilityLoss = _randomUtil.GetChance100(50); } @@ -461,31 +499,30 @@ public class RepairService( /// /// Repair kit details from db /// Repair kit to update - protected void AddMaxResourceToKitIfMissing(TemplateItem repairKitDetails, Item repairKitInInventory) + protected void AddMaxResourceToKitIfMissing( + TemplateItem repairKitDetails, + Item repairKitInInventory + ) { var maxRepairAmount = repairKitDetails.Properties.MaxRepairResource; if (repairKitInInventory.Upd is null) { if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"Repair kit: {repairKitInInventory.Id} in inventory lacks upd object, adding"); + _logger.Debug( + $"Repair kit: {repairKitInInventory.Id} in inventory lacks upd object, adding" + ); } repairKitInInventory.Upd = new Upd { - RepairKit = new UpdRepairKit - { - Resource = maxRepairAmount - } + RepairKit = new UpdRepairKit { Resource = maxRepairAmount }, }; } if (repairKitInInventory.Upd.RepairKit?.Resource is null) { - repairKitInInventory.Upd.RepairKit = new UpdRepairKit - { - Resource = maxRepairAmount - }; + repairKitInInventory.Upd.RepairKit = new UpdRepairKit { Resource = maxRepairAmount }; } } @@ -511,7 +548,7 @@ public class RepairService( BaseClasses.ARMOR, BaseClasses.VEST, BaseClasses.HEADWEAR, - BaseClasses.ARMOR_PLATE + BaseClasses.ARMOR_PLATE, ] ) ) @@ -519,7 +556,9 @@ public class RepairService( var armorConfig = _repairConfig.RepairKit.Armor; AddBuff(armorConfig, repairDetails.RepairedItem); } - else if (_itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON)) + else if ( + _itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON) + ) { var weaponConfig = _repairConfig.RepairKit.Weapon; AddBuff(weaponConfig, repairDetails.RepairedItem); @@ -553,7 +592,11 @@ public class RepairService( Rarity = bonusRarityName, BuffType = Enum.Parse(bonusTypeName), Value = bonusValue, - ThresholdDurability = _randomUtil.GetPercentOfValue(bonusThresholdPercent, item.Upd.Repairable.Durability.Value, 0) + ThresholdDurability = _randomUtil.GetPercentOfValue( + bonusThresholdPercent, + item.Upd.Repairable.Durability.Value, + 0 + ), }; } @@ -585,8 +628,9 @@ public class RepairService( // Skill < level 10 + repairing weapon if ( - itemSkillType == SkillTypes.WeaponTreatment && - _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.WeaponTreatment)?.Progress < 1000 + itemSkillType == SkillTypes.WeaponTreatment + && _profileHelper.GetSkillFromProfile(pmcData, SkillTypes.WeaponTreatment)?.Progress + < 1000 ) { return false; @@ -594,12 +638,10 @@ public class RepairService( // Skill < level 10 + repairing armor if ( - new HashSet - { - SkillTypes.LightVests, - SkillTypes.HeavyVests - }.Contains(itemSkillType.Value) && - _profileHelper.GetSkillFromProfile(pmcData, itemSkillType.Value)?.Progress < 1000 + new HashSet { SkillTypes.LightVests, SkillTypes.HeavyVests }.Contains( + itemSkillType.Value + ) + && _profileHelper.GetSkillFromProfile(pmcData, itemSkillType.Value)?.Progress < 1000 ) { return false; @@ -611,10 +653,12 @@ public class RepairService( { case SkillTypes.LightVests: case SkillTypes.HeavyVests: - buffSettings = ((ArmorSkills) skillSettings[itemSkillType.ToString()]).BuffSettings; + buffSettings = ((ArmorSkills)skillSettings[itemSkillType.ToString()]).BuffSettings; break; case SkillTypes.WeaponTreatment: - buffSettings = ((WeaponTreatment) skillSettings[itemSkillType.ToString()]).BuffSettings; + buffSettings = ( + (WeaponTreatment)skillSettings[itemSkillType.ToString()] + ).BuffSettings; break; default: _logger.Error($"Unhandled buff type: {itemSkillType}"); @@ -625,23 +669,30 @@ public class RepairService( var commonBuffChanceLevelBonus = buffSettings.CommonBuffChanceLevelBonus; var receivedDurabilityMaxPercent = buffSettings.ReceivedDurabilityMaxPercent; - var skillLevel = - Math.Truncate((_profileHelper.GetSkillFromProfile(pmcData, itemSkillType.Value)?.Progress ?? 0) / 100); + var skillLevel = Math.Truncate( + (_profileHelper.GetSkillFromProfile(pmcData, itemSkillType.Value)?.Progress ?? 0) / 100 + ); if (repairDetails.RepairPoints is null) { _logger.Error( - _localisationService.GetText("repair-item_has_no_repair_points", repairDetails.RepairedItem.Template) + _localisationService.GetText( + "repair-item_has_no_repair_points", + repairDetails.RepairedItem.Template + ) ); } - var durabilityToRestorePercent = repairDetails.RepairPoints / template.Properties.MaxDurability; + var durabilityToRestorePercent = + repairDetails.RepairPoints / template.Properties.MaxDurability; var durabilityMultiplier = GetDurabilityMultiplier( receivedDurabilityMaxPercent.Value, durabilityToRestorePercent.Value ); - var doBuff = commonBuffMinChanceValue + commonBuffChanceLevelBonus * skillLevel * durabilityMultiplier; + var doBuff = + commonBuffMinChanceValue + + commonBuffChanceLevelBonus * skillLevel * durabilityMultiplier; var random = new Random(); return random.Next() <= doBuff; } @@ -655,12 +706,7 @@ public class RepairService( { var isArmorRelated = _itemHelper.IsOfBaseclasses( itemTemplate.Id, - [ - BaseClasses.ARMOR, - BaseClasses.VEST, - BaseClasses.HEADWEAR, - BaseClasses.ARMOR_PLATE - ] + [BaseClasses.ARMOR, BaseClasses.VEST, BaseClasses.HEADWEAR, BaseClasses.ARMOR_PLATE] ); if (isArmorRelated) @@ -696,7 +742,10 @@ public class RepairService( /// Max durability percent /// current durability percent /// durability multiplier value - protected double GetDurabilityMultiplier(double receiveDurabilityMaxPercent, double receiveDurabilityPercent) + protected double GetDurabilityMultiplier( + double receiveDurabilityMaxPercent, + double receiveDurabilityPercent + ) { // Ensure the max percent is at least 0.01 var validMaxPercent = Math.Max(0.01, receiveDurabilityMaxPercent); @@ -708,44 +757,20 @@ public class RepairService( public class RepairDetails { [JsonPropertyName("repairCost")] - public double? RepairCost - { - get; - set; - } + public double? RepairCost { get; set; } [JsonPropertyName("repairPoints")] - public double? RepairPoints - { - get; - set; - } + public double? RepairPoints { get; set; } [JsonPropertyName("repairedItem")] - public Item? RepairedItem - { - get; - set; - } + public Item? RepairedItem { get; set; } [JsonPropertyName("repairedItemIsArmor")] - public bool? RepairedItemIsArmor - { - get; - set; - } + public bool? RepairedItemIsArmor { get; set; } [JsonPropertyName("repairAmount")] - public double? RepairAmount - { - get; - set; - } + public double? RepairAmount { get; set; } [JsonPropertyName("repairedByKit")] - public bool? RepairedByKit - { - get; - set; - } + public bool? RepairedByKit { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs index e123e671..604bcb8e 100644 --- a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs @@ -53,13 +53,18 @@ public class SeasonalEventService( ItemTpl.FACECOVER_ROOSTER_MASK, ItemTpl.FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_FIREWORK, ItemTpl.BARTER_SHYSHKA_CHRISTMAS_TREE_LIFE_EXTENDER, - ItemTpl.BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_CHRISTMAS_EDITION + ItemTpl.BACKPACK_MYSTERY_RANCH_TERRAFRAME_BACKPACK_CHRISTMAS_EDITION, ]; private List _currentlyActiveEvents = []; protected readonly HashSet _equipmentSlotsToFilter = - [EquipmentSlots.FaceCover, EquipmentSlots.Headwear, EquipmentSlots.Backpack, EquipmentSlots.TacticalVest]; + [ + EquipmentSlots.FaceCover, + EquipmentSlots.Headwear, + EquipmentSlots.Backpack, + EquipmentSlots.TacticalVest, + ]; private bool _halloweenEventActive; @@ -75,14 +80,15 @@ public class SeasonalEventService( ItemTpl.FACECOVER_MISHA_MAYOROV_MASK, ItemTpl.FACECOVER_SLENDER_MASK, ItemTpl.FACECOVER_SPOOKY_SKULL_MASK, - ItemTpl.RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER + ItemTpl.RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER, ]; protected HttpConfig _httpConfig = _configServer.GetConfig(); protected LocationConfig _locationConfig = _configServer.GetConfig(); protected HashSet _lootContainersToFilter = ["Backpack", "Pockets", "TacticalVest"]; protected QuestConfig _questConfig = _configServer.GetConfig(); - protected SeasonalEventConfig _seasonalEventConfig = _configServer.GetConfig(); + protected SeasonalEventConfig _seasonalEventConfig = + _configServer.GetConfig(); protected WeatherConfig _weatherConfig = _configServer.GetConfig(); /// @@ -195,7 +201,9 @@ public class SeasonalEventService( /// /// Name of event to get gear changes for /// bots with equipment changes - protected Dictionary>>? GetEventBotGear(SeasonalEventType eventType) + protected Dictionary>>? GetEventBotGear( + SeasonalEventType eventType + ) { return _seasonalEventConfig.EventGear.GetValueOrDefault(eventType, null); } @@ -205,7 +213,9 @@ public class SeasonalEventService( /// /// Name of event to get gear changes for /// bots with loot changes - protected Dictionary>> GetEventBotLoot(SeasonalEventType eventType) + protected Dictionary>> GetEventBotLoot( + SeasonalEventType eventType + ) { return _seasonalEventConfig.EventLoot.GetValueOrDefault(eventType, null); } @@ -257,7 +267,9 @@ public class SeasonalEventService( var seasonEvent = _seasonalEventConfig.Events.FirstOrDefault(e => e.Type == eventType); if (seasonEvent is null) { - _logger.Warning($"Unable to force event: {eventType} as it cannot be found in events config"); + _logger.Warning( + $"Unable to force event: {eventType} as it cannot be found in events config" + ); return false; } @@ -285,7 +297,15 @@ public class SeasonalEventService( continue; } - if (DateIsBetweenTwoDates(currentDate, events.StartMonth, events.StartDay, events.EndMonth, events.EndDay)) + if ( + DateIsBetweenTwoDates( + currentDate, + events.StartMonth, + events.StartDay, + events.EndMonth, + events.EndDay + ) + ) { _currentlyActiveEvents.Add(events); } @@ -336,7 +356,13 @@ public class SeasonalEventService( /// Upper bound for month /// Upper bound for day /// True when inside date range - private bool DateIsBetweenTwoDates(DateTime dateToCheck, int startMonth, int startDay, int endMonth, int endDay) + private bool DateIsBetweenTwoDates( + DateTime dateToCheck, + int startMonth, + int startDay, + int endMonth, + int endDay + ) { var eventStartDate = new DateTime(dateToCheck.Year, startMonth, startDay); var eventEndDate = new DateTime(dateToCheck.Year, endMonth, endDay, 23, 59, 0); @@ -361,37 +387,36 @@ public class SeasonalEventService( _logger.Warning( _localisationService.GetText( "seasonal-missing_equipment_slot_on_bot", - new - { - equipmentSlot = equipmentSlotKey, - botRole - } + new { equipmentSlot = equipmentSlotKey, botRole } ) ); } var equipment = botInventory.Equipment[equipmentSlotKey]; - botInventory.Equipment[equipmentSlotKey] = equipment.Where(i => !_christmasEventItems.Contains(i.Key)).ToDictionary(); + botInventory.Equipment[equipmentSlotKey] = equipment + .Where(i => !_christmasEventItems.Contains(i.Key)) + .ToDictionary(); } // Remove christmas related loot from loot containers var props = botInventory.Items.GetType().GetProperties(); foreach (var lootContainerKey in _lootContainersToFilter) { - var propInfo = props - .FirstOrDefault(p => string.Equals(p.Name.ToLower(), lootContainerKey.ToLower(), StringComparison.OrdinalIgnoreCase)); - var prop = (Dictionary?) propInfo.GetValue(botInventory.Items); + var propInfo = props.FirstOrDefault(p => + string.Equals( + p.Name.ToLower(), + lootContainerKey.ToLower(), + StringComparison.OrdinalIgnoreCase + ) + ); + var prop = (Dictionary?)propInfo.GetValue(botInventory.Items); if (prop is null) { _logger.Warning( _localisationService.GetText( "seasonal-missing_loot_container_slot_on_bot", - new - { - lootContainer = lootContainerKey, - botRole - } + new { lootContainer = lootContainerKey, botRole } ) ); } @@ -434,9 +459,17 @@ public class SeasonalEventService( EnableHalloweenSummonEvent(); AddPumpkinsToScavBackpacks(); RenameBitcoin(); - if (eventType.Settings is not null && eventType.Settings.ReplaceBotHostility.GetValueOrDefault(false)) + if ( + eventType.Settings is not null + && eventType.Settings.ReplaceBotHostility.GetValueOrDefault(false) + ) { - if (_seasonalEventConfig.HostilitySettingsForEvent.TryGetValue("AprilFools", out var botData)) + if ( + _seasonalEventConfig.HostilitySettingsForEvent.TryGetValue( + "AprilFools", + out var botData + ) + ) { ReplaceBotHostility(botData); } @@ -483,7 +516,11 @@ public class SeasonalEventService( if (eventType.Settings?.ReplaceBotHostility ?? false) { - ReplaceBotHostility(_seasonalEventConfig.HostilitySettingsForEvent.FirstOrDefault(x => x.Key == "zombies").Value); + ReplaceBotHostility( + _seasonalEventConfig + .HostilitySettingsForEvent.FirstOrDefault(x => x.Key == "zombies") + .Value + ); } if (eventType.Settings?.AdjustBotAppearances ?? false) @@ -501,7 +538,9 @@ public class SeasonalEventService( if (eventType.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where(x => x != EventType.None).ToList(); + globalConfig.EventType = globalConfig + .EventType.Where(x => x != EventType.None) + .ToList(); globalConfig.EventType.Add(EventType.Christmas); } @@ -527,7 +566,9 @@ public class SeasonalEventService( if (eventType.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where(x => x != EventType.None).ToList(); + globalConfig.EventType = globalConfig + .EventType.Where(x => x != EventType.None) + .ToList(); globalConfig.EventType.Add(EventType.Christmas); } @@ -571,8 +612,14 @@ public class SeasonalEventService( var props = botDb.BotAppearance.GetType().GetProperties(); foreach (var itemKey in weightAdjustments) { - var prop = props.FirstOrDefault(x => string.Equals(x.Name, appearanceKey.Key, StringComparison.CurrentCultureIgnoreCase)); - var propValue = (Dictionary) prop.GetValue(botDb.BotAppearance); + var prop = props.FirstOrDefault(x => + string.Equals( + x.Name, + appearanceKey.Key, + StringComparison.CurrentCultureIgnoreCase + ) + ); + var propValue = (Dictionary)prop.GetValue(botDb.BotAppearance); propValue[itemKey.Key] = weightAdjustments[itemKey.Key]; prop.SetValue(botDb.BotAppearance, propValue); } @@ -580,7 +627,9 @@ public class SeasonalEventService( } } - private void ReplaceBotHostility(Dictionary> hostilitySettings) + private void ReplaceBotHostility( + Dictionary> hostilitySettings + ) { var locations = _databaseService.GetLocations().GetDictionary(); var ignoreList = _locationConfig.NonMaps; @@ -610,7 +659,10 @@ public class SeasonalEventService( foreach (var settings in newHostilitySettings) { - var matchingBaseSettings = locationBase.Base.BotLocationModifier.AdditionalHostilitySettings.FirstOrDefault(x => x.BotRole == settings.BotRole); + var matchingBaseSettings = + locationBase.Base.BotLocationModifier.AdditionalHostilitySettings.FirstOrDefault( + x => x.BotRole == settings.BotRole + ); if (matchingBaseSettings is null) { continue; @@ -706,8 +758,11 @@ public class SeasonalEventService( /// protected void AdjustZryachiyMeleeChance() { - var zryachiyKvP = _databaseService.GetBots().Types - .FirstOrDefault(x => string.Equals(x.Key, "bosszryachiy", StringComparison.OrdinalIgnoreCase)); + var zryachiyKvP = _databaseService + .GetBots() + .Types.FirstOrDefault(x => + string.Equals(x.Key, "bosszryachiy", StringComparison.OrdinalIgnoreCase) + ); var value = new Dictionary(); foreach (var chance in zryachiyKvP.Value.BotChances.EquipmentChances) @@ -755,7 +810,8 @@ public class SeasonalEventService( var mappedLocations = GetLocationFromInfectedLocation(locationId); foreach (var locationKey in mappedLocations) { - _databaseService.GetLocation(locationKey) + _databaseService + .GetLocation(locationKey) .Base.Events.Halloween2024.InfectionPercentage = infectionPercentage; } @@ -773,7 +829,9 @@ public class SeasonalEventService( _databaseService.GetLocation(locationId).Base.Waves = []; } - var locationsWithActiveInfection = GetLocationsWithZombies(zombieSettings.MapInfectionAmount); + var locationsWithActiveInfection = GetLocationsWithZombies( + zombieSettings.MapInfectionAmount + ); AddEventBossesToMaps("halloweenzombies", locationsWithActiveInfection); } @@ -787,7 +845,8 @@ public class SeasonalEventService( var result = new HashSet(); // Get only the locations with an infection above 0 - var infectionKeys = locationInfections.Where(location => locationInfections[location.Key] > 0 + var infectionKeys = locationInfections.Where(location => + locationInfections[location.Key] > 0 ); // Convert the infected location id into its generic location id @@ -810,7 +869,7 @@ public class SeasonalEventService( { "factory4" => ["factory4_day", "factory4_night"], "Sandbox" => ["sandbox", "sandbox_high"], - _ => [infectedLocationKey] + _ => [infectedLocationKey], }; } @@ -834,8 +893,8 @@ public class SeasonalEventService( continue; } - ((Location) locations[map.Key]).Base.Waves = []; - ((Location) locations[map.Key]).Base.Waves.AddRange(wavesToAdd); + ((Location)locations[map.Key]).Base.Waves = []; + ((Location)locations[map.Key]).Base.Waves.AddRange(wavesToAdd); } } @@ -846,7 +905,12 @@ public class SeasonalEventService( /// OPTIONAL - Maps to add bosses to protected void AddEventBossesToMaps(string eventType, HashSet? mapIdWhitelist = null) { - if (!_seasonalEventConfig.EventBossSpawns.TryGetValue(eventType.ToLower(), out var botsToAddPerMap)) + if ( + !_seasonalEventConfig.EventBossSpawns.TryGetValue( + eventType.ToLower(), + out var botsToAddPerMap + ) + ) { _logger.Warning($"Unable to add: {eventType} bosses, eventBossSpawns is missing"); return; @@ -866,10 +930,9 @@ public class SeasonalEventService( } var locationName = _databaseService.GetLocations().GetMappedKey(locationKey); - var mapBosses = ((Location) locations[locationName]).Base.BossLocationSpawn; + var mapBosses = ((Location)locations[locationName]).Base.BossLocationSpawn; foreach (var boss in bossesToAdd) { - if (mapBosses.All(bossSpawn => bossSpawn.BossName != boss.BossName)) { // Zombie doesn't exist in maps boss list yet, add @@ -888,22 +951,30 @@ public class SeasonalEventService( switch (eventType) { case SeasonalEventType.Halloween: - _httpConfig.ServerImagePathOverride["./assets/images/traders/5a7c2ebb86f7746e324a06ab.png"] = - "./assets/images/traders/halloween/5a7c2ebb86f7746e324a06ab.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/5ac3b86a86f77461491d1ad8.png"] = - "./assets/images/traders/halloween/5ac3b86a86f77461491d1ad8.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/5c06531a86f7746319710e1b.png"] = - "./assets/images/traders/halloween/5c06531a86f7746319710e1b.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/59b91ca086f77469a81232e4.png"] = - "./assets/images/traders/halloween/59b91ca086f77469a81232e4.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/59b91cab86f77469aa5343ca.png"] = - "./assets/images/traders/halloween/59b91cab86f77469aa5343ca.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/59b91cb486f77469a81232e5.png"] = - "./assets/images/traders/halloween/59b91cb486f77469a81232e5.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/59b91cbd86f77469aa5343cb.png"] = - "./assets/images/traders/halloween/59b91cbd86f77469aa5343cb.png"; - _httpConfig.ServerImagePathOverride["./assets/images/traders/579dc571d53a0658a154fbec.png"] = - "./assets/images/traders/halloween/579dc571d53a0658a154fbec.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/5a7c2ebb86f7746e324a06ab.png" + ] = "./assets/images/traders/halloween/5a7c2ebb86f7746e324a06ab.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/5ac3b86a86f77461491d1ad8.png" + ] = "./assets/images/traders/halloween/5ac3b86a86f77461491d1ad8.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/5c06531a86f7746319710e1b.png" + ] = "./assets/images/traders/halloween/5c06531a86f7746319710e1b.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/59b91ca086f77469a81232e4.png" + ] = "./assets/images/traders/halloween/59b91ca086f77469a81232e4.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/59b91cab86f77469aa5343ca.png" + ] = "./assets/images/traders/halloween/59b91cab86f77469aa5343ca.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/59b91cb486f77469a81232e5.png" + ] = "./assets/images/traders/halloween/59b91cb486f77469a81232e5.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/59b91cbd86f77469aa5343cb.png" + ] = "./assets/images/traders/halloween/59b91cbd86f77469aa5343cb.png"; + _httpConfig.ServerImagePathOverride[ + "./assets/images/traders/579dc571d53a0658a154fbec.png" + ] = "./assets/images/traders/halloween/579dc571d53a0658a154fbec.png"; break; case SeasonalEventType.Christmas: // TODO: find christmas trader icons @@ -969,7 +1040,8 @@ public class SeasonalEventService( // Grab gear to add and loop over it foreach (var itemToAddKvP in equipmentKvP.Value) { - var equipmentSlot = (EquipmentSlots) Enum.Parse(typeof(EquipmentSlots), equipmentKvP.Key); + var equipmentSlot = (EquipmentSlots) + Enum.Parse(typeof(EquipmentSlots), equipmentKvP.Key); var equipmentDict = botToUpdate.BotInventory.Equipment[equipmentSlot]; equipmentDict[itemToAddKvP.Key] = equipmentKvP.Value[itemToAddKvP.Key]; } @@ -1021,16 +1093,14 @@ public class SeasonalEventService( /// protected void AddPumpkinsToScavBackpacks() { - _databaseService.GetBots() - .Types["assault"] - .BotInventory.Items.Backpack[ - ItemTpl.RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER - ] = 400; + _databaseService.GetBots().Types["assault"].BotInventory.Items.Backpack[ + ItemTpl.RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER + ] = 400; } protected void RenameBitcoin() { - if(_databaseService.GetLocales().Global.TryGetValue("en", out var lazyLoad)) + if (_databaseService.GetLocales().Global.TryGetValue("en", out var lazyLoad)) { lazyLoad.AddTransformer(localeData => { @@ -1075,7 +1145,12 @@ public class SeasonalEventService( var maps = _databaseService.GetLocations().GetDictionary(); foreach (var gifterMapSettings in gifterSettings) { - if (!maps.TryGetValue(_databaseService.GetLocations().GetMappedKey(gifterMapSettings.Map), out var mapData)) + if ( + !maps.TryGetValue( + _databaseService.GetLocations().GetMappedKey(gifterMapSettings.Map), + out var mapData + ) + ) { _logger.Warning($"AddGifterBotToMaps() Map not found {gifterMapSettings.Map}"); @@ -1083,7 +1158,9 @@ public class SeasonalEventService( } // Don't add gifter to map twice - var existingGifter = mapData.Base.BossLocationSpawn.FirstOrDefault(boss => boss.BossName == "gifter"); + var existingGifter = mapData.Base.BossLocationSpawn.FirstOrDefault(boss => + boss.BossName == "gifter" + ); if (existingGifter is not null) { existingGifter.BossChance = gifterMapSettings.SpawnChance; @@ -1109,7 +1186,7 @@ public class SeasonalEventService( TriggerName = "", Delay = 0, IsRandomTimeSpawn = false, - IgnoreMaxBots = true + IgnoreMaxBots = true, } ); } @@ -1119,13 +1196,17 @@ public class SeasonalEventService( { if (seasonalEvent.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where(x => x != EventType.None).ToList(); + globalConfig.EventType = globalConfig + .EventType.Where(x => x != EventType.None) + .ToList(); globalConfig.EventType.Add(EventType.Christmas); } if (seasonalEvent.Settings?.EnableHalloweenHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where(x => x != EventType.None).ToList(); + globalConfig.EventType = globalConfig + .EventType.Where(x => x != EventType.None) + .ToList(); globalConfig.EventType.Add(EventType.Halloween); globalConfig.EventType.Add(EventType.HalloweenIllumination); } @@ -1170,7 +1251,13 @@ public class SeasonalEventService( protected void GiveGift(string playerId, string giftKey) { var giftData = _giftService.GetGiftById(giftKey); - if (!_profileHelper.PlayerHasRecievedMaxNumberOfGift(playerId, giftKey, giftData.MaxToSendPlayer ?? 5)) + if ( + !_profileHelper.PlayerHasRecievedMaxNumberOfGift( + playerId, + giftKey, + giftData.MaxToSendPlayer ?? 5 + ) + ) { _giftService.SendGiftToPlayer(playerId, giftKey); } diff --git a/Libraries/SPTarkov.Server.Core/Services/TraderPurchasePersisterService.cs b/Libraries/SPTarkov.Server.Core/Services/TraderPurchasePersisterService.cs index 2c724158..c1c1820f 100644 --- a/Libraries/SPTarkov.Server.Core/Services/TraderPurchasePersisterService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/TraderPurchasePersisterService.cs @@ -26,7 +26,10 @@ public class TraderPurchasePersisterService( /// Session id /// Trader to loop up purchases for /// Dictionary of assort id and count purchased - public Dictionary? GetProfileTraderPurchases(string sessionId, string traderId) + public Dictionary? GetProfileTraderPurchases( + string sessionId, + string traderId + ) { var profile = _profileHelper.GetFullProfile(sessionId); @@ -53,7 +56,8 @@ public class TraderPurchasePersisterService( public TraderPurchaseData? GetProfileTraderPurchase( string sessionId, string traderId, - string assortId) + string assortId + ) { var profile = _profileHelper.GetFullProfile(sessionId); @@ -125,17 +129,15 @@ public class TraderPurchasePersisterService( foreach (var purchaseKvP in purchasesFromTrader) { - var traderUpdateDetails = _traderConfig.UpdateTime.FirstOrDefault(x => x.TraderId == traderId); + var traderUpdateDetails = _traderConfig.UpdateTime.FirstOrDefault(x => + x.TraderId == traderId + ); if (traderUpdateDetails is null) { _logger.Error( _localisationService.GetText( "trader-unable_to_delete_stale_purchases", - new - { - profileId = profile.ProfileInfo.ProfileId, - traderId - } + new { profileId = profile.ProfileInfo.ProfileId, traderId } ) ); @@ -144,12 +146,17 @@ public class TraderPurchasePersisterService( var purchaseDetails = purchaseKvP.Value; var resetTimeForItem = - purchaseDetails.PurchaseTimestamp + - _randomUtil.GetDouble(traderUpdateDetails.Seconds.Min, traderUpdateDetails.Seconds.Max); + purchaseDetails.PurchaseTimestamp + + _randomUtil.GetDouble( + traderUpdateDetails.Seconds.Min, + traderUpdateDetails.Seconds.Max + ); if (resetTimeForItem < _timeUtil.GetTimeStamp()) { // Item was purchased far enough in past a trader refresh would have occured, remove purchase record from profile - _logger.Debug($"Removed trader: {traderId} purchase: {purchaseKvP} from profile: {profile.ProfileInfo.ProfileId}"); + _logger.Debug( + $"Removed trader: {traderId} purchase: {purchaseKvP} from profile: {profile.ProfileInfo.ProfileId}" + ); profile.TraderPurchases[traderId].Remove(purchaseKvP.Key); } diff --git a/Libraries/SPTarkov.Server.Core/Services/TraderStore.cs b/Libraries/SPTarkov.Server.Core/Services/TraderStore.cs index 595ab8ad..f42e2714 100644 --- a/Libraries/SPTarkov.Server.Core/Services/TraderStore.cs +++ b/Libraries/SPTarkov.Server.Core/Services/TraderStore.cs @@ -14,8 +14,8 @@ public class TraderStore( DatabaseService databaseService, IEnumerable injectedTraders, LocalisationService localisationService, - ISptLogger logger) - : IOnLoad + ISptLogger logger +) : IOnLoad { private readonly Dictionary _traders = new(); @@ -46,7 +46,12 @@ public class TraderStore( } catch (Exception e) { - logger.Error(localisationService.GetText("trader-unable_to_add_custom_trader", new { traderId = trader.Name, error = e.StackTrace })); + logger.Error( + localisationService.GetText( + "trader-unable_to_add_custom_trader", + new { traderId = trader.Name, error = e.StackTrace } + ) + ); } } else @@ -55,7 +60,9 @@ public class TraderStore( } } - logger.Info($"Importing traders complete {(customTraders == 0 ? "" : $"[{customTraders} traders loaded]")}"); + logger.Info( + $"Importing traders complete {(customTraders == 0 ? "" : $"[{customTraders} traders loaded]")}" + ); return Task.CompletedTask; } diff --git a/Libraries/SPTarkov.Server.Core/Utils/App.cs b/Libraries/SPTarkov.Server.Core/Utils/App.cs index 1d55e52c..934d3f10 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/App.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/App.cs @@ -45,10 +45,14 @@ public class App( if (_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"OS: {Environment.OSVersion.Version} | {Environment.OSVersion.Platform}"); + _logger.Debug( + $"OS: {Environment.OSVersion.Version} | {Environment.OSVersion.Platform}" + ); _logger.Debug($"Ran as admin: {Environment.IsPrivilegedProcess}"); _logger.Debug($"CPU cores: {Environment.ProcessorCount}"); - _logger.Debug($"PATH: {_encodingUtil.ToBase64(Environment.ProcessPath ?? "null returned")}"); + _logger.Debug( + $"PATH: {_encodingUtil.ToBase64(Environment.ProcessPath ?? "null returned")}" + ); _logger.Debug($"Server: {ProgramStatics.SPT_VERSION() ?? _coreConfig.SptVersion}"); // _logger.Debug($"RAM: {(os.totalmem() / 1024 / 1024 / 1024).toFixed(2)}GB"); @@ -75,15 +79,25 @@ public class App( public async Task StartAsync() { - if(!_httpServer.IsStarted()) + if (!_httpServer.IsStarted()) { - _logger.Success(_localisationService.GetText("started_webserver_success", _httpServer.ListeningUrl())); - _logger.Success(_localisationService.GetText("websocket-started", _httpServer.ListeningUrl().Replace("https://", "wss://"))); + _logger.Success( + _localisationService.GetText( + "started_webserver_success", + _httpServer.ListeningUrl() + ) + ); + _logger.Success( + _localisationService.GetText( + "websocket-started", + _httpServer.ListeningUrl().Replace("https://", "wss://") + ) + ); } _logger.Success(GetRandomisedStartMessage()); - await _httpServer.StartAsync(); + await _httpServer.StartAsync(); } protected string GetRandomisedStartMessage() @@ -114,7 +128,8 @@ public class App( var updateableName = updateable.GetType().FullName; if (string.IsNullOrEmpty(updateableName)) { - updateableName = $"{updateable.GetType().Namespace}.{updateable.GetType().Name}"; + updateableName = + $"{updateable.GetType().Namespace}.{updateable.GetType().Name}"; } var lastRunTimeTimestamp = _onUpdateLastRun.GetValueOrDefault(updateableName, 0); @@ -122,7 +137,7 @@ public class App( try { - if(await updateable.OnUpdate(secondsSinceLastRun)) + if (await updateable.OnUpdate(secondsSinceLastRun)) { _onUpdateLastRun[updateableName] = _timeUtil.GetTimeStamp(); } @@ -139,7 +154,12 @@ public class App( protected void LogUpdateException(Exception err, IOnUpdate updateable) { - _logger.Error(_localisationService.GetText("scheduled_event_failed_to_run", updateable.GetType().FullName)); + _logger.Error( + _localisationService.GetText( + "scheduled_event_failed_to_run", + updateable.GetType().FullName + ) + ); _logger.Error(err.ToString()); } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Callbacks/TimeoutCallback.cs b/Libraries/SPTarkov.Server.Core/Utils/Callbacks/TimeoutCallback.cs index 8c09e45a..a3578bdd 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Callbacks/TimeoutCallback.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Callbacks/TimeoutCallback.cs @@ -5,10 +5,9 @@ public static class TimeoutCallback public static Task RunInTimespan(Action action, TimeSpan timeSpan) { return Task.Factory.StartNew(() => - { - Thread.Sleep(timeSpan); - action(); - } - ); + { + Thread.Sleep(timeSpan); + action(); + }); } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Cloners/ReflectionsCloner.cs b/Libraries/SPTarkov.Server.Core/Utils/Cloners/ReflectionsCloner.cs index b367174c..e654249a 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Cloners/ReflectionsCloner.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Cloners/ReflectionsCloner.cs @@ -23,7 +23,7 @@ public class ReflectionsCloner(ISptLogger logger) : ICloner { try { - return (T?) Clone(obj, typeof(T)).Result; + return (T?)Clone(obj, typeof(T)).Result; } catch (Exception e) { @@ -74,18 +74,24 @@ public class ReflectionsCloner(ISptLogger logger) : ICloner (result as IDictionary).Add(clonedKey, clonedValue); } } - else if (objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(HashSet<>)) + else if ( + objectType.IsGenericType + && objectType.GetGenericTypeDefinition() == typeof(HashSet<>) + ) { if (!AddMethodInfoCache.TryGetValue(objectType, out var addMethodInfo)) { - addMethodInfo = objectType.GetMethod("Add", BindingFlags.Instance | BindingFlags.Public); + addMethodInfo = objectType.GetMethod( + "Add", + BindingFlags.Instance | BindingFlags.Public + ); while (!AddMethodInfoCache.TryAdd(objectType, addMethodInfo)) { ; } } - var toCloneEnumerable = (IEnumerable) obj; + var toCloneEnumerable = (IEnumerable)obj; foreach (var toClone in toCloneEnumerable) { @@ -121,10 +127,12 @@ public class ReflectionsCloner(ISptLogger logger) : ICloner case PropertyInfo propertyInfo: var propertyValue = propertyInfo.GetValue(obj, null); - var propertyCloned = await Clone(propertyValue, propertyInfo.PropertyType); + var propertyCloned = await Clone( + propertyValue, + propertyInfo.PropertyType + ); propertyInfo.SetValue(result, propertyCloned, null); - break; case FieldInfo fieldInfo: @@ -132,14 +140,15 @@ public class ReflectionsCloner(ISptLogger logger) : ICloner var fieldCloned = await Clone(fieldValue, fieldInfo.FieldType); fieldInfo.SetValue(result, fieldCloned); - break; case MemberInfo: break; default: if (logger.IsLogEnabled(LogLevel.Debug)) { - logger.Debug($"Unknown member type {member.Name} {member.MemberType}"); + logger.Debug( + $"Unknown member type {member.Name} {member.MemberType}" + ); } break; @@ -187,8 +196,10 @@ public class ReflectionsCloner(ISptLogger logger) : ICloner } } - item.GetSetMethod(true).Invoke(clone, [await Clone(item.GetValue(obj), item.PropertyType)]); - list.GetSetMethod(true).Invoke(clone, [await Clone(list.GetValue(obj), list.PropertyType)]); + item.GetSetMethod(true) + .Invoke(clone, [await Clone(item.GetValue(obj), item.PropertyType)]); + list.GetSetMethod(true) + .Invoke(clone, [await Clone(list.GetValue(obj), list.PropertyType)]); return clone; } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Collections/ExhaustableArray.cs b/Libraries/SPTarkov.Server.Core/Utils/Collections/ExhaustableArray.cs index ff25ba96..401b426b 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Collections/ExhaustableArray.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Collections/ExhaustableArray.cs @@ -8,32 +8,18 @@ public record ExhaustableArray : IExhaustableArray private readonly RandomUtil _randomUtil; private readonly LinkedList? pool; - public ExhaustableArray( - T[]? itemPool, - RandomUtil randomUtil, - ICloner cloner - ) : this(new LinkedList(itemPool ?? []), randomUtil, cloner) - { - } + public ExhaustableArray(T[]? itemPool, RandomUtil randomUtil, ICloner cloner) + : this(new LinkedList(itemPool ?? []), randomUtil, cloner) { } - public ExhaustableArray( - LinkedList? itemPool, - RandomUtil randomUtil, - ICloner cloner - ) + public ExhaustableArray(LinkedList? itemPool, RandomUtil randomUtil, ICloner cloner) { _cloner = cloner; _randomUtil = randomUtil; pool = cloner.Clone(itemPool ?? []); } - public ExhaustableArray( - ICollection? itemPool, - RandomUtil randomUtil, - ICloner cloner - ) : this(new LinkedList(itemPool ?? []), randomUtil, cloner) - { - } + public ExhaustableArray(ICollection? itemPool, RandomUtil randomUtil, ICloner cloner) + : this(new LinkedList(itemPool ?? []), randomUtil, cloner) { } public T? GetRandomValue() { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Collections/ProbabilityObjectArray.cs b/Libraries/SPTarkov.Server.Core/Utils/Collections/ProbabilityObjectArray.cs index 6372c294..d802bcca 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Collections/ProbabilityObjectArray.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Collections/ProbabilityObjectArray.cs @@ -29,7 +29,8 @@ public class ProbabilityObjectArray : List> MathUtil mathUtil, ICloner cloner, ICollection>? items = null - ) : base(items ?? []) + ) + : base(items ?? []) { _mathUtil = mathUtil; _cloner = cloner; @@ -56,7 +57,11 @@ public class ProbabilityObjectArray : List> /// Filtered results public ProbabilityObjectArray Filter(Predicate> predicate) { - var result = new ProbabilityObjectArray(_mathUtil, _cloner, new List>()); + var result = new ProbabilityObjectArray( + _mathUtil, + _cloner, + new List>() + ); foreach (var probabilityObject in this) { if (predicate.Invoke(probabilityObject)) @@ -92,7 +97,7 @@ public class ProbabilityObjectArray : List> /// ProbabilityObjectArray without the dropped element public ProbabilityObjectArray Drop(K key) { - return (ProbabilityObjectArray) this.Where(r => !r.Key?.Equals(key) ?? false); + return (ProbabilityObjectArray)this.Where(r => !r.Key?.Equals(key) ?? false); } /// @@ -122,11 +127,11 @@ public class ProbabilityObjectArray : List> /** * Get the maximum relative probability out of a ProbabilityObjectArray - * + * * Example: * po = new ProbabilityObjectArray(new ProbabilityObject("a", 5), new ProbabilityObject("b", 1)) * po.maxProbability() // returns 5 - * + * * @return {number} the maximum value of all relative probabilities in this ProbabilityObjectArray */ public double MaxProbability() @@ -154,7 +159,11 @@ public class ProbabilityObjectArray : List> * @param lockList list keys which shall be replaced even if drawing without replacement * @returns Array consisting of N random keys for this ProbabilityObjectArray */ - public List Draw(int drawCount = 1, bool removeAfterDraw = true, List? neverRemoveWhitelist = null) + public List Draw( + int drawCount = 1, + bool removeAfterDraw = true, + List? neverRemoveWhitelist = null + ) { neverRemoveWhitelist ??= []; if (Count == 0) @@ -163,11 +172,7 @@ public class ProbabilityObjectArray : List> } var totals = this.Aggregate( - new - { - probArray = new List(), - keyArray = new List() - }, + new { probArray = new List(), keyArray = new List() }, (acc, x) => { acc.probArray.Add(x.RelativeProbability.Value); @@ -218,9 +223,7 @@ public class ProbabilityObjectArray : List> /// public class ProbabilityObject { - public ProbabilityObject() - { - } + public ProbabilityObject() { } /** * constructor for the ProbabilityObject @@ -236,26 +239,14 @@ public class ProbabilityObject } [JsonPropertyName("key")] - public K? Key - { - get; - set; - } + public K? Key { get; set; } /// /// Weighting of key compared to other ProbabilityObjects /// [JsonPropertyName("relativeProbability")] - public double? RelativeProbability - { - get; - set; - } + public double? RelativeProbability { get; set; } [JsonPropertyName("data")] - public V? Data - { - get; - set; - } + public V? Data { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/DatabaseImporter.cs b/Libraries/SPTarkov.Server.Core/Utils/DatabaseImporter.cs index 40aaca3d..db790bda 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/DatabaseImporter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/DatabaseImporter.cs @@ -21,7 +21,7 @@ public class DatabaseImporter( ImageRouter _imageRouter, ImporterUtil _importerUtil, JsonUtil _jsonUtil - ) : IOnLoad +) : IOnLoad { private const string _sptDataPath = "./SPT_Data/"; protected ISptLogger _logger = logger; @@ -90,21 +90,26 @@ public class DatabaseImporter( await using var ms = new MemoryStream(jsonBytes); - var FileHashes = await _jsonUtil.DeserializeFromMemoryStreamAsync>(ms) ?? []; + var FileHashes = + await _jsonUtil.DeserializeFromMemoryStreamAsync>(ms) ?? []; - foreach(var hash in FileHashes) + foreach (var hash in FileHashes) { databaseHashes.Add(hash.Path, hash.Hash); } } else { - _logger.Error(_localisationService.GetText("validation_error_exception", checksFilePath)); + _logger.Error( + _localisationService.GetText("validation_error_exception", checksFilePath) + ); } } catch (Exception) { - _logger.Error(_localisationService.GetText("validation_error_exception", checksFilePath)); + _logger.Error( + _localisationService.GetText("validation_error_exception", checksFilePath) + ); } } @@ -169,12 +174,16 @@ public class DatabaseImporter( { if (databaseHashes[relativePath] != hashString) { - _logger.Warning(_localisationService.GetText("validation_error_file", fileName)); + _logger.Warning( + _localisationService.GetText("validation_error_file", fileName) + ); } } else { - _logger.Warning(_localisationService.GetText("validation_error_file", fileName)); + _logger.Warning( + _localisationService.GetText("validation_error_file", fileName) + ); } } } @@ -186,4 +195,3 @@ public class FileHash public string Path { get; set; } = string.Empty; public string Hash { get; set; } = string.Empty; } - diff --git a/Libraries/SPTarkov.Server.Core/Utils/EncodingUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/EncodingUtil.cs index 92073d34..b221d19f 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/EncodingUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/EncodingUtil.cs @@ -14,7 +14,7 @@ public class EncodingUtil EncodeType.HEX => Convert.ToHexString(Encoding.Default.GetBytes(value)), EncodeType.ASCII => Encoding.ASCII.GetString(Encoding.Default.GetBytes(value)), EncodeType.UTF8 => Encoding.UTF8.GetString(Encoding.Default.GetBytes(value)), - _ => throw new ArgumentOutOfRangeException(nameof(encode), encode, null) + _ => throw new ArgumentOutOfRangeException(nameof(encode), encode, null), }; } @@ -61,5 +61,5 @@ public enum EncodeType BASE64, HEX, ASCII, - UTF8 + UTF8, } diff --git a/Libraries/SPTarkov.Server.Core/Utils/FileUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/FileUtil.cs index 37dd403d..c17369ae 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/FileUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/FileUtil.cs @@ -13,7 +13,11 @@ public class FileUtil() if (recursive) { - files.AddRange(Directory.GetDirectories(path).SelectMany(d => GetFiles(d, recursive, searchPattern))); + files.AddRange( + Directory + .GetDirectories(path) + .SelectMany(d => GetFiles(d, recursive, searchPattern)) + ); } return files; @@ -146,7 +150,6 @@ public class FileUtil() return false; } - // Ensure dir exists Directory.CreateDirectory(Path.GetDirectoryName(destinationFilePath)); diff --git a/Libraries/SPTarkov.Server.Core/Utils/HashUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/HashUtil.cs index 38e4a507..2bb21c82 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/HashUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/HashUtil.cs @@ -20,12 +20,12 @@ public partial class HashUtil(RandomUtil _randomUtil) Span objectId = stackalloc byte[12]; // Time stamp (4 bytes) - var timestamp = (int) DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + var timestamp = (int)DateTimeOffset.UtcNow.ToUnixTimeSeconds(); // Convert to big-endian - objectId[0] = (byte) (timestamp >> 24); - objectId[1] = (byte) (timestamp >> 16); - objectId[2] = (byte) (timestamp >> 8); - objectId[3] = (byte) timestamp; + objectId[0] = (byte)(timestamp >> 24); + objectId[1] = (byte)(timestamp >> 16); + objectId[2] = (byte)(timestamp >> 8); + objectId[3] = (byte)timestamp; // Random value (5 bytes) _randomUtil.NextBytes(objectId.Slice(4, 5)); @@ -33,9 +33,9 @@ public partial class HashUtil(RandomUtil _randomUtil) // Incrementing counter (3 bytes) // 24-bit counter var counter = _randomUtil.GetInt(0, 16777215); - objectId[9] = (byte) (counter >> 16); - objectId[10] = (byte) (counter >> 8); - objectId[11] = (byte) counter; + objectId[9] = (byte)(counter >> 16); + objectId[10] = (byte)(counter >> 8); + objectId[11] = (byte)counter; return Convert.ToHexStringLower(objectId); } @@ -76,7 +76,9 @@ public partial class HashUtil(RandomUtil _randomUtil) return Convert.ToHexString(sha1HashData).Replace("-", string.Empty); } - throw new NotImplementedException($"Provided hash algorithm: {algorithm} is not supported."); + throw new NotImplementedException( + $"Provided hash algorithm: {algorithm} is not supported." + ); } /// @@ -92,21 +94,23 @@ public partial class HashUtil(RandomUtil _randomUtil) switch (algorithm) { case HashingAlgorithm.MD5: - { - await using var ms = new MemoryStream(Encoding.UTF8.GetBytes(data)); - var md5HashData = await MD5.HashDataAsync(ms); - return Convert.ToHexString(md5HashData).Replace("-", string.Empty); - } + { + await using var ms = new MemoryStream(Encoding.UTF8.GetBytes(data)); + var md5HashData = await MD5.HashDataAsync(ms); + return Convert.ToHexString(md5HashData).Replace("-", string.Empty); + } case HashingAlgorithm.SHA1: - { - await using var ms = new MemoryStream(Encoding.UTF8.GetBytes(data)); - var sha1HashData = await SHA1.HashDataAsync(ms); - return Convert.ToHexString(sha1HashData).Replace("-", string.Empty); - } + { + await using var ms = new MemoryStream(Encoding.UTF8.GetBytes(data)); + var sha1HashData = await SHA1.HashDataAsync(ms); + return Convert.ToHexString(sha1HashData).Replace("-", string.Empty); + } } - throw new NotImplementedException($"Provided hash algorithm: {algorithm} is not supported."); + throw new NotImplementedException( + $"Provided hash algorithm: {algorithm} is not supported." + ); } /// @@ -128,5 +132,5 @@ public partial class HashUtil(RandomUtil _randomUtil) public enum HashingAlgorithm { MD5, - SHA1 + SHA1, } diff --git a/Libraries/SPTarkov.Server.Core/Utils/HttpFileUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/HttpFileUtil.cs index ee777d4f..f0aaa54f 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/HttpFileUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/HttpFileUtil.cs @@ -12,7 +12,9 @@ public class HttpFileUtil(HttpServerHelper httpServerHelper) { var pathSlice = filePath.Split("/"); var mimePath = _httpServerHelper.GetMimeText(pathSlice[^1].Split(".")[^1]); - var type = string.IsNullOrWhiteSpace(mimePath) ? _httpServerHelper.GetMimeText("txt") : mimePath; + var type = string.IsNullOrWhiteSpace(mimePath) + ? _httpServerHelper.GetMimeText("txt") + : mimePath; resp.Headers.Append("Content-Type", type); await resp.SendFileAsync(filePath, CancellationToken.None); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/HttpResponseUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/HttpResponseUtil.cs index 28bf430f..d97bb886 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/HttpResponseUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/HttpResponseUtil.cs @@ -20,13 +20,10 @@ public class HttpResponseUtil new("[\\f]"), new("[\\n]"), new("[\\r]"), - new("[\\t]") + new("[\\t]"), ]; - public HttpResponseUtil( - JsonUtil jsonUtil, - LocalisationService localisationService - ) + public HttpResponseUtil(JsonUtil jsonUtil, LocalisationService localisationService) { _localisationService = localisationService; _jsonUtil = jsonUtil; @@ -60,21 +57,30 @@ public class HttpResponseUtil * @param errmsg * @returns */ - public string GetBody(T data, BackendErrorCodes err = BackendErrorCodes.None, string? errmsg = null, bool sanitize = true) + public string GetBody( + T data, + BackendErrorCodes err = BackendErrorCodes.None, + string? errmsg = null, + bool sanitize = true + ) { return sanitize ? ClearString(GetUnclearedBody(data, err, errmsg)) : GetUnclearedBody(data, err, errmsg); } - public string GetUnclearedBody(T? data, BackendErrorCodes err = BackendErrorCodes.None, string? errmsg = null) + public string GetUnclearedBody( + T? data, + BackendErrorCodes err = BackendErrorCodes.None, + string? errmsg = null + ) { return _jsonUtil.Serialize( new GetBodyResponseData { Err = err, ErrMsg = errmsg, - Data = data + Data = data, } ); } @@ -119,7 +125,7 @@ public class HttpResponseUtil { Index = output.Warnings?.Count - 1, ErrorMessage = message, - Code = errorCode + Code = errorCode, } ); } @@ -131,8 +137,8 @@ public class HttpResponseUtil { Index = 0, ErrorMessage = message, - Code = errorCode - } + Code = errorCode, + }, ]; } diff --git a/Libraries/SPTarkov.Server.Core/Utils/ImporterUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/ImporterUtil.cs index bad558d8..915329c2 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/ImporterUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/ImporterUtil.cs @@ -8,13 +8,18 @@ using SPTarkov.Server.Core.Utils.Json; namespace SPTarkov.Server.Core.Utils; [Injectable(InjectionType.Singleton)] -public class ImporterUtil( - ISptLogger _logger, - FileUtil _fileUtil, - JsonUtil _jsonUtil) +public class ImporterUtil(ISptLogger _logger, FileUtil _fileUtil, JsonUtil _jsonUtil) { - private readonly FrozenSet _directoriesToIgnore = ["./SPT_Data/database/locales/server"]; - private readonly FrozenSet _filesToIgnore = ["bearsuits.json", "usecsuits.json", "archivedquests.json"]; + private readonly FrozenSet _directoriesToIgnore = + [ + "./SPT_Data/database/locales/server", + ]; + private readonly FrozenSet _filesToIgnore = + [ + "bearsuits.json", + "usecsuits.json", + "archivedquests.json", + ]; public async Task LoadRecursiveAsync( string filePath, @@ -22,9 +27,14 @@ public class ImporterUtil( Func? onObjectDeserialized = null ) { - var result = await LoadRecursiveAsync(filePath, typeof(T), onReadCallback, onObjectDeserialized); + var result = await LoadRecursiveAsync( + filePath, + typeof(T), + onReadCallback, + onObjectDeserialized + ); - return (T) result; + return (T)result; } /// @@ -53,12 +63,24 @@ public class ImporterUtil( // Process files foreach (var file in files) { - if (_fileUtil.GetFileExtension(file) != "json" || _filesToIgnore.Contains(_fileUtil.GetFileNameAndExtension(file).ToLower())) + if ( + _fileUtil.GetFileExtension(file) != "json" + || _filesToIgnore.Contains(_fileUtil.GetFileNameAndExtension(file).ToLower()) + ) { continue; } - tasks.Add(ProcessFileAsync(file, loadedType, onReadCallback, onObjectDeserialized, result, dictionaryLock)); + tasks.Add( + ProcessFileAsync( + file, + loadedType, + onReadCallback, + onObjectDeserialized, + result, + dictionaryLock + ) + ); } // Process directories @@ -69,7 +91,16 @@ public class ImporterUtil( continue; } - tasks.Add(ProcessDirectoryAsync(directory, loadedType, result, onReadCallback, onObjectDeserialized, dictionaryLock)); + tasks.Add( + ProcessDirectoryAsync( + directory, + loadedType, + result, + onReadCallback, + onObjectDeserialized, + dictionaryLock + ) + ); } // Wait for all tasks to finish @@ -143,11 +174,19 @@ public class ImporterUtil( out var isDictionary ); - var loadedData = await LoadRecursiveAsync($"{directory}/", matchedProperty, onReadCallback, onObjectDeserialized); + var loadedData = await LoadRecursiveAsync( + $"{directory}/", + matchedProperty, + onReadCallback, + onObjectDeserialized + ); lock (dictionaryLock) { - setMethod.Invoke(result, isDictionary ? [directory, loadedData] : new[] { loadedData }); + setMethod.Invoke( + result, + isDictionary ? [directory, loadedData] : new[] { loadedData } + ); } } catch (Exception ex) @@ -158,7 +197,10 @@ public class ImporterUtil( private async Task DeserializeFileAsync(string file, Type propertyType) { - if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(LazyLoad<>)) + if ( + propertyType.IsGenericType + && propertyType.GetGenericTypeDefinition() == typeof(LazyLoad<>) + ) { return CreateLazyLoadDeserialization(file, propertyType); } @@ -190,7 +232,12 @@ public class ImporterUtil( return Activator.CreateInstance(propertyType, expressionDelegate); } - public MethodInfo GetSetMethod(string propertyName, Type type, out Type propertyType, out bool isDictionary) + public MethodInfo GetSetMethod( + string propertyName, + Type type, + out Type propertyType, + out bool isDictionary + ) { MethodInfo setMethod; isDictionary = false; diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ArrayToObjectFactoryConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ArrayToObjectFactoryConverter.cs index e34369ee..a29c29e4 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ArrayToObjectFactoryConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ArrayToObjectFactoryConverter.cs @@ -10,22 +10,29 @@ public class ArrayToObjectFactoryConverter : JsonConverterFactory return true; } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance(typeof(ArrayToObjectConverter<>).MakeGenericType(typeToConvert)); + return (JsonConverter) + Activator.CreateInstance( + typeof(ArrayToObjectConverter<>).MakeGenericType(typeToConvert) + ); } private class ArrayToObjectConverter : JsonConverter { public override bool HandleNull { - get - { - return true; - } + get { return true; } } - public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override T? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { switch (reader.TokenType) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseInteractionRequestDataConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseInteractionRequestDataConverter.cs index 82442a76..ff8bec21 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseInteractionRequestDataConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseInteractionRequestDataConverter.cs @@ -18,8 +18,14 @@ namespace SPTarkov.Server.Core.Utils.Json.Converters; public class BaseInteractionRequestDataConverter : JsonConverter { - private static Dictionary> _modHandlers = new(); - public override BaseInteractionRequestData? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + private static Dictionary> _modHandlers = + new(); + + public override BaseInteractionRequestData? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { using var jsonDocument = JsonDocument.ParseValue(ref reader); @@ -39,7 +45,11 @@ public class BaseInteractionRequestDataConverter : JsonConverterRoot json element of client request /// Raw JSON request text /// BaseInteractionRequestData - private static BaseInteractionRequestData? ConvertToCorrectType(string action, JsonElement jsonDocumentRoot, string jsonText) + private static BaseInteractionRequestData? ConvertToCorrectType( + string action, + JsonElement jsonDocumentRoot, + string jsonText + ) { switch (action) { @@ -64,11 +74,15 @@ public class BaseInteractionRequestDataConverter : JsonConverter(jsonText); case HideoutEventActions.HIDEOUT_SINGLE_PRODUCTION_START: - return JsonSerializer.Deserialize(jsonText); + return JsonSerializer.Deserialize( + jsonText + ); case HideoutEventActions.HIDEOUT_SCAV_CASE_PRODUCTION_START: return JsonSerializer.Deserialize(jsonText); case HideoutEventActions.HIDEOUT_CONTINUOUS_PRODUCTION_START: - return JsonSerializer.Deserialize(jsonText); + return JsonSerializer.Deserialize( + jsonText + ); case HideoutEventActions.HIDEOUT_TAKE_PRODUCTION: return JsonSerializer.Deserialize(jsonText); case HideoutEventActions.HIDEOUT_RECORD_SHOOTING_RANGE_POINTS: @@ -77,13 +91,17 @@ public class BaseInteractionRequestDataConverter : JsonConverter(jsonText); case HideoutEventActions.HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START: - return JsonSerializer.Deserialize(jsonText); + return JsonSerializer.Deserialize( + jsonText + ); case HideoutEventActions.HIDEOUT_DELETE_PRODUCTION_COMMAND: return JsonSerializer.Deserialize(jsonText); case HideoutEventActions.HIDEOUT_CUSTOMIZATION_APPLY_COMMAND: return JsonSerializer.Deserialize(jsonText); case HideoutEventActions.HIDEOUT_CUSTOMIZATION_SET_MANNEQUIN_POSE: - return JsonSerializer.Deserialize(jsonText); + return JsonSerializer.Deserialize( + jsonText + ); case ItemEventActions.INSURE: return JsonSerializer.Deserialize(jsonText); case ItemEventActions.ADD_TO_WISHLIST: @@ -93,19 +111,19 @@ public class BaseInteractionRequestDataConverter : JsonConverter(jsonText); case ItemEventActions.TRADING_CONFIRM: + { + switch (jsonDocumentRoot.GetProperty("type").GetString()) { - switch (jsonDocumentRoot.GetProperty("type").GetString()) - { - case ItemEventActions.BUY_FROM_TRADER: - return JsonSerializer.Deserialize(jsonText); - case ItemEventActions.SELL_TO_TRADER: - return JsonSerializer.Deserialize(jsonText); - default: - throw new Exception( - $"Unhandled action type: {action}, make sure BaseInteractionRequestDataConverter has deserialization for this action." - ); - } + case ItemEventActions.BUY_FROM_TRADER: + return JsonSerializer.Deserialize(jsonText); + case ItemEventActions.SELL_TO_TRADER: + return JsonSerializer.Deserialize(jsonText); + default: + throw new Exception( + $"Unhandled action type: {action}, make sure BaseInteractionRequestDataConverter has deserialization for this action." + ); } + } case ItemEventActions.RAGFAIR_BUY_OFFER: return JsonSerializer.Deserialize(jsonText); case ItemEventActions.SELL_ALL_FROM_SAVAGE: @@ -188,15 +206,24 @@ public class BaseInteractionRequestDataConverter : JsonConverter handler) + public static void RegisterModDataHandler( + string action, + Func handler + ) { if (!_modHandlers.TryAdd(action, handler)) { - throw new Exception($"Unable to register action {action} to BaseInteractionRequestDataConverter as it already exists."); + throw new Exception( + $"Unable to register action {action} to BaseInteractionRequestDataConverter as it already exists." + ); } } - public override void Write(Utf8JsonWriter writer, BaseInteractionRequestData value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + BaseInteractionRequestData value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize(writer, value, options); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseSptLoggerReferenceConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseSptLoggerReferenceConverter.cs index e75dcad1..5a538015 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseSptLoggerReferenceConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/BaseSptLoggerReferenceConverter.cs @@ -6,7 +6,11 @@ namespace SPTarkov.Server.Core.Utils.Json.Converters; public class BaseSptLoggerReferenceConverter : JsonConverter { - public override BaseSptLoggerReference? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override BaseSptLoggerReference? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { using (var jsonDocument = JsonDocument.ParseValue(ref reader)) { @@ -22,12 +26,16 @@ public class BaseSptLoggerReferenceConverter : JsonConverter(); default: - throw new Exception($"The logger type '{typeElement.GetString()}' does not exist."); + throw new Exception( + $"The logger type '{typeElement.GetString()}' does not exist." + ); } } } - public override void Write(Utf8JsonWriter writer, BaseSptLoggerReference value, JsonSerializerOptions options) - { - } + public override void Write( + Utf8JsonWriter writer, + BaseSptLoggerReference value, + JsonSerializerOptions options + ) { } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOfListOrTConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOfListOrTConverter.cs index cc2d2d04..55a3a996 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOfListOrTConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOfListOrTConverter.cs @@ -7,26 +7,35 @@ public class DictionaryOfListOrTConverter : JsonConverterFactory { public override bool CanConvert(Type typeToConvert) { - return typeToConvert.IsGenericType && - typeToConvert.GetGenericTypeDefinition() == typeof(Dictionary<,>) && - typeToConvert.GenericTypeArguments[1].IsGenericType && - typeToConvert.GenericTypeArguments[1].GetGenericTypeDefinition() == typeof(ListOrT<>); + return typeToConvert.IsGenericType + && typeToConvert.GetGenericTypeDefinition() == typeof(Dictionary<,>) + && typeToConvert.GenericTypeArguments[1].IsGenericType + && typeToConvert.GenericTypeArguments[1].GetGenericTypeDefinition() + == typeof(ListOrT<>); } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance( - typeof(DictionaryOfListOrTConverter<,>).MakeGenericType( - typeToConvert.GenericTypeArguments[0], - typeToConvert.GenericTypeArguments[1].GenericTypeArguments[0] - ) - ); + return (JsonConverter) + Activator.CreateInstance( + typeof(DictionaryOfListOrTConverter<,>).MakeGenericType( + typeToConvert.GenericTypeArguments[0], + typeToConvert.GenericTypeArguments[1].GenericTypeArguments[0] + ) + ); } } public class DictionaryOfListOrTConverter : JsonConverter>?> { - public override Dictionary>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override Dictionary>? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { if (reader.TokenType == JsonTokenType.StartArray) { @@ -41,7 +50,11 @@ public class DictionaryOfListOrTConverter : JsonConverter> value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + Dictionary> value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize(writer, value, options); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOrListConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOrListConverter.cs index 8c409e01..8f2269bf 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOrListConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DictionaryOrListConverter.cs @@ -7,20 +7,32 @@ public class DictionaryOrListConverter : JsonConverterFactory { public override bool CanConvert(Type typeToConvert) { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(DictionaryOrList<,>); + return typeToConvert.IsGenericType + && typeToConvert.GetGenericTypeDefinition() == typeof(DictionaryOrList<,>); } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance( - typeof(DictionaryOrListConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments[0], typeToConvert.GenericTypeArguments[1]) - ); + return (JsonConverter) + Activator.CreateInstance( + typeof(DictionaryOrListConverter<,>).MakeGenericType( + typeToConvert.GenericTypeArguments[0], + typeToConvert.GenericTypeArguments[1] + ) + ); } } public class DictionaryOrListConverter : JsonConverter?> { - public override DictionaryOrList? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override DictionaryOrList? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { switch (reader.TokenType) { @@ -35,15 +47,24 @@ public class DictionaryOrListConverter : JsonConverter>(jsonText, options); + var dictionary = JsonSerializer.Deserialize>( + jsonText, + options + ); return new DictionaryOrList(dictionary, null); } default: - throw new Exception($"Unable to translate object type {reader.TokenType} to ListOrT."); + throw new Exception( + $"Unable to translate object type {reader.TokenType} to ListOrT." + ); } } - public override void Write(Utf8JsonWriter writer, DictionaryOrList value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + DictionaryOrList value, + JsonSerializerOptions options + ) { if (value.IsList) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DogtagSideConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DogtagSideConverter.cs index b7b2b4ae..4944a946 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DogtagSideConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/DogtagSideConverter.cs @@ -6,7 +6,11 @@ namespace SPTarkov.Server.Core.Utils.Json.Converters; public class DogtagSideConverter : JsonConverter { - public override DogtagSide Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override DogtagSide Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { if (reader.TokenType == JsonTokenType.Number) { @@ -17,7 +21,11 @@ public class DogtagSideConverter : JsonConverter return value != null ? Enum.Parse(value) : DogtagSide.NotApplicable; } - public override void Write(Utf8JsonWriter writer, DogtagSide value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + DogtagSide value, + JsonSerializerOptions options + ) { switch (value) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftEnumConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftEnumConverter.cs index 089d5589..a9ee62bd 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftEnumConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftEnumConverter.cs @@ -8,24 +8,28 @@ public class EftEnumConverter : JsonConverter { private static readonly JsonSerializerOptions _options = new() { - Converters = - { - new JsonStringEnumConverter() - } + Converters = { new JsonStringEnumConverter() }, }; - public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override T? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { - if (reader.TokenType == JsonTokenType.String || reader.TokenType == JsonTokenType.PropertyName) + if ( + reader.TokenType == JsonTokenType.String + || reader.TokenType == JsonTokenType.PropertyName + ) { var str = reader.GetString(); - return (T) Enum.Parse(typeof(T), str, true); + return (T)Enum.Parse(typeof(T), str, true); } if (reader.TokenType == JsonTokenType.Number) { var str = reader.GetInt32().ToString(); - return (T) Enum.Parse(typeof(T), str, true); + return (T)Enum.Parse(typeof(T), str, true); } return default; @@ -54,12 +58,20 @@ public class EftEnumConverter : JsonConverter } } - public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override T ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { return Read(ref reader, typeToConvert, options); } - public override void WriteAsPropertyName(Utf8JsonWriter writer, [DisallowNull] T value, JsonSerializerOptions options) + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + [DisallowNull] T value, + JsonSerializerOptions options + ) { object propertyValue = null; if (typeof(T).GetFields().Any(f => f.FieldType == typeof(string))) @@ -90,5 +102,4 @@ public class EftEnumConverter : JsonConverter /// This attribute should be applied to enums which should be added as a converter to the json converter /// [AttributeUsage(AttributeTargets.Enum)] -public class EftEnumConverterAttribute : Attribute -{ } +public class EftEnumConverterAttribute : Attribute { } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftListEnumConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftListEnumConverter.cs index 63a79be3..2719c05a 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftListEnumConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/EftListEnumConverter.cs @@ -7,13 +7,14 @@ public class EftListEnumConverter : JsonConverter> { private static readonly JsonSerializerOptions _options = new() { - Converters = - { - new JsonStringEnumConverter() - } + Converters = { new JsonStringEnumConverter() }, }; - public override List? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override List? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { if (reader.TokenType == JsonTokenType.StartArray) { @@ -39,5 +40,4 @@ public class EftListEnumConverter : JsonConverter> /// This attribute should be applied to enums which should be added as a converter to the json converter /// [AttributeUsage(AttributeTargets.Enum)] -public class EftListEnumConverterAttribute : Attribute -{ } +public class EftListEnumConverterAttribute : Attribute { } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ListOrTConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ListOrTConverter.cs index c41479ca..71b6f356 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ListOrTConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/ListOrTConverter.cs @@ -7,18 +7,29 @@ public class ListOrTConverterFactory : JsonConverterFactory { public override bool CanConvert(Type typeToConvert) { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ListOrT<>); + return typeToConvert.IsGenericType + && typeToConvert.GetGenericTypeDefinition() == typeof(ListOrT<>); } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance(typeof(ListOrTConverter<>).MakeGenericType(typeToConvert.GenericTypeArguments[0])); + return (JsonConverter) + Activator.CreateInstance( + typeof(ListOrTConverter<>).MakeGenericType(typeToConvert.GenericTypeArguments[0]) + ); } } public class ListOrTConverter : JsonConverter?> { - public override ListOrT? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override ListOrT? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { switch (reader.TokenType) { @@ -35,11 +46,17 @@ public class ListOrTConverter : JsonConverter?> var obj = JsonSerializer.Deserialize(ref reader, options); return new ListOrT(null, obj); default: - throw new Exception($"Unable to translate object type {reader.TokenType} to ListOrT."); + throw new Exception( + $"Unable to translate object type {reader.TokenType} to ListOrT." + ); } } - public override void Write(Utf8JsonWriter writer, ListOrT value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + ListOrT value, + JsonSerializerOptions options + ) { if (value.IsItem) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/SptJsonConverterRegistrator.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/SptJsonConverterRegistrator.cs index be569f15..a16f736e 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/SptJsonConverterRegistrator.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/SptJsonConverterRegistrator.cs @@ -9,30 +9,45 @@ public class SptJsonConverterRegistrator : IJsonConverterRegistrator { public IEnumerable GetJsonConverters() { - return [ + return + [ new BaseSptLoggerReferenceConverter(), new ListOrTConverterFactory(), new DictionaryOrListConverter(), - new EftEnumConverter(), // Special case, this belongs to a lib. new BaseInteractionRequestDataConverter(), - - ..GetGenericJsonConverters() + .. GetGenericJsonConverters(), ]; } private static List GetGenericJsonConverters() { - var enums = AppDomain.CurrentDomain.GetAssemblies() + var enums = AppDomain + .CurrentDomain.GetAssemblies() .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsEnum && type.GetCustomAttribute() != null); + .Where(type => + type.IsEnum && type.GetCustomAttribute() != null + ); - var listEnums = AppDomain.CurrentDomain.GetAssemblies() + var listEnums = AppDomain + .CurrentDomain.GetAssemblies() .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsEnum && type.GetCustomAttribute() != null); + .Where(type => + type.IsEnum && type.GetCustomAttribute() != null + ); - var result = enums.Select(e => (JsonConverter) Activator.CreateInstance(typeof(EftEnumConverter<>).MakeGenericType(e))!).ToList(); - result.AddRange(listEnums.Select(e => (JsonConverter) Activator.CreateInstance(typeof(EftListEnumConverter<>).MakeGenericType(e))!)); + var result = enums + .Select(e => + (JsonConverter) + Activator.CreateInstance(typeof(EftEnumConverter<>).MakeGenericType(e))! + ) + .ToList(); + result.AddRange( + listEnums.Select(e => + (JsonConverter) + Activator.CreateInstance(typeof(EftListEnumConverter<>).MakeGenericType(e))! + ) + ); return result; } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToNumberFactoryConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToNumberFactoryConverter.cs index 86e83a5e..61dab416 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToNumberFactoryConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToNumberFactoryConverter.cs @@ -13,9 +13,15 @@ public class StringToNumberFactoryConverter : JsonConverterFactory return true; } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance(typeof(StringToNumberConverter<>).MakeGenericType(typeToConvert)); + return (JsonConverter) + Activator.CreateInstance( + typeof(StringToNumberConverter<>).MakeGenericType(typeToConvert) + ); } private class StringToNumberConverter : JsonConverter @@ -28,11 +34,18 @@ public class StringToNumberFactoryConverter : JsonConverterFactory if (_stringParseMethod == null) { var underlyingType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); - _stringParseMethod = underlyingType.GetMethod("Parse", [typeof(string), typeof(IFormatProvider)]); + _stringParseMethod = underlyingType.GetMethod( + "Parse", + [typeof(string), typeof(IFormatProvider)] + ); } } - public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override T? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { if (reader.TokenType == JsonTokenType.String) { @@ -49,12 +62,15 @@ public class StringToNumberFactoryConverter : JsonConverterFactory if (_stringParseMethod != null) { - return (T) _stringParseMethod.Invoke(null, [value, CultureInfo.InvariantCulture]); + return (T) + _stringParseMethod.Invoke(null, [value, CultureInfo.InvariantCulture]); } } catch (Exception ex) { - Debug.WriteLine($"Failed to parse '{value}' into {typeToConvert.Name}, returning null."); + Debug.WriteLine( + $"Failed to parse '{value}' into {typeToConvert.Name}, returning null." + ); return default; } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToObjectFactoryConverter.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToObjectFactoryConverter.cs index 996444d0..3457c3ed 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToObjectFactoryConverter.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/Converters/StringToObjectFactoryConverter.cs @@ -10,14 +10,24 @@ public class StringToObjectFactoryConverter : JsonConverterFactory return true; } - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + public override JsonConverter? CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) { - return (JsonConverter) Activator.CreateInstance(typeof(StringToObjectConverter<>).MakeGenericType(typeToConvert)); + return (JsonConverter) + Activator.CreateInstance( + typeof(StringToObjectConverter<>).MakeGenericType(typeToConvert) + ); } public class StringToObjectConverter : JsonConverter { - public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override T? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { switch (reader.TokenType) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/DictionaryOrList.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/DictionaryOrList.cs index c5602743..8c1399b2 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/DictionaryOrList.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/DictionaryOrList.cs @@ -2,29 +2,17 @@ namespace SPTarkov.Server.Core.Utils.Json; public class DictionaryOrList(Dictionary? dictionary, List? list) { - public Dictionary? Dictionary - { - get; - } = dictionary; + public Dictionary? Dictionary { get; } = dictionary; - public List? List - { - get; - } = list; + public List? List { get; } = list; public bool IsList { - get - { - return List != null; - } + get { return List != null; } } public bool IsDictionary { - get - { - return Dictionary != null; - } + get { return Dictionary != null; } } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/LazyLoad.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/LazyLoad.cs index 03905ed8..d61db2d6 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/LazyLoad.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/LazyLoad.cs @@ -11,7 +11,7 @@ public class LazyLoad(Func deserialize) private Timer? autoCleanerTimeout; /// - /// Adds a transformer to modify the value during lazy loading. Transformers execute + /// Adds a transformer to modify the value during lazy loading. Transformers execute /// in registration order and the final result is cached until auto-cleanup. /// /// Function that transforms the value @@ -46,7 +46,7 @@ public class LazyLoad(Func deserialize) _result = transform(_result); } } - catch(Exception) + catch (Exception) { throw; } @@ -60,14 +60,17 @@ public class LazyLoad(Func deserialize) { _result = default; _isLoaded = false; - autoCleanerTimeout?.Change(Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan); + autoCleanerTimeout?.Change( + Timeout.InfiniteTimeSpan, + Timeout.InfiniteTimeSpan + ); autoCleanerTimeout = null; }, null, _autoCleanerTimeout, Timeout.InfiniteTimeSpan ); - } + } autoCleanerTimeout?.Change(_autoCleanerTimeout, Timeout.InfiniteTimeSpan); return _result; diff --git a/Libraries/SPTarkov.Server.Core/Utils/Json/ListOrT.cs b/Libraries/SPTarkov.Server.Core/Utils/Json/ListOrT.cs index 746efeb9..89c5ba6e 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Json/ListOrT.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Json/ListOrT.cs @@ -4,9 +4,8 @@ public class ListOrT(List? list, T? item) { // Do not remove, its used by the cloner // ReSharper disable once UnusedMember.Local - private ListOrT() : this(null, default) - { - } + private ListOrT() + : this(null, default) { } public List? List { @@ -26,17 +25,11 @@ public class ListOrT(List? list, T? item) public bool IsItem { - get - { - return Item != null; - } + get { return Item != null; } } public bool IsList { - get - { - return List != null; - } + get { return List != null; } } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs index bb821a24..4b251981 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs @@ -12,9 +12,7 @@ public class JsonUtil private static JsonSerializerOptions? jsonSerializerOptionsIndented; private static JsonSerializerOptions jsonSerializerOptionsNoIndent; - public JsonUtil( - IEnumerable registrators - ) + public JsonUtil(IEnumerable registrators) { jsonSerializerOptionsNoIndent = new JsonSerializerOptions() { @@ -34,7 +32,7 @@ public class JsonUtil jsonSerializerOptionsIndented = new JsonSerializerOptions(jsonSerializerOptionsNoIndent) { - WriteIndented = true + WriteIndented = true, }; } @@ -46,7 +44,9 @@ public class JsonUtil /// Deserialized object or null public T? Deserialize(string? json) { - return string.IsNullOrEmpty(json) ? default : JsonSerializer.Deserialize(json, jsonSerializerOptionsNoIndent); + return string.IsNullOrEmpty(json) + ? default + : JsonSerializer.Deserialize(json, jsonSerializerOptionsNoIndent); } /// @@ -57,7 +57,9 @@ public class JsonUtil /// public object? Deserialize(string? json, Type type) { - return string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize(json, type, jsonSerializerOptionsNoIndent); + return string.IsNullOrEmpty(json) + ? null + : JsonSerializer.Deserialize(json, type, jsonSerializerOptionsNoIndent); } /// @@ -90,7 +92,14 @@ public class JsonUtil return default; } - await using FileStream fs = new(file, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 4096, useAsync: true); + await using FileStream fs = new( + file, + FileMode.Open, + FileAccess.Read, + FileShare.Read, + bufferSize: 4096, + useAsync: true + ); return await JsonSerializer.DeserializeAsync(fs, jsonSerializerOptionsNoIndent); } @@ -127,7 +136,14 @@ public class JsonUtil return default; } - await using FileStream fs = new(file, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 4096, useAsync: true); + await using FileStream fs = new( + file, + FileMode.Open, + FileAccess.Read, + FileShare.Read, + bufferSize: 4096, + useAsync: true + ); return await JsonSerializer.DeserializeAsync(fs, type, jsonSerializerOptionsNoIndent); } @@ -173,7 +189,12 @@ public class JsonUtil /// Serialised object as JSON, or null public string? Serialize(T? obj, bool indented = false) { - return obj == null ? null : JsonSerializer.Serialize(obj, indented ? jsonSerializerOptionsIndented : jsonSerializerOptionsNoIndent); + return obj == null + ? null + : JsonSerializer.Serialize( + obj, + indented ? jsonSerializerOptionsIndented : jsonSerializerOptionsNoIndent + ); } /// @@ -185,6 +206,12 @@ public class JsonUtil /// Serialized text public string? Serialize(object? obj, Type type, bool indented = false) { - return obj == null ? null : JsonSerializer.Serialize(obj, type, indented ? jsonSerializerOptionsIndented : jsonSerializerOptionsNoIndent); + return obj == null + ? null + : JsonSerializer.Serialize( + obj, + type, + indented ? jsonSerializerOptionsIndented : jsonSerializerOptionsNoIndent + ); } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/FileLogger.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/FileLogger.cs index 2c675371..458018c9 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/FileLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/FileLogger.cs @@ -1,5 +1,3 @@ namespace SPTarkov.Server.Core.Utils.Logger; -public class FileLogger -{ -} +public class FileLogger { } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/BaseLogHandler.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/BaseLogHandler.cs index 862dc4c8..5b1babf5 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/BaseLogHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/BaseLogHandler.cs @@ -2,16 +2,18 @@ namespace SPTarkov.Server.Core.Utils.Logger.Handlers; public abstract class BaseLogHandler : ILogHandler { - public abstract LoggerType LoggerType - { - get; - } + public abstract LoggerType LoggerType { get; } public abstract void Log(SptLogMessage message, BaseSptLoggerReference reference); - protected string FormatMessage(string processedMessage, SptLogMessage message, BaseSptLoggerReference reference) + protected string FormatMessage( + string processedMessage, + SptLogMessage message, + BaseSptLoggerReference reference + ) { - var formattedMessage = reference.Format.Replace("%date%", message.LogTime.ToString("yyyy-MM-dd")) + var formattedMessage = reference + .Format.Replace("%date%", message.LogTime.ToString("yyyy-MM-dd")) .Replace("%time%", message.LogTime.ToString("HH:mm:ss.fff")) .Replace("%message%", processedMessage) .Replace("%loggerShort%", message.Logger.Split('.').Last()) diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/ConsoleLogHandler.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/ConsoleLogHandler.cs index 20589ad6..91e9ecd3 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/ConsoleLogHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/ConsoleLogHandler.cs @@ -10,7 +10,13 @@ public class ConsoleLogHandler : BaseLogHandler public override void Log(SptLogMessage message, BaseSptLoggerReference reference) { - Console.WriteLine(FormatMessage(GetColorizedText(message.Message, message.TextColor, message.BackgroundColor), message, reference)); + Console.WriteLine( + FormatMessage( + GetColorizedText(message.Message, message.TextColor, message.BackgroundColor), + message, + reference + ) + ); } private string GetColorizedText( @@ -22,14 +28,14 @@ public class ConsoleLogHandler : BaseLogHandler var colorString = string.Empty; if (textColor != null) { - colorString += ((int) textColor.Value).ToString(); + colorString += ((int)textColor.Value).ToString(); } if (backgroundColor != null) { colorString += string.IsNullOrEmpty(colorString) - ? ((int) backgroundColor.Value).ToString() - : $";{((int) backgroundColor.Value).ToString()}"; + ? ((int)backgroundColor.Value).ToString() + : $";{((int)backgroundColor.Value).ToString()}"; } return $"\x1b[{colorString}m{data}\x1b[0m"; diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/FileLogHandler.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/FileLogHandler.cs index 8ec091cb..00d65ef3 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/FileLogHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/Handlers/FileLogHandler.cs @@ -14,12 +14,16 @@ public class FileLogHandler(IEnumerable replacers) : BaseL // That way we dont need to process them twice and generate extra garbage // _cacheFileNames[config.FilePath][config.FilePattern] will give you the current file pattern private readonly Dictionary> _cachedFileNames = new(); + // This section needs to be fully locked as it is a double dictionary lookup private readonly Lock _cachedFileNamesLocks = new(); private readonly Dictionary> _cachedWipedPatterns = new(); - private readonly Dictionary _replacers = replacers.ToDictionary(kv => kv.Pattern, kv => kv); + private readonly Dictionary _replacers = replacers.ToDictionary( + kv => kv.Pattern, + kv => kv + ); private readonly ConcurrentDictionary _fileLocks = new(); private readonly ConcurrentDictionary _fileInfos = new(); @@ -40,7 +44,8 @@ public class FileLogHandler(IEnumerable replacers) : BaseL if (!_fileLocks.TryGetValue(targetFile, out var lockObject)) { lockObject = new Lock(); - while (!_fileLocks.TryAdd(targetFile, lockObject)) ; + while (!_fileLocks.TryAdd(targetFile, lockObject)) + ; } lock (lockObject) { @@ -50,17 +55,22 @@ public class FileLogHandler(IEnumerable replacers) : BaseL } // The AppendAllText will create the file as long as the directory exists - System.IO.File.AppendAllText(targetFile, FormatMessage(message.Message + "\n", message, reference)); + System.IO.File.AppendAllText( + targetFile, + FormatMessage(message.Message + "\n", message, reference) + ); if (!_fileInfos.TryGetValue(targetFile, out _)) { var fileInfo = new FileInfo(targetFile); - while (!_fileInfos.TryAdd(targetFile, fileInfo)) ; + while (!_fileInfos.TryAdd(targetFile, fileInfo)) + ; } if (!_fileConfigs.TryGetValue(targetFile, out _)) { - while (!_fileConfigs.TryAdd(targetFile, config)) ; + while (!_fileConfigs.TryAdd(targetFile, config)) + ; } } } @@ -163,7 +173,8 @@ public class FileLogHandler(IEnumerable replacers) : BaseL for (var i = fileConfig.MaxRollingFiles - 1; i > 0; i--) { var oldReference = i - 1; - var oldFile = oldReference == 0 ? fileInfo.FullName : $"{unpatternedFileName}.{i - 1}"; + var oldFile = + oldReference == 0 ? fileInfo.FullName : $"{unpatternedFileName}.{i - 1}"; var newFile = $"{unpatternedFileName}.{i}"; if (System.IO.File.Exists(oldFile)) { diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/ILogHandler.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/ILogHandler.cs index 43ae28b6..8fa6394b 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/ILogHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/ILogHandler.cs @@ -2,10 +2,7 @@ namespace SPTarkov.Server.Core.Utils.Logger; public interface ILogHandler { - LoggerType LoggerType - { - get; - } + LoggerType LoggerType { get; } void Log(SptLogMessage message, BaseSptLoggerReference reference); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/LoggerType.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/LoggerType.cs index 932611e5..1c8ddf14 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/LoggerType.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/LoggerType.cs @@ -1,2 +1 @@ namespace SPTarkov.Server.Core.Utils.Logger; - diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs index 1b0fb92a..d964d43a 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs @@ -37,7 +37,8 @@ public class SptLogger : ISptLogger, IDisposable if (_config == null) { throw new Exception( - "The configuration path was loaded but it contained invalid or incorrect configuration."); + "The configuration path was loaded but it contained invalid or incorrect configuration." + ); } _loggerQueueManager.Initialize(_config); @@ -47,7 +48,9 @@ public class SptLogger : ISptLogger, IDisposable { if (fileUtil.FileExists(sptloggerDevelopmentJson)) { - _config = jsonUtil.DeserializeFromFile(sptloggerDevelopmentJson); + _config = jsonUtil.DeserializeFromFile( + sptloggerDevelopmentJson + ); } else { @@ -77,7 +80,8 @@ public class SptLogger : ISptLogger, IDisposable data, ex, textColor, - backgroundColor) + backgroundColor + ) ); } @@ -92,7 +96,8 @@ public class SptLogger : ISptLogger, IDisposable Thread.CurrentThread.Name, data, ex, - LogTextColor.Green) + LogTextColor.Green + ) ); } @@ -107,7 +112,8 @@ public class SptLogger : ISptLogger, IDisposable Thread.CurrentThread.Name, data, ex, - LogTextColor.Red) + LogTextColor.Red + ) ); } @@ -122,7 +128,8 @@ public class SptLogger : ISptLogger, IDisposable Thread.CurrentThread.Name, data, ex, - LogTextColor.Yellow) + LogTextColor.Yellow + ) ); } @@ -136,7 +143,8 @@ public class SptLogger : ISptLogger, IDisposable Environment.CurrentManagedThreadId, Thread.CurrentThread.Name, data, - ex) + ex + ) ); } @@ -151,7 +159,8 @@ public class SptLogger : ISptLogger, IDisposable Thread.CurrentThread.Name, data, ex, - LogTextColor.Gray) + LogTextColor.Gray + ) ); } @@ -167,7 +176,8 @@ public class SptLogger : ISptLogger, IDisposable data, ex, LogTextColor.Black, - LogBackgroundColor.Red) + LogBackgroundColor.Red + ) ); } @@ -189,7 +199,8 @@ public class SptLogger : ISptLogger, IDisposable data, ex, textColor, - backgroundColor) + backgroundColor + ) ); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerConfiguration.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerConfiguration.cs index d0815aa5..098e1aab 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerConfiguration.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerConfiguration.cs @@ -8,77 +8,41 @@ namespace SPTarkov.Server.Core.Utils.Logger; public class SptLoggerConfiguration { [JsonPropertyName("loggers")] - public List Loggers - { - get; - set; - } + public List Loggers { get; set; } [JsonPropertyName("poolingTimeMs")] - public uint PoolingTimeMs - { - get; - set; - } = 500; + public uint PoolingTimeMs { get; set; } = 500; } public abstract class BaseSptLoggerReference { [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LoggerType Type - { - get; - set; - } + public LoggerType Type { get; set; } [JsonPropertyName("filters")] - public List Filters - { - get; - set; - } + public List Filters { get; set; } [JsonPropertyName("logLevel")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LogLevel LogLevel - { - get; - set; - } + public LogLevel LogLevel { get; set; } [JsonPropertyName("format")] - public string Format - { - get; - set; - } + public string Format { get; set; } } public class SptLoggerFilter { [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public SptLoggerFilterType Type - { - get; - set; - } + public SptLoggerFilterType Type { get; set; } [JsonPropertyName("name")] - public string Name - { - get; - set; - } + public string Name { get; set; } [JsonPropertyName("matchingType")] [JsonConverter(typeof(JsonStringEnumConverter))] - public MatchingType MatchingType - { - get; - set; - } + public MatchingType MatchingType { get; set; } protected bool Equals(SptLoggerFilter other) { @@ -102,32 +66,25 @@ public class SptLoggerFilter return false; } - return Equals((SptLoggerFilter) obj); + return Equals((SptLoggerFilter)obj); } public override int GetHashCode() { - return HashCode.Combine((int) Type, Name, (int) MatchingType); + return HashCode.Combine((int)Type, Name, (int)MatchingType); } } public class FileSptLoggerReference : BaseSptLoggerReference { [JsonPropertyName("filePath")] - public string FilePath - { - get; - set; - } + public string FilePath { get; set; } [JsonPropertyName("filePattern")] - public string FilePattern - { - get; - set; - } + public string FilePattern { get; set; } private int _maxFileSizeMb; + [JsonPropertyName("maxFileSizeMB")] public int MaxFileSizeMb { @@ -143,6 +100,7 @@ public class FileSptLoggerReference : BaseSptLoggerReference } private int _maxRollingFiles; + [JsonPropertyName("maxRollingFiles")] public int MaxRollingFiles { @@ -158,27 +116,24 @@ public class FileSptLoggerReference : BaseSptLoggerReference } } -public class ConsoleSptLoggerReference : BaseSptLoggerReference -{ -} +public class ConsoleSptLoggerReference : BaseSptLoggerReference { } public enum LoggerType { File, - Console + Console, } - public enum MatchingType { Literal, - Regex + Regex, } public enum SptLoggerFilterType { Exclude, - Include + Include, } public static class SptLoggerFilterExtensions @@ -199,7 +154,8 @@ public static class SptLoggerFilterExtensions if (!_cachedRegexes.TryGetValue(filter, out var regex)) { regex = new Regex(filter.Name); - while(!_cachedRegexes.TryAdd(filter, regex)); + while (!_cachedRegexes.TryAdd(filter, regex)) + ; } if (!regex.IsMatch(message.Logger)) @@ -207,7 +163,6 @@ public static class SptLoggerFilterExtensions return false; } break; - } return true; diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerQueueManager.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerQueueManager.cs index d2b91a52..0865b0cb 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerQueueManager.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLoggerQueueManager.cs @@ -5,7 +5,8 @@ namespace SPTarkov.Server.Core.Utils.Logger; [Injectable(InjectionType.Singleton)] public class SptLoggerQueueManager(IEnumerable logHandlers) { - private readonly Dictionary> _resolvedMessageLoggerTypes = new(); + private readonly Dictionary> _resolvedMessageLoggerTypes = + new(); private readonly Lock _resolvedMessageLoggerTypesLock = new(); private Thread? _loggerTask; private readonly Lock LoggerTaskLock = new(); @@ -50,7 +51,7 @@ public class SptLoggerQueueManager(IEnumerable logHandlers) } } - Thread.Sleep((int) _config.PoolingTimeMs); + Thread.Sleep((int)_config.PoolingTimeMs); } lock (_messageQueueLock) @@ -73,23 +74,29 @@ public class SptLoggerQueueManager(IEnumerable logHandlers) { if (!_resolvedMessageLoggerTypes.TryGetValue(message.Logger, out messageLoggers)) { - messageLoggers = _config.Loggers.Where(logger => - { - var excludeFilters = logger.Filters?.Where(filter => filter.Type == SptLoggerFilterType.Exclude); - var includeFilters = logger.Filters?.Where(filter => filter.Type == SptLoggerFilterType.Include); - var passed = true; - if (excludeFilters?.Any() ?? false) + messageLoggers = _config + .Loggers.Where(logger => { - passed = !excludeFilters.Any(filter => filter.Match(message)); - } + var excludeFilters = logger.Filters?.Where(filter => + filter.Type == SptLoggerFilterType.Exclude + ); + var includeFilters = logger.Filters?.Where(filter => + filter.Type == SptLoggerFilterType.Include + ); + var passed = true; + if (excludeFilters?.Any() ?? false) + { + passed = !excludeFilters.Any(filter => filter.Match(message)); + } - if (includeFilters?.Any() ?? false) - { - passed = includeFilters.Any(filter => filter.Match(message)); - } + if (includeFilters?.Any() ?? false) + { + passed = includeFilters.Any(filter => filter.Match(message)); + } - return passed; - }).ToList(); + return passed; + }) + .ToList(); _resolvedMessageLoggerTypes.Add(message.Logger, messageLoggers); } } @@ -98,8 +105,10 @@ public class SptLoggerQueueManager(IEnumerable logHandlers) { messageLoggers.ForEach(logger => { - if (logger.LogLevel.CanLog(message.LogLevel) && - (_logHandlers?.TryGetValue(logger.Type, out var handler) ?? false)) + if ( + logger.LogLevel.CanLog(message.LogLevel) + && (_logHandlers?.TryGetValue(logger.Type, out var handler) ?? false) + ) { handler.Log(message, logger); } diff --git a/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs index b0437966..0772ef2d 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs @@ -43,7 +43,7 @@ public class MathUtil cumSumArray[i] = cumSumArray[i - 1] + values[i]; } - return [..cumSumArray]; + return [.. cumSumArray]; } /// diff --git a/Libraries/SPTarkov.Server.Core/Utils/RagfairOfferHolder.cs b/Libraries/SPTarkov.Server.Core/Utils/RagfairOfferHolder.cs index 84ef378f..de207230 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/RagfairOfferHolder.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/RagfairOfferHolder.cs @@ -76,10 +76,7 @@ public class RagfairOfferHolder( return null; } - var result = _offersById - .Where(x => offerIds.Contains(x.Key)) - .Select(x => x.Value) - .ToList(); + var result = _offersById.Where(x => offerIds.Contains(x.Key)).Select(x => x.Value).ToList(); return result; } @@ -151,7 +148,8 @@ public class RagfairOfferHolder( !string.IsNullOrEmpty(itemTpl) && !(sellerIsTrader || _profileHelper.IsPlayer(sellerId)) && _offersByTemplate.TryGetValue(itemTpl, out var offers) - && offers?.Count >= _ragfairServerHelper.GetOfferCountByBaseType(itemSoldTemplate.Value.Parent) + && offers?.Count + >= _ragfairServerHelper.GetOfferCountByBaseType(itemSoldTemplate.Value.Parent) ) { // If it is an NPC PMC offer AND we have already reached the maximum amount of possible offers @@ -182,7 +180,9 @@ public class RagfairOfferHolder( { if (!_offersById.TryGetValue(offerId, out var offer)) { - _logger.Warning(_localisationService.GetText("ragfair-unable_to_remove_offer_doesnt_exist", offerId)); + _logger.Warning( + _localisationService.GetText("ragfair-unable_to_remove_offer_doesnt_exist", offerId) + ); return; } @@ -290,7 +290,6 @@ public class RagfairOfferHolder( _logger.Error($"Unable to add offer: {offerId} to _offersByTrader"); return false; - } /// @@ -352,7 +351,9 @@ public class RagfairOfferHolder( if (offer.Items?.Count == 0) { - _logger.Error($"Unable to process expired offer: {expiredOfferId}, it has no items"); + _logger.Error( + $"Unable to process expired offer: {expiredOfferId}, it has no items" + ); continue; } @@ -384,7 +385,10 @@ public class RagfairOfferHolder( { foreach (var offer in GetOffers()) { - if (_expiredOfferIds.Contains(offer.Id) || _ragfairServerHelper.IsTrader(offer.User.Id)) + if ( + _expiredOfferIds.Contains(offer.Id) + || _ragfairServerHelper.IsTrader(offer.User.Id) + ) { // Already flagged or trader offer (handled separately), skip continue; @@ -394,7 +398,9 @@ public class RagfairOfferHolder( { if (!_expiredOfferIds.Add(offer.Id)) { - _logger.Warning($"Unable to add offer: {offer.Id} to expired offers as it already exists"); + _logger.Warning( + $"Unable to add offer: {offer.Id} to expired offers as it already exists" + ); } } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/RandomUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/RandomUtil.cs index 4643ba43..ca546f2f 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/RandomUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/RandomUtil.cs @@ -17,7 +17,8 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// public const int MaxSignificantDigits = 15; - private static readonly int DecimalPointRandomPrecisionMultiplier = (int) Math.Pow(10, DecimalPointRandomPrecision); + private static readonly int DecimalPointRandomPrecisionMultiplier = (int) + Math.Pow(10, DecimalPointRandomPrecision); public readonly Random Random = new(); /// @@ -46,11 +47,11 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// A random floating-point number between `min` (inclusive) and `max` (exclusive). public double GetDouble(double min, double max) { - var realMin = (long) (min * DecimalPointRandomPrecisionMultiplier); - var realMax = (long) (max * DecimalPointRandomPrecisionMultiplier); + var realMin = (long)(min * DecimalPointRandomPrecisionMultiplier); + var realMax = (long)(max * DecimalPointRandomPrecisionMultiplier); return Math.Round( - Random.NextInt64(realMin, realMax) / (double) DecimalPointRandomPrecisionMultiplier, + Random.NextInt64(realMin, realMax) / (double)DecimalPointRandomPrecisionMultiplier, DecimalPointRandomPrecision ); } @@ -143,7 +144,8 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// Type of key /// Type of Value /// A random TKey representing one of the keys of the dictionary. - public TKey GetKey(Dictionary dictionary) where TKey : notnull + public TKey GetKey(Dictionary dictionary) + where TKey : notnull { return GetCollectionValue(dictionary.Keys); } @@ -155,7 +157,8 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// Type of key /// Type of Value /// A random TVal representing one of the values of the dictionary. - public TVal GetVal(Dictionary dictionary) where TKey : notnull + public TVal GetVal(Dictionary dictionary) + where TKey : notnull { return GetCollectionValue(dictionary.Values); } @@ -174,7 +177,8 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// public double GetNormallyDistributedRandomNumber(double mean, double sigma, int attempt = 0) { - double u, v; + double u, + v; do { @@ -216,9 +220,7 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) } // Return low directly when low and high are equal - return low == high - ? low - : Random.Next(low, (int) high); + return low == high ? low : Random.Next(low, (int)high); } /// @@ -235,19 +237,21 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) { if (!double.IsFinite(val1) || !double.IsFinite(val2)) { - throw new ArgumentException("RandNum() parameters 'value1' and 'value2' must be finite numbers."); + throw new ArgumentException( + "RandNum() parameters 'value1' and 'value2' must be finite numbers." + ); } // Determine the range var min = Math.Min(val1, val2); var max = Math.Max(val1, val2); - var realPrecision = (long) Math.Pow(10, precision); + var realPrecision = (long)Math.Pow(10, precision); - var minInt = (long) (min * realPrecision); - var maxInt = (long) (max * realPrecision); + var minInt = (long)(min * realPrecision); + var maxInt = (long)(max * realPrecision); - return Math.Round(Random.NextInt64(minInt, maxInt) / (double) realPrecision, precision); + return Math.Round(Random.NextInt64(minInt, maxInt) / (double)realPrecision, precision); } /// @@ -258,7 +262,11 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// Whether to draw with replacement. Defaults to true. /// The type of elements in the list. /// A List containing the drawn elements. - public List DrawRandomFromList(List originalList, int count = 1, bool replacement = true) + public List DrawRandomFromList( + List originalList, + int count = 1, + bool replacement = true + ) { var list = originalList; var drawCount = count; @@ -299,7 +307,12 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// The type of elements in keys /// The type of elements in values /// A list of randomly drawn keys from the dictionary. - public List DrawRandomFromDict(Dictionary dict, int count = 1, bool replacement = true) where TKey : notnull + public List DrawRandomFromDict( + Dictionary dict, + int count = 1, + bool replacement = true + ) + where TKey : notnull { var keys = dict.Keys.ToList(); var randomKeys = DrawRandomFromList(keys, count, replacement); @@ -331,7 +344,9 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) if (max < min) { - _logger.Error($"Invalid argument, Bounded random number generation max is smaller than min({max} < {min}"); + _logger.Error( + $"Invalid argument, Bounded random number generation max is smaller than min({max} < {min}" + ); return -1; } @@ -359,7 +374,6 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) _logger.Warning($"min-> {min}; max-> {max}; shift-> {shift}"); } - var biasedMin = shift >= 0 ? min - shift : min; var biasedMax = shift < 0 ? max + shift : max; @@ -404,7 +418,10 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) currentIndex--; // Swap it with the current element. - (originalList[currentIndex], originalList[randomIndex]) = (originalList[randomIndex], originalList[currentIndex]); + (originalList[currentIndex], originalList[randomIndex]) = ( + originalList[randomIndex], + originalList[currentIndex] + ); } return originalList; @@ -429,9 +446,9 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) /// The number of decimal places, or 0 if none exist. public int GetNumberPrecision(double num) { - var preciseNum = (decimal) num; + var preciseNum = (decimal)num; var factor = 0; - while ((double) (preciseNum % 1) > double.Epsilon) + while ((double)(preciseNum % 1) > double.Epsilon) { preciseNum *= 10M; factor++; diff --git a/Libraries/SPTarkov.Server.Core/Utils/TimeUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/TimeUtil.cs index 85625535..513c9fc6 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/TimeUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/TimeUtil.cs @@ -79,7 +79,7 @@ public class TimeUtil : GetDateTimeNow(); var startOfDay = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); - return ((DateTimeOffset) startOfDay).ToUnixTimeMilliseconds(); + return ((DateTimeOffset)startOfDay).ToUnixTimeMilliseconds(); } /// @@ -138,11 +138,12 @@ public class TimeUtil public long GetTimeStampOfNextHour() { var now = DateTime.UtcNow; - var timeUntilNextHour = TimeSpan.FromMinutes(60 - now.Minute) + var timeUntilNextHour = TimeSpan + .FromMinutes(60 - now.Minute) .Subtract(TimeSpan.FromSeconds(now.Second)) .Subtract(TimeSpan.FromMilliseconds(now.Millisecond)); - var time = ((DateTimeOffset) now.Add(timeUntilNextHour)).ToUnixTimeSeconds(); + var time = ((DateTimeOffset)now.Add(timeUntilNextHour)).ToUnixTimeSeconds(); return time; } @@ -167,7 +168,7 @@ public class TimeUtil // Create a new DateTime with the last full hour, 0 minutes, and 0 seconds var lastFullHour = new DateTime(now.Year, now.Month, now.Day, hours, 0, 0); - return ((DateTimeOffset) lastFullHour).ToUnixTimeSeconds(); + return ((DateTimeOffset)lastFullHour).ToUnixTimeSeconds(); } /// diff --git a/Libraries/SPTarkov.Server.Core/Utils/TimerUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/TimerUtil.cs index a8697dd6..454b27cb 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/TimerUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/TimerUtil.cs @@ -23,7 +23,7 @@ public class TimerUtil { "ns" => timePassed.Nanoseconds, "ms" => timePassed.Milliseconds, - _ => timePassed.Seconds + _ => timePassed.Seconds, }; } } diff --git a/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs b/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs index fcf6dc1a..9940e1d4 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs @@ -23,7 +23,7 @@ public class WatermarkLocale "", localisationService.GetText("watermark-free_of_charge"), localisationService.GetText("watermark-paid_scammed"), - localisationService.GetText("watermark-commercial_use_prohibited") + localisationService.GetText("watermark-commercial_use_prohibited"), ]; warning = [ @@ -34,7 +34,7 @@ public class WatermarkLocale $"{localisationService.GetText("watermark-report_issues_to")}:", localisationService.GetText("watermark-issue_tracker_url"), "", - localisationService.GetText("watermark-use_at_own_risk") + localisationService.GetText("watermark-use_at_own_risk"), ]; modding = [ @@ -42,7 +42,7 @@ public class WatermarkLocale localisationService.GetText("watermark-modding_disabled"), "", localisationService.GetText("watermark-not_an_issue"), - localisationService.GetText("watermark-do_not_report") + localisationService.GetText("watermark-do_not_report"), ]; } @@ -98,8 +98,7 @@ public class Watermark : IOnLoad versionLabel = $"{sptConfig.ProjectName} {versionTag} {sptConfig.CompatibleTarkovVersion}"; text = [versionLabel]; - text = [..text, ..description]; - + text = [.. text, .. description]; if (ProgramStatics.DEBUG()) { @@ -111,7 +110,6 @@ public class Watermark : IOnLoad text.AddRange(modding); } - if (sptConfig.CustomWatermarkLocaleKeys?.Count > 0) { foreach (var key in sptConfig.CustomWatermarkLocaleKeys) @@ -134,7 +132,8 @@ public class Watermark : IOnLoad public string GetVersionTag(bool withEftVersion = false) { var sptVersion = ProgramStatics.SPT_VERSION() ?? sptConfig.SptVersion; - var versionTag = /*ProgramStatics.DEBUG*/ $"{sptVersion} - {_localisationService.GetText("bleeding_edge_build")}"; + var versionTag = /*ProgramStatics.DEBUG*/ + $"{sptVersion} - {_localisationService.GetText("bleeding_edge_build")}"; if (withEftVersion) { @@ -153,7 +152,9 @@ public class Watermark : IOnLoad public string GetInGameVersionLabel() { var sptVersion = ProgramStatics.SPT_VERSION(); - var versionTag = ProgramStatics.DEBUG() ? $"{sptVersion} - BLEEDINGEDGE {ProgramStatics.COMMIT()?.Substring(0, 6) ?? ""}" : $"{sptVersion} - {ProgramStatics.COMMIT()?.Substring(0, 6) ?? ""}"; + var versionTag = ProgramStatics.DEBUG() + ? $"{sptVersion} - BLEEDINGEDGE {ProgramStatics.COMMIT()?.Substring(0, 6) ?? ""}" + : $"{sptVersion} - {ProgramStatics.COMMIT()?.Substring(0, 6) ?? ""}"; return $"{sptConfig.ProjectName} {versionTag}"; } diff --git a/Patches/Ceciler.Virtualizer/Ceciler.Virtualizer.csproj b/Patches/Ceciler.Virtualizer/Ceciler.Virtualizer.csproj index e90359ce..a54098c9 100644 --- a/Patches/Ceciler.Virtualizer/Ceciler.Virtualizer.csproj +++ b/Patches/Ceciler.Virtualizer/Ceciler.Virtualizer.csproj @@ -1,21 +1,17 @@  - - - net9.0 - enable - enable - - - - - ..\..\Ceciler\Ceciler.Interfaces.dll - - - - - - all - - - + + net9.0 + enable + enable + + + + ..\..\Ceciler\Ceciler.Interfaces.dll + + + + + all + + diff --git a/Patches/Ceciler.Virtualizer/VirtualizerPatch.cs b/Patches/Ceciler.Virtualizer/VirtualizerPatch.cs index b48d045b..cc53fefb 100644 --- a/Patches/Ceciler.Virtualizer/VirtualizerPatch.cs +++ b/Patches/Ceciler.Virtualizer/VirtualizerPatch.cs @@ -21,7 +21,6 @@ public class VirtualizerPatch : IPatcher continue; } - if (typeDefinitionMethod.IsFinal && typeDefinitionMethod.IsVirtual) { typeDefinitionMethod.IsFinal = false; @@ -59,27 +58,25 @@ public class VirtualizerPatch : IPatcher } #if DEBUG - var writerParams = new WriterParameters() - { - WriteSymbols = true - }; + var writerParams = new WriterParameters() { WriteSymbols = true }; assembly.Write(writerParams); #else assembly.Write(); #endif - } static bool MethodIsSerializationCallback(MethodDefinition method) { return ContainsAttribute(method.CustomAttributes, "OnSerializingAttribute") - || ContainsAttribute(method.CustomAttributes, "OnSerializedAttribute") - || ContainsAttribute(method.CustomAttributes, "OnDeserializingAttribute") - || ContainsAttribute(method.CustomAttributes, "OnDeserializedAttribute"); + || ContainsAttribute(method.CustomAttributes, "OnSerializedAttribute") + || ContainsAttribute(method.CustomAttributes, "OnDeserializingAttribute") + || ContainsAttribute(method.CustomAttributes, "OnDeserializedAttribute"); } - public static bool ContainsAttribute(IEnumerable attributes, string attributeName) => - attributes.Any(attribute => attribute.Constructor.DeclaringType.Name == attributeName); + public static bool ContainsAttribute( + IEnumerable attributes, + string attributeName + ) => attributes.Any(attribute => attribute.Constructor.DeclaringType.Name == attributeName); public string Name { diff --git a/SPTarkov.Server/Logger/SptLoggerExtensions.cs b/SPTarkov.Server/Logger/SptLoggerExtensions.cs index 2f0f629c..063ca5d2 100644 --- a/SPTarkov.Server/Logger/SptLoggerExtensions.cs +++ b/SPTarkov.Server/Logger/SptLoggerExtensions.cs @@ -5,15 +5,16 @@ namespace SPTarkov.Server.Logger; public static class SptLoggerExtensions { - public static IHostBuilder UseSptLogger(this IHostBuilder builder) { ArgumentNullException.ThrowIfNull(builder); - builder.ConfigureServices((_, collection) => - { - collection.AddSptLogger(); - }); + builder.ConfigureServices( + (_, collection) => + { + collection.AddSptLogger(); + } + ); return builder; } @@ -22,10 +23,12 @@ public static class SptLoggerExtensions { ArgumentNullException.ThrowIfNull(collection); - collection.AddSingleton(sp => - new SptLoggerProvider(sp.GetService(), sp.GetService(), sp.GetService())); + collection.AddSingleton(sp => new SptLoggerProvider( + sp.GetService(), + sp.GetService(), + sp.GetService() + )); return collection; } - } diff --git a/SPTarkov.Server/Logger/SptLoggerProvider.cs b/SPTarkov.Server/Logger/SptLoggerProvider.cs index 3864764d..a89d8bce 100644 --- a/SPTarkov.Server/Logger/SptLoggerProvider.cs +++ b/SPTarkov.Server/Logger/SptLoggerProvider.cs @@ -5,13 +5,15 @@ using SPTarkov.Server.Core.Utils.Logger; namespace SPTarkov.Server.Logger; [Injectable] -public class SptLoggerProvider(JsonUtil jsonUtil, FileUtil fileUtil, SptLoggerQueueManager queueManager) : ILoggerProvider, ILoggerFactory +public class SptLoggerProvider( + JsonUtil jsonUtil, + FileUtil fileUtil, + SptLoggerQueueManager queueManager +) : ILoggerProvider, ILoggerFactory { private List loggerProviders = new(); - public void Dispose() - { - } + public void Dispose() { } public void AddProvider(ILoggerProvider provider) { diff --git a/SPTarkov.Server/Logger/SptLoggerWrapper.cs b/SPTarkov.Server/Logger/SptLoggerWrapper.cs index ed3d8d98..43c19fa6 100644 --- a/SPTarkov.Server/Logger/SptLoggerWrapper.cs +++ b/SPTarkov.Server/Logger/SptLoggerWrapper.cs @@ -8,13 +8,19 @@ public class SptLoggerWrapper : ILogger { private readonly SptLogger _logger; - public SptLoggerWrapper(string category, JsonUtil jsonUtil, FileUtil fileUtil, SptLoggerQueueManager queueManager) + public SptLoggerWrapper( + string category, + JsonUtil jsonUtil, + FileUtil fileUtil, + SptLoggerQueueManager queueManager + ) { _logger = new SptLogger(fileUtil, jsonUtil, queueManager); _logger.OverrideCategory(category); } - public IDisposable? BeginScope(TState state) where TState : notnull + public IDisposable? BeginScope(TState state) + where TState : notnull { return null; } @@ -24,7 +30,13 @@ public class SptLoggerWrapper : ILogger return _logger.IsLogEnabled(ConvertLogLevel(logLevel)); } - public void Log(Microsoft.Extensions.Logging.LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + public void Log( + Microsoft.Extensions.Logging.LogLevel logLevel, + EventId eventId, + TState state, + Exception? exception, + Func formatter + ) { var level = ConvertLogLevel(logLevel); switch (level) @@ -60,7 +72,7 @@ public class SptLoggerWrapper : ILogger LogLevel.Warn => Microsoft.Extensions.Logging.LogLevel.Warning, LogLevel.Error => Microsoft.Extensions.Logging.LogLevel.Error, LogLevel.Fatal => Microsoft.Extensions.Logging.LogLevel.Critical, - _ => throw new ArgumentOutOfRangeException(nameof(level), level, null) + _ => throw new ArgumentOutOfRangeException(nameof(level), level, null), }; } @@ -74,7 +86,7 @@ public class SptLoggerWrapper : ILogger Microsoft.Extensions.Logging.LogLevel.Warning => LogLevel.Warn, Microsoft.Extensions.Logging.LogLevel.Error => LogLevel.Error, Microsoft.Extensions.Logging.LogLevel.Critical => LogLevel.Fatal, - _ => throw new ArgumentOutOfRangeException(nameof(level), level, null) + _ => throw new ArgumentOutOfRangeException(nameof(level), level, null), }; } } diff --git a/SPTarkov.Server/Modding/ModDllLoader.cs b/SPTarkov.Server/Modding/ModDllLoader.cs index 556fa521..71e02ad0 100644 --- a/SPTarkov.Server/Modding/ModDllLoader.cs +++ b/SPTarkov.Server/Modding/ModDllLoader.cs @@ -53,18 +53,18 @@ public class ModDllLoader /// SptMod private static SptMod LoadMod(string path) { - var result = new SptMod - { - Directory = path, - Assemblies = [] - }; + var result = new SptMod { Directory = path, Assemblies = [] }; var assemblyCount = 0; foreach (var file in new DirectoryInfo(path).GetFiles()) // Only search top level { if (string.Equals(file.Extension, ".dll", StringComparison.OrdinalIgnoreCase)) { assemblyCount++; - result.Assemblies.Add(AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetFullPath(file.FullName))); + result.Assemblies.Add( + AssemblyLoadContext.Default.LoadFromAssemblyPath( + Path.GetFullPath(file.FullName) + ) + ); } } @@ -77,14 +77,22 @@ public class ModDllLoader if (result.ModMetadata == null) { - throw new Exception($"Failed to load mod metadata for: {Path.GetFullPath(path)} \ndid you override `AbstractModMetadata`?"); + throw new Exception( + $"Failed to load mod metadata for: {Path.GetFullPath(path)} \ndid you override `AbstractModMetadata`?" + ); } - if (result.ModMetadata?.Name == null || result.ModMetadata?.Author == null || - result.ModMetadata?.Version == null || result.ModMetadata?.Licence == null || - result.ModMetadata?.SptVersion == null) + if ( + result.ModMetadata?.Name == null + || result.ModMetadata?.Author == null + || result.ModMetadata?.Version == null + || result.ModMetadata?.Licence == null + || result.ModMetadata?.SptVersion == null + ) { - throw new Exception($"The mod metadata for: {Path.GetFullPath(path)} is missing one of these properties: name, author, licence, version or sptVersion"); + throw new Exception( + $"The mod metadata for: {Path.GetFullPath(path)} is missing one of these properties: name, author, licence, version or sptVersion" + ); } return result; @@ -105,11 +113,15 @@ public class ModDllLoader { foreach (var module in allAsmModules) { - var modMetadata = module.GetTypes().SingleOrDefault(t => typeof(AbstractModMetadata).IsAssignableFrom(t)); + var modMetadata = module + .GetTypes() + .SingleOrDefault(t => typeof(AbstractModMetadata).IsAssignableFrom(t)); if (result != null && modMetadata != null) { - throw new Exception($"Duplicate mod metadata found for mod at path: {Path.GetFullPath(path)}"); + throw new Exception( + $"Duplicate mod metadata found for mod at path: {Path.GetFullPath(path)}" + ); } if (modMetadata != null) diff --git a/SPTarkov.Server/Modding/ModLoadOrder.cs b/SPTarkov.Server/Modding/ModLoadOrder.cs index 22a679db..44e70912 100644 --- a/SPTarkov.Server/Modding/ModLoadOrder.cs +++ b/SPTarkov.Server/Modding/ModLoadOrder.cs @@ -9,7 +9,9 @@ public class ModLoadOrder(ICloner cloner) protected Dictionary mods = new(); protected Dictionary modsAvailable = new(); - public Dictionary SetModList(Dictionary mods) + public Dictionary SetModList( + Dictionary mods + ) { this.mods = mods; modsAvailable = cloner.Clone(this.mods); @@ -36,7 +38,7 @@ public class ModLoadOrder(ICloner cloner) public List GetLoadOrder() { - return [..loadOrder.Keys]; + return [.. loadOrder.Keys]; } public HashSet GetModsOnLoadBefore(string mod) diff --git a/SPTarkov.Server/Modding/ModValidator.cs b/SPTarkov.Server/Modding/ModValidator.cs index 485b9a8c..09da196a 100644 --- a/SPTarkov.Server/Modding/ModValidator.cs +++ b/SPTarkov.Server/Modding/ModValidator.cs @@ -16,7 +16,8 @@ public class ModValidator( ISemVer semVer, ModLoadOrder modLoadOrder, JsonUtil jsonUtil, - FileUtil fileUtil) + FileUtil fileUtil +) { protected readonly string basepath = "user/mods/"; protected readonly string modOrderPath = "user/mods/order.json"; @@ -32,7 +33,9 @@ public class ModValidator( { ValidateMods(mods); - var sortedModLoadOrder = modLoadOrder.SetModList(imported.ToDictionary(m => m.Key, m => m.Value.ModMetadata)); + var sortedModLoadOrder = modLoadOrder.SetModList( + imported.ToDictionary(m => m.Key, m => m.Value.ModMetadata) + ); var finalList = new List(); foreach (var orderMod in SortModsLoadOrder()) { @@ -65,10 +68,7 @@ public class ModValidator( logger.Info(localisationService.GetText("modloader-mod_order_missing")); // Write file with empty order array to disk - fileUtil.WriteFile(modOrderPath, jsonUtil.Serialize(new ModOrder - { - Order = [] - })); + fileUtil.WriteFile(modOrderPath, jsonUtil.Serialize(new ModOrder { Order = [] })); } else { @@ -138,7 +138,9 @@ public class ModValidator( { foreach (var missingMod in missingFromOrderJSON.Keys) { - logger.Debug(localisationService.GetText("modloader-mod_order_missing_from_json", missingMod)); + logger.Debug( + localisationService.GetText("modloader-mod_order_missing_from_json", missingMod) + ); } } @@ -147,10 +149,7 @@ public class ModValidator( { if (ShouldSkipMod(mod.ModMetadata)) { - logger.Warning(localisationService.GetText("modloader-skipped_mod", new - { - mod - })); + logger.Warning(localisationService.GetText("modloader-skipped_mod", new { mod })); continue; } @@ -187,7 +186,7 @@ public class ModValidator( foreach (var mod in modPackageData.Values) { var name = $"{mod.Author}-{mod.Name}"; - groupedMods.Add(name, [..groupedMods.GetValueOrDefault(name) ?? [], mod]); + groupedMods.Add(name, [.. groupedMods.GetValueOrDefault(name) ?? [], mod]); // if there's more than one entry for a given mod it means there's at least 2 mods with the same author and name trying to load. if (groupedMods[name].Count > 1 && !skippedMods.Contains(name)) @@ -213,7 +212,6 @@ public class ModValidator( return mods.Where(ValidMod).ToList(); } - /// /// Is the passed in mod compatible with the running server version /// @@ -227,7 +225,9 @@ public class ModValidator( // Error and prevent loading if sptVersion property is not a valid semver string if (!(semVer.IsValid(mod.SptVersion) || semVer.IsValidRange(mod.SptVersion))) { - logger.Error(localisationService.GetText("modloader-invalid_sptversion_field", modName)); + logger.Error( + localisationService.GetText("modloader-invalid_sptversion_field", modName) + ); return false; } @@ -235,12 +235,15 @@ public class ModValidator( if (!semVer.Satisfies(sptVersion, mod.SptVersion)) { logger.Error( - localisationService.GetText("modloader-outdated_sptversion_field", new - { - modName, - modVersion = mod.Version, - desiredSptVersion = mod.SptVersion - }) + localisationService.GetText( + "modloader-outdated_sptversion_field", + new + { + modName, + modVersion = mod.Version, + desiredSptVersion = mod.SptVersion, + } + ) ); return false; @@ -274,12 +277,15 @@ public class ModValidator( // Add mod to imported list imported.Add(mod.ModMetadata.Name, mod); logger.Info( - localisationService.GetText("modloader-loaded_mod", new - { - name = mod.ModMetadata.Name, - version = mod.ModMetadata.Version, - author = mod.ModMetadata.Author - }) + localisationService.GetText( + "modloader-loaded_mod", + new + { + name = mod.ModMetadata.Name, + version = mod.ModMetadata.Version, + author = mod.ModMetadata.Author, + } + ) ); } @@ -293,7 +299,10 @@ public class ModValidator( return skippedMods.Contains($"{pkg.Author}-{pkg.Name}"); } - protected bool AreModDependenciesFulfilled(AbstractModMetadata pkg, Dictionary loadedMods) + protected bool AreModDependenciesFulfilled( + AbstractModMetadata pkg, + Dictionary loadedMods + ) { if (pkg.ModDependencies == null) { @@ -309,11 +318,10 @@ public class ModValidator( if (!loadedMods.ContainsKey(modDependency)) { logger.Error( - localisationService.GetText("modloader-missing_dependency", new - { - mod = modName, - modDependency - }) + localisationService.GetText( + "modloader-missing_dependency", + new { mod = modName, modDependency } + ) ); return false; } @@ -321,13 +329,16 @@ public class ModValidator( if (!semVer.Satisfies(loadedMods[modDependency].Version, requiredVersion)) { logger.Error( - localisationService.GetText("modloader-outdated_dependency", new - { - mod = modName, - modDependency, - currentVersion = loadedMods[modDependency].Version, - requiredVersion - }) + localisationService.GetText( + "modloader-outdated_dependency", + new + { + mod = modName, + modDependency, + currentVersion = loadedMods[modDependency].Version, + requiredVersion, + } + ) ); return false; } @@ -336,7 +347,10 @@ public class ModValidator( return true; } - protected bool IsModCompatible(AbstractModMetadata mod, Dictionary loadedMods) + protected bool IsModCompatible( + AbstractModMetadata mod, + Dictionary loadedMods + ) { var incompatbileModsList = mod.Incompatibilities; if (incompatbileModsList == null) @@ -350,12 +364,15 @@ public class ModValidator( if (loadedMods.ContainsKey(incompatibleModName)) { logger.Error( - localisationService.GetText("modloader-incompatible_mod_found", new - { - author = mod.Author, - name = mod.Name, - incompatibleModName - }) + localisationService.GetText( + "modloader-incompatible_mod_found", + new + { + author = mod.Author, + name = mod.Name, + incompatibleModName, + } + ) ); return false; } @@ -374,7 +391,11 @@ public class ModValidator( var modName = mod.ModMetadata.Name; var modPath = GetModPath(modName); - var modIsCalledBepinEx = string.Equals(modName, "bepinex", StringComparison.OrdinalIgnoreCase); + var modIsCalledBepinEx = string.Equals( + modName, + "bepinex", + StringComparison.OrdinalIgnoreCase + ); var modIsCalledUser = string.Equals(modName, "user", StringComparison.OrdinalIgnoreCase); var modIsCalledSrc = string.Equals(modName, "src", StringComparison.OrdinalIgnoreCase); var modIsCalledDb = string.Equals(modName, "db", StringComparison.OrdinalIgnoreCase); @@ -406,7 +427,9 @@ public class ModValidator( if (!semVer.IsValid(config.Version)) { - logger.Error(localisationService.GetText("modloader-invalid_version_property", modName)); + logger.Error( + localisationService.GetText("modloader-invalid_version_property", modName) + ); issue = true; } diff --git a/SPTarkov.Server/Program.cs b/SPTarkov.Server/Program.cs index 019d033c..e4a84ef5 100644 --- a/SPTarkov.Server/Program.cs +++ b/SPTarkov.Server/Program.cs @@ -20,7 +20,9 @@ public static class Program // Some users don't know how to create a shortcut... if (!IsRunFromInstallationFolder()) { - Console.WriteLine("You have not created a shortcut properly. Please hold alt when dragging to create a shortcut."); + Console.WriteLine( + "You have not created a shortcut properly. Please hold alt when dragging to create a shortcut." + ); await Task.Delay(-1); return; } @@ -47,7 +49,9 @@ public static class Program // update the loadedMods list with our validated sorted mods loadedMods = sortedLoadedMods; - diHandler.AddInjectableTypesFromAssemblies(sortedLoadedMods.SelectMany(a => a.Assemblies)); + diHandler.AddInjectableTypesFromAssemblies( + sortedLoadedMods.SelectMany(a => a.Assemblies) + ); } diHandler.InjectAll(); @@ -65,9 +69,10 @@ public static class Program { // Convert to relative path string relativeModPath = Path.GetRelativePath( - Directory.GetCurrentDirectory(), - mod.Directory - ).Replace('\\', '/'); + Directory.GetCurrentDirectory(), + mod.Directory + ) + .Replace('\\', '/'); bundleLoader.AddBundles(relativeModPath); } @@ -85,7 +90,8 @@ public static class Program await app.InitializeAsync(); // Run garbage collection now the server is ready to start - GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + GCSettings.LargeObjectHeapCompactionMode = + GCLargeObjectHeapCompactionMode.CompactOnce; GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true, true); await app.StartAsync(); @@ -128,8 +134,8 @@ public static class Program diHandler.AddInjectableTypesFromAssembly(typeof(App).Assembly); diHandler.InjectAll(); // register the mod validator components - var provider = builder.Services - .AddScoped(typeof(ISptLogger), typeof(SptLogger)) + var provider = builder + .Services.AddScoped(typeof(ISptLogger), typeof(SptLogger)) .AddScoped(typeof(ISemVer), typeof(SemanticVersioningSemVer)) .AddSingleton() .AddSingleton() @@ -165,10 +171,12 @@ public static class Program private static bool IsRunFromInstallationFolder() { - var dirFiles = Directory.GetFiles(Directory.GetCurrentDirectory()); + var dirFiles = Directory.GetFiles(Directory.GetCurrentDirectory()); // This file is guaranteed to exist if ran from the correct location, even if the game does not exist here. - return dirFiles.Any(dirFile => dirFile.EndsWith("sptLogger.json") || dirFile.EndsWith("sptLogger.Development.json")); + return dirFiles.Any(dirFile => + dirFile.EndsWith("sptLogger.json") || dirFile.EndsWith("sptLogger.Development.json") + ); } [DllImport("kernel32.dll", SetLastError = true)] diff --git a/SPTarkov.Server/SPTarkov.Server.csproj b/SPTarkov.Server/SPTarkov.Server.csproj index 0fd5bff5..d033e5ed 100644 --- a/SPTarkov.Server/SPTarkov.Server.csproj +++ b/SPTarkov.Server/SPTarkov.Server.csproj @@ -1,7 +1,5 @@ - - SPTarkov.Server Single Player Tarkov @@ -17,29 +15,27 @@ true false - SPTarkov.Server ..\Libraries\SPTarkov.Server.Assets\SPT_Data\images\icon.ico - SPTarkov.Server.Linux - - - + - Always @@ -52,9 +48,7 @@ Always - - diff --git a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.cs b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.cs index d6ee1563..59501f13 100644 --- a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.cs +++ b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.cs @@ -28,13 +28,13 @@ public class HideoutCraftQuestIdGenerator( "66140c4a9688754de10dac07", // Old event quest production "Documents with decrypted data" "661e6c26750e453380391f55", // Old event quest production "Documents with decrypted data" "660c2dbaa2a92e70cc074863", // Old event quest production "Decrypted flash drive" - "67093210d514d26f8408612b" // Old event quest production "TG-Vi-24 true vaccine" + "67093210d514d26f8408612b", // Old event quest production "TG-Vi-24 true vaccine" ]; private static readonly Dictionary _forcedQuestToProductionAssociations = new() { // KEY = PRODUCTION, VALUE = QUEST - { "63a571802116d261d2336cd1", "625d6ffaf7308432be1d44c5" } // Network Provider - Part 2 + { "63a571802116d261d2336cd1", "625d6ffaf7308432be1d44c5" }, // Network Provider - Part 2 }; private readonly Dictionary _questProductionMap = new(); @@ -50,10 +50,14 @@ public class HideoutCraftQuestIdGenerator( // Figure out our source and target directories var projectDir = Directory.GetParent("./").Parent.Parent.Parent.Parent.Parent; - const string productionPath = "Libraries\\SPTarkov.Server.Assets\\Assets\\database\\hideout\\production.json"; + const string productionPath = + "Libraries\\SPTarkov.Server.Assets\\Assets\\database\\hideout\\production.json"; var productionFilePath = Path.Combine(projectDir.FullName, productionPath); - var updatedProductionJson = _jsonUtil.Serialize(_databaseServer.GetTables().Hideout.Production, true); + var updatedProductionJson = _jsonUtil.Serialize( + _databaseServer.GetTables().Hideout.Production, + true + ); _fileUtil.WriteFile(productionFilePath, updatedProductionJson); } @@ -62,7 +66,9 @@ public class HideoutCraftQuestIdGenerator( { foreach (var (questId, quest) in _databaseServer.GetTables().Templates.Quests) { - var combinedRewards = CombineRewards(quest.Rewards).Where(x => x.Type == RewardType.ProductionScheme).ToList(); + var combinedRewards = CombineRewards(quest.Rewards) + .Where(x => x.Type == RewardType.ProductionScheme) + .ToList(); foreach (var reward in combinedRewards) { // Assume all productions only output a single item template @@ -70,7 +76,7 @@ public class HideoutCraftQuestIdGenerator( { QuestId = questId, ItemTemplate = reward.Items[0].Template, - Quantity = 0 + Quantity = 0, }; // Loop over root items only, ignore children @@ -79,8 +85,8 @@ public class HideoutCraftQuestIdGenerator( if (item.Template != output.ItemTemplate) { _logger.Error( - $"Production scheme has multiple output items. " + - $"{output.ItemTemplate} != {item.Template}" + $"Production scheme has multiple output items. " + + $"{output.ItemTemplate} != {item.Template}" ); continue; @@ -106,7 +112,9 @@ public class HideoutCraftQuestIdGenerator( } // Look for a 'quest completion' requirement - var questCompleteRequirements = production.Requirements.Where(req => req.Type == "QuestComplete").ToList(); + var questCompleteRequirements = production + .Requirements.Where(req => req.Type == "QuestComplete") + .ToList(); if (questCompleteRequirements.Count == 0) { // Production has no quest requirement @@ -115,14 +123,21 @@ public class HideoutCraftQuestIdGenerator( if (questCompleteRequirements.Count > 1) { - _logger.Error($"Error, production: {production.Id} contains multiple QuestComplete requirements"); + _logger.Error( + $"Error, production: {production.Id} contains multiple QuestComplete requirements" + ); // Production has no multiple quest requirements continue; } // Check for forced ids - if (_forcedQuestToProductionAssociations.TryGetValue(production.Id, out var associatedQuestIdToComplete)) + if ( + _forcedQuestToProductionAssociations.TryGetValue( + production.Id, + out var associatedQuestIdToComplete + ) + ) { // Found one, move to next production _logger.Success( @@ -134,13 +149,21 @@ public class HideoutCraftQuestIdGenerator( } // Try to find the quest that matches this production - var questProductionOutputs = _questProductionOutputList.Where(output => - output.ItemTemplate == production.EndProduct && output.Quantity == production.Count + var questProductionOutputs = _questProductionOutputList + .Where(output => + output.ItemTemplate == production.EndProduct + && output.Quantity == production.Count ) .ToList(); // Make sure we found valid data - if (!IsValidQuestProduction(production, questProductionOutputs, questCompleteRequirements[0])) + if ( + !IsValidQuestProduction( + production, + questProductionOutputs, + questCompleteRequirements[0] + ) + ) { continue; } @@ -154,8 +177,11 @@ public class HideoutCraftQuestIdGenerator( } } - private bool IsValidQuestProduction(HideoutProduction production, - List questProductionOutputs, Requirement questComplete) + private bool IsValidQuestProduction( + HideoutProduction production, + List questProductionOutputs, + Requirement questComplete + ) { // A lot of error handling for edge cases if (!questProductionOutputs.Any()) @@ -174,7 +200,10 @@ public class HideoutCraftQuestIdGenerator( return false; } - if (questComplete.QuestId is not null && questComplete.QuestId != questProductionOutputs[0].QuestId) + if ( + questComplete.QuestId is not null + && questComplete.QuestId != questProductionOutputs[0].QuestId + ) { _logger.Error( $"Multiple productions match quest.EndProduct {production.EndProduct} with quantity {production.Count}, existing quest: {questComplete.QuestId}" @@ -211,21 +240,9 @@ public class HideoutCraftQuestIdGenerator( public class QuestProductionOutput { - public string QuestId - { - get; - set; - } + public string QuestId { get; set; } - public string ItemTemplate - { - get; - set; - } + public string ItemTemplate { get; set; } - public double Quantity - { - get; - set; - } + public double Quantity { get; set; } } diff --git a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.csproj b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.csproj index 5eb50062..d56c02a6 100644 --- a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.csproj +++ b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGenerator.csproj @@ -1,19 +1,15 @@ - - - + true false enable Exe - - - - - + + + + - diff --git a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGeneratorLauncher.cs b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGeneratorLauncher.cs index 11942db5..62ad383c 100644 --- a/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGeneratorLauncher.cs +++ b/Tools/HideoutCraftQuestIdGenerator/HideoutCraftQuestIdGeneratorLauncher.cs @@ -12,7 +12,9 @@ public class HideoutCraftQuestIdGeneratorLauncher { var serviceCollection = new ServiceCollection(); var diHandler = new DependencyInjectionHandler(serviceCollection); - diHandler.AddInjectableTypesFromTypeAssembly(typeof(HideoutCraftQuestIdGeneratorLauncher)); + diHandler.AddInjectableTypesFromTypeAssembly( + typeof(HideoutCraftQuestIdGeneratorLauncher) + ); diHandler.AddInjectableTypesFromTypeAssembly(typeof(App)); diHandler.InjectAll(); var serviceProvider = serviceCollection.BuildServiceProvider(); diff --git a/Tools/HideoutCraftQuestIdGenerator/SptBasicLogger.cs b/Tools/HideoutCraftQuestIdGenerator/SptBasicLogger.cs index ed39d804..43b2aefc 100644 --- a/Tools/HideoutCraftQuestIdGenerator/SptBasicLogger.cs +++ b/Tools/HideoutCraftQuestIdGenerator/SptBasicLogger.cs @@ -15,8 +15,12 @@ public class SptBasicLogger : ISptLogger categoryName = typeof(T).Name; } - public void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, - Exception? ex = null) + public void LogWithColor( + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ) { Console.WriteLine($"{categoryName}: {data}"); } diff --git a/Tools/ItemTplGenerator/ItemOverrides.cs b/Tools/ItemTplGenerator/ItemOverrides.cs index 708056fd..b873d95c 100644 --- a/Tools/ItemTplGenerator/ItemOverrides.cs +++ b/Tools/ItemTplGenerator/ItemOverrides.cs @@ -10,23 +10,19 @@ public class ItemOverrides // Stashes { "5963866b86f7747bfa1c4462", "QuestOffline" }, { "5963866286f7747bf429b572", "QuestRaid" }, - // Usables { "614451b71e5874611e2c7ae5", "Bottle of Tarkovskaya vodka (Bad)" }, - // Special { "557ffd194bdc2d28148b457f", "Pockets 1x4" }, { "627a4e6b255f7527fb05a0f6", "Pockets 1x4 Special" }, { "65e080be269cbd5c5005e529", "Pockets 1x4 TUE" }, { "64cbd95a29b9b4283e216ff5", "Pockets 2x3" }, { "665ee77ccf2d642e98220bca", "Secure container Gamma TUE" }, - // Misc { "6662e9f37fa79a6d83730fa0", "Dogtag USEC EOD" }, { "6662ea05f6259762c56f3189", "Dogtag USEC TUE" }, { "6662e9aca7e0b43baa3d5f74", "Dogtag BEAR EOD" }, { "6662e9cda7e0b43baa3d5f76", "Dogtag BEAR TUE" }, - // Quest Items { "590de92486f77423d9312a33", "Watch Gold" }, { "5937fc6786f7742cab753590", "Watch Silver" }, @@ -70,7 +66,6 @@ public class ItemOverrides { "661421c7c1f2f548c50ee649", "Unheard laptop" }, { "661423200d240a5f5d0f679b", "Unheard laptop 2" }, { "66a0f0926fee20fa70036da6", "Quest blood sample nf2024" }, - // Weapon Parts { "5d1340b3d7ad1a0b52682ed7", "GEN M3 FDE" }, { "55802d5f4bdc2dac148b458e", "GEN M3 Window" }, @@ -80,30 +75,25 @@ public class ItemOverrides { "5e21a3c67e40bd02257a008a", "GEN M3 Banana" }, { "6241c2c2117ad530666a5108", "GEN M3 AIRSOFT" }, { "61840d85568c120fdd2962a5", "MK16 FDE" }, - // Lootable Containers { "5914944186f774189e5e76c2", "Jacket 204Key" }, { "5937ef2b86f77408a47244b3", "Jacket MachineryKey" }, { "59387ac686f77401442ddd61", "Jacket 114Key" }, { "61aa1e9a32a4743c3453d2cf", "Duffle bag Adv" }, { "61aa1ead84ea0800645777fd", "Medbag SMU06 Adv" }, - // Storage Containers { "5b6d9ce188a4501afc1b2b25", "THICC Weapon case" }, { "5c0a840b86f7742ffa4f2482", "THICC Item case" }, { "5d235bb686f77443f4331278", "SICC" }, { "61aa1e6984ea0800645777f9", "Long Weapon Box" }, - // Grenade launchers, they are weird, so just number them { "5e81ebcd8e146c7080625e15", "FN40GL 01" }, { "639c3fbbd0446708ee622ee9", "FN40GL 02" }, { "639af924d0446708ee62294e", "FN40GL 03" }, - // Airdrop crates { "66da1b49099cf6adcc07a36b", "Airdrop technical supply crate event 1" }, { "66da1b546916142b3b022777", "Airdrop technical supply crate event 2" }, { "61a89e5445a2672acf66c877", "Airdrop technical supply crate event 3" }, - // Posters { "6759e7a44ff23436160d7ff5", "Girl poster 4" }, { "6759e8b1c3102563bd01c985", "Girl poster 5" }, @@ -111,20 +101,17 @@ public class ItemOverrides { "675a046b8f547d6cae01922e", "Arena poster 2" }, { "6759e61067c8eb5cd10352f1", "Girl poster 2" }, { "6759e6c39422e1708e0e9b81", "Girl poster 3" }, - // Keys { "63a71f1a0aa9fb29da61c537", "City key 26" }, { "590de52486f774226a0c24c2", "Machinery tech key" }, { "590de4a286f77423d9312a32", "Folding automobile key" }, { "63a39e0f64283b5e9c56b282", "City key x" }, - { "67499d2c69a58fceba104a43", "Lightkeeper btr quest rpg ammo case" }, { "67499d4deca8acb2d206163b", "BTR quest electronic jamming device" }, - { "6764207f2fa5e32733055c4a", "Dogtag USEC Prestige 1" }, { "675dc9d37ae1a8792107ca96", "Dogtag BEAR Prestige 1" }, { "675dcb0545b1a2d108011b2b", "Dogtag BEAR Prestige 2" }, - { "6764202ae307804338014c1a", "Dogtag USEC Prestige 2" } + { "6764202ae307804338014c1a", "Dogtag USEC Prestige 2" }, } ); } diff --git a/Tools/ItemTplGenerator/ItemTplGenerator.cs b/Tools/ItemTplGenerator/ItemTplGenerator.cs index 77fc750c..3674791f 100644 --- a/Tools/ItemTplGenerator/ItemTplGenerator.cs +++ b/Tools/ItemTplGenerator/ItemTplGenerator.cs @@ -44,7 +44,13 @@ public class ItemTplGenerator( // Figure out our source and target directories var projectDir = Directory.GetParent("./").Parent.Parent.Parent.Parent.Parent; - enumDir = Path.Combine(projectDir.FullName, "Libraries", "SPTarkov.Server.Core", "Models", "Enums"); + enumDir = Path.Combine( + projectDir.FullName, + "Libraries", + "SPTarkov.Server.Core", + "Models", + "Enums" + ); items = _databaseServer.GetTables().Templates.Items; // Generate an object containing all item name to ID associations @@ -57,7 +63,7 @@ public class ItemTplGenerator( itemTplOutPath, new Dictionary> { - { nameof(ItemTpl), orderedItemsObject } + { nameof(ItemTpl), orderedItemsObject }, } ); @@ -69,7 +75,7 @@ public class ItemTplGenerator( weaponTypeOutPath, new Dictionary> { - { nameof(Weapons), weaponsObject } + { nameof(Weapons), weaponsObject }, } ); @@ -97,9 +103,11 @@ public class ItemTplGenerator( var itemSuffix = GetItemSuffix(item); // Handle the case where the item starts with the parent category name. Avoids things like 'POCKETS_POCKETS' - if (itemName.Length > itemParentName.Length && - itemParentName == itemName.Substring(1, itemParentName.Length) && - itemPrefix == "") + if ( + itemName.Length > itemParentName.Length + && itemParentName == itemName.Substring(1, itemParentName.Length) + && itemPrefix == "" + ) { itemName = itemName.Substring(itemParentName.Length + 1); if (itemName.Length > 0 && itemName[0] != '_') @@ -109,8 +117,10 @@ public class ItemTplGenerator( } // Handle the case where the item ends with the parent category name. Avoids things like 'KEY_DORM_ROOM_103_KEY' - if (itemName.Length >= itemParentName.Length && - itemParentName == itemName.Substring(itemName.Length - itemParentName.Length)) + if ( + itemName.Length >= itemParentName.Length + && itemParentName == itemName.Substring(itemName.Length - itemParentName.Length) + ) { itemName = itemName.Substring(0, itemName.Length - itemParentName.Length); @@ -160,7 +170,9 @@ public class ItemTplGenerator( else { var val = itemsObject.ContainsKey(itemKey) ? itemsObject[itemKey] : itemKey; - _logger.Error($"New itemOverride entry required: itemsObject already contains {itemKey} {val} => {item.Id}"); + _logger.Error( + $"New itemOverride entry required: itemsObject already contains {itemKey} {val} => {item.Id}" + ); continue; } } @@ -178,7 +190,10 @@ public class ItemTplGenerator( private Dictionary GenerateWeaponsObject() { var weaponsObject = new Dictionary(); - foreach (var kv /*[itemId, item]*/ in items) + foreach ( + var kv /*[itemId, item]*/ + in items + ) { if (!_itemHelper.IsOfBaseclass(kv.Key, BaseClasses.WEAPON)) { @@ -196,8 +211,10 @@ public class ItemTplGenerator( // Include any bracketed suffixes that exist, handles the case of colored gun variants var weaponFullName = _localeService.GetLocaleDb()[$"{kv.Key} Name"]?.ToUpper(); - if (weaponFullName.RegexMatch(@"\((.+?)\)$", out var itemNameBracketSuffix) && - !weaponShortName.EndsWith(itemNameBracketSuffix.Groups[1].Value)) + if ( + weaponFullName.RegexMatch(@"\((.+?)\)$", out var itemNameBracketSuffix) + && !weaponShortName.EndsWith(itemNameBracketSuffix.Groups[1].Value) + ) { weaponShortName += $"_{itemNameBracketSuffix.Groups[1].Value}"; } @@ -233,10 +250,7 @@ public class ItemTplGenerator( /// The sanitized enum key private string SanitizeEnumKey(string enumKey) { - return enumKey - .ToUpper() - .RegexReplace("[^A-Z0-9_]", "") - .RegexReplace("_+", "_"); + return enumKey.ToUpper().RegexReplace("[^A-Z0-9_]", "").RegexReplace("_+", "_"); } private string GetParentName(TemplateItem item) @@ -406,14 +420,18 @@ public class ItemTplGenerator( private string GetAmmoBoxPrefix(TemplateItem item) { - var ammoItem = item.Properties?.StackSlots?[0]?.Props?.Filters?[0]?.Filter?.FirstOrDefault(); + var ammoItem = item.Properties?.StackSlots?[0]?.Props?.Filters?[ + 0 + ]?.Filter?.FirstOrDefault(); return GetAmmoPrefix(items[ammoItem]); } private string GetMagazinePrefix(TemplateItem item) { - var ammoItem = item.Properties?.Cartridges?[0]?.Props?.Filters?[0]?.Filter?.FirstOrDefault(); + var ammoItem = item.Properties?.Cartridges?[0]?.Props?.Filters?[ + 0 + ]?.Filter?.FirstOrDefault(); return GetAmmoPrefix(items[ammoItem]); } @@ -437,18 +455,19 @@ public class ItemTplGenerator( else if ( _itemHelper.IsOfBaseclasses( item.Id, - [ - BaseClasses.RANDOM_LOOT_CONTAINER, - BaseClasses.BUILT_IN_INSERTS, - BaseClasses.STASH - ] + [BaseClasses.RANDOM_LOOT_CONTAINER, BaseClasses.BUILT_IN_INSERTS, BaseClasses.STASH] ) ) { itemName = item.Name.ToUpper(); } // For the listed types, use the short name - else if (_itemHelper.IsOfBaseclasses(item.Id, [BaseClasses.AMMO, BaseClasses.AMMO_BOX, BaseClasses.MAGAZINE])) + else if ( + _itemHelper.IsOfBaseclasses( + item.Id, + [BaseClasses.AMMO, BaseClasses.AMMO_BOX, BaseClasses.MAGAZINE] + ) + ) { if (localeDb.TryGetValue($"{item.Id} ShortName", out itemName)) { @@ -536,7 +555,11 @@ public class ItemTplGenerator( return ""; } - private void LogEnumValueChanges(Dictionary data, string enumName, Type originalEnum) + private void LogEnumValueChanges( + Dictionary data, + string enumName, + Type originalEnum + ) { // First generate a mapping of the original enum values to names var originalEnumValues = new Dictionary(); @@ -557,7 +580,10 @@ public class ItemTplGenerator( } } - private void WriteEnumsToFile(string outputPath, Dictionary> enumEntries) + private void WriteEnumsToFile( + string outputPath, + Dictionary> enumEntries + ) { var enumFileData = "// This is an auto generated file, do not modify. Re-generate by running ItemTplGenerator.exe"; diff --git a/Tools/ItemTplGenerator/ItemTplGenerator.csproj b/Tools/ItemTplGenerator/ItemTplGenerator.csproj index 5eb50062..d56c02a6 100644 --- a/Tools/ItemTplGenerator/ItemTplGenerator.csproj +++ b/Tools/ItemTplGenerator/ItemTplGenerator.csproj @@ -1,19 +1,15 @@ - - - + true false enable Exe - - - - - + + + + - diff --git a/Tools/ItemTplGenerator/SptBasicLogger.cs b/Tools/ItemTplGenerator/SptBasicLogger.cs index 4a35048d..66b05db7 100644 --- a/Tools/ItemTplGenerator/SptBasicLogger.cs +++ b/Tools/ItemTplGenerator/SptBasicLogger.cs @@ -15,8 +15,12 @@ public class SptBasicLogger : ISptLogger categoryName = typeof(T).Name; } - public void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, - Exception? ex = null) + public void LogWithColor( + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ) { Console.WriteLine($"{categoryName}: {data}"); } diff --git a/Tools/JsonExtensionDataGenerator/JsonExtensionDataGenerator.csproj b/Tools/JsonExtensionDataGenerator/JsonExtensionDataGenerator.csproj index 85b49591..4404f3eb 100644 --- a/Tools/JsonExtensionDataGenerator/JsonExtensionDataGenerator.csproj +++ b/Tools/JsonExtensionDataGenerator/JsonExtensionDataGenerator.csproj @@ -1,10 +1,8 @@  - - - Exe - net9.0 - enable - enable - - + + Exe + net9.0 + enable + enable + diff --git a/Tools/JsonExtensionDataGenerator/JsonExtensionDataGeneratorLauncher.cs b/Tools/JsonExtensionDataGenerator/JsonExtensionDataGeneratorLauncher.cs index df44713f..21b5b19c 100644 --- a/Tools/JsonExtensionDataGenerator/JsonExtensionDataGeneratorLauncher.cs +++ b/Tools/JsonExtensionDataGenerator/JsonExtensionDataGeneratorLauncher.cs @@ -4,16 +4,19 @@ namespace JsonExtensionDataGenerator; public class JsonExtensionDataGeneratorLauncher { - private static readonly Regex _recordAndClassRegex = new("^(public record |public class )", RegexOptions.Multiline); + private static readonly Regex _recordAndClassRegex = new( + "^(public record |public class )", + RegexOptions.Multiline + ); private static readonly Regex _endRecordClassRegex = new("^}", RegexOptions.Multiline); private static readonly Regex _startRecordClassRegex = new("^{", RegexOptions.Multiline); private const int StartRecordClassOffset = 3; - private static readonly Regex _extensionFinding = - new( - // https://regexr.com/8f5gf - "^(public){0,1} (record|class) (\\w+(<(\\w+(,){0,1})+>){0,1})(\\(.*\\)){0,1}[\r\n ]*:[\r\n ]*(\\w+(<(\\w+(,){0,1})+>){0,1}([\r\n ]*,[\r\n ]*)*)+" - , RegexOptions.Multiline); + private static readonly Regex _extensionFinding = new( + // https://regexr.com/8f5gf + "^(public){0,1} (record|class) (\\w+(<(\\w+(,){0,1})+>){0,1})(\\(.*\\)){0,1}[\r\n ]*:[\r\n ]*(\\w+(<(\\w+(,){0,1})+>){0,1}([\r\n ]*,[\r\n ]*)*)+", + RegexOptions.Multiline + ); private static readonly Regex _extensionCleanup = new(",.*"); @@ -22,7 +25,6 @@ public class JsonExtensionDataGeneratorLauncher private const string Using = "using System.Text.Json.Serialization;\r\n"; - public static void Main(string[] args) { var modelFiles = LoadModelFiles(); @@ -39,13 +41,17 @@ public class JsonExtensionDataGeneratorLauncher var content = File.ReadAllText(modelFile); if (!content.Contains("public record ") && !content.Contains("public class ")) { - Console.WriteLine($"File {fileName} doesn't contain any records or classes, skipping..."); + Console.WriteLine( + $"File {fileName} doesn't contain any records or classes, skipping..." + ); // Probably an enum or interface return; } var classesAndRecordsToProcessCount = _recordAndClassRegex.Matches(content).Count; - Console.WriteLine($"Found {classesAndRecordsToProcessCount} records or classes for {fileName}"); + Console.WriteLine( + $"Found {classesAndRecordsToProcessCount} records or classes for {fileName}" + ); var firstTimeFlag = false; var currentIndex = 0; try @@ -56,9 +62,15 @@ public class JsonExtensionDataGeneratorLauncher var endIndex = FindEndClassIndex(content, startIndex); currentIndex = endIndex; // Check if this class already has the tag anywhere - if (content.Substring(startIndex, endIndex - startIndex).Contains("[JsonExtensionData]")) + if ( + content + .Substring(startIndex, endIndex - startIndex) + .Contains("[JsonExtensionData]") + ) { - Console.WriteLine($"Class index {i} for {fileName} already contains [JsonExtensionData], skipping class..."); + Console.WriteLine( + $"Class index {i} for {fileName} already contains [JsonExtensionData], skipping class..." + ); continue; } @@ -66,7 +78,9 @@ public class JsonExtensionDataGeneratorLauncher { if (extensions.Any(e => !e.StartsWith("I"))) { - Console.WriteLine($"Class index {i} for {fileName} extends a parent class, skipping..."); + Console.WriteLine( + $"Class index {i} for {fileName} extends a parent class, skipping..." + ); continue; } } @@ -76,7 +90,9 @@ public class JsonExtensionDataGeneratorLauncher { if (!content.Contains("using System.Text.Json.Serialization;")) { - Console.WriteLine($"Class index {i} for {fileName} doesn't contain using for Json.Serialization. Adding."); + Console.WriteLine( + $"Class index {i} for {fileName} doesn't contain using for Json.Serialization. Adding." + ); // insert the using and adjust the indexes content = Using + content; startIndex += Using.Length; @@ -88,8 +104,9 @@ public class JsonExtensionDataGeneratorLauncher } // We need to add StartRecordClassOffset to offset the EOL - var insertionIndex = _startRecordClassRegex.Match(content, startIndex, endIndex - startIndex).Index + - StartRecordClassOffset; + var insertionIndex = + _startRecordClassRegex.Match(content, startIndex, endIndex - startIndex).Index + + StartRecordClassOffset; content = content.Insert(insertionIndex, Insertion); Console.WriteLine($"Class index {i} for {fileName} processed."); currentIndex += Insertion.Length; @@ -117,7 +134,9 @@ public class JsonExtensionDataGeneratorLauncher if (match.Success) { var extensionsGroup = match.Groups[8]; - extensions = extensionsGroup.Captures.Select(c => _extensionCleanup.Replace(c.Value, "")); + extensions = extensionsGroup.Captures.Select(c => + _extensionCleanup.Replace(c.Value, "") + ); return true; } @@ -138,7 +157,12 @@ public class JsonExtensionDataGeneratorLauncher private static IEnumerable LoadModelFiles() { var projectDir = Directory.GetParent("./").Parent.Parent.Parent.Parent.Parent; - var modelsDir = Path.Combine(projectDir.FullName, "Libraries", "SPTarkov.Server.Core", "Models"); + var modelsDir = Path.Combine( + projectDir.FullName, + "Libraries", + "SPTarkov.Server.Core", + "Models" + ); return Directory.GetFiles(modelsDir, "*.cs", SearchOption.AllDirectories); } } diff --git a/UnitTests/DI.cs b/UnitTests/DI.cs index 911e29ad..e0e9a7b8 100644 --- a/UnitTests/DI.cs +++ b/UnitTests/DI.cs @@ -21,20 +21,21 @@ public class DI } var services = new ServiceCollection(); - var jsonUtil = new JsonUtil([ new SptJsonConverterRegistrator() ]); + var jsonUtil = new JsonUtil([new SptJsonConverterRegistrator()]); var mathUtil = new MathUtil(); services.AddSingleton(jsonUtil); services.AddSingleton(mathUtil); - services.AddSingleton(); - services.AddSingleton,MockLogger>(); + services.AddSingleton(); + services.AddSingleton, MockLogger>(); services.AddSingleton(); services.AddSingleton(); _serviceProvider = services.BuildServiceProvider(); } - public static T GetService() where T : notnull + public static T GetService() + where T : notnull { return _serviceProvider.GetRequiredService(); } diff --git a/UnitTests/Mock/MockLogger.cs b/UnitTests/Mock/MockLogger.cs index 0015dc59..f5aaf81c 100644 --- a/UnitTests/Mock/MockLogger.cs +++ b/UnitTests/Mock/MockLogger.cs @@ -6,7 +6,12 @@ namespace UnitTests.Mock; public class MockLogger : ISptLogger { - public void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, Exception? ex = null) + public void LogWithColor( + string data, + LogTextColor? textColor = null, + LogBackgroundColor? backgroundColor = null, + Exception? ex = null + ) { throw new NotImplementedException(); } diff --git a/UnitTests/Tests/Test.cs b/UnitTests/Tests/Test.cs index 2807984a..1360caea 100644 --- a/UnitTests/Tests/Test.cs +++ b/UnitTests/Tests/Test.cs @@ -13,9 +13,12 @@ public class Test [TestInitialize] public async Task Setup() { - var importer = new ImporterUtil(new MockLogger(), new FileUtil(), DI.GetService()); + var importer = new ImporterUtil( + new MockLogger(), + new FileUtil(), + DI.GetService() + ); _templates = await importer.LoadRecursiveAsync("./TestAssets/"); - } [TestMethod] diff --git a/UnitTests/Tests/Utils/HashUtilTests.cs b/UnitTests/Tests/Utils/HashUtilTests.cs index 95c4c2a3..19c7e537 100644 --- a/UnitTests/Tests/Utils/HashUtilTests.cs +++ b/UnitTests/Tests/Utils/HashUtilTests.cs @@ -27,11 +27,7 @@ public class HashUtilTests // Invalid mongoId length var test = _hashUtil.IsValidMongoId(result); - Assert.AreEqual( - true, - test, - $"IsValidMongoId() `{result}` is not a valid MongoId." - ); + Assert.AreEqual(true, test, $"IsValidMongoId() `{result}` is not a valid MongoId."); } } @@ -41,7 +37,11 @@ public class HashUtilTests false, "677ddb67406e9918a0264bbz contains invalid char `z`, but result was true" )] - [DataRow("677ddb67406e9918a0264bbcc", false, "677ddb67406e9918a0264bbcc is 25 characters, but result was true")] + [DataRow( + "677ddb67406e9918a0264bbcc", + false, + "677ddb67406e9918a0264bbcc is 25 characters, but result was true" + )] [DataRow( "677ddb67406e9918a0264bbc", true, @@ -50,24 +50,19 @@ public class HashUtilTests public void IsValidMongoIdTest(string mongoId, bool passes, string failMessage) { var result = _hashUtil.IsValidMongoId(mongoId); - Assert.AreEqual( - passes, - result, - failMessage - ); + Assert.AreEqual(passes, result, failMessage); } - [TestMethod] - [DataRow("123456789", "25F9E794323B453885F5181F1B624D0B", "Not valid output, expected '25F9E794323B453885F5181F1B624D0B'")] + [DataRow( + "123456789", + "25F9E794323B453885F5181F1B624D0B", + "Not valid output, expected '25F9E794323B453885F5181F1B624D0B'" + )] public void GenerateValidMd5Test(string input, string expectedOutput, string failMessage) { - var result = _hashUtil.GenerateHashForData(HashingAlgorithm.MD5,input); - Assert.AreEqual( - expectedOutput, - result, - failMessage - ); + var result = _hashUtil.GenerateHashForData(HashingAlgorithm.MD5, input); + Assert.AreEqual(expectedOutput, result, failMessage); } [TestMethod] @@ -78,12 +73,16 @@ public class HashUtilTests var stopwatch = new Stopwatch(); stopwatch.Start(); - Parallel.For(0, 1000, i => - { - Thread.Sleep(random.Next(0, 10)); - var mongoId = _hashUtil.Generate(); - concurrentBag.Add(mongoId); - }); + Parallel.For( + 0, + 1000, + i => + { + Thread.Sleep(random.Next(0, 10)); + var mongoId = _hashUtil.Generate(); + concurrentBag.Add(mongoId); + } + ); stopwatch.Stop(); Console.WriteLine($"Elapsed time: {stopwatch.ElapsedMilliseconds} ms"); diff --git a/UnitTests/Tests/Utils/JsonUtilTests.cs b/UnitTests/Tests/Utils/JsonUtilTests.cs index d74cc86b..630919c5 100644 --- a/UnitTests/Tests/Utils/JsonUtilTests.cs +++ b/UnitTests/Tests/Utils/JsonUtilTests.cs @@ -19,9 +19,11 @@ public class JsonUtilTests { var value = new Dictionary { - { QuestStatusEnum.AvailableForStart, 1 } + { QuestStatusEnum.AvailableForStart, 1 }, }; - var result = _jsonUtil.Deserialize>(_jsonUtil.Serialize(value)); + var result = _jsonUtil.Deserialize>( + _jsonUtil.Serialize(value) + ); Assert.AreEqual(value.Count, result?.Count); Assert.AreEqual(value.First().Key, result?.First().Key); Assert.AreEqual(value.First().Value, result?.First().Value); diff --git a/UnitTests/Tests/Utils/MathUtilTests.cs b/UnitTests/Tests/Utils/MathUtilTests.cs index 41ebeb52..acab2559 100644 --- a/UnitTests/Tests/Utils/MathUtilTests.cs +++ b/UnitTests/Tests/Utils/MathUtilTests.cs @@ -16,40 +16,19 @@ public class MathUtilTests [TestMethod] public void ListSumTest() { - var test = new List - { - 1.1f, - 2.1f, - 3.3f - }; + var test = new List { 1.1f, 2.1f, 3.3f }; const double expected = 6.5f; var actual = _mathUtil.ListSum(test); - Assert.AreEqual( - expected, - actual, - $"ListSum() Expected: {expected}, Actual: {actual}" - ); + Assert.AreEqual(expected, actual, $"ListSum() Expected: {expected}, Actual: {actual}"); } [TestMethod] public void ListCumSumTest() { - var test = new List - { - 1f, - 2f, - 3f, - 4f - }; - var expected = new List - { - 1f, - 3f, - 6f, - 10f - }; + var test = new List { 1f, 2f, 3f, 4f }; + var expected = new List { 1f, 3f, 6f, 10f }; var actual = _mathUtil.ListCumSum(test); @@ -57,7 +36,9 @@ public class MathUtilTests { if (Math.Abs(expected[i] - actual[i]) > 0.00001f) { - Assert.Fail($"ListCumSum() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}"); + Assert.Fail( + $"ListCumSum() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}" + ); } } } @@ -65,20 +46,8 @@ public class MathUtilTests [TestMethod] public void ListProductTest() { - var test = new List - { - 1f, - 2f, - 3f, - 4f - }; - var expected = new List - { - 2f, - 4f, - 6f, - 8f - }; + var test = new List { 1f, 2f, 3f, 4f }; + var expected = new List { 2f, 4f, 6f, 8f }; var actual = _mathUtil.ListProduct(test, 2); @@ -86,7 +55,9 @@ public class MathUtilTests { if (Math.Abs(expected[i] - actual[i]) > 0.00001f) { - Assert.Fail($"ListProduct() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}"); + Assert.Fail( + $"ListProduct() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}" + ); } } } @@ -94,20 +65,8 @@ public class MathUtilTests [TestMethod] public void ListAddTest() { - var test = new List - { - 1f, - 2f, - 3f, - 4f - }; - var expected = new List - { - 3f, - 4f, - 5f, - 6f - }; + var test = new List { 1f, 2f, 3f, 4f }; + var expected = new List { 3f, 4f, 5f, 6f }; var actual = _mathUtil.ListAdd(test, 2); @@ -115,7 +74,9 @@ public class MathUtilTests { if (Math.Abs(expected[i] - actual[i]) > 0.00001f) { - Assert.Fail($"ListProduct() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}"); + Assert.Fail( + $"ListProduct() Expected: {string.Join(", ", expected)}, Actual: {string.Join(", ", actual)}" + ); } } } @@ -127,10 +88,6 @@ public class MathUtilTests var actual = _mathUtil.MapToRange(0.5, 0, 1, 1, 3); - Assert.AreEqual( - expected, - actual, - $"MapToRange() Expected: {expected}, Actual: {actual}" - ); + Assert.AreEqual(expected, actual, $"MapToRange() Expected: {expected}, Actual: {actual}"); } } diff --git a/UnitTests/Tests/Utils/RandomUtilTests.cs b/UnitTests/Tests/Utils/RandomUtilTests.cs index 89985d3d..c1abdb15 100644 --- a/UnitTests/Tests/Utils/RandomUtilTests.cs +++ b/UnitTests/Tests/Utils/RandomUtilTests.cs @@ -23,7 +23,9 @@ public sealed class RandomUtilTests if (result < 0 || result > 10) { - Assert.Fail($"GetInt(0, 10) out of range. Expected range [0, 10] but was {result}."); + Assert.Fail( + $"GetInt(0, 10) out of range. Expected range [0, 10] but was {result}." + ); } } } @@ -53,7 +55,9 @@ public sealed class RandomUtilTests if (result is < 0d or >= 10d) { - Assert.Fail($"GetDouble(0d, 10d) out of range. Expected range [0.0d, 9.999d] but was {result}."); + Assert.Fail( + $"GetDouble(0d, 10d) out of range. Expected range [0.0d, 9.999d] but was {result}." + ); } } } @@ -125,7 +129,9 @@ public sealed class RandomUtilTests if (result < 0 || result > 9) { - Assert.Fail($"RandInt(0, 10) out of range. Expected range [0, 9] but was {result}."); + Assert.Fail( + $"RandInt(0, 10) out of range. Expected range [0, 9] but was {result}." + ); } } @@ -135,7 +141,9 @@ public sealed class RandomUtilTests if (result < 0 || result > 9) { - Assert.Fail($"RandInt(10, null) out of range. Expected range [0, 9] but was {result}."); + Assert.Fail( + $"RandInt(10, null) out of range. Expected range [0, 9] but was {result}." + ); } } } @@ -149,12 +157,16 @@ public sealed class RandomUtilTests if (result < 0 || result >= 10) { - Assert.Fail($"RandNum(0, 10) out of range. Expected range [0, 9.999d] but was {result}."); + Assert.Fail( + $"RandNum(0, 10) out of range. Expected range [0, 9.999d] but was {result}." + ); } if (_randomUtil.GetNumberPrecision(result) > RandomUtil.MaxSignificantDigits) { - Assert.Fail($"RandNum(0, 10) precision of {result} exceeds the allowable precision ({RandomUtil.MaxSignificantDigits}) for the given values."); + Assert.Fail( + $"RandNum(0, 10) precision of {result} exceeds the allowable precision ({RandomUtil.MaxSignificantDigits}) for the given values." + ); } } @@ -164,12 +176,16 @@ public sealed class RandomUtilTests if (result < 0 || result >= 10) { - Assert.Fail($"RandNum(10) out of range. Expected range [0, 9.999d] but was {result}."); + Assert.Fail( + $"RandNum(10) out of range. Expected range [0, 9.999d] but was {result}." + ); } if (_randomUtil.GetNumberPrecision(result) > RandomUtil.MaxSignificantDigits) { - Assert.Fail($"RandNum(10) precision of {result} exceeds the allowable precision ({RandomUtil.MaxSignificantDigits}) for the given values."); + Assert.Fail( + $"RandNum(10) precision of {result} exceeds the allowable precision ({RandomUtil.MaxSignificantDigits}) for the given values." + ); } } } @@ -177,19 +193,7 @@ public sealed class RandomUtilTests [TestMethod] public void ShuffleTest() { - var testList = new List - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - }; + var testList = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var orig = new List(testList); diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 0ce2ce2c..5073a8c3 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -1,35 +1,27 @@ - - enable - - - - PreserveNewest - -