Removed check for Enum converter and removed unnecesary converters
This commit is contained in:
@@ -605,7 +605,6 @@ public record BossSupport
|
||||
public string? BossEscortAmount { get; set; }
|
||||
|
||||
[JsonPropertyName("BossEscortDifficult")]
|
||||
[JsonConverter(typeof(ListOrTConverterFactory))]
|
||||
public ListOrT<string> BossEscortDifficulty { get; set; }
|
||||
|
||||
[JsonPropertyName("BossEscortType")]
|
||||
|
||||
@@ -203,7 +203,6 @@ public record QuestCondition
|
||||
/// Can be mongoId or string e.g. event_labyrinth_06_mech_place_01
|
||||
/// </summary>
|
||||
[JsonPropertyName("target")]
|
||||
[JsonConverter(typeof(ListOrTConverterFactory))]
|
||||
public ListOrT<string>? Target { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
@@ -338,7 +337,6 @@ public record QuestConditionCounterCondition
|
||||
public bool? DynamicLocale { get; set; }
|
||||
|
||||
[JsonPropertyName("target")]
|
||||
[JsonConverter(typeof(ListOrTConverterFactory))]
|
||||
public ListOrT<string>? Target { get; set; }
|
||||
|
||||
[JsonPropertyName("completeInSeconds")]
|
||||
|
||||
@@ -8,7 +8,7 @@ public class EftEnumConverterFactory : JsonConverterFactory
|
||||
{
|
||||
public override bool CanConvert(Type typeToConvert)
|
||||
{
|
||||
return typeToConvert.IsEnum && (typeToConvert.Namespace?.Contains("SPTarkov") ?? false);
|
||||
return typeToConvert.IsEnum;
|
||||
}
|
||||
|
||||
public override JsonConverter? CreateConverter(
|
||||
|
||||
@@ -9,8 +9,7 @@ public class EftListEnumConverterFactory : JsonConverterFactory
|
||||
{
|
||||
return typeToConvert.IsGenericType
|
||||
&& typeToConvert.GetGenericTypeDefinition() == typeof(List<>)
|
||||
&& typeToConvert.GenericTypeArguments[0].IsEnum
|
||||
&& (typeToConvert.GenericTypeArguments[0].Namespace?.Contains("SPTarkov") ?? false);
|
||||
&& typeToConvert.GenericTypeArguments[0].IsEnum;
|
||||
}
|
||||
|
||||
public override JsonConverter? CreateConverter(
|
||||
|
||||
@@ -15,7 +15,6 @@ public class SptJsonConverterRegistrator : IJsonConverterRegistrator
|
||||
new BaseSptLoggerReferenceConverter(),
|
||||
new ListOrTConverterFactory(),
|
||||
new DictionaryOrListConverter(),
|
||||
new EftEnumConverter<LogLevel>(), // Special case, this belongs to a lib.
|
||||
new BaseInteractionRequestDataConverter(),
|
||||
new StringToMongoIdConverter(),
|
||||
new EftEnumConverterFactory(),
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
|
||||
namespace SPTarkov.Server.Core.Utils.Json.Converters
|
||||
{
|
||||
namespace SPTarkov.Server.Core.Utils.Json.Converters;
|
||||
|
||||
public class StringToMongoIdConverter : JsonConverter<MongoId>
|
||||
{
|
||||
public override MongoId Read(
|
||||
@@ -49,4 +49,3 @@ namespace SPTarkov.Server.Core.Utils.Json.Converters
|
||||
writer.WritePropertyName(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user