From 83d37a8241a9f5b0bc8f88cc0931e65d4a486b57 Mon Sep 17 00:00:00 2001 From: CWX Date: Thu, 16 Jan 2025 14:33:29 +0000 Subject: [PATCH 1/4] change types for workoutdata --- Core/Models/Eft/Health/WorkoutData.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/Models/Eft/Health/WorkoutData.cs b/Core/Models/Eft/Health/WorkoutData.cs index 40936109..d08de768 100644 --- a/Core/Models/Eft/Health/WorkoutData.cs +++ b/Core/Models/Eft/Health/WorkoutData.cs @@ -1,4 +1,7 @@ -namespace Core.Models.Eft.Health; +using Core.Models.Eft.Common.Tables; +using Mastering = Core.Models.Eft.Common.Mastering; + +namespace Core.Models.Eft.Health; using System.Text.Json.Serialization; @@ -14,10 +17,10 @@ public class WorkoutSkills public List? Common { get; set; } [JsonPropertyName("Mastering")] - public List? Mastering { get; set; } + public List? Mastering { get; set; } [JsonPropertyName("Bonuses")] - public object? Bonuses { get; set; } + public Bonus? Bonuses { get; set; } [JsonPropertyName("Points")] public int? Points { get; set; } @@ -87,4 +90,4 @@ public class WorkoutBodyPart [JsonPropertyName("MildMusclePain")] public int? MildMusclePain { get; set; } -} \ No newline at end of file +} From db2f85f60359674683a2e06bda3cb699e3de788c Mon Sep 17 00:00:00 2001 From: CWX Date: Thu, 16 Jan 2025 14:33:43 +0000 Subject: [PATCH 2/4] include Nulls when reading --- Core/Models/Eft/Common/Tables/BotBase.cs | 3 +++ Core/Models/Eft/Common/Tables/HandbookBase.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/Models/Eft/Common/Tables/BotBase.cs b/Core/Models/Eft/Common/Tables/BotBase.cs index f5034cad..4b916e1c 100644 --- a/Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Core/Models/Eft/Common/Tables/BotBase.cs @@ -510,6 +510,8 @@ public class Hideout public Dictionary? Production { get; set; } public List? Areas { get; set; } public Dictionary? Improvements { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public HideoutCounters? HideoutCounters { get; set; } public double? Seed { get; set; } public Dictionary? MannequinPoses { get; set; } @@ -769,6 +771,7 @@ public class Bonus public double? Value { get; set; } [JsonPropertyName("icon")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Icon { get; set; } [JsonPropertyName("filter")] diff --git a/Core/Models/Eft/Common/Tables/HandbookBase.cs b/Core/Models/Eft/Common/Tables/HandbookBase.cs index 02b16c30..9a516d58 100644 --- a/Core/Models/Eft/Common/Tables/HandbookBase.cs +++ b/Core/Models/Eft/Common/Tables/HandbookBase.cs @@ -35,8 +35,9 @@ public class HandbookItem public string? Id { get; set; } [JsonPropertyName("ParentId")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? ParentId { get; set; } [JsonPropertyName("Price")] public decimal? Price { get; set; } -} \ No newline at end of file +} From c385d77d1efc5789dfe0b04022b421a527f4a8ce Mon Sep 17 00:00:00 2001 From: CWX Date: Thu, 16 Jan 2025 14:35:05 +0000 Subject: [PATCH 3/4] include null when reading --- Core/Models/Eft/Common/Tables/HandbookBase.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/Models/Eft/Common/Tables/HandbookBase.cs b/Core/Models/Eft/Common/Tables/HandbookBase.cs index 9a516d58..ef2d0372 100644 --- a/Core/Models/Eft/Common/Tables/HandbookBase.cs +++ b/Core/Models/Eft/Common/Tables/HandbookBase.cs @@ -20,6 +20,7 @@ public class HandbookCategory public string? ParentId { get; set; } [JsonPropertyName("Icon")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Icon { get; set; } [JsonPropertyName("Color")] From fd969976eb4cb6aba8d538ce67fa0a84d9c7065d Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 16 Jan 2025 14:51:10 +0000 Subject: [PATCH 4/4] Fixed `client/weather` returning the wrong date --- Core/Generators/WeatherGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Generators/WeatherGenerator.cs b/Core/Generators/WeatherGenerator.cs index a05ae751..d7fb519c 100644 --- a/Core/Generators/WeatherGenerator.cs +++ b/Core/Generators/WeatherGenerator.cs @@ -46,7 +46,7 @@ public class WeatherGenerator */ public void CalculateGameTime(WeatherData data) { - var computedDate = new DateTime(); + var computedDate = DateTime.Now; var formattedDate = this._timeUtil.FormatDate(computedDate); data.Date = formattedDate;