Removed Product as a whole, it was just an item
This commit is contained in:
@@ -10,7 +10,6 @@ using Core.Servers;
|
||||
using Core.Services;
|
||||
using Core.Utils.Cloners;
|
||||
using SptCommon.Annotations;
|
||||
using Product = Core.Models.Eft.ItemEvent.Product;
|
||||
|
||||
namespace Core.Controllers;
|
||||
|
||||
@@ -174,7 +173,7 @@ public class CustomizationController(
|
||||
{
|
||||
output.ProfileChanges[sessionId]
|
||||
.Items?.DeletedItems.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = inventoryItem.Id,
|
||||
Template = inventoryItem.Template,
|
||||
@@ -202,7 +201,7 @@ public class CustomizationController(
|
||||
{
|
||||
output.ProfileChanges[sessionId]
|
||||
.Items?.DeletedItems.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = inventoryItem.Id,
|
||||
Template = inventoryItem.Template,
|
||||
@@ -225,7 +224,7 @@ public class CustomizationController(
|
||||
inventoryItem.Upd.StackObjectsCount -= paymentItemDetails.Count;
|
||||
output.ProfileChanges[sessionId]
|
||||
.Items?.ChangedItems?.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = inventoryItem.Id,
|
||||
Template = inventoryItem.Template,
|
||||
|
||||
@@ -600,7 +600,7 @@ public class HideoutController(
|
||||
return productionTime * fenceLevel.ScavCaseTimeModifier;
|
||||
}
|
||||
|
||||
public void AddScavCaseRewardsToProfile(PmcData pmcData, List<Product> rewards, string recipeId)
|
||||
public void AddScavCaseRewardsToProfile(PmcData pmcData, List<Item> rewards, string recipeId)
|
||||
{
|
||||
pmcData.Hideout.Production[$"ScavCase{recipeId}"] = new Production { Products = rewards, RecipeId = recipeId };
|
||||
}
|
||||
@@ -1236,7 +1236,7 @@ public class HideoutController(
|
||||
if (existingMannequin is null)
|
||||
{
|
||||
var standId = _hashUtil.Generate();
|
||||
var mannequinToAdd = new Product
|
||||
var mannequinToAdd = new Item
|
||||
{
|
||||
Id = standId,
|
||||
Template = ItemTpl.INVENTORY_DEFAULT,
|
||||
@@ -1246,7 +1246,7 @@ public class HideoutController(
|
||||
pmcData.Inventory.Items.Add(mannequinToAdd);
|
||||
|
||||
// Add pocket child item
|
||||
var mannequinPocketItemToAdd = new Product
|
||||
var mannequinPocketItemToAdd = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Template = pmcData.Inventory.Items.FirstOrDefault(
|
||||
|
||||
@@ -13,7 +13,6 @@ using Core.Utils;
|
||||
using Core.Utils.Cloners;
|
||||
using Core.Models.Eft.Profile;
|
||||
using Core.Models.Spt.Dialog;
|
||||
using Product = Core.Models.Eft.ItemEvent.Product;
|
||||
|
||||
namespace Core.Controllers;
|
||||
|
||||
@@ -307,7 +306,7 @@ public class InventoryController(
|
||||
var mapItem = _mapMarkerService.EditMarkerOnMap(pmcData, request);
|
||||
|
||||
// sync with client
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(mapItem.ConvertToProduct());
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(mapItem);
|
||||
}
|
||||
|
||||
public void DeleteMapMarker(PmcData pmcData, InventoryDeleteMarkerRequestData request, string sessionId,
|
||||
@@ -316,7 +315,7 @@ public class InventoryController(
|
||||
var mapItem = _mapMarkerService.DeleteMarkerFromMap(pmcData, request);
|
||||
|
||||
// sync with client
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(mapItem.ConvertToProduct());
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(mapItem);
|
||||
}
|
||||
|
||||
public void CreateMapMarker(PmcData pmcData, InventoryCreateMarkerRequestData request, string sessionId,
|
||||
@@ -325,7 +324,7 @@ public class InventoryController(
|
||||
var adjustedMapItem = _mapMarkerService.CreateMarkerOnMap(pmcData, request);
|
||||
|
||||
// Sync with client
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(adjustedMapItem.ConvertToProduct());
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(adjustedMapItem);
|
||||
}
|
||||
|
||||
public void SortInventory(PmcData pmcData, InventorySortRequestData request, string sessionId,
|
||||
@@ -682,7 +681,7 @@ public class InventoryController(
|
||||
destinationItem.Upd.StackObjectsCount +=
|
||||
sourceItem.Upd.StackObjectsCount; // Add source stackcount to destination
|
||||
output.ProfileChanges[sessionID]
|
||||
.Items.DeletedItems.Add(new Product { Id = sourceItem.Id }); // Inform client source item being deleted
|
||||
.Items.DeletedItems.Add(new Item { Id = sourceItem.Id }); // Inform client source item being deleted
|
||||
|
||||
var indexOfItemToRemove = inventoryItems.From.FindIndex((x) => x.Id == sourceItem.Id);
|
||||
if (indexOfItemToRemove == -1)
|
||||
@@ -733,7 +732,7 @@ public class InventoryController(
|
||||
// Inform client of change
|
||||
output.ProfileChanges[sessionID]
|
||||
.Items.NewItems.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = request.NewItem,
|
||||
Template = itemToSplit.Template,
|
||||
|
||||
@@ -13,7 +13,6 @@ using Core.Servers;
|
||||
using Core.Services;
|
||||
using Core.Utils;
|
||||
using Core.Utils.Cloners;
|
||||
using Product = Core.Models.Eft.ItemEvent.Product;
|
||||
|
||||
|
||||
namespace Core.Controllers;
|
||||
@@ -297,7 +296,7 @@ public class QuestController(
|
||||
// Important: don't tell the client to remove the attachments, it will handle it
|
||||
output.ProfileChanges[sessionID]
|
||||
.Items.DeletedItems.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = itemHandover.Id
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class RepairController(
|
||||
}
|
||||
|
||||
// Add repaired item to output object
|
||||
output.ProfileChanges[sessionID].Items.ChangedItems.Add(repairDetails.RepairedItem.ConvertToProduct());
|
||||
output.ProfileChanges[sessionID].Items.ChangedItems.Add(repairDetails.RepairedItem);
|
||||
|
||||
// Add skill points for repairing weapons
|
||||
_repairService.AddRepairSkillPoints(sessionID, repairDetails, pmcData);
|
||||
|
||||
@@ -15,7 +15,6 @@ using Core.Utils;
|
||||
using Core.Utils.Cloners;
|
||||
using SptCommon.Annotations;
|
||||
using SptCommon.Extensions;
|
||||
using Product = Core.Models.Eft.ItemEvent.Product;
|
||||
|
||||
namespace Core.Helpers;
|
||||
|
||||
@@ -146,7 +145,7 @@ public class InventoryHelper(
|
||||
|
||||
// Add item + mods to output and profile inventory
|
||||
output.ProfileChanges[sessionId]
|
||||
.Items.NewItems.AddRange(itemWithModsToAddClone.Select(x => x.ConvertToProduct()));
|
||||
.Items.NewItems.AddRange(itemWithModsToAddClone.Select(x => x));
|
||||
pmcData.Inventory.Items.AddRange(itemWithModsToAddClone);
|
||||
|
||||
_logger.Debug(
|
||||
@@ -463,7 +462,7 @@ public class InventoryHelper(
|
||||
var insuredItems = profile.InsuredItems;
|
||||
|
||||
// We have output object, inform client of root item deletion, not children
|
||||
if (output is not null) output.ProfileChanges[sessionId].Items.DeletedItems.Add(new Product { Id = itemId });
|
||||
if (output is not null) output.ProfileChanges[sessionId].Items.DeletedItems.Add(new Item { Id = itemId });
|
||||
|
||||
foreach (var item in itemAndChildrenToRemove)
|
||||
{
|
||||
@@ -576,7 +575,7 @@ public class InventoryHelper(
|
||||
itemToReduce.Upd.StackObjectsCount -= remainingCount;
|
||||
remainingCount = 0;
|
||||
if (output is not null)
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(itemToReduce.ConvertToProduct());
|
||||
output.ProfileChanges[sessionId].Items.ChangedItems.Add(itemToReduce);
|
||||
}
|
||||
|
||||
if (remainingCount == 0)
|
||||
|
||||
@@ -2007,19 +2007,6 @@ public class ItemHelper(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Product GetProductFromItem(Item item)
|
||||
{
|
||||
return new Product
|
||||
{
|
||||
Id = item.Id,
|
||||
Template = item.Template,
|
||||
ParentId = item.ParentId,
|
||||
SlotId = item.SlotId,
|
||||
Location = ((JsonElement)item.Location).ToObject<ItemLocation>(),
|
||||
Upd = item.Upd,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemSize
|
||||
|
||||
@@ -12,8 +12,6 @@ using Core.Services;
|
||||
using Core.Utils;
|
||||
using Core.Utils.Cloners;
|
||||
using SptCommon.Extensions;
|
||||
using Product = Core.Models.Eft.ItemEvent.Product;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.Helpers;
|
||||
|
||||
@@ -544,7 +542,7 @@ public class QuestHelper(
|
||||
{
|
||||
output.ProfileChanges[sessionId]
|
||||
.Items.ChangedItems.Add(
|
||||
new Product
|
||||
new Item
|
||||
{
|
||||
Id = item.Id,
|
||||
Template = item.Template,
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Core.Helpers
|
||||
var craftingRecipes = _databaseService.GetHideout().Production.Recipes;
|
||||
|
||||
// Area that will be used to craft unlocked item
|
||||
var desiredHideoutAreaType = int.Parse(craftUnlockReward.TraderId.ToString());
|
||||
var desiredHideoutAreaType = (HideoutAreas)craftUnlockReward.TraderId;
|
||||
|
||||
var matchingProductions = craftingRecipes.Where(
|
||||
(prod) =>
|
||||
|
||||
Reference in New Issue
Block a user