Converted sessionIds from strings to MongoId struct
This commit is contained in:
@@ -166,11 +166,7 @@ public class MatchCallbacks(
|
||||
/// Handle client/analytics/event-disconnect
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ValueTask<string> EventDisconnect(
|
||||
string url,
|
||||
PutMetricsRequestData info,
|
||||
string sessionID
|
||||
)
|
||||
public ValueTask<string> EventDisconnect(string url, PutMetricsRequestData info, string MongoId)
|
||||
{
|
||||
return new ValueTask<string>(httpResponseUtil.NullResponse());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
using SPTarkov.Server.Core.Servers;
|
||||
@@ -21,7 +22,7 @@ public class AchievementController(
|
||||
/// </summary>
|
||||
/// <param name="sessionID">Session/player id</param>
|
||||
/// <returns></returns>
|
||||
public virtual GetAchievementsResponse GetAchievements(string sessionID)
|
||||
public virtual GetAchievementsResponse GetAchievements(MongoId sessionID)
|
||||
{
|
||||
return new GetAchievementsResponse { Elements = databaseService.GetAchievements() };
|
||||
}
|
||||
@@ -31,7 +32,7 @@ public class AchievementController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <returns>CompletedAchievementsResponse</returns>
|
||||
public virtual CompletedAchievementsResponse GetAchievementStatics(string sessionId)
|
||||
public virtual CompletedAchievementsResponse GetAchievementStatics(MongoId sessionId)
|
||||
{
|
||||
var stats = new Dictionary<string, int>();
|
||||
var profiles = profileHelper
|
||||
|
||||
@@ -82,7 +82,7 @@ public class BotController(
|
||||
/// <param name="ignoreRaidSettings">OPTIONAL - should raid settings chosen pre-raid be ignored</param>
|
||||
/// <returns>Difficulty object</returns>
|
||||
public DifficultyCategories GetBotDifficulty(
|
||||
string sessionId,
|
||||
MongoId sessionId,
|
||||
string type,
|
||||
string diffLevel,
|
||||
bool ignoreRaidSettings = false
|
||||
@@ -192,7 +192,7 @@ public class BotController(
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns>List of bots</returns>
|
||||
public List<BotBase> Generate(string sessionId, GenerateBotsRequestData request)
|
||||
public List<BotBase> Generate(MongoId sessionId, GenerateBotsRequestData request)
|
||||
{
|
||||
var pmcProfile = _profileHelper.GetPmcProfile(sessionId);
|
||||
|
||||
@@ -209,7 +209,7 @@ public class BotController(
|
||||
protected List<BotBase> GenerateBotWaves(
|
||||
GenerateBotsRequestData request,
|
||||
PmcData? pmcProfile,
|
||||
string sessionId
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var generatedBotList = new List<BotBase>();
|
||||
@@ -268,7 +268,7 @@ public class BotController(
|
||||
GenerateCondition generateRequest,
|
||||
BotGenerationDetails botGenerationDetails,
|
||||
List<BotBase> botList,
|
||||
string sessionId
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var isEventBot = generateRequest.Role?.Contains(
|
||||
@@ -352,7 +352,7 @@ public class BotController(
|
||||
/// Pull raid settings from Application context
|
||||
/// </summary>
|
||||
/// <returns>GetRaidConfigurationRequestData if it exists</returns>
|
||||
protected GetRaidConfigurationRequestData? GetMostRecentRaidSettings(string sessionId)
|
||||
protected GetRaidConfigurationRequestData? GetMostRecentRaidSettings(MongoId sessionId)
|
||||
{
|
||||
var raidConfiguration = _profileActivityService
|
||||
.GetProfileActivityRaidData(sessionId)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Builds;
|
||||
using SPTarkov.Server.Core.Models.Eft.PresetBuild;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
@@ -27,7 +28,7 @@ public class BuildController(
|
||||
/// </summary>
|
||||
/// <param name="sessionID">Session/player id</param>
|
||||
/// <returns></returns>
|
||||
public UserBuilds? GetUserBuilds(string sessionID)
|
||||
public UserBuilds? GetUserBuilds(MongoId sessionID)
|
||||
{
|
||||
const string secureContainerSlotId = "SecuredContainer";
|
||||
|
||||
@@ -90,7 +91,7 @@ public class BuildController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="body"></param>
|
||||
public void SaveWeaponBuild(string sessionId, PresetBuildActionRequestData body)
|
||||
public void SaveWeaponBuild(MongoId sessionId, PresetBuildActionRequestData body)
|
||||
{
|
||||
var pmcData = _profileHelper.GetPmcProfile(sessionId);
|
||||
|
||||
@@ -130,7 +131,7 @@ public class BuildController(
|
||||
/// </summary>
|
||||
/// <param name="sessionID">Session/player id</param>
|
||||
/// <param name="request"></param>
|
||||
public void SaveEquipmentBuild(string sessionID, PresetBuildActionRequestData request)
|
||||
public void SaveEquipmentBuild(MongoId sessionID, PresetBuildActionRequestData request)
|
||||
{
|
||||
var profile = _profileHelper.GetFullProfile(sessionID);
|
||||
var pmcData = profile.CharacterData.PmcData;
|
||||
@@ -173,7 +174,7 @@ public class BuildController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="request"></param>
|
||||
public void RemoveBuild(string sessionId, RemoveBuildRequestData request)
|
||||
public void RemoveBuild(MongoId sessionId, RemoveBuildRequestData request)
|
||||
{
|
||||
if (request.Id is not null)
|
||||
{
|
||||
@@ -186,7 +187,7 @@ public class BuildController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="request"></param>
|
||||
public void CreateMagazineTemplate(string sessionId, SetMagazineRequest request)
|
||||
public void CreateMagazineTemplate(MongoId sessionId, SetMagazineRequest request)
|
||||
{
|
||||
var result = new MagazineBuild
|
||||
{
|
||||
@@ -220,8 +221,8 @@ public class BuildController(
|
||||
/// Remove build from players profile
|
||||
/// </summary>
|
||||
/// <param name="idToRemove"></param>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
protected void RemovePlayerBuild(string idToRemove, string sessionID)
|
||||
/// <param name="sessionID">Session/Player id</param>
|
||||
protected void RemovePlayerBuild(string idToRemove, MongoId sessionID)
|
||||
{
|
||||
var profile = _saveServer.GetProfile(sessionID);
|
||||
var weaponBuilds = profile.UserBuildData.WeaponBuilds;
|
||||
|
||||
@@ -28,16 +28,13 @@ public class CustomizationController(
|
||||
PaymentService _paymentService
|
||||
)
|
||||
{
|
||||
protected const string _lowerParentClothingId = "5cd944d01388ce000a659df9";
|
||||
protected const string _upperParentClothingId = "5cd944ca1388ce03a44dc2a4";
|
||||
|
||||
/// <summary>
|
||||
/// Get purchasable clothing items from trader that match players side (usec/bear)
|
||||
/// </summary>
|
||||
/// <param name="traderId">trader to look up clothing for</param>
|
||||
/// <param name="sessionId">Session id</param>
|
||||
/// <returns>Suit array</returns>
|
||||
public List<Suit> GetTraderSuits(string traderId, string sessionId)
|
||||
public List<Suit> GetTraderSuits(string traderId, MongoId sessionId)
|
||||
{
|
||||
var pmcData = _profileHelper.GetPmcProfile(sessionId);
|
||||
var clothing = _databaseService.GetCustomization();
|
||||
@@ -75,7 +72,7 @@ public class CustomizationController(
|
||||
public ItemEventRouterResponse BuyCustomisation(
|
||||
PmcData pmcData,
|
||||
BuyClothingRequestData buyClothingRequest,
|
||||
string sessionId
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var output = _eventOutputHolder.GetOutput(sessionId);
|
||||
@@ -130,7 +127,7 @@ public class CustomizationController(
|
||||
/// <param name="suitId">clothing id</param>
|
||||
/// <param name="sessionId">Session id of profile to check for clothing in</param>
|
||||
/// <returns>true if already purchased</returns>
|
||||
protected bool OutfitAlreadyPurchased(object suitId, string sessionId)
|
||||
protected bool OutfitAlreadyPurchased(object suitId, MongoId sessionId)
|
||||
{
|
||||
var fullProfile = _profileHelper.GetFullProfile(sessionId);
|
||||
|
||||
@@ -146,7 +143,7 @@ public class CustomizationController(
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="offerId"></param>
|
||||
/// <returns>Suit</returns>
|
||||
protected Suit? GetTraderClothingOffer(string sessionId, string? offerId)
|
||||
protected Suit? GetTraderClothingOffer(MongoId sessionId, string? offerId)
|
||||
{
|
||||
var foundSuit = GetAllTraderSuits(sessionId).FirstOrDefault(s => s.Id == offerId);
|
||||
if (foundSuit is null)
|
||||
@@ -170,7 +167,7 @@ public class CustomizationController(
|
||||
/// <param name="itemsToPayForClothingWith">Clothing purchased</param>
|
||||
/// <param name="output">Client response</param>
|
||||
protected void PayForClothingItems(
|
||||
string sessionId,
|
||||
MongoId sessionId,
|
||||
PmcData pmcData,
|
||||
List<PaymentItemForClothing>? itemsToPayForClothingWith,
|
||||
ItemEventRouterResponse output
|
||||
@@ -210,7 +207,7 @@ public class CustomizationController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <returns></returns>
|
||||
protected List<Suit> GetAllTraderSuits(string sessionId)
|
||||
protected List<Suit> GetAllTraderSuits(MongoId sessionId)
|
||||
{
|
||||
var traders = _databaseService.GetTraders();
|
||||
var result = new List<Suit>();
|
||||
@@ -234,7 +231,7 @@ public class CustomizationController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <returns></returns>
|
||||
public HideoutCustomisation GetHideoutCustomisation(string sessionId)
|
||||
public HideoutCustomisation GetHideoutCustomisation(MongoId sessionId)
|
||||
{
|
||||
return _databaseService.GetHideout().Customisation!;
|
||||
}
|
||||
@@ -244,7 +241,7 @@ public class CustomizationController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <returns></returns>
|
||||
public List<CustomisationStorage> GetCustomisationStorage(string sessionId)
|
||||
public List<CustomisationStorage> GetCustomisationStorage(MongoId sessionId)
|
||||
{
|
||||
var customisationResultsClone = _cloner.Clone(
|
||||
_databaseService.GetTemplates().CustomisationStorage
|
||||
@@ -269,7 +266,7 @@ public class CustomizationController(
|
||||
/// <param name="pmcData">Players PMC profile</param>
|
||||
/// <returns></returns>
|
||||
public ItemEventRouterResponse SetCustomisation(
|
||||
string sessionId,
|
||||
MongoId sessionId,
|
||||
CustomizationSetRequest request,
|
||||
PmcData pmcData
|
||||
)
|
||||
@@ -311,7 +308,7 @@ public class CustomizationController(
|
||||
}
|
||||
|
||||
// Body
|
||||
if (dbSuit.Parent == _upperParentClothingId)
|
||||
if (dbSuit.Parent == CustomisationTypeId.UPPER)
|
||||
{
|
||||
pmcData.Customization.Body = dbSuit.Properties.Body;
|
||||
pmcData.Customization.Hands = dbSuit.Properties.Hands;
|
||||
@@ -320,7 +317,7 @@ public class CustomizationController(
|
||||
}
|
||||
|
||||
// Feet
|
||||
if (dbSuit.Parent == _lowerParentClothingId)
|
||||
if (dbSuit.Parent == CustomisationTypeId.LOWER)
|
||||
{
|
||||
pmcData.Customization.Feet = dbSuit.Properties.Feet;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
using SPTarkov.Server.Core.Helpers.Dialogue;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Eft.Ws;
|
||||
@@ -65,7 +66,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">session id</param>
|
||||
/// <returns>GetFriendListDataResponse</returns>
|
||||
public virtual GetFriendListDataResponse GetFriendList(string sessionId)
|
||||
public virtual GetFriendListDataResponse GetFriendList(MongoId sessionId)
|
||||
{
|
||||
// Add all chatbots to the friends list
|
||||
var friends = GetActiveChatBots();
|
||||
@@ -124,7 +125,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session Id</param>
|
||||
/// <returns>list of dialogs</returns>
|
||||
public virtual List<DialogueInfo> GenerateDialogueList(string sessionId)
|
||||
public virtual List<DialogueInfo> GenerateDialogueList(MongoId sessionId)
|
||||
{
|
||||
var data = new List<DialogueInfo>();
|
||||
foreach (var (_, dialog) in _dialogueHelper.GetDialogsForProfile(sessionId))
|
||||
@@ -147,7 +148,7 @@ public class DialogueController(
|
||||
/// <param name="dialogueId">Dialog id</param>
|
||||
/// <param name="sessionId">Session Id</param>
|
||||
/// <returns>DialogueInfo</returns>
|
||||
public virtual DialogueInfo? GetDialogueInfo(string? dialogueId, string sessionId)
|
||||
public virtual DialogueInfo? GetDialogueInfo(string? dialogueId, MongoId sessionId)
|
||||
{
|
||||
var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId);
|
||||
var dialogue = dialogs!.GetValueOrDefault(dialogueId);
|
||||
@@ -161,7 +162,7 @@ public class DialogueController(
|
||||
/// <param name="dialogue">Dialog</param>
|
||||
/// <param name="sessionId">Session Id</param>
|
||||
/// <returns>DialogueInfo</returns>
|
||||
public virtual DialogueInfo? GetDialogueInfo(Dialogue dialogue, string sessionId)
|
||||
public virtual DialogueInfo? GetDialogueInfo(Dialogue dialogue, MongoId sessionId)
|
||||
{
|
||||
if (!dialogue.Messages.Any())
|
||||
{
|
||||
@@ -192,7 +193,7 @@ public class DialogueController(
|
||||
public virtual List<UserDialogInfo> GetDialogueUsers(
|
||||
Dialogue? dialog,
|
||||
MessageType? messageType,
|
||||
string sessionId
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var profile = _saveServer.GetProfile(sessionId);
|
||||
@@ -241,7 +242,7 @@ public class DialogueController(
|
||||
/// <returns>GetMailDialogViewResponseData object</returns>
|
||||
public virtual GetMailDialogViewResponseData GenerateDialogueView(
|
||||
GetMailDialogViewRequestData request,
|
||||
string sessionId
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var dialogueId = request.DialogId;
|
||||
@@ -376,7 +377,7 @@ public class DialogueController(
|
||||
/// <param name="sessionId">Session id</param>
|
||||
/// <param name="dialogueId">Dialog id</param>
|
||||
/// <returns>Count of messages with attachments</returns>
|
||||
protected int GetUnreadMessagesWithAttachmentsCount(string sessionId, string dialogueId)
|
||||
protected int GetUnreadMessagesWithAttachmentsCount(MongoId sessionId, string dialogueId)
|
||||
{
|
||||
var newAttachmentCount = 0;
|
||||
var activeMessages = GetActiveMessagesFromDialog(sessionId, dialogueId);
|
||||
@@ -397,10 +398,10 @@ public class DialogueController(
|
||||
/// <summary>
|
||||
/// Get messages from a specific dialog that have items not expired
|
||||
/// </summary>
|
||||
/// <param name="sessionID">Session/Player id</param>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="dialogueId">Dialog to get mail attachments from</param>
|
||||
/// <returns>Message array</returns>
|
||||
protected List<Message> GetActiveMessagesFromDialog(string sessionId, string dialogueId)
|
||||
protected List<Message> GetActiveMessagesFromDialog(MongoId sessionId, string dialogueId)
|
||||
{
|
||||
var timeNow = _timeUtil.GetTimeStamp();
|
||||
var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId);
|
||||
@@ -430,7 +431,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="dialogueId">id of the dialog to remove</param>
|
||||
/// <param name="sessionId">Player id</param>
|
||||
public virtual void RemoveDialogue(string? dialogueId, string sessionId)
|
||||
public virtual void RemoveDialogue(string? dialogueId, MongoId sessionId)
|
||||
{
|
||||
var profile = _saveServer.GetProfile(sessionId);
|
||||
if (!profile.DialogueRecords.ContainsKey(dialogueId))
|
||||
@@ -454,7 +455,7 @@ public class DialogueController(
|
||||
/// <param name="dialogueId"></param>
|
||||
/// <param name="shouldPin"></param>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
public virtual void SetDialoguePin(string? dialogueId, bool shouldPin, string sessionId)
|
||||
public virtual void SetDialoguePin(string? dialogueId, bool shouldPin, MongoId sessionId)
|
||||
{
|
||||
var dialog = _dialogueHelper.GetDialogsForProfile(sessionId).GetValueOrDefault(dialogueId);
|
||||
if (dialog is null)
|
||||
@@ -478,10 +479,10 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="dialogueIds">Dialog ids to set as read</param>
|
||||
/// <param name="sessionId">Player profile id</param>
|
||||
public virtual void SetRead(List<string>? dialogueIds, string sessionId)
|
||||
public virtual void SetRead(List<string>? dialogueIds, MongoId sessionId)
|
||||
{
|
||||
var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId);
|
||||
if (dialogs is null || !dialogs.Any())
|
||||
if (dialogs?.Any() != true)
|
||||
{
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText(
|
||||
@@ -506,8 +507,11 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="dialogueId">Dialog to get mail attachments from</param>
|
||||
/// <param name="sessionId">Session id</param>
|
||||
/// <returns>GetAllAttachmentsResponse or null if dialogue doesnt exist</returns>
|
||||
public virtual GetAllAttachmentsResponse GetAllAttachments(string dialogueId, string sessionId)
|
||||
/// <returns>GetAllAttachmentsResponse or null if dialogue doesn't exist</returns>
|
||||
public virtual GetAllAttachmentsResponse? GetAllAttachments(
|
||||
string dialogueId,
|
||||
MongoId sessionId
|
||||
)
|
||||
{
|
||||
var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId);
|
||||
var dialog = dialogs.TryGetValue(dialogueId, out var dialogInfo);
|
||||
@@ -519,7 +523,7 @@ public class DialogueController(
|
||||
}
|
||||
|
||||
// Removes corner 'new messages' tag
|
||||
dialogInfo.AttachmentsNew = 0;
|
||||
dialogInfo!.AttachmentsNew = 0;
|
||||
|
||||
var activeMessages = GetActiveMessagesFromDialog(sessionId, dialogueId);
|
||||
var messagesWithAttachments = GetMessageWithAttachments(activeMessages);
|
||||
@@ -538,7 +542,10 @@ public class DialogueController(
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async ValueTask<string> SendMessage(string sessionId, SendMessageRequest request)
|
||||
public virtual async ValueTask<string> SendMessage(
|
||||
MongoId sessionId,
|
||||
SendMessageRequest request
|
||||
)
|
||||
{
|
||||
_mailSendService.SendPlayerMessageToNpc(sessionId, request.DialogId!, request.Text!);
|
||||
|
||||
@@ -570,7 +577,7 @@ public class DialogueController(
|
||||
/// Delete expired items from all messages in player profile. triggers when updating traders.
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session id</param>
|
||||
protected void RemoveExpiredItemsFromMessages(string sessionId)
|
||||
protected void RemoveExpiredItemsFromMessages(MongoId sessionId)
|
||||
{
|
||||
foreach (var (dialogId, _) in _dialogueHelper.GetDialogsForProfile(sessionId))
|
||||
{
|
||||
@@ -583,7 +590,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session id</param>
|
||||
/// <param name="dialogueId">Dialog id</param>
|
||||
protected void RemoveExpiredItemsFromMessage(string sessionId, string dialogueId)
|
||||
protected void RemoveExpiredItemsFromMessage(MongoId sessionId, string dialogueId)
|
||||
{
|
||||
var dialogs = _dialogueHelper.GetDialogsForProfile(sessionId);
|
||||
if (!dialogs.TryGetValue(dialogueId, out var dialog))
|
||||
@@ -617,12 +624,12 @@ public class DialogueController(
|
||||
/// <param name="request">Sent friend request</param>
|
||||
/// <returns></returns>
|
||||
public virtual FriendRequestSendResponse SendFriendRequest(
|
||||
string sessionID,
|
||||
MongoId sessionID,
|
||||
FriendRequestData request
|
||||
)
|
||||
{
|
||||
// To avoid needing to jump between profiles, auto-accept all friend requests
|
||||
var friendProfile = _profileHelper.GetFullProfile(request.To);
|
||||
var friendProfile = _profileHelper.GetFullProfile(request.To.Value);
|
||||
if (friendProfile?.CharacterData?.PmcData is null)
|
||||
{
|
||||
return new FriendRequestSendResponse
|
||||
@@ -671,7 +678,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="sessionID">Session/player id</param>
|
||||
/// <param name="request">Sent delete friend request</param>
|
||||
public virtual void DeleteFriend(string sessionID, DeleteFriendRequest request)
|
||||
public virtual void DeleteFriend(MongoId sessionID, DeleteFriendRequest request)
|
||||
{
|
||||
var profile = _saveServer.GetProfile(sessionID);
|
||||
var friendIndex = profile.FriendProfileIds.IndexOf(request.FriendId);
|
||||
@@ -686,7 +693,7 @@ public class DialogueController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <param name="request">Client request to clear messages</param>
|
||||
public void ClearMessages(string sessionId, ClearMailMessageRequest request)
|
||||
public void ClearMessages(MongoId sessionId, ClearMailMessageRequest request)
|
||||
{
|
||||
var profile = _saveServer.GetProfile(sessionId);
|
||||
if (!profile.DialogueRecords.TryGetValue(request.DialogId, out var dialogToClear))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.ItemEvent;
|
||||
using SPTarkov.Server.Core.Models.Eft.Repair;
|
||||
@@ -15,25 +16,25 @@ public class RepairController(EventOutputHolder _eventOutputHolder, RepairServic
|
||||
/// Repair with trader
|
||||
/// </summary>
|
||||
/// <param name="sessionID">session id</param>
|
||||
/// <param name="body">endpoint request data</param>
|
||||
/// <param name="request">endpoint request data</param>
|
||||
/// <param name="pmcData">player profile</param>
|
||||
/// <returns>ItemEventRouterResponse</returns>
|
||||
public ItemEventRouterResponse TraderRepair(
|
||||
string sessionID,
|
||||
TraderRepairActionDataRequest body,
|
||||
MongoId sessionID,
|
||||
TraderRepairActionDataRequest request,
|
||||
PmcData pmcData
|
||||
)
|
||||
{
|
||||
var output = _eventOutputHolder.GetOutput(sessionID);
|
||||
|
||||
// find the item to repair
|
||||
foreach (var repairItem in body.RepairItems)
|
||||
foreach (var repairItem in request.RepairItems)
|
||||
{
|
||||
var repairDetails = _repairService.RepairItemByTrader(
|
||||
sessionID,
|
||||
pmcData,
|
||||
repairItem,
|
||||
body.TId
|
||||
request.TId
|
||||
);
|
||||
|
||||
_repairService.PayForRepair(
|
||||
@@ -41,7 +42,7 @@ public class RepairController(EventOutputHolder _eventOutputHolder, RepairServic
|
||||
pmcData,
|
||||
repairItem.Id,
|
||||
repairDetails.RepairCost.Value,
|
||||
body.TId,
|
||||
request.TId,
|
||||
output
|
||||
);
|
||||
|
||||
@@ -69,7 +70,7 @@ public class RepairController(EventOutputHolder _eventOutputHolder, RepairServic
|
||||
/// <param name="pmcData">player profile</param>
|
||||
/// <returns>ItemEventRouterResponse</returns>
|
||||
public ItemEventRouterResponse RepairWithKit(
|
||||
string sessionId,
|
||||
MongoId sessionId,
|
||||
RepairActionDataRequest body,
|
||||
PmcData pmcData
|
||||
)
|
||||
@@ -81,7 +82,7 @@ public class RepairController(EventOutputHolder _eventOutputHolder, RepairServic
|
||||
sessionId,
|
||||
pmcData,
|
||||
body.RepairKitsInfo,
|
||||
body.Target,
|
||||
body.Target.Value,
|
||||
output
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Generators;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Weather;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
@@ -47,7 +48,7 @@ public class WeatherController(
|
||||
/// </summary>
|
||||
/// <param name="sessionId">Session/Player id</param>
|
||||
/// <returns>GetLocalWeatherResponseData</returns>
|
||||
public GetLocalWeatherResponseData GenerateLocal(string sessionId)
|
||||
public GetLocalWeatherResponseData GenerateLocal(MongoId sessionId)
|
||||
{
|
||||
var result = new GetLocalWeatherResponseData
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ public class PlayerScavGenerator(
|
||||
/// </summary>
|
||||
/// <param name="sessionID">session id to specify what profile is updated</param>
|
||||
/// <returns>profile object</returns>
|
||||
public PmcData Generate(string sessionID)
|
||||
public PmcData Generate(MongoId sessionID)
|
||||
{
|
||||
// get karma level from profile
|
||||
var profile = _saveServer.GetProfile(sessionID);
|
||||
@@ -70,7 +70,7 @@ public class PlayerScavGenerator(
|
||||
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug($"Generated player scav loadout with karma level {scavKarmaLevel}");
|
||||
_logger.Debug($"Generated player scav load out with karma level: {scavKarmaLevel}");
|
||||
}
|
||||
|
||||
// Edit baseBotNode values
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||
@@ -18,5 +19,5 @@ public record FriendRequestData : IRequestData
|
||||
public int? RetryAfter { get; set; }
|
||||
|
||||
[JsonPropertyName("to")]
|
||||
public string? To { get; set; }
|
||||
public MongoId? To { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Inventory;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Repair;
|
||||
@@ -15,7 +16,7 @@ public record RepairActionDataRequest : InventoryBaseActionRequestData
|
||||
/// item to repair
|
||||
/// </summary>
|
||||
[JsonPropertyName("target")]
|
||||
public string? Target { get; set; }
|
||||
public MongoId? Target { get; set; }
|
||||
}
|
||||
|
||||
public record RepairKitsInfo
|
||||
|
||||
Reference in New Issue
Block a user