From 236a61840f9c554f17d770811af624b5e84ee3d8 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 4 Aug 2025 16:22:43 +0200 Subject: [PATCH] Convert node's InsuranceTIme to int32 --- .../Migrations/4.0/ThreeElevenToFourZero.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Libraries/SPTarkov.Server.Core/Migration/Migrations/4.0/ThreeElevenToFourZero.cs b/Libraries/SPTarkov.Server.Core/Migration/Migrations/4.0/ThreeElevenToFourZero.cs index c3e9e871..bc15fd27 100644 --- a/Libraries/SPTarkov.Server.Core/Migration/Migrations/4.0/ThreeElevenToFourZero.cs +++ b/Libraries/SPTarkov.Server.Core/Migration/Migrations/4.0/ThreeElevenToFourZero.cs @@ -60,6 +60,21 @@ public class ThreeElevenToFourZero(Watermark watermark) : AbstractProfileMigrati } } + if (profile["insurance"] is JsonArray insuranceArray) + { + foreach (var item in insuranceArray) + { + if (item is JsonObject insuranceEntry && insuranceEntry["scheduledTime"] is JsonValue scheduledTimeValue) + { + if (scheduledTimeValue.TryGetValue(out var timeAsDouble)) + { + // Handle the node server having turned this value into a double + insuranceEntry["scheduledTime"] = Convert.ToInt32(timeAsDouble); + } + } + } + } + return base.Migrate(profile); }