First pass at rest area hideout changes

This commit is contained in:
Chomp
2025-08-23 21:02:24 +01:00
parent 8f84ff0723
commit 0df0d95363
6 changed files with 54 additions and 3 deletions
@@ -371,4 +371,14 @@ public class InventoryCallbacks(InventoryController inventoryController, QuestCo
inventoryController.PinOrLock(pmcData, info, sessionID, output);
return output;
}
public ItemEventRouterResponse SaveDialogueState(
PmcData pmcData,
SaveDialogueStateRequest request,
MongoId sessionId,
ItemEventRouterResponse output
)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
namespace SPTarkov.Server.Core.Models.Eft.Inventory;
public record SaveDialogueStateRequest : InventoryBaseActionRequestData
{
[JsonPropertyName("nodePathTraveled")]
public List<NodePathTraveled> NodePathTraveled { get; set; }
}
public class NodePathTraveled
{
[JsonPropertyName("traderId")]
public string TraderId { get; set; }
[JsonPropertyName("dialogueId")]
public string DialogueId { get; set; }
[JsonPropertyName("nodeId")]
public string NodeId { get; set; }
}
@@ -1,5 +1,3 @@
using System.Text.Json.Serialization;
namespace SPTarkov.Server.Core.Models.Enums;
public record ItemEventActions
@@ -58,4 +56,5 @@ public record ItemEventActions
public const string EAT = "Eat";
public const string CUSTOMIZATION_SET = "CustomizationSet";
public const string CUSTOMIZATION_BUY = "CustomizationBuy";
public const string SAVE_DIALOGUE_STATE = "SaveDialogueState";
}
@@ -147,6 +147,10 @@ public class InventoryItemEventRouter(InventoryCallbacks inventoryCallbacks, Hid
return new ValueTask<ItemEventRouterResponse>(
inventoryCallbacks.PinOrLock(pmcData, body as PinOrLockItemRequest, sessionID, output)
);
case ItemEventActions.SAVE_DIALOGUE_STATE:
return new ValueTask<ItemEventRouterResponse>(
inventoryCallbacks.SaveDialogueState(pmcData, body as SaveDialogueStateRequest, sessionID, output)
);
default:
throw new Exception($"InventoryItemEventRouter being used when it cant handle route {url}");
}
@@ -1,6 +1,5 @@
using System.Text.RegularExpressions;
using SPTarkov.DI.Annotations;
using SPTarkov.Server.Core.Exceptions;
using SPTarkov.Server.Core.Extensions;
using SPTarkov.Server.Core.Helpers;
using SPTarkov.Server.Core.Models.Common;
@@ -421,6 +420,22 @@ public class ProfileFixerService(
}
}
var restArea = pmcProfile.Hideout.Areas.FirstOrDefault(area => area.Type == HideoutAreas.RestSpace);
if (restArea is not null)
{
var slots = restArea.Slots.Count;
if (slots < 1)
{
if (logger.IsLogEnabled(LogLevel.Debug))
{
logger.Debug("Updating restArea slots to a size of 1");
}
AddEmptyObjectsToHideoutAreaSlots(HideoutAreas.RestSpace, 1, pmcProfile);
}
}
var waterCollSlots = pmcProfile.Hideout.Areas.FirstOrDefault(x => x.Type == HideoutAreas.WaterCollector)?.Slots?.Count;
var extraWaterCollSlots = globals.Configuration.SkillsSettings.HideoutManagement.EliteSlots.WaterCollector.Slots;
@@ -185,6 +185,8 @@ public class BaseInteractionRequestDataConverter : JsonConverter<BaseInteraction
return JsonSerializer.Deserialize<FailQuestRequestData>(jsonText, options);
case ItemEventActions.PIN_LOCK:
return JsonSerializer.Deserialize<PinOrLockItemRequest>(jsonText, options);
case ItemEventActions.SAVE_DIALOGUE_STATE:
return JsonSerializer.Deserialize<SaveDialogueStateRequest>(jsonText, options);
default:
if (_modHandlers.TryGetValue(action, out var handler))
{