Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ public ItemEventRouterResponse SaveDialogueState(
ItemEventRouterResponse output
)
{
throw new NotImplementedException();
inventoryController.SetDialogueProgress(pmcData, request, sessionId, output);
return output;
}
}
13 changes: 13 additions & 0 deletions Libraries/SPTarkov.Server.Core/Controllers/InventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ public void PinOrLock(PmcData pmcData, PinOrLockItemRequest request, MongoId ses
itemToAdjust.Upd.PinLockState = request.State;
}

/// <summary>
/// Handle /client/game/profile/items/moving SaveDialogueState
/// </summary>
/// <param name="pmcData">Player's PMC profile</param>
/// <param name="request"></param>
/// <param name="sessionId">Session/Player id</param>
/// <param name="output"></param>
public void SetDialogueProgress(PmcData pmcData, SaveDialogueStateRequest request, MongoId sessionId, ItemEventRouterResponse output)
{
var fullProfile = profileHelper.GetFullProfile(sessionId);
fullProfile.DialogueProgress = request.DialogueProgress;
}

/// <summary>
/// Handle /client/game/profile/items/moving SetFavoriteItems
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ namespace SPTarkov.Server.Core.Models.Eft.Inventory;
public record SaveDialogueStateRequest : InventoryBaseActionRequestData
{
[JsonPropertyName("nodePathTraveled")]
public List<NodePathTraveled> NodePathTraveled { get; set; }
public List<NodePathTraveled>? DialogueProgress { get; set; }
}

public class NodePathTraveled
{
[JsonPropertyName("traderId")]
public string TraderId { get; set; }
public string? TraderId { get; set; }

[JsonPropertyName("dialogueId")]
public string DialogueId { get; set; }
public string? DialogueId { get; set; }

[JsonPropertyName("nodeId")]
public string NodeId { get; set; }
public string? NodeId { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Eft.Common;
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
using SPTarkov.Server.Core.Models.Eft.Inventory;
using SPTarkov.Server.Core.Models.Eft.Prestige;
using SPTarkov.Server.Core.Models.Enums;
using SPTarkov.Server.Core.Models.Spt.Dialog;
Expand Down Expand Up @@ -58,6 +59,12 @@ public record SptProfile
/// </summary>
[JsonPropertyName("customisationUnlocks")]
public List<CustomisationStorage>? CustomisationUnlocks { get; set; }

/// <summary>
/// Stores the most recently sent dialog progress result from the client
/// </summary>
[JsonPropertyName("dialogueProgress")]
public List<NodePathTraveled>? DialogueProgress { get; set; }
}

public record TraderPurchaseData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ protected override List<HandledRoute> GetHandledRoutes()
new(ItemEventActions.SET_FAVORITE_ITEMS, false),
new(ItemEventActions.QUEST_FAIL, false),
new(ItemEventActions.PIN_LOCK, false),
new(ItemEventActions.SAVE_DIALOGUE_STATE, false),
};
}

Expand Down
Loading