Apply enforced file scoped namespacing
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace Benchmarks
|
||||
namespace Benchmarks;
|
||||
|
||||
[SimpleJob(warmupCount: 10, iterationCount: 25)]
|
||||
[MemoryDiagnoser]
|
||||
public class MathUtilInterpBenchmarks
|
||||
{
|
||||
[SimpleJob(warmupCount: 10, iterationCount: 25)]
|
||||
[MemoryDiagnoser]
|
||||
public class MathUtilInterpBenchmarks
|
||||
{
|
||||
private MathUtil _mathUtil;
|
||||
|
||||
private double input = 15d;
|
||||
@@ -24,5 +24,4 @@ namespace Benchmarks
|
||||
{
|
||||
_mathUtil.Interp1(input, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
namespace SPTarkov.Reflection.Patching
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchPrefixAttribute : Attribute { }
|
||||
namespace SPTarkov.Reflection.Patching;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchPostfixAttribute : Attribute { }
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchPrefixAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchTranspilerAttribute : Attribute { }
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchPostfixAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchFinalizerAttribute : Attribute { }
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchTranspilerAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchIlManipulatorAttribute : Attribute { }
|
||||
}
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchFinalizerAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class PatchIlManipulatorAttribute : Attribute { }
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
namespace SPTarkov.Server.Core.DI
|
||||
namespace SPTarkov.Server.Core.DI;
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public static class ServiceLocator
|
||||
{
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public static class ServiceLocator
|
||||
{
|
||||
public static IServiceProvider ServiceProvider { get; private set; }
|
||||
|
||||
internal static void SetServiceProvider(IServiceProvider provider)
|
||||
{
|
||||
ServiceProvider = provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using SPTarkov.Server.Core.Models.Spt.Inventory;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class ContainerExtensions
|
||||
{
|
||||
public static class ContainerExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Finds a slot for an item in a given 2D container map
|
||||
/// </summary>
|
||||
@@ -249,5 +249,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return true; // Slot is free
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class CurrencyTypeExtensions
|
||||
{
|
||||
public static class CurrencyTypeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets currency TPL from TAG
|
||||
/// </summary>
|
||||
@@ -21,5 +21,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Formats the time part of a date as a UTC string.
|
||||
/// </summary>
|
||||
@@ -137,5 +137,4 @@
|
||||
// Remove count of day difference to get desired day
|
||||
return dateTime.AddDays(-dayDifferenceCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class DictionaryExtensions
|
||||
{
|
||||
public static class DictionaryExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Add a value by key to a dictionary, if the key doesn't exist, create it
|
||||
/// </summary>
|
||||
@@ -41,5 +41,4 @@
|
||||
collection.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Match;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class EndRaidResultExtensions
|
||||
{
|
||||
public static class EndRaidResultExtensions
|
||||
{
|
||||
private static readonly HashSet<ExitStatus> _deathStates = [ExitStatus.KILLED, ExitStatus.MISSINGINACTION, ExitStatus.LEFT];
|
||||
|
||||
/// <summary>
|
||||
@@ -69,5 +69,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
{
|
||||
return raidResult?.ExitName is not null && coopExtracts.Contains(raidResult.ExitName.Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class FullProfileExtensions
|
||||
{
|
||||
public static class FullProfileExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Add a list of suit ids to a profiles suit list, no duplicates
|
||||
/// </summary>
|
||||
@@ -219,5 +219,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
{
|
||||
return fullProfile?.ProfileInfo?.Edition?.ToLowerInvariant().StartsWith("spt developer") ?? false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class ItemEventRouterResponseExtensions
|
||||
{
|
||||
public static class ItemEventRouterResponseExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Add item stack change object into output route event response
|
||||
/// </summary>
|
||||
@@ -29,5 +29,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class ItemExtensions
|
||||
{
|
||||
public static class ItemExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// This method will compare two items and see if they are equivalent
|
||||
/// This method will NOT compare IDs on the items
|
||||
@@ -448,5 +448,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// Get the rouble amount for the desired container, multiplied by the current map bot will spawn on
|
||||
/// </summary>
|
||||
public static class LootContainerSettingsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the rouble amount for the desired container, multiplied by the current map bot will spawn on
|
||||
/// </summary>
|
||||
public static class LootContainerSettingsExtensions
|
||||
{
|
||||
public static double GetRoubleValue(this LootContainerSettings settings, int botLevel, string? locationId)
|
||||
{
|
||||
var roubleTotalByLevel = GetContainerRoubleTotalByLevel(botLevel, settings.TotalRubByLevel);
|
||||
@@ -48,5 +48,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return matchingValue.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class MathExtensions
|
||||
{
|
||||
public static class MathExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper to create the cumulative sum of all enumerable elements
|
||||
/// [1, 2, 3, 4].CumulativeSum() = [1, 3, 6, 10]
|
||||
@@ -79,5 +79,4 @@
|
||||
{
|
||||
return Math.Abs(value - target) <= error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class MongoIdExtensions
|
||||
{
|
||||
public static class MongoIdExtensions
|
||||
{
|
||||
//Temporary, but necessary
|
||||
public static IEnumerable<MongoId> ToMongoIds(this IEnumerable<string> source)
|
||||
{
|
||||
@@ -67,5 +67,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class ProductionExtensions
|
||||
{
|
||||
public static class ProductionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Has the craft completed
|
||||
/// Ignores bitcoin farm/cultist circle as they're continuous crafts
|
||||
@@ -41,5 +41,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class ProfileExtensions
|
||||
{
|
||||
public static class ProfileExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Return all quest items current in the supplied profile
|
||||
/// </summary>
|
||||
@@ -239,5 +239,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
bodyPart.Health.Maximum = profileTemplate.Character.Health.BodyParts[partKey].Health.Maximum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class QuestConditionExtensions
|
||||
{
|
||||
public static class QuestConditionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Get all quest conditions from provided list
|
||||
/// </summary>
|
||||
@@ -63,5 +63,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return filteredQuests;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Ragfair;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class RagfairOfferExtensions
|
||||
{
|
||||
public static class RagfairOfferExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Is the passed in offer stale - end time > passed in time
|
||||
/// </summary>
|
||||
@@ -45,5 +45,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using SPTarkov.Server.Core.Models.Spt.Mod;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class SptModExtensions
|
||||
{
|
||||
public static class SptModExtensions
|
||||
{
|
||||
public static string GetModPath(this SptMod sptMod)
|
||||
{
|
||||
var relativeModPath = Path.GetRelativePath(Directory.GetCurrentDirectory(), sptMod.Directory).Replace('\\', '/');
|
||||
|
||||
return relativeModPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string Encode(this string value, EncodeType encode)
|
||||
{
|
||||
return encode switch
|
||||
@@ -35,5 +35,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
ASCII,
|
||||
UTF8,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class TemplateItemExtensions
|
||||
{
|
||||
public static class TemplateItemExtensions
|
||||
{
|
||||
public static IEnumerable<TemplateItem> OfClass(this Dictionary<MongoId, TemplateItem> templates, params MongoId[] baseClasses)
|
||||
{
|
||||
return templates.Where(x => baseClasses.Contains(x.Value.Parent)).Select(x => x.Value);
|
||||
@@ -76,5 +76,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
&& (item.Properties.Cartridges is null || !item.Properties.Cartridges.Any())
|
||||
&& (item.Properties.Chambers is null || !item.Properties.Chambers.Any());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class TraderAssortExtensions
|
||||
{
|
||||
public static class TraderAssortExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Remove an item from an assort
|
||||
/// Must be removed from the assorts; items + barterScheme + LoyaltyLevel
|
||||
@@ -47,5 +47,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
.Items.Where(item => item.ParentId == "hideout" && itemsTplsToRemove.Contains(item.Template))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class UtilityExtensions
|
||||
{
|
||||
public static class UtilityExtensions
|
||||
{
|
||||
public static IEnumerable<T> IntersectWith<T>(this IEnumerable<T> first, IEnumerable<T> second)
|
||||
{
|
||||
//a.Intersect(x => b.Contains(x)).ToList();
|
||||
@@ -9,5 +9,4 @@
|
||||
|
||||
return first.Where(second.Contains);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using SPTarkov.Server.Core.Constants;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
|
||||
namespace SPTarkov.Server.Core.Extensions
|
||||
namespace SPTarkov.Server.Core.Extensions;
|
||||
|
||||
public static class WildSpawnTypeExtensions
|
||||
{
|
||||
public static class WildSpawnTypeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Is the passed in bot role a PMC (USEC/Bear/PMC)
|
||||
/// </summary>
|
||||
@@ -32,5 +32,4 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration
|
||||
namespace SPTarkov.Server.Core.Migration;
|
||||
|
||||
public abstract class AbstractProfileMigration : IProfileMigration
|
||||
{
|
||||
public abstract class AbstractProfileMigration : IProfileMigration
|
||||
{
|
||||
public abstract string FromVersion { get; }
|
||||
public abstract string ToVersion { get; }
|
||||
public abstract string MigrationName { get; }
|
||||
@@ -36,5 +36,4 @@ namespace SPTarkov.Server.Core.Migration
|
||||
|
||||
return SemanticVersioning.Version.TryParse(versionNumber, out var version) ? version : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration
|
||||
namespace SPTarkov.Server.Core.Migration;
|
||||
|
||||
public interface IProfileMigration
|
||||
{
|
||||
public interface IProfileMigration
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows for adding checks if the profile in question can migrate
|
||||
/// </summary>
|
||||
@@ -26,5 +26,4 @@ namespace SPTarkov.Server.Core.Migration
|
||||
/// </summary>
|
||||
/// <returns>Should return true if successful, should return false if not</returns>
|
||||
public bool PostMigrate(SptProfile profile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@ using System.Text.Json.Nodes;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using Range = SemanticVersioning.Range;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations;
|
||||
|
||||
/// <summary>
|
||||
/// In 0.16.1.3.35312 BSG changed this to from an int to a hex64 encoded value.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class HideoutSeed : AbstractProfileMigration
|
||||
{
|
||||
/// <summary>
|
||||
/// In 0.16.1.3.35312 BSG changed this to from an int to a hex64 encoded value.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class HideoutSeed : AbstractProfileMigration
|
||||
{
|
||||
public override string FromVersion
|
||||
{
|
||||
get { return "~3.10"; }
|
||||
@@ -51,5 +51,4 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
|
||||
return base.Migrate(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations;
|
||||
|
||||
/// <summary>
|
||||
/// In the minor versions of 3.10 or somewhere in between these properties were added, it's possible that a profile has not updated
|
||||
/// To these thus never having received them, re-add them here.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class ThreeTenMinorFixes : AbstractProfileMigration
|
||||
{
|
||||
/// <summary>
|
||||
/// In the minor versions of 3.10 or somewhere in between these properties were added, it's possible that a profile has not updated
|
||||
/// To these thus never having received them, re-add them here.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class ThreeTenMinorFixes : AbstractProfileMigration
|
||||
{
|
||||
public override string FromVersion
|
||||
{
|
||||
get { return "~3.10"; }
|
||||
@@ -50,5 +50,4 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
|
||||
return base.PostMigrate(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Services;
|
||||
using Range = SemanticVersioning.Range;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
{
|
||||
[Injectable]
|
||||
public class ThreeTenToThreeEleven(
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations;
|
||||
|
||||
[Injectable]
|
||||
public class ThreeTenToThreeEleven(
|
||||
DatabaseService databaseService,
|
||||
// Yes, referencing the helpers directly causes a circular dependency. Too bad!
|
||||
IServiceProvider serviceProvider
|
||||
) : AbstractProfileMigration
|
||||
{
|
||||
) : AbstractProfileMigration
|
||||
{
|
||||
private List<string> _oldSuiteData = [];
|
||||
|
||||
public override string FromVersion
|
||||
@@ -156,11 +156,7 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
foreach (var oldSuite in _oldSuiteData)
|
||||
{
|
||||
// Default Bear clothing, dont need to add this
|
||||
if (
|
||||
oldSuite == "5cd946231388ce000d572fe3"
|
||||
|| oldSuite == "5cd945d71388ce000a659dfb"
|
||||
|| oldSuite == "666841a02537107dc508b704"
|
||||
)
|
||||
if (oldSuite == "5cd946231388ce000d572fe3" || oldSuite == "5cd945d71388ce000a659dfb" || oldSuite == "666841a02537107dc508b704")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -203,11 +199,7 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
foreach (var oldSuite in _oldSuiteData)
|
||||
{
|
||||
// Default Usec clothing, dont need to add this
|
||||
if (
|
||||
oldSuite == "5cde9ec17d6c8b04723cf479"
|
||||
|| oldSuite == "5cde9e957d6c8b0474535da7"
|
||||
|| oldSuite == "666841a02537107dc508b704"
|
||||
)
|
||||
if (oldSuite == "5cde9ec17d6c8b04723cf479" || oldSuite == "5cde9e957d6c8b0474535da7" || oldSuite == "666841a02537107dc508b704")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -228,5 +220,4 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Services;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations;
|
||||
|
||||
/// <summary>
|
||||
/// In 16.8.0.37972 BSG added customization for voices, technically this only affects BE profiles, but this should fix these.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class TheVoices(DatabaseService databaseService) : AbstractProfileMigration
|
||||
{
|
||||
/// <summary>
|
||||
/// In 16.8.0.37972 BSG added customization for voices, technically this only affects BE profiles, but this should fix these.
|
||||
/// </summary>
|
||||
[Injectable]
|
||||
public class TheVoices(DatabaseService databaseService) : AbstractProfileMigration
|
||||
{
|
||||
private bool _pmcVoiceIsMissing = false;
|
||||
private bool _scavVoiceIsMissing = false;
|
||||
|
||||
@@ -81,5 +81,4 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
|
||||
profileObject["characters"]!["scav"]!["Customization"]!["Voice"] = voiceMongoId.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
using Range = SemanticVersioning.Range;
|
||||
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
namespace SPTarkov.Server.Core.Migration.Migrations;
|
||||
|
||||
[Injectable]
|
||||
public class ThreeElevenToFourZero(Watermark watermark) : AbstractProfileMigration
|
||||
{
|
||||
[Injectable]
|
||||
public class ThreeElevenToFourZero(Watermark watermark) : AbstractProfileMigration
|
||||
{
|
||||
public override string FromVersion
|
||||
{
|
||||
get { return "~3.11"; }
|
||||
@@ -71,5 +71,4 @@ namespace SPTarkov.Server.Core.Migration.Migrations
|
||||
|
||||
return base.PostMigrate(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Ws
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Ws;
|
||||
|
||||
public record WsRagfairNewRating : WsNotificationEvent
|
||||
{
|
||||
public record WsRagfairNewRating : WsNotificationEvent
|
||||
{
|
||||
[JsonPropertyName("rating")]
|
||||
public double? Rating { get; set; }
|
||||
|
||||
[JsonPropertyName("isRatingGrowing")]
|
||||
public bool? IsRatingGrowing { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SPTarkov.Server.Core.Models.Enums.Hideout
|
||||
namespace SPTarkov.Server.Core.Models.Enums.Hideout;
|
||||
|
||||
public enum HideoutNotificationType
|
||||
{
|
||||
public enum HideoutNotificationType
|
||||
{
|
||||
None,
|
||||
FuelIsLow,
|
||||
NoFuel,
|
||||
@@ -13,5 +13,4 @@
|
||||
RepairComplete,
|
||||
ScavCaseReady,
|
||||
DecryptionComplete,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Enums
|
||||
namespace SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum SkillClass
|
||||
{
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum SkillClass
|
||||
{
|
||||
Physical,
|
||||
Combat,
|
||||
Special,
|
||||
Practical,
|
||||
Mental,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Launcher
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Launcher;
|
||||
|
||||
public enum NicknameValidationResult
|
||||
{
|
||||
public enum NicknameValidationResult
|
||||
{
|
||||
Taken,
|
||||
Short,
|
||||
Valid,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Ragfair
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Ragfair;
|
||||
|
||||
public record CreateFleaOfferDetails
|
||||
{
|
||||
public record CreateFleaOfferDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// Owner of the offer
|
||||
/// </summary>
|
||||
@@ -45,5 +45,4 @@ namespace SPTarkov.Server.Core.Models.Spt.Ragfair
|
||||
/// Offer should be sold all in one offer
|
||||
/// </summary>
|
||||
public bool SellInOnePiece { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,25 +2,25 @@ using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Eft.Match;
|
||||
using SPTarkov.Server.Core.Models.Spt.Location;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Services
|
||||
namespace SPTarkov.Server.Core.Models.Spt.Services;
|
||||
|
||||
public class ProfileActivityData
|
||||
{
|
||||
public class ProfileActivityData
|
||||
{
|
||||
public long ClientStartedTimestamp { get; set; }
|
||||
public long LastActive { get; set; }
|
||||
public ProfileActivityRaidData? RaidData { get; set; } = null;
|
||||
public IReadOnlyList<ProfileActiveClientMods> ActiveClientMods { get; set; } = [];
|
||||
}
|
||||
}
|
||||
|
||||
public class ProfileActivityRaidData
|
||||
{
|
||||
public class ProfileActivityRaidData
|
||||
{
|
||||
public GetRaidConfigurationRequestData? RaidConfiguration { get; set; } = null;
|
||||
public RaidChanges? RaidAdjustments { get; set; } = null;
|
||||
public LocationTransit? LocationTransit { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
public record ProfileActiveClientMods
|
||||
{
|
||||
public record ProfileActiveClientMods
|
||||
{
|
||||
[JsonPropertyName("modName")]
|
||||
public required string Name { get; init; }
|
||||
|
||||
@@ -29,5 +29,4 @@ namespace SPTarkov.Server.Core.Models.Spt.Services
|
||||
|
||||
[JsonPropertyName("modVersion")]
|
||||
public required Version Version { get; init; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@ using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Services
|
||||
{
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class ProfileMigratorService(
|
||||
namespace SPTarkov.Server.Core.Services;
|
||||
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class ProfileMigratorService(
|
||||
IEnumerable<IProfileMigration> profileMigrations,
|
||||
TimeUtil timeUtil,
|
||||
ISptLogger<ProfileMigratorService> logger
|
||||
)
|
||||
{
|
||||
)
|
||||
{
|
||||
private IEnumerable<AbstractProfileMigration> _sortedMigrations = [];
|
||||
|
||||
public SptProfile HandlePendingMigrations(JsonObject profile)
|
||||
@@ -133,5 +133,4 @@ namespace SPTarkov.Server.Core.Services
|
||||
visitedTypeDictionary[migrationType] = true;
|
||||
sortedMigrations.Add(migration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ using SPTarkov.Server.Core.Servers.Http;
|
||||
using SPTarkov.Server.Core.Services;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Status
|
||||
namespace SPTarkov.Server.Core.Status;
|
||||
|
||||
[Injectable(TypePriority = 0)]
|
||||
public class StatusPage(TimeUtil timeUtil, ProfileActivityService profileActivityService, ConfigServer configServer) : IHttpListener
|
||||
{
|
||||
[Injectable(TypePriority = 0)]
|
||||
public class StatusPage(TimeUtil timeUtil, ProfileActivityService profileActivityService, ConfigServer configServer) : IHttpListener
|
||||
{
|
||||
protected readonly CoreConfig _coreConfig = configServer.GetConfig<CoreConfig>();
|
||||
|
||||
public bool CanHandle(MongoId sessionId, HttpRequest req)
|
||||
@@ -50,5 +50,4 @@ namespace SPTarkov.Server.Core.Status
|
||||
await resp.StartAsync();
|
||||
await resp.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user