diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/database/templates/profiles.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/database/templates/profiles.json index 5d8d2194..199f96b4 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/database/templates/profiles.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/database/templates/profiles.json @@ -16,7 +16,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731c8bafff850080488bb" }, "Encyclopedia": { @@ -2714,7 +2714,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731d1170146228c0d222a" }, "Encyclopedia": { @@ -5612,7 +5612,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731c8bafff850080488bb" }, "Encyclopedia": { @@ -8869,7 +8869,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731d1170146228c0d222a" }, "Encyclopedia": { @@ -12234,7 +12234,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731c8bafff850080488bb" }, "Encyclopedia": { @@ -15949,7 +15949,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731d1170146228c0d222a" }, "Encyclopedia": { @@ -19871,7 +19871,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "6746fd09bafff85008048838" }, "Encyclopedia": { @@ -23637,7 +23637,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "67471938bafff850080488b7" }, "Encyclopedia": { @@ -27549,7 +27549,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "67471928d17d6431550563b5" }, "Encyclopedia": { @@ -32054,7 +32054,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "6747193f170146228c0d2226" }, "Encyclopedia": { @@ -36765,7 +36765,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "67471928d17d6431550563b5" }, "Encyclopedia": { @@ -37754,7 +37754,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "6747193f170146228c0d2226" }, "Encyclopedia": { @@ -38744,7 +38744,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "6746fd09bafff85008048838" }, "Encyclopedia": { @@ -41892,7 +41892,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "67471938bafff850080488b7" }, "Encyclopedia": { @@ -45027,7 +45027,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "67471928d17d6431550563b5" }, "Encyclopedia": { @@ -48450,7 +48450,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "6747193f170146228c0d2226" }, "Encyclopedia": { @@ -51864,7 +51864,7 @@ "Body": "5cc0858d14c02e000c6bea66", "Feet": "5cc085bb14c02e000e67a5c5", "Hands": "5cc0876314c02e000c6bea6b", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731c8bafff850080488bb" }, "Encyclopedia": { @@ -52843,7 +52843,7 @@ "Body": "5cde95d97d6c8b647a3769b0", "Feet": "5cde95ef7d6c8b04713c4f2d", "Hands": "5cde95fa7d6c8b04737c2d13", - "Head": "__REPLACEME__", + "Head": "000000000000000000000000", "DogTag": "674731d1170146228c0d222a" }, "Encyclopedia": { diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs index eaa3eb0f..94b7a533 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs @@ -527,7 +527,7 @@ public class BotGenerator( bot.Customization.Body = weightedRandomHelper.GetWeightedValue(appearance.Body); var bodyGlobalDictDb = databaseService.GetGlobals().Configuration.Customization.Body; - var chosenBodyTemplate = databaseService.GetCustomization()[bot.Customization.Body]; + var chosenBodyTemplate = databaseService.GetCustomization()[bot.Customization.Body.Value]; // Some bodies have matching hands, look up body to see if this is the case var chosenBody = bodyGlobalDictDb.FirstOrDefault(c => diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs index 452a6b26..76aa8378 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/BotBase.cs @@ -319,48 +319,17 @@ public record Customization [JsonExtensionData] public Dictionary? ExtensionData { get; set; } - private string? _head; - private string? _body; - private string? _feet; - private string? _dogtag; - private string? _hands; - private string? _voice; + public MongoId? Head { get; set; } - public string? Head - { - get { return _head; } - set { _head = value == null ? null : string.Intern(value); } - } + public MongoId? Body { get; set; } - public string? Body - { - get { return _body; } - set { _body = value == null ? null : string.Intern(value); } - } + public MongoId? Feet { get; set; } - public string? Feet - { - get { return _feet; } - set { _feet = value == null ? null : string.Intern(value); } - } + public MongoId? Hands { get; set; } - public string? Hands - { - get { return _hands; } - set { _hands = value == null ? null : string.Intern(value); } - } + public MongoId? DogTag { get; set; } - public string? DogTag - { - get { return _dogtag; } - set { _dogtag = value == null ? null : string.Intern(value); } - } - - public string? Voice - { - get { return _voice; } - set { _voice = value == null ? null : string.Intern(value); } - } + public MongoId? Voice { get; set; } } public record BotBaseHealth diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs index 5719a795..1f53143b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Templates/Templates.cs @@ -32,7 +32,7 @@ public record Templates public HandbookBase? Handbook { get; set; } [JsonPropertyName("customization")] - public Dictionary? Customization { get; set; } + public Dictionary? Customization { get; set; } /// /// The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) diff --git a/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs b/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs index 12da3714..de07b31a 100644 --- a/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/DatabaseService.cs @@ -232,7 +232,7 @@ public class DatabaseService( } /// assets/database/templates/customisation.json - public Dictionary GetCustomization() + public Dictionary GetCustomization() { if (databaseServer.GetTables().Templates?.Customization == null) { diff --git a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs index a4a85d33..0a175736 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs @@ -187,7 +187,7 @@ public class ProfileFixerService( ); // Check Head - if (customizationDb[pmcProfile.Customization.Head] is null) + if (!customizationDb.ContainsKey(pmcProfile.Customization.Head.Value)) { var defaultHead = playerIsUsec ? customizationDbArray.FirstOrDefault(x => x.Name == "DefaultUsecHead") @@ -196,7 +196,7 @@ public class ProfileFixerService( } // check Body - if (customizationDb[pmcProfile.Customization.Body] is null) + if (customizationDb.ContainsKey(pmcProfile.Customization.Body.Value)) { var defaultBody = playerIsUsec ? customizationDbArray.FirstOrDefault(x => x.Name == "DefaultUsecBody") @@ -205,7 +205,7 @@ public class ProfileFixerService( } // check Hands - if (customizationDb[pmcProfile.Customization.Hands] is null) + if (customizationDb.ContainsKey(pmcProfile.Customization.Hands.Value)) { var defaultHands = playerIsUsec ? customizationDbArray.FirstOrDefault(x => x.Name == "DefaultUsecHands") @@ -214,7 +214,7 @@ public class ProfileFixerService( } // check Feet - if (customizationDb[pmcProfile.Customization.Feet] is null) + if (customizationDb.ContainsKey(pmcProfile.Customization.Feet.Value)) { var defaultFeet = playerIsUsec ? customizationDbArray.FirstOrDefault(x => x.Name == "DefaultUsecFeet")