From fe4a71a6811095edeb488422df15943d00e5e496 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 20 Dec 2025 20:17:20 +0100 Subject: [PATCH] Further khorovod fixes --- .../SPT_Data/configs/seasonalevents.json | 8 ++--- .../Models/Spt/Config/SeasonalEventConfig.cs | 4 +-- .../Services/LocationLifecycleService.cs | 35 +++++++++++++------ 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/seasonalevents.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/seasonalevents.json index f495ce91..fcb3143f 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/seasonalevents.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/seasonalevents.json @@ -14000,7 +14000,7 @@ ] } }, - "khorvodEventTransitWhitelist": { + "khorovodEventTransitWhitelist": { "shoreline": [ 24 ], @@ -14013,11 +14013,11 @@ "woods": [ 15 ], - "factory4_day": [ - 13 - ], "bigmap": [ 11 + ], + "interchange": [ + ] } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs index cdfefef7..d1b5f55a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs @@ -47,8 +47,8 @@ public record SeasonalEventConfig : BaseConfig [JsonPropertyName("hostilitySettingsForEvent")] public required Dictionary>> HostilitySettingsForEvent { get; set; } - [JsonPropertyName("khorvodEventTransitWhitelist")] - public required Dictionary> KhorvodEventTransitWhitelist { get; set; } + [JsonPropertyName("khorovodEventTransitWhitelist")] + public required Dictionary> KhorovodEventTransitWhitelist { get; set; } /// /// Ids of containers on locations that only have Christmas loot diff --git a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs index 41c4eeef..8a410d5c 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs @@ -116,23 +116,36 @@ public class LocationLifecycleService( var location = GenerateLocationAndLoot(sessionId, request.Location, !request.ShouldSkipLootGeneration ?? true); var isRundansActive = databaseService.GetGlobals().Configuration.RunddansSettings.Active; - // Handle Runddans / Khorovod event - if (transitionType == TransitionType.EVENT && isRundansActive) + if (transitionType == TransitionType.EVENT) { - // TODO - wire up this first part to EnableKhorvodEvent in Seasonal config + move isRundansActive check to below block - if (location.Transits != null) + // Handle Runddans / Khorovod event + if (isRundansActive && location.Transits is not null) { // Get whitelist for maps transits, event should have 1 only - var matchingTransitWhitelist = SeasonalEventConfig.KhorvodEventTransitWhitelist?.GetValueOrDefault(location.Id, null); - if (matchingTransitWhitelist != null) - { - location.Transits = location.Transits.Where(transit => matchingTransitWhitelist.Contains(transit.Id.Value)).ToList(); - } + var matchingTransitWhitelist = SeasonalEventConfig.KhorovodEventTransitWhitelist.GetValueOrDefault( + location.Id.ToLowerInvariant(), + [] + ); foreach (var transits in location.Transits) { - transits.ActivateAfterSeconds = 300; - transits.Events = true; + if (transits.Id is null) + { + continue; + } + + // ActivateAfterSeconds sets the timer on the generator, events is needed because it is checked again in the client + // To enable certain stuff for the Khorovod event + if (matchingTransitWhitelist.Contains(transits.Id.Value)) + { + transits.ActivateAfterSeconds = 20; + transits.Events = true; + } + else + { + // Disable the other transits in this event, people are only allowed to transit to certain points + transits.IsActive = false; + } } } }