Use correct new MongoId() instead of hashutil
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Extensions;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
@@ -19,8 +18,7 @@ public class BtrDeliveryCallbacks(
|
||||
TimeUtil _timeUtil,
|
||||
ConfigServer _configServer,
|
||||
SaveServer _saveServer,
|
||||
HashUtil _hashUtil,
|
||||
ItemHelper _itemHelper
|
||||
HashUtil _hashUtil
|
||||
) : IOnUpdate
|
||||
{
|
||||
private readonly BtrDeliveryConfig _btrDeliveryConfig =
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace SPTarkov.Server.Core.Controllers;
|
||||
[Injectable]
|
||||
public class HideoutController(
|
||||
ISptLogger<HideoutController> _logger,
|
||||
HashUtil _hashUtil,
|
||||
TimeUtil _timeUtil,
|
||||
DatabaseService _databaseService,
|
||||
InventoryHelper _inventoryHelper,
|
||||
@@ -1189,7 +1188,7 @@ public class HideoutController(
|
||||
// Create root item
|
||||
var rewardToAdd = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = recipe.EndProduct,
|
||||
Upd = new Upd { StackObjectsCount = recipe.Count },
|
||||
};
|
||||
@@ -1207,7 +1206,7 @@ public class HideoutController(
|
||||
if (!rewardIsPreset)
|
||||
{
|
||||
itemAndChildrenToSendToPlayer.Add(
|
||||
[new Item { Id = _hashUtil.Generate(), Template = recipe.EndProduct }]
|
||||
[new Item { Id = new MongoId(), Template = recipe.EndProduct }]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1719,7 +1718,7 @@ public class HideoutController(
|
||||
// No child, add it
|
||||
if (existingMannequin is null)
|
||||
{
|
||||
var standId = _hashUtil.Generate();
|
||||
var standId = new MongoId();
|
||||
var mannequinToAdd = new Item
|
||||
{
|
||||
Id = standId,
|
||||
@@ -1732,7 +1731,7 @@ public class HideoutController(
|
||||
// Add pocket child item
|
||||
var mannequinPocketItemToAdd = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = pmcData
|
||||
.Inventory.Items.FirstOrDefault(item =>
|
||||
item.SlotId == "Pockets" && item.ParentId == pmcData.Inventory.Equipment
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Extensions;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
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.ItemEvent;
|
||||
@@ -25,15 +26,12 @@ public class TradeController(
|
||||
TradeHelper _tradeHelper,
|
||||
TimeUtil _timeUtil,
|
||||
RandomUtil _randomUtil,
|
||||
HashUtil _hashUtil,
|
||||
ItemHelper _itemHelper,
|
||||
ProfileHelper _profileHelper,
|
||||
RagfairOfferHelper _ragfairOfferHelper,
|
||||
TraderHelper _traderHelper,
|
||||
RagfairServer _ragfairServer,
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
RagfairPriceService _ragfairPriceService,
|
||||
MailSendService _mailSendService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
@@ -330,7 +328,7 @@ public class TradeController(
|
||||
// Create single currency item with all currency on it
|
||||
var rootCurrencyReward = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = Money.ROUBLES,
|
||||
Upd = new Upd { StackObjectsCount = roublesToSend },
|
||||
};
|
||||
|
||||
@@ -21,9 +21,7 @@ namespace SPTarkov.Server.Core.Generators;
|
||||
[Injectable]
|
||||
public class BotEquipmentModGenerator(
|
||||
ISptLogger<BotEquipmentModGenerator> _logger,
|
||||
HashUtil _hashUtil,
|
||||
RandomUtil _randomUtil,
|
||||
DatabaseService _databaseService,
|
||||
ItemHelper _itemHelper,
|
||||
BotEquipmentFilterService _botEquipmentFilterService,
|
||||
ItemFilterService _itemFilterService,
|
||||
@@ -187,7 +185,8 @@ public class BotEquipmentModGenerator(
|
||||
);
|
||||
switch (plateSlotFilteringOutcome.Result)
|
||||
{
|
||||
case Result.UNKNOWN_FAILURE or Result.NO_DEFAULT_FILTER:
|
||||
case Result.UNKNOWN_FAILURE
|
||||
or Result.NO_DEFAULT_FILTER:
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
@@ -260,7 +259,7 @@ public class BotEquipmentModGenerator(
|
||||
}
|
||||
|
||||
// Generate new id to ensure all items are unique on bot
|
||||
var modId = _hashUtil.Generate();
|
||||
var modId = new MongoId();
|
||||
equipment.Add(
|
||||
CreateModItem(
|
||||
modId,
|
||||
@@ -740,7 +739,7 @@ public class BotEquipmentModGenerator(
|
||||
request.WeaponStats.HasOptic = true;
|
||||
}
|
||||
|
||||
var modId = _hashUtil.Generate();
|
||||
var modId = new MongoId();
|
||||
request.Weapon.Add(
|
||||
CreateModItem(
|
||||
modId,
|
||||
@@ -1685,7 +1684,7 @@ public class BotEquipmentModGenerator(
|
||||
/// <param name="botRole">The bots role mod is being created for</param>
|
||||
/// <returns>Item object</returns>
|
||||
public Item CreateModItem(
|
||||
string modId,
|
||||
MongoId modId,
|
||||
string modTpl,
|
||||
string parentId,
|
||||
string modSlot,
|
||||
@@ -2031,7 +2030,7 @@ public class BotEquipmentModGenerator(
|
||||
foreach (var slot in cylinderMagTemplate.Properties.Slots)
|
||||
{
|
||||
var modSlotId = slot.Name;
|
||||
var modId = _hashUtil.Generate();
|
||||
var modId = new MongoId();
|
||||
items.Add(
|
||||
new Item
|
||||
{
|
||||
|
||||
@@ -794,9 +794,7 @@ public class BotGenerator(
|
||||
/// <returns></returns>
|
||||
public void AddIdsToBot(BotBase bot, BotGenerationDetails botGenerationDetails)
|
||||
{
|
||||
var botId = _hashUtil.Generate();
|
||||
|
||||
bot.Id = botId;
|
||||
bot.Id = new MongoId();
|
||||
bot.Aid = botGenerationDetails.IsPmc.GetValueOrDefault(false)
|
||||
? _hashUtil.GenerateAccountId()
|
||||
: 0;
|
||||
@@ -809,7 +807,7 @@ public class BotGenerator(
|
||||
/// <param name="profile">Profile to update</param>
|
||||
public void GenerateInventoryId(BotBase profile)
|
||||
{
|
||||
var newInventoryItemId = _hashUtil.Generate();
|
||||
var newInventoryItemId = new MongoId();
|
||||
|
||||
foreach (var item in profile.Inventory.Items)
|
||||
{
|
||||
@@ -892,7 +890,7 @@ public class BotGenerator(
|
||||
{
|
||||
Item inventoryItem = new()
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = GetDogtagTplByGameVersionAndSide(bot.Info.Side, bot.Info.GameVersion),
|
||||
ParentId = bot.Inventory.Equipment,
|
||||
SlotId = Slots.Dogtag,
|
||||
|
||||
@@ -18,9 +18,7 @@ namespace SPTarkov.Server.Core.Generators;
|
||||
[Injectable]
|
||||
public class BotInventoryGenerator(
|
||||
ISptLogger<BotInventoryGenerator> _logger,
|
||||
HashUtil _hashUtil,
|
||||
RandomUtil _randomUtil,
|
||||
DatabaseService _databaseService,
|
||||
ProfileActivityService _profileActivityService,
|
||||
BotWeaponGenerator _botWeaponGenerator,
|
||||
BotLootGenerator _botLootGenerator,
|
||||
@@ -133,12 +131,12 @@ public class BotInventoryGenerator(
|
||||
/// <returns>PmcInventory object</returns>
|
||||
public BotBaseInventory GenerateInventoryBase()
|
||||
{
|
||||
var equipmentId = _hashUtil.Generate();
|
||||
var stashId = _hashUtil.Generate();
|
||||
var questRaidItemsId = _hashUtil.Generate();
|
||||
var questStashItemsId = _hashUtil.Generate();
|
||||
var sortingTableId = _hashUtil.Generate();
|
||||
var hideoutCustomizationStashId = _hashUtil.Generate();
|
||||
var equipmentId = new MongoId();
|
||||
var stashId = new MongoId();
|
||||
var questRaidItemsId = new MongoId();
|
||||
var questStashItemsId = new MongoId();
|
||||
var sortingTableId = new MongoId();
|
||||
var hideoutCustomizationStashId = new MongoId();
|
||||
|
||||
return new BotBaseInventory
|
||||
{
|
||||
@@ -579,7 +577,7 @@ public class BotInventoryGenerator(
|
||||
}
|
||||
|
||||
// Create root item
|
||||
var id = _hashUtil.Generate();
|
||||
var id = new MongoId();
|
||||
Item item = new()
|
||||
{
|
||||
Id = id,
|
||||
|
||||
@@ -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.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Models.Spt.Bots;
|
||||
@@ -16,11 +17,9 @@ namespace SPTarkov.Server.Core.Generators;
|
||||
[Injectable]
|
||||
public class BotLootGenerator(
|
||||
ISptLogger<BotLootGenerator> _logger,
|
||||
HashUtil _hashUtil,
|
||||
RandomUtil _randomUtil,
|
||||
ItemHelper _itemHelper,
|
||||
InventoryHelper _inventoryHelper,
|
||||
DatabaseService _databaseService,
|
||||
HandbookHelper _handbookHelper,
|
||||
BotGeneratorHelper _botGeneratorHelper,
|
||||
BotWeaponGenerator _botWeaponGenerator,
|
||||
@@ -549,7 +548,7 @@ public class BotLootGenerator(
|
||||
continue;
|
||||
}
|
||||
|
||||
var newRootItemId = _hashUtil.Generate();
|
||||
var newRootItemId = new MongoId();
|
||||
List<Item> itemWithChildrenToAdd =
|
||||
[
|
||||
new()
|
||||
@@ -687,7 +686,7 @@ public class BotLootGenerator(
|
||||
[
|
||||
new()
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = _weightedRandomHelper.GetWeightedValue(
|
||||
_botConfig.WalletLoot.CurrencyWeight
|
||||
),
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace SPTarkov.Server.Core.Generators;
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class BotWeaponGenerator(
|
||||
ISptLogger<BotWeaponGenerator> _logger,
|
||||
HashUtil _hashUtil,
|
||||
DatabaseService _databaseService,
|
||||
ItemHelper _itemHelper,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
@@ -291,7 +290,7 @@ public class BotWeaponGenerator(
|
||||
weaponWithModsList.Add(
|
||||
new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = ammoTemplate,
|
||||
ParentId = weaponWithModsList[0].Id,
|
||||
SlotId = slotId,
|
||||
@@ -330,7 +329,7 @@ public class BotWeaponGenerator(
|
||||
[
|
||||
new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = weaponTemplate,
|
||||
ParentId = weaponParentId,
|
||||
SlotId = equipmentSlot,
|
||||
@@ -586,7 +585,7 @@ public class BotWeaponGenerator(
|
||||
{
|
||||
for (var i = 0; i < stackCount; i++)
|
||||
{
|
||||
var id = _hashUtil.Generate();
|
||||
var id = new MongoId();
|
||||
_botGeneratorHelper.AddItemWithChildrenToEquipmentSlot(
|
||||
new HashSet<EquipmentSlots> { EquipmentSlots.SecuredContainer },
|
||||
id,
|
||||
@@ -896,14 +895,14 @@ public class BotWeaponGenerator(
|
||||
/// Add desired ammo template as item to weapon modifications list, placed as child to UBGL.
|
||||
/// </summary>
|
||||
/// <param name="weaponMods">Weapon with children.</param>
|
||||
/// <param name="ubglMod">UBGL item.</param>
|
||||
/// <param name="ubglMod">Underbarrrel grenade launcher item.</param>
|
||||
/// <param name="ubglAmmoTpl">Grenade ammo template.</param>
|
||||
protected void FillUbgl(List<Item> weaponMods, Item ubglMod, string ubglAmmoTpl)
|
||||
{
|
||||
weaponMods.Add(
|
||||
new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = ubglAmmoTpl,
|
||||
ParentId = ubglMod.Id,
|
||||
SlotId = "patron_in_weapon",
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace SPTarkov.Server.Core.Generators;
|
||||
public class LootGenerator(
|
||||
ISptLogger<LootGenerator> _logger,
|
||||
RandomUtil _randomUtil,
|
||||
HashUtil _hashUtil,
|
||||
ItemHelper _itemHelper,
|
||||
PresetHelper _presetHelper,
|
||||
DatabaseService _databaseService,
|
||||
@@ -62,7 +61,7 @@ public class LootGenerator(
|
||||
[
|
||||
new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = chosenSealedContainer.Id,
|
||||
Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true },
|
||||
},
|
||||
@@ -216,7 +215,7 @@ public class LootGenerator(
|
||||
// Non-preset item to be added
|
||||
var newLootItem = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = itemTpl,
|
||||
Upd = new Upd { StackObjectsCount = randomisedItemCount, SpawnedInSession = true },
|
||||
};
|
||||
@@ -370,7 +369,7 @@ public class LootGenerator(
|
||||
|
||||
var newLootItem = new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = randomItem.Id,
|
||||
Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true },
|
||||
};
|
||||
@@ -641,7 +640,7 @@ public class LootGenerator(
|
||||
var chosenAmmoBox = _randomUtil.GetArrayValue(ammoBoxesMatchingCaliber);
|
||||
var ammoBoxReward = new List<Item>
|
||||
{
|
||||
new() { Id = _hashUtil.Generate(), Template = chosenAmmoBox.Id },
|
||||
new() { Id = new MongoId(), Template = chosenAmmoBox.Id },
|
||||
};
|
||||
_itemHelper.AddCartridgesToAmmoBox(ammoBoxReward, chosenAmmoBox);
|
||||
rewards.Add(ammoBoxReward);
|
||||
@@ -677,7 +676,7 @@ public class LootGenerator(
|
||||
var chosenRewardItem = _randomUtil.GetArrayValue(rewardItemPool);
|
||||
var rewardItem = new List<Item>
|
||||
{
|
||||
new() { Id = _hashUtil.Generate(), Template = chosenRewardItem.Id },
|
||||
new() { Id = new MongoId(), Template = chosenRewardItem.Id },
|
||||
};
|
||||
|
||||
rewards.Add(rewardItem);
|
||||
@@ -734,7 +733,7 @@ public class LootGenerator(
|
||||
var chosenItem = _randomUtil.DrawRandomFromList(relatedItems.ToList());
|
||||
var reward = new List<Item>
|
||||
{
|
||||
new() { Id = _hashUtil.Generate(), Template = chosenItem[0].Id },
|
||||
new() { Id = new MongoId(), Template = chosenItem[0].Id },
|
||||
};
|
||||
|
||||
modRewards.Add(reward);
|
||||
@@ -772,10 +771,7 @@ public class LootGenerator(
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Item> rewardItem =
|
||||
[
|
||||
new() { Id = _hashUtil.Generate(), Template = chosenRewardItemTpl },
|
||||
];
|
||||
List<Item> rewardItem = [new() { Id = new MongoId(), Template = chosenRewardItemTpl }];
|
||||
itemsToReturn.Add(rewardItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,7 @@ namespace SPTarkov.Server.Core.Helpers;
|
||||
[Injectable]
|
||||
public class ItemHelper(
|
||||
ISptLogger<ItemHelper> _logger,
|
||||
HashUtil _hashUtil,
|
||||
RandomUtil _randomUtil,
|
||||
MathUtil _mathUtil,
|
||||
DatabaseService _databaseService,
|
||||
HandbookHelper _handbookHelper,
|
||||
ItemBaseClassService _itemBaseClassService,
|
||||
@@ -308,7 +306,7 @@ public class ItemHelper(
|
||||
/// <param name="tpl">Item template id to check</param>
|
||||
/// <param name="baseClassTpl">Baseclass to check for</param>
|
||||
/// <returns>is the tpl a descendant</returns>
|
||||
public bool IsOfBaseclass(string tpl, string baseClassTpl)
|
||||
public bool IsOfBaseclass(MongoId tpl, string baseClassTpl)
|
||||
{
|
||||
return _itemBaseClassService.ItemHasBaseClass(tpl, [baseClassTpl]);
|
||||
}
|
||||
@@ -814,7 +812,7 @@ public class ItemHelper(
|
||||
var amount = Math.Min(remainingCount ?? 0, maxStackSize ?? 0);
|
||||
var newStackClone = _cloner.Clone(itemToSplit);
|
||||
|
||||
newStackClone.Id = _hashUtil.Generate();
|
||||
newStackClone.Id = new MongoId();
|
||||
newStackClone.Upd.StackObjectsCount = amount;
|
||||
remainingCount -= amount;
|
||||
rootAndChildren.Add(newStackClone);
|
||||
@@ -892,7 +890,7 @@ public class ItemHelper(
|
||||
var amount = Math.Min(remainingCount ?? 0, itemMaxStackSize);
|
||||
var newItemClone = _cloner.Clone(itemToSplit);
|
||||
|
||||
newItemClone.Id = _hashUtil.Generate();
|
||||
newItemClone.Id = new MongoId();
|
||||
newItemClone.Upd.StackObjectsCount = amount;
|
||||
remainingCount -= amount;
|
||||
result.Add([newItemClone]);
|
||||
@@ -1002,7 +1000,7 @@ public class ItemHelper(
|
||||
}
|
||||
|
||||
// Generate new id
|
||||
var newId = _hashUtil.Generate();
|
||||
var newId = new MongoId();
|
||||
|
||||
// Keep copy of original id
|
||||
var originalId = item.Id;
|
||||
@@ -1043,7 +1041,7 @@ public class ItemHelper(
|
||||
foreach (var item in items)
|
||||
{
|
||||
// Generate new id
|
||||
var newId = _hashUtil.Generate();
|
||||
var newId = new MongoId();
|
||||
|
||||
// Keep copy of original id
|
||||
var originalId = item.Id;
|
||||
@@ -1113,7 +1111,7 @@ public class ItemHelper(
|
||||
}
|
||||
|
||||
// Generate new id
|
||||
var newId = _hashUtil.Generate();
|
||||
var newId = new MongoId();
|
||||
|
||||
// Keep copy of original id
|
||||
var originalId = item.Id;
|
||||
@@ -1735,7 +1733,7 @@ public class ItemHelper(
|
||||
{
|
||||
return new Item
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Id = new MongoId(),
|
||||
Template = ammoTpl,
|
||||
ParentId = parentId,
|
||||
SlotId = "cartridges",
|
||||
@@ -1842,8 +1840,8 @@ public class ItemHelper(
|
||||
// Create basic item structure ready to add to weapon array
|
||||
Item modItemToAdd = new()
|
||||
{
|
||||
Id = _hashUtil.Generate(),
|
||||
Template = chosenTpl,
|
||||
Id = new MongoId(),
|
||||
Template = chosenTpl.Value,
|
||||
ParentId = result[0].Id,
|
||||
SlotId = slot.Name,
|
||||
};
|
||||
@@ -1866,7 +1864,7 @@ public class ItemHelper(
|
||||
/// <param name="possibleTpls">Tpls to randomly choose from</param>
|
||||
/// <param name="incompatibleModTpls">Incompatible tpls to not allow</param>
|
||||
/// <returns>Chosen tpl or undefined</returns>
|
||||
public string? GetCompatibleTplFromArray(
|
||||
public MongoId? GetCompatibleTplFromArray(
|
||||
HashSet<MongoId> possibleTpls,
|
||||
HashSet<MongoId> incompatibleModTpls
|
||||
)
|
||||
@@ -1876,7 +1874,7 @@ public class ItemHelper(
|
||||
return null;
|
||||
}
|
||||
|
||||
string? chosenTpl = null;
|
||||
MongoId? chosenTpl = null;
|
||||
var count = 0;
|
||||
while (chosenTpl is null)
|
||||
{
|
||||
@@ -1924,7 +1922,7 @@ public class ItemHelper(
|
||||
public List<Item> ReparentItemAndChildren(Item rootItem, List<Item> itemWithChildren)
|
||||
{
|
||||
var oldRootId = itemWithChildren[0].Id;
|
||||
Dictionary<string, string> idMappings = new();
|
||||
Dictionary<string, MongoId> idMappings = new();
|
||||
|
||||
idMappings[oldRootId] = rootItem.Id;
|
||||
|
||||
@@ -1932,7 +1930,7 @@ public class ItemHelper(
|
||||
{
|
||||
if (!idMappings.ContainsKey(mod.Id))
|
||||
{
|
||||
idMappings[mod.Id] = _hashUtil.Generate();
|
||||
idMappings[mod.Id] = new MongoId();
|
||||
}
|
||||
|
||||
// Has parentId + no remapping exists for its parent
|
||||
@@ -1942,7 +1940,7 @@ public class ItemHelper(
|
||||
)
|
||||
// Make remapping for items parentId
|
||||
{
|
||||
idMappings[mod.ParentId] = _hashUtil.Generate();
|
||||
idMappings[mod.ParentId] = new MongoId();
|
||||
}
|
||||
|
||||
mod.Id = idMappings[mod.Id];
|
||||
@@ -1970,9 +1968,9 @@ public class ItemHelper(
|
||||
// Optional: new id to use
|
||||
// Returns New root id
|
||||
|
||||
public string RemapRootItemId(List<Item> itemWithChildren, string? newId = null)
|
||||
public string RemapRootItemId(List<Item> itemWithChildren, MongoId? newId = null)
|
||||
{
|
||||
newId ??= _hashUtil.Generate();
|
||||
newId ??= new MongoId();
|
||||
|
||||
var rootItemExistingId = itemWithChildren[0].Id;
|
||||
|
||||
@@ -1981,7 +1979,7 @@ public class ItemHelper(
|
||||
// Root, update id
|
||||
if (item.Id.Equals(rootItemExistingId))
|
||||
{
|
||||
item.Id = newId;
|
||||
item.Id = newId.Value;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public record WalletLootSettings
|
||||
public required Dictionary<string, double> StackSizeWeight { get; set; }
|
||||
|
||||
[JsonPropertyName("currencyWeight")]
|
||||
public required Dictionary<string, double> CurrencyWeight { get; set; }
|
||||
public required Dictionary<MongoId, double> CurrencyWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// What wallets will have money in them
|
||||
|
||||
Reference in New Issue
Block a user