Convert TemplateItem to MongoId (#436)

* Convert TemplateItem to MongoId

* Push new extensions

* Handle null mongoid's being passed to regex

* Handle null strings, fixes item events

* Updated loot generation to work with new property `composedKey`

Fixed typo in `SlotId`

* Fix missing method after merge

* Remove duplicately named MongoIDExtensions?

* Fixed location loot generation to handle impending loot json changes

* Updated location JSONs with new properties (excluding lighthouse loose loot)

* Fixed build issue with ItemTplGenerator

* use correct handing for new mongo ids

* Added helper method to improve readability

---------

Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
This commit is contained in:
Jesse
2025-07-02 11:14:04 +02:00
committed by GitHub
parent 46989aa19e
commit 54f0d0779c
89 changed files with 529 additions and 413 deletions
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
namespace SPTarkov.Server.Core.Models.Spt.Bots;
@@ -11,7 +12,7 @@ public record FilterPlateModsForSlotByLevelResult
public Result? Result { get; set; }
[JsonPropertyName("plateModTpls")]
public HashSet<string>? PlateModTemplates { get; set; }
public HashSet<MongoId>? PlateModTemplates { get; set; }
}
public enum Result
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
namespace SPTarkov.Server.Core.Models.Spt.Bots;
@@ -66,7 +67,7 @@ public record GenerateWeaponRequest
/// Array of item tpls the weapon does not support
/// </summary>
[JsonPropertyName("conflictingItemTpls")]
public HashSet<string>? ConflictingItemTpls { get; set; }
public HashSet<MongoId>? ConflictingItemTpls { get; set; }
}
public record BotData
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
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.Config;
@@ -41,7 +42,7 @@ public record ModToSpawnRequest
/// Pool of items to pick from
/// </summary>
[JsonPropertyName("itemModPool")]
public Dictionary<string, HashSet<string>>? ItemModPool { get; set; }
public Dictionary<string, HashSet<MongoId>>? ItemModPool { get; set; }
/// <summary>
/// List with only weapon tpl in it, ready for mods to be added
@@ -77,7 +78,7 @@ public record ModToSpawnRequest
/// List of item tpls the weapon does not support
/// </summary>
[JsonPropertyName("conflictingItemTpls")]
public HashSet<string>? ConflictingItemTpls { get; set; }
public HashSet<MongoId>? ConflictingItemTpls { get; set; }
[JsonPropertyName("botData")]
public BotData? BotData { get; set; }