diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs index cc289bf7..f6371664 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/ClientLogCallbacks.cs @@ -3,6 +3,7 @@ using SPTarkov.Server.Core.Controllers; using SPTarkov.Server.Core.Models.Enums; using SPTarkov.Server.Core.Models.Spt.Config; using SPTarkov.Server.Core.Models.Spt.Logging; +using SPTarkov.Server.Core.Models.Spt.Mod; using SPTarkov.Server.Core.Servers; using SPTarkov.Server.Core.Services; using SPTarkov.Server.Core.Utils; @@ -14,8 +15,8 @@ public class ClientLogCallbacks( HttpResponseUtil _httpResponseUtil, ClientLogController _clientLogController, ConfigServer _configServer, - LocalisationService _localisationService -// ModLoadOrder _modLoadOrder // TODO: needs implementing + LocalisationService _localisationService, + IReadOnlyList _loadedMods ) { /// @@ -50,7 +51,7 @@ public class ClientLogCallbacks( data.ReleaseSummaryText = _localisationService.GetText("release-summary"); data.IsBeta = ProgramStatics.ENTRY_TYPE() is EntryType.BLEEDING_EDGE or EntryType.BLEEDING_EDGE_MODS; data.IsModdable = ProgramStatics.MODS(); - data.IsModded = false; // TODO + data.IsModded = _loadedMods.Count > 0; return new ValueTask(_httpResponseUtil.NoBody(data)); } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs index a78f3ce3..4f6515b5 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs @@ -1877,7 +1877,7 @@ public class ItemHelper( public List AddChildSlotItems( List itemToAdd, TemplateItem itemToAddTemplate, - Dictionary? modSpawnChanceDict = null, + Dictionary? modSpawnChanceDict = null, bool requiredOnly = false ) { @@ -1895,10 +1895,9 @@ public class ItemHelper( if (modSpawnChanceDict is not null && !(slot.Required ?? false)) { // only roll chance to not include mod if dict exists and has value for this mod type (e.g. front_plate) - var modSpawnChance = modSpawnChanceDict[slot.Name.ToLower()]; - if (modSpawnChance is not null) + if(modSpawnChanceDict.ContainsKey(slot.Name.ToLower())) { - if (!_randomUtil.GetChance100(modSpawnChance ?? 0)) + if (!_randomUtil.GetChance100(modSpawnChanceDict[slot.Name.ToLower()])) { continue; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs index 3f00420d..6ad7d172 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Location.cs @@ -183,97 +183,6 @@ public record ItemDistribution } } -public record StaticPropsBase -{ - [JsonPropertyName("Id")] - public string? Id - { - get; - set; - } - - [JsonPropertyName("IsContainer")] - public bool? IsContainer - { - get; - set; - } - - [JsonPropertyName("useGravity")] - public bool? UseGravity - { - get; - set; - } - - [JsonPropertyName("randomRotation")] - public bool? RandomRotation - { - get; - set; - } - - [JsonPropertyName("Position")] - public XYZ? Position - { - get; - set; - } - - [JsonPropertyName("Rotation")] - public XYZ? Rotation - { - get; - set; - } - - [JsonPropertyName("IsGroupPosition")] - public bool? IsGroupPosition - { - get; - set; - } - - [JsonPropertyName("IsAlwaysSpawn")] - public bool? IsAlwaysSpawn - { - get; - set; - } - - [JsonPropertyName("GroupPositions")] - public GroupPosition[] GroupPositions - { - get; - set; - } - - [JsonPropertyName("Root")] - public string? Root - { - get; - set; - } - - [JsonPropertyName("Items")] - public Item[] Items - { - get; - set; - } -} - -[Obsolete("use SpawnpointTemplate")] -public record StaticWeaponProps : StaticPropsBase -{ - [JsonPropertyName("Items")] - public Item[] Items - { - get; - set; - } -} - public record StaticContainerDetails { [JsonPropertyName("staticWeapons")] @@ -348,55 +257,3 @@ public record StaticAmmoDetails set; } } - -public record StaticForcedProps -{ - [JsonPropertyName("containerId")] - public string? ContainerId - { - get; - set; - } - - [JsonPropertyName("itemTpl")] - public string? ItemTpl - { - get; - set; - } -} - -[Obsolete("use SpawnpointTemplate")] -public record StaticContainerProps : StaticPropsBase -{ - [JsonPropertyName("Items")] - public StaticItem[] Items - { - get; - set; - } -} - -public record StaticItem -{ - [JsonPropertyName("_id")] - public string? Id - { - get; - set; - } - - [JsonPropertyName("_tpl")] - public string? Tpl - { - get; - set; - } - - [JsonPropertyName("upd")] - public Upd? Upd - { - get; - set; - } -} diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs index ce051bcc..b1ee9056 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/LocationBase.cs @@ -949,11 +949,11 @@ public record NonWaveGroupScenario public record Limit : MinMax { [JsonPropertyName("items")] - public object[] Items + public List? Items { get; set; - } // TODO: was on TS any[] hmmm.. + } [JsonPropertyName("min")] public int? Min diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs index 7bdcde67..7ed3ffa0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotDetailsForChatMessages.cs @@ -8,7 +8,7 @@ public record BotDetailsForChatMessages { get; set; - } + } = string.Empty; public DogtagSide Side { diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs index 753e00c1..aff8a7cd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotGenerationDetails.cs @@ -56,7 +56,7 @@ public record BotGenerationDetails /// Level specific overrides for PMC level /// [JsonPropertyName("locationSpecificPmcLevelOverride")] - public MinMax LocationSpecificPmcLevelOverride + public MinMax? LocationSpecificPmcLevelOverride { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs index e807f4e5..7e577ecc 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/BotLootCache.cs @@ -5,95 +5,95 @@ namespace SPTarkov.Server.Core.Models.Spt.Bots; public record BotLootCache { [JsonPropertyName("backpackLoot")] - public Dictionary? BackpackLoot + public Dictionary BackpackLoot { get; set; - } + } = []; [JsonPropertyName("pocketLoot")] - public Dictionary? PocketLoot + public Dictionary PocketLoot { get; set; - } + } = []; [JsonPropertyName("vestLoot")] - public Dictionary? VestLoot + public Dictionary VestLoot { get; set; - } + } = []; [JsonPropertyName("secureLoot")] - public Dictionary? SecureLoot + public Dictionary SecureLoot { get; set; - } + } = []; [JsonPropertyName("combinedPoolLoot")] - public Dictionary? CombinedPoolLoot + public Dictionary CombinedPoolLoot { get; set; - } + } = []; [JsonPropertyName("specialItems")] - public Dictionary? SpecialItems + public Dictionary SpecialItems { get; set; - } + } = []; [JsonPropertyName("healingItems")] - public Dictionary? HealingItems + public Dictionary HealingItems { get; set; - } + } = []; [JsonPropertyName("drugItems")] - public Dictionary? DrugItems + public Dictionary DrugItems { get; set; - } + } = []; [JsonPropertyName("foodItems")] - public Dictionary? FoodItems + public Dictionary FoodItems { get; set; - } + } = []; [JsonPropertyName("drinkItems")] - public Dictionary? DrinkItems + public Dictionary DrinkItems { get; set; - } + } = []; [JsonPropertyName("currencyItems")] - public Dictionary? CurrencyItems + public Dictionary CurrencyItems { get; set; - } + } = []; [JsonPropertyName("stimItems")] - public Dictionary? StimItems + public Dictionary StimItems { get; set; - } + } = []; [JsonPropertyName("grenadeItems")] - public Dictionary? GrenadeItems + public Dictionary GrenadeItems { get; set; - } + } = []; } public record LootCacheType diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs index ff945489..51670c02 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs @@ -7,14 +7,14 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record AirdropConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-airdrop"; [JsonPropertyName("airdropTypeWeightings")] - public Dictionary AirdropTypeWeightings + public required Dictionary AirdropTypeWeightings { get; set; @@ -24,76 +24,14 @@ public record AirdropConfig : BaseConfig /// What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter /// [JsonPropertyName("loot")] - public Dictionary Loot + public required Dictionary Loot { get; set; } [JsonPropertyName("customAirdropMapping")] - public Dictionary CustomAirdropMapping - { - get; - set; - } -} - -/// -/// Chance map will have an airdrop occur out of 100 - locations not included count as 0% -/// -public record AirdropChancePercent -{ - [JsonPropertyName("bigmap")] - public double Bigmap - { - get; - set; - } - - [JsonPropertyName("woods")] - public double Woods - { - get; - set; - } - - [JsonPropertyName("lighthouse")] - public double Lighthouse - { - get; - set; - } - - [JsonPropertyName("shoreline")] - public double Shoreline - { - get; - set; - } - - [JsonPropertyName("interchange")] - public double Interchange - { - get; - set; - } - - [JsonPropertyName("reserve")] - public double Reserve - { - get; - set; - } - - [JsonPropertyName("tarkovStreets")] - public double TarkovStreets - { - get; - set; - } - - [JsonPropertyName("sandbox")] - public double Sandbox + public required Dictionary CustomAirdropMapping { get; set; @@ -107,7 +45,7 @@ public record AirdropLoot { [JsonPropertyName("icon")] [JsonConverter(typeof(JsonStringEnumConverter))] - public AirdropTypeEnum Icon + public required AirdropTypeEnum Icon { get; set; @@ -117,7 +55,7 @@ public record AirdropLoot /// Min/max of weapons inside crate /// [JsonPropertyName("weaponPresetCount")] - public MinMax? WeaponPresetCount + public required MinMax WeaponPresetCount { get; set; @@ -127,7 +65,7 @@ public record AirdropLoot /// Min/max of armors (head/chest/rig) inside crate /// [JsonPropertyName("armorPresetCount")] - public MinMax? ArmorPresetCount + public required MinMax ArmorPresetCount { get; set; @@ -137,7 +75,7 @@ public record AirdropLoot /// Min/max of items inside crate /// [JsonPropertyName("itemCount")] - public MinMax ItemCount + public required MinMax ItemCount { get; set; @@ -147,7 +85,7 @@ public record AirdropLoot /// Min/max of sealed weapon boxes inside crate /// [JsonPropertyName("weaponCrateCount")] - public MinMax WeaponCrateCount + public required MinMax WeaponCrateCount { get; set; @@ -157,7 +95,7 @@ public record AirdropLoot /// Items to never allow - tpls /// [JsonPropertyName("itemBlacklist")] - public List ItemBlacklist + public required List ItemBlacklist { get; set; @@ -167,7 +105,7 @@ public record AirdropLoot /// Item type (parentId) to allow inside crate /// [JsonPropertyName("itemTypeWhitelist")] - public List ItemTypeWhitelist + public required List ItemTypeWhitelist { get; set; @@ -177,7 +115,7 @@ public record AirdropLoot /// Item type/ item tpls to limit count of inside crate - key: item base type: value: max count /// [JsonPropertyName("itemLimits")] - public Dictionary ItemLimits + public required Dictionary ItemLimits { get; set; @@ -187,7 +125,7 @@ public record AirdropLoot /// Items to limit stack size of key: item tpl value: min/max stack size /// [JsonPropertyName("itemStackLimits")] - public Dictionary> ItemStackLimits + public required Dictionary> ItemStackLimits { get; set; @@ -214,7 +152,7 @@ public record AirdropLoot } [JsonPropertyName("useForcedLoot")] - public bool? UseForcedLoot + public bool UseForcedLoot { get; set; @@ -228,14 +166,14 @@ public record AirdropLoot } [JsonPropertyName("useRewardItemBlacklist")] - public bool? UseRewardItemBlacklist + public bool UseRewardItemBlacklist { get; set; } [JsonPropertyName("blockSeasonalItemsOutOfSeason")] - public bool? BlockSeasonalItemsOutOfSeason + public bool BlockSeasonalItemsOutOfSeason { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs index 3846946c..d67f6d28 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs @@ -5,14 +5,14 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BackupConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-backup"; [JsonPropertyName("enabled")] - public bool Enabled + public required bool Enabled { get; set; @@ -30,10 +30,10 @@ public record BackupConfig : BaseConfig { get; set; - } + } = string.Empty; [JsonPropertyName("backupInterval")] - public BackupConfigInterval BackupInterval + public required BackupConfigInterval BackupInterval { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs index 01073bcd..003b8aad 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BaseConfig.cs @@ -2,10 +2,10 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; -public record BaseConfig +public abstract record BaseConfig { [JsonPropertyName("kind")] - public string Kind + public abstract string Kind { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs index 4a360677..5bfff3a0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs @@ -8,7 +8,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BotConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -18,17 +18,7 @@ public record BotConfig : BaseConfig /// How many variants of each bot should be generated on raid start /// [JsonPropertyName("presetBatch")] - public Dictionary? PresetBatch - { - get; - set; - } - - /// - /// Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to - /// - [JsonPropertyName("botsToNotAddPMCsAsEnemiesTo")] - public List BotsToNotAddPMCsAsEnemiesTo + public required Dictionary PresetBatch { get; set; @@ -38,7 +28,7 @@ public record BotConfig : BaseConfig /// What bot types should be classified as bosses /// [JsonPropertyName("bosses")] - public List Bosses + public required List Bosses { get; set; @@ -48,7 +38,7 @@ public record BotConfig : BaseConfig /// Control weapon/armor durability min/max values for each bot type /// [JsonPropertyName("durability")] - public BotDurability Durability + public required BotDurability Durability { get; set; @@ -58,7 +48,7 @@ public record BotConfig : BaseConfig /// Controls the percentage values of randomization item resources /// [JsonPropertyName("lootItemResourceRandomization")] - public Dictionary LootItemResourceRandomization + public required Dictionary LootItemResourceRandomization { get; set; @@ -69,7 +59,7 @@ public record BotConfig : BaseConfig /// key: bottype, value: bottypes to revenge on seeing their death /// [JsonPropertyName("revenge")] - public Dictionary> Revenge + public required Dictionary> Revenge { get; set; @@ -81,7 +71,7 @@ public record BotConfig : BaseConfig /// key: itemTpl: value: max item count> /// [JsonPropertyName("itemSpawnLimits")] - public Dictionary> ItemSpawnLimits + public required Dictionary> ItemSpawnLimits { get; set; @@ -91,7 +81,7 @@ public record BotConfig : BaseConfig /// Blacklist/whitelist items on a bot /// [JsonPropertyName("equipment")] - public Dictionary Equipment + public required Dictionary Equipment { get; set; @@ -111,7 +101,7 @@ public record BotConfig : BaseConfig /// What ai brain should a normal scav use per map /// [JsonPropertyName("assaultBrainType")] - public Dictionary> AssaultBrainType + public required Dictionary> AssaultBrainType { get; set; @@ -121,7 +111,7 @@ public record BotConfig : BaseConfig /// What ai brain should a player scav use per map /// [JsonPropertyName("playerScavBrainType")] - public Dictionary> PlayerScavBrainType + public required Dictionary> PlayerScavBrainType { get; set; @@ -131,7 +121,7 @@ public record BotConfig : BaseConfig /// Max number of bots that can be spawned in a raid at any one time /// [JsonPropertyName("maxBotCap")] - public Dictionary MaxBotCap + public required Dictionary MaxBotCap { get; set; @@ -161,7 +151,7 @@ public record BotConfig : BaseConfig /// Bot roles in this array will be given a dog tag on generation /// [JsonPropertyName("botRolesWithDogTags")] - public HashSet BotRolesWithDogTags + public required HashSet BotRolesWithDogTags { get; set; @@ -171,7 +161,7 @@ public record BotConfig : BaseConfig /// Settings to control the items that get added into wallets on bots /// [JsonPropertyName("walletLoot")] - public WalletLootSettings WalletLoot + public required WalletLootSettings WalletLoot { get; set; @@ -181,7 +171,7 @@ public record BotConfig : BaseConfig /// Currency weights, Keyed by botrole / currency /// [JsonPropertyName("currencyStackSize")] - public Dictionary>> CurrencyStackSize + public required Dictionary>> CurrencyStackSize { get; set; @@ -191,7 +181,7 @@ public record BotConfig : BaseConfig /// Tpls for low profile gas blocks /// [JsonPropertyName("lowProfileGasBlockTpls")] - public HashSet LowProfileGasBlockTpls + public required HashSet LowProfileGasBlockTpls { get; set; @@ -201,7 +191,7 @@ public record BotConfig : BaseConfig /// What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ /// [JsonPropertyName("disableLootOnBotTypes")] - public HashSet DisableLootOnBotTypes + public required HashSet DisableLootOnBotTypes { get; set; @@ -221,7 +211,7 @@ public record BotConfig : BaseConfig /// Bot roles that must have a unique name when generated vs other bots in raid /// [JsonPropertyName("botRolesThatMustHaveUniqueName")] - public HashSet BotRolesThatMustHaveUniqueName + public required HashSet BotRolesThatMustHaveUniqueName { get; set; @@ -562,21 +552,21 @@ public record WalletLootSettings } [JsonPropertyName("itemCount")] - public MinMax ItemCount + public required MinMax ItemCount { get; set; } [JsonPropertyName("stackSizeWeight")] - public Dictionary StackSizeWeight + public required Dictionary StackSizeWeight { get; set; } [JsonPropertyName("currencyWeight")] - public Dictionary CurrencyWeight + public required Dictionary CurrencyWeight { get; set; @@ -586,7 +576,7 @@ public record WalletLootSettings /// What wallets will have money in them /// [JsonPropertyName("walletTplPool")] - public List WalletTplPool + public required List WalletTplPool { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs index 8898bf14..0ca0c93a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotDurability.cs @@ -5,21 +5,21 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record BotDurability { [JsonPropertyName("default")] - public DefaultDurability Default + public required DefaultDurability Default { get; set; } [JsonPropertyName("botDurabilities")] - public Dictionary BotDurabilities + public required Dictionary BotDurabilities { get; set; } [JsonPropertyName("pmc")] - public PmcDurability Pmc + public required PmcDurability Pmc { get; set; @@ -32,14 +32,14 @@ public record BotDurability public record DefaultDurability { [JsonPropertyName("armor")] - public ArmorDurability Armor + public required ArmorDurability Armor { get; set; } [JsonPropertyName("weapon")] - public WeaponDurability Weapon + public required WeaponDurability Weapon { get; set; @@ -49,14 +49,14 @@ public record DefaultDurability public record PmcDurability { [JsonPropertyName("armor")] - public PmcDurabilityArmor Armor + public required PmcDurabilityArmor Armor { get; set; } [JsonPropertyName("weapon")] - public WeaponDurability Weapon + public required WeaponDurability Weapon { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs index bc0b02db..6f8fc57a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs @@ -6,91 +6,91 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record CoreConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-core"; [JsonPropertyName("sptVersion")] - public string SptVersion + public required string SptVersion { get; set; } [JsonPropertyName("projectName")] - public string ProjectName + public required string ProjectName { get; set; } [JsonPropertyName("compatibleTarkovVersion")] - public string CompatibleTarkovVersion + public required string CompatibleTarkovVersion { get; set; } [JsonPropertyName("serverName")] - public string ServerName + public required string ServerName { get; set; } [JsonPropertyName("profileSaveIntervalSeconds")] - public int ProfileSaveIntervalInSeconds + public required int ProfileSaveIntervalInSeconds { get; set; } [JsonPropertyName("sptFriendNickname")] - public string SptFriendNickname + public required string SptFriendNickname { get; set; } [JsonPropertyName("allowProfileWipe")] - public bool AllowProfileWipe + public required bool AllowProfileWipe { get; set; } [JsonPropertyName("bsgLogging")] - public BsgLogging BsgLogging + public required BsgLogging BsgLogging { get; set; } [JsonPropertyName("release")] - public Release Release + public required Release Release { get; set; } [JsonPropertyName("fixes")] - public GameFixes Fixes + public required GameFixes Fixes { get; set; } [JsonPropertyName("survey")] - public SurveyResponseData Survey + public required SurveyResponseData Survey { get; set; } [JsonPropertyName("features")] - public ServerFeatures Features + public required ServerFeatures Features { get; set; @@ -175,7 +175,7 @@ public record Release /// Text logged when users agreed to terms /// [JsonPropertyName("betaDisclaimerAcceptText")] - public string BetaDisclaimerAcceptText + public string? BetaDisclaimerAcceptText { get; set; @@ -185,7 +185,7 @@ public record Release /// Server mods loaded message /// [JsonPropertyName("serverModsLoadedText")] - public string ServerModsLoadedText + public string? ServerModsLoadedText { get; set; @@ -195,7 +195,7 @@ public record Release /// Server mods loaded debug message text /// [JsonPropertyName("serverModsLoadedDebugText")] - public string ServerModsLoadedDebugText + public string? ServerModsLoadedDebugText { get; set; @@ -205,7 +205,7 @@ public record Release /// Client mods loaded message /// [JsonPropertyName("clientModsLoadedText")] - public string ClientModsLoadedText + public string? ClientModsLoadedText { get; set; @@ -215,7 +215,7 @@ public record Release /// Client mods loaded debug message text /// [JsonPropertyName("clientModsLoadedDebugText")] - public string ClientModsLoadedDebugText + public string? ClientModsLoadedDebugText { get; set; @@ -225,7 +225,7 @@ public record Release /// Illegal plugins log message /// [JsonPropertyName("illegalPluginsLoadedText")] - public string IllegalPluginsLoadedText + public string? IllegalPluginsLoadedText { get; set; @@ -235,7 +235,7 @@ public record Release /// Illegal plugins exception /// [JsonPropertyName("illegalPluginsExceptionText")] - public string IllegalPluginsExceptionText + public string? IllegalPluginsExceptionText { get; set; @@ -337,16 +337,6 @@ public record GameFixes public record ServerFeatures { - /// - /// Controls whether the server attempts to download mod dependencies not included in the server's executable - /// - [JsonPropertyName("autoInstallModDependencies")] - public bool AutoInstallModDependencies - { - get; - set; - } - [JsonPropertyName("compressProfile")] public bool CompressProfile { @@ -355,7 +345,7 @@ public record ServerFeatures } [JsonPropertyName("chatbotFeatures")] - public ChatbotFeatures ChatbotFeatures + public required ChatbotFeatures ChatbotFeatures { get; set; @@ -365,7 +355,7 @@ public record ServerFeatures /// Keyed to profile type e.g. "Standard" or "SPT Developer" /// [JsonPropertyName("createNewProfileTypesBlacklist")] - public HashSet CreateNewProfileTypesBlacklist + public required HashSet CreateNewProfileTypesBlacklist { get; set; @@ -375,7 +365,7 @@ public record ServerFeatures /// Profile ids to ignore when calculating achievement stats /// [JsonPropertyName("achievementProfileIdBlacklist")] - public HashSet? AchievementProfileIdBlacklist + public required HashSet? AchievementProfileIdBlacklist { get; set; @@ -392,14 +382,14 @@ public record ChatbotFeatures } [JsonPropertyName("commandoFeatures")] - public CommandoFeatures CommandoFeatures + public required CommandoFeatures CommandoFeatures { get; set; } [JsonPropertyName("commandUseLimits")] - public Dictionary CommandUseLimits + public required Dictionary CommandUseLimits { get; set; @@ -409,7 +399,7 @@ public record ChatbotFeatures /// Human readable id to guid for each bot /// [JsonPropertyName("ids")] - public Dictionary Ids + public required Dictionary Ids { get; set; @@ -419,7 +409,7 @@ public record ChatbotFeatures /// Bot Ids player is allowed to interact with /// [JsonPropertyName("enabledBots")] - public Dictionary EnabledBots + public required Dictionary EnabledBots { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs index cdb5bba7..e8f684d4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/GiftsConfig.cs @@ -9,14 +9,14 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record GiftsConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-gifts"; [JsonPropertyName("gifts")] - public Dictionary Gifts + public required Dictionary Gifts { get; set; @@ -33,7 +33,7 @@ public record Gift { get; set; - } + } = []; /// /// Who is sending the gift to player @@ -56,7 +56,7 @@ public record Gift } [JsonPropertyName("senderDetails")] - public UserDialogInfo SenderDetails + public UserDialogInfo? SenderDetails { get; set; @@ -73,7 +73,7 @@ public record Gift } [JsonPropertyName("messageText")] - public string MessageText + public string? MessageText { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs index 9d9e2e31..d505694b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HealthConfig.cs @@ -5,21 +5,21 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HealthConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-health"; [JsonPropertyName("healthMultipliers")] - public HealthMultipliers HealthMultipliers + public required HealthMultipliers HealthMultipliers { get; set; } [JsonPropertyName("save")] - public HealthSave Save + public required HealthSave Save { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs index 3290b1e5..d271569b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HideoutConfig.cs @@ -7,7 +7,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HideoutConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -27,7 +27,7 @@ public record HideoutConfig : BaseConfig /// Default values used to hydrate `RunIntervalSeconds` with /// [JsonPropertyName("runIntervalValues")] - public RunIntervalValues RunIntervalValues + public required RunIntervalValues RunIntervalValues { get; set; @@ -72,14 +72,14 @@ public record HideoutConfig : BaseConfig } [JsonPropertyName("cultistCircle")] - public CultistCircleSettings CultistCircle + public required CultistCircleSettings CultistCircle { get; set; } [JsonPropertyName("hideoutCraftsToAdd")] - public List HideoutCraftsToAdd + public required List HideoutCraftsToAdd { get; set; @@ -92,28 +92,28 @@ public record HideoutCraftToAdd /// The new mongoId for the craft to use /// [JsonPropertyName("newId")] - public string NewId + public required string NewId { get; set; } [JsonPropertyName("requirements")] - public List Requirements + public required List Requirements { get; set; } [JsonPropertyName("craftIdToCopy")] - public string CraftIdToCopy + public required string CraftIdToCopy { get; set; } [JsonPropertyName("craftOutputTpl")] - public string CraftOutputTpl + public required string CraftOutputTpl { get; set; @@ -137,7 +137,7 @@ public record CultistCircleSettings } [JsonPropertyName("rewardPriceMultiplerMinMax")] - public MinMax RewardPriceMultiplierMinMax + public required MinMax RewardPriceMultiplierMinMax { get; set; @@ -191,7 +191,7 @@ public record CultistCircleSettings } [JsonPropertyName("craftTimeThreshholds")] - public List CraftTimeThreshholds + public required List CraftTimeThreshholds { get; set; @@ -211,7 +211,7 @@ public record CultistCircleSettings /// Specific reward pool when player sacrifices specific item(s) /// [JsonPropertyName("directRewards")] - public List DirectRewards + public required List DirectRewards { get; set; @@ -221,7 +221,7 @@ public record CultistCircleSettings /// Overrides for reward stack sizes, keyed by item tpl /// [JsonPropertyName("directRewardStackSize")] - public Dictionary> DirectRewardStackSize + public required Dictionary> DirectRewardStackSize { get; set; @@ -231,7 +231,7 @@ public record CultistCircleSettings /// Item tpls to exclude from the reward pool /// [JsonPropertyName("rewardItemBlacklist")] - public List RewardItemBlacklist + public required List RewardItemBlacklist { get; set; @@ -241,14 +241,14 @@ public record CultistCircleSettings /// Item tpls to include in the reward pool /// [JsonPropertyName("additionalRewardItemPool")] - public List AdditionalRewardItemPool + public required List AdditionalRewardItemPool { get; set; } [JsonPropertyName("currencyRewards")] - public Dictionary> CurrencyRewards + public required Dictionary> CurrencyRewards { get; set; @@ -268,21 +268,21 @@ public record CraftTimeThreshold : MinMax public record DirectRewardSettings { [JsonPropertyName("reward")] - public List Reward + public required List Reward { get; set; } [JsonPropertyName("requiredItems")] - public List RequiredItems + public required List RequiredItems { get; set; } [JsonPropertyName("craftTimeSeconds")] - public int CraftTimeSeconds + public required int CraftTimeSeconds { get; set; @@ -292,7 +292,7 @@ public record DirectRewardSettings /// Is the reward a one time reward or can it be given multiple times /// [JsonPropertyName("repeatable")] - public bool Repeatable + public required bool Repeatable { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs index 2eae5bc0..3f08e199 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/HttpConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record HttpConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -15,14 +15,14 @@ public record HttpConfig : BaseConfig /// Address used by webserver /// [JsonPropertyName("ip")] - public string Ip + public required string Ip { get; set; } [JsonPropertyName("port")] - public int Port + public required int Port { get; set; @@ -32,28 +32,28 @@ public record HttpConfig : BaseConfig /// Address used by game client to connect to /// [JsonPropertyName("backendIp")] - public string BackendIp + public required string BackendIp { get; set; } [JsonPropertyName("backendPort")] - public int BackendPort + public required int BackendPort { get; set; } [JsonPropertyName("webSocketPingDelayMs")] - public int WebSocketPingDelayMs + public required int WebSocketPingDelayMs { get; set; } [JsonPropertyName("logRequests")] - public bool LogRequests + public required bool LogRequests { get; set; @@ -63,14 +63,14 @@ public record HttpConfig : BaseConfig /// e.g. "SPT_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "SPT_Data/Server/images/traders/NewTraderImage.png" /// [JsonPropertyName("serverImagePathOverride")] - public Dictionary ServerImagePathOverride + public required Dictionary ServerImagePathOverride { get; set; } [JsonPropertyName("certificatePassword")] - public string? CertificatePassword + public required string CertificatePassword { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs index cfa47c87..e7895c17 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InRaidConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InRaidConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -15,7 +15,7 @@ public record InRaidConfig : BaseConfig /// Overrides to apply to the pre-raid settings screen /// [JsonPropertyName("raidMenuSettings")] - public RaidMenuSettings RaidMenuSettings + public required RaidMenuSettings RaidMenuSettings { get; set; @@ -35,7 +35,7 @@ public record InRaidConfig : BaseConfig /// Names of car extracts /// [JsonPropertyName("carExtracts")] - public List CarExtracts + public required List CarExtracts { get; set; @@ -45,7 +45,7 @@ public record InRaidConfig : BaseConfig /// Names of coop extracts /// [JsonPropertyName("coopExtracts")] - public List CoopExtracts + public required List CoopExtracts { get; set; @@ -125,14 +125,14 @@ public record InRaidConfig : BaseConfig public record RaidMenuSettings { [JsonPropertyName("aiAmount")] - public string AiAmount + public required string AiAmount { get; set; } [JsonPropertyName("aiDifficulty")] - public string AiDifficulty + public required string AiDifficulty { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs index a95b8145..7dd2f1ef 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InsuranceConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InsuranceConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -19,7 +19,7 @@ public record InsuranceConfig : BaseConfig { get; set; - } + } = []; /// /// Item slots that should never be returned as insurance @@ -29,7 +29,7 @@ public record InsuranceConfig : BaseConfig { get; set; - } + } = []; /// /// Some slots should always be removed, e.g. 'cartridges' @@ -39,7 +39,7 @@ public record InsuranceConfig : BaseConfig { get; set; - } + } = []; /// /// Override to control how quickly insurance is processed/returned in seconds diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs index cd52e6ef..353a738a 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/InventoryConfig.cs @@ -6,7 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record InventoryConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -23,14 +23,14 @@ public record InventoryConfig : BaseConfig } [JsonPropertyName("randomLootContainers")] - public Dictionary RandomLootContainers + public required Dictionary RandomLootContainers { get; set; } [JsonPropertyName("sealedAirdropContainer")] - public SealedAirdropContainerSettings SealedAirdropContainer + public required SealedAirdropContainerSettings SealedAirdropContainer { get; set; @@ -40,7 +40,7 @@ public record InventoryConfig : BaseConfig /// Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars /// [JsonPropertyName("customMoneyTpls")] - public List CustomMoneyTpls + public required List CustomMoneyTpls { get; set; @@ -50,7 +50,7 @@ public record InventoryConfig : BaseConfig /// Multipliers for skill gain when inside menus, NOT in-game /// [JsonPropertyName("skillGainMultiplers")] - public Dictionary SkillGainMultipliers + public required Dictionary SkillGainMultipliers { get; set; @@ -60,7 +60,7 @@ public record InventoryConfig : BaseConfig /// Container Tpls that should be deprioritised when choosing where to take money from for payments /// [JsonPropertyName("deprioritisedMoneyContainers")] - public HashSet DeprioritisedMoneyContainers + public required HashSet DeprioritisedMoneyContainers { get; set; @@ -108,7 +108,7 @@ public record RewardDetails public record SealedAirdropContainerSettings { [JsonPropertyName("weaponRewardWeight")] - public Dictionary WeaponRewardWeight + public required Dictionary WeaponRewardWeight { get; set; @@ -132,21 +132,21 @@ public record SealedAirdropContainerSettings } [JsonPropertyName("weaponModRewardLimits")] - public Dictionary> WeaponModRewardLimits + public required Dictionary> WeaponModRewardLimits { get; set; } [JsonPropertyName("rewardTypeLimits")] - public Dictionary> RewardTypeLimits + public required Dictionary> RewardTypeLimits { get; set; } [JsonPropertyName("ammoBoxWhitelist")] - public List AmmoBoxWhitelist + public required List AmmoBoxWhitelist { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs index f40e95b9..c2e37a1c 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ItemConfig.cs @@ -6,7 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record ItemConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -16,7 +16,7 @@ public record ItemConfig : BaseConfig /// Items that should be globally blacklisted /// [JsonPropertyName("blacklist")] - public HashSet Blacklist + public required HashSet Blacklist { get; set; @@ -26,7 +26,7 @@ public record ItemConfig : BaseConfig /// Items that should not be lootable from any location /// [JsonPropertyName("lootableItemBlacklist")] - public HashSet LootableItemBlacklist + public required HashSet LootableItemBlacklist { get; set; @@ -36,7 +36,7 @@ public record ItemConfig : BaseConfig /// items that should not be given as rewards /// [JsonPropertyName("rewardItemBlacklist")] - public HashSet RewardItemBlacklist + public required HashSet RewardItemBlacklist { get; set; @@ -46,7 +46,7 @@ public record ItemConfig : BaseConfig /// Item base types that should not be given as rewards /// [JsonPropertyName("rewardItemTypeBlacklist")] - public HashSet RewardItemTypeBlacklist + public required HashSet RewardItemTypeBlacklist { get; set; @@ -56,14 +56,14 @@ public record ItemConfig : BaseConfig /// Items that can only be found on bosses /// [JsonPropertyName("bossItems")] - public HashSet BossItems + public required HashSet BossItems { get; set; } [JsonPropertyName("handbookPriceOverride")] - public Dictionary HandbookPriceOverride + public required Dictionary HandbookPriceOverride { get; set; @@ -73,7 +73,7 @@ public record ItemConfig : BaseConfig /// Presets to add to the globals.json `ItemPresets` dictionary on server start /// [JsonPropertyName("customItemGlobalPresets")] - public List CustomItemGlobalPresets + public required List CustomItemGlobalPresets { get; set; @@ -100,5 +100,5 @@ public record HandbookPriceOverride { get; set; - } + } = string.Empty; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs index 0e850361..d131ed0f 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocaleConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LocaleConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -15,7 +15,7 @@ public record LocaleConfig : BaseConfig /// e.g. ru/en/cn/fr etc, or 'system', will take computer locale setting /// [JsonPropertyName("gameLocale")] - public string GameLocale + public required string GameLocale { get; set; @@ -25,7 +25,7 @@ public record LocaleConfig : BaseConfig /// e.g. ru/en/cn/fr etc, or 'system', will take computer locale setting /// [JsonPropertyName("serverLocale")] - public string ServerLocale + public required string ServerLocale { get; set; @@ -35,14 +35,14 @@ public record LocaleConfig : BaseConfig /// Languages server can be translated into /// [JsonPropertyName("serverSupportedLocales")] - public List ServerSupportedLocales + public required List ServerSupportedLocales { get; set; } [JsonPropertyName("fallbacks")] - public Dictionary Fallbacks + public required Dictionary Fallbacks { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs index 30c59d8d..9cb978fb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LocationConfig.cs @@ -7,7 +7,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LocationConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -17,21 +17,21 @@ public record LocationConfig : BaseConfig /// Rogues are classified as bosses and spawn immediately, this can result in no scavs spawning, delay rogues spawning to allow scavs to spawn first /// [JsonPropertyName("rogueLighthouseSpawnTimeSettings")] - public RogueLighthouseSpawnTimeSettings RogueLighthouseSpawnTimeSettings + public required RogueLighthouseSpawnTimeSettings RogueLighthouseSpawnTimeSettings { get; set; } [JsonPropertyName("looseLootMultiplier")] - public Dictionary LooseLootMultiplier + public required Dictionary LooseLootMultiplier { get; set; } [JsonPropertyName("staticLootMultiplier")] - public Dictionary StaticLootMultiplier + public required Dictionary StaticLootMultiplier { get; set; @@ -41,7 +41,7 @@ public record LocationConfig : BaseConfig /// Custom bot waves to add to a locations base json on game start if addCustomBotWavesToMaps is true /// [JsonPropertyName("customWaves")] - public CustomWaves CustomWaves + public CustomWaves? CustomWaves { get; set; @@ -51,7 +51,7 @@ public record LocationConfig : BaseConfig /// Open zones to add to map /// [JsonPropertyName("openZones")] - public Dictionary> OpenZones + public required Dictionary> OpenZones { get; set; @@ -61,7 +61,7 @@ public record LocationConfig : BaseConfig /// Key = map id, value = item tpls that should only have one forced loot spawn position /// [JsonPropertyName("forcedLootSingleSpawnById")] - public Dictionary> ForcedLootSingleSpawnById + public required Dictionary> ForcedLootSingleSpawnById { get; set; @@ -111,7 +111,7 @@ public record LocationConfig : BaseConfig /// Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true /// [JsonPropertyName("botTypeLimits")] - public Dictionary> BotTypeLimits + public required Dictionary> BotTypeLimits { get; set; @@ -121,7 +121,7 @@ public record LocationConfig : BaseConfig /// Container randomisation settings /// [JsonPropertyName("containerRandomisationSettings")] - public ContainerRandomisationSettings ContainerRandomisationSettings + public required ContainerRandomisationSettings ContainerRandomisationSettings { get; set; @@ -178,7 +178,7 @@ public record LocationConfig : BaseConfig /// Key: map, value: loose loot ids to ignore /// [JsonPropertyName("looseLootBlacklist")] - public Dictionary> LooseLootBlacklist + public required Dictionary> LooseLootBlacklist { get; set; @@ -188,7 +188,7 @@ public record LocationConfig : BaseConfig /// Key: map, value: settings to control how long scav raids are /// [JsonPropertyName("scavRaidTimeSettings")] - public ScavRaidTimeSettings ScavRaidTimeSettings + public required ScavRaidTimeSettings ScavRaidTimeSettings { get; set; @@ -198,7 +198,7 @@ public record LocationConfig : BaseConfig /// Settings to adjust mods for lootable equipment in raid /// [JsonPropertyName("equipmentLootSettings")] - public EquipmentLootSettings EquipmentLootSettings + public required EquipmentLootSettings EquipmentLootSettings { get; set; @@ -208,7 +208,7 @@ public record LocationConfig : BaseConfig /// Min percentage to set raider spawns at, -1 makes no changes /// [JsonPropertyName("reserveRaiderSpawnChanceOverrides")] - public ReserveRaiderSpawnChanceOverrides ReserveRaiderSpawnChanceOverrides + public required ReserveRaiderSpawnChanceOverrides ReserveRaiderSpawnChanceOverrides { get; set; @@ -218,7 +218,7 @@ public record LocationConfig : BaseConfig /// Containers to remove all children from when generating static/loose loot /// [JsonPropertyName("tplsToStripChildItemsFrom")] - public HashSet TplsToStripChildItemsFrom + public required HashSet TplsToStripChildItemsFrom { get; set; @@ -228,7 +228,7 @@ public record LocationConfig : BaseConfig /// Map ids players cannot visit /// [JsonPropertyName("nonMaps")] - public HashSet NonMaps + public required HashSet NonMaps { get; set; @@ -258,24 +258,7 @@ public record EquipmentLootSettings /// Percentage chance item will be added to equipment /// [JsonPropertyName("modSpawnChancePercent")] - public Dictionary ModSpawnChancePercent - { - get; - set; - } -} - -public record FixEmptyBotWavesSettings -{ - [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } - - [JsonPropertyName("ignoreMaps")] - public List IgnoreMaps + public required Dictionary ModSpawnChancePercent { get; set; @@ -299,30 +282,6 @@ public record RogueLighthouseSpawnTimeSettings } } -public record SplitWaveSettings -{ - [JsonPropertyName("enabled")] - public bool Enabled - { - get; - set; - } - - [JsonPropertyName("ignoreMaps")] - public List IgnoreMaps - { - get; - set; - } - - [JsonPropertyName("waveSizeThreshold")] - public int WaveSizeThreshold - { - get; - set; - } -} - public record CustomWaves { /// @@ -333,152 +292,20 @@ public record CustomWaves { get; set; - } + } = []; [JsonPropertyName("normal")] public Dictionary> Normal { get; set; - } + } = []; } public record BotTypeLimit : MinMax { [JsonPropertyName("type")] - public string Type - { - get; - set; - } -} - -/// -/// Multiplier to apply to the loot count for a given map -/// -public record LootMultiplier -{ - [JsonPropertyName("bigmap")] - public double BigMap - { - get; - set; - } - - [JsonPropertyName("develop")] - public double Develop - { - get; - set; - } - - [JsonPropertyName("factory4_day")] - public double Factory4Day - { - get; - set; - } - - [JsonPropertyName("factory4_night")] - public double Factory4Night - { - get; - set; - } - - [JsonPropertyName("interchange")] - public double Interchange - { - get; - set; - } - - [JsonPropertyName("laboratory")] - public double Laboratory - { - get; - set; - } - - [JsonPropertyName("rezervbase")] - public double RezervBase - { - get; - set; - } - - [JsonPropertyName("shoreline")] - public double Shoreline - { - get; - set; - } - - [JsonPropertyName("woods")] - public double Woods - { - get; - set; - } - - [JsonPropertyName("hideout")] - public double Hideout - { - get; - set; - } - - [JsonPropertyName("lighthouse")] - public double Lighthouse - { - get; - set; - } - - [JsonPropertyName("privatearea")] - public double PrivateArea - { - get; - set; - } - - [JsonPropertyName("suburbs")] - public double Suburbs - { - get; - set; - } - - [JsonPropertyName("tarkovstreets")] - public double TarkovStreets - { - get; - set; - } - - [JsonPropertyName("terminal")] - public double Terminal - { - get; - set; - } - - [JsonPropertyName("town")] - public double Town - { - get; - set; - } - - [JsonPropertyName("sandbox")] - public double Sandbox - { - get; - set; - } - - [JsonPropertyName("sandbox_high")] - public double SandboxHigh + public new required string Type { get; set; @@ -498,7 +325,7 @@ public record ContainerRandomisationSettings /// What maps can use the container randomisation feature /// [JsonPropertyName("maps")] - public Dictionary Maps + public required Dictionary Maps { get; set; @@ -508,7 +335,7 @@ public record ContainerRandomisationSettings /// Some container types don't work when randomised /// [JsonPropertyName("containerTypesToNotRandomise")] - public HashSet ContainerTypesToNotRandomise + public required HashSet ContainerTypesToNotRandomise { get; set; @@ -532,14 +359,14 @@ public record ContainerRandomisationSettings public record ScavRaidTimeSettings { [JsonPropertyName("settings")] - public ScavRaidTimeConfigSettings Settings + public required ScavRaidTimeConfigSettings Settings { get; set; } [JsonPropertyName("maps")] - public Dictionary? Maps + public required Dictionary Maps { get; set; @@ -606,7 +433,7 @@ public record ScavRaidTimeLocationSettings { get; set; - } + } = []; /// /// Should bot waves be removed / spawn times be adjusted diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs index 53722abc..3196bd4b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LootConfig.cs @@ -6,7 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LootConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -16,7 +16,7 @@ public record LootConfig : BaseConfig /// Spawn positions to add into a map, key=mapid /// [JsonPropertyName("looseLoot")] - public Dictionary LooseLoot + public required Dictionary LooseLoot { get; set; @@ -26,7 +26,7 @@ public record LootConfig : BaseConfig /// Loose loot probability adjustments to apply on game start /// [JsonPropertyName("looseLootSpawnPointAdjustments")] - public Dictionary>? LooseLootSpawnPointAdjustments + public required Dictionary> LooseLootSpawnPointAdjustments { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs index 6414ae82..7880fad8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/LostOnDeathConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record LostOnDeathConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -15,7 +15,7 @@ public record LostOnDeathConfig : BaseConfig /// What equipment in each slot should be lost on death /// [JsonPropertyName("equipment")] - public LostEquipment Equipment + public required LostEquipment Equipment { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs index 34b2c6ca..14d6e038 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/MatchConfig.cs @@ -5,7 +5,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record MatchConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -19,7 +19,7 @@ public record MatchConfig : BaseConfig } [JsonPropertyName("randomiseMapContainers")] - public Dictionary RandomiseMapContainers + public required Dictionary RandomiseMapContainers { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs index 7843dd1c..8d2888c4 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PlayerScavConfig.cs @@ -7,14 +7,14 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PlayerScavConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-playerscav"; [JsonPropertyName("karmaLevel")] - public Dictionary KarmaLevel + public required Dictionary KarmaLevel { get; set; @@ -24,28 +24,28 @@ public record PlayerScavConfig : BaseConfig public record KarmaLevel { [JsonPropertyName("botTypeForLoot")] - public string BotTypeForLoot + public required string BotTypeForLoot { get; set; } [JsonPropertyName("modifiers")] - public Modifiers Modifiers + public required Modifiers Modifiers { get; set; } [JsonPropertyName("itemLimits")] - public Dictionary ItemLimits + public required Dictionary ItemLimits { get; set; } [JsonPropertyName("equipmentBlacklist")] - public Dictionary> EquipmentBlacklist + public required Dictionary> EquipmentBlacklist { get; set; @@ -59,7 +59,7 @@ public record KarmaLevel } [JsonPropertyName("lootItemsToAddChancePercent")] - public Dictionary LootItemsToAddChancePercent + public required Dictionary LootItemsToAddChancePercent { get; set; @@ -69,59 +69,14 @@ public record KarmaLevel public record Modifiers { [JsonPropertyName("equipment")] - public Dictionary Equipment + public required Dictionary Equipment { get; set; } [JsonPropertyName("mod")] - public Dictionary Mod - { - get; - set; - } -} - -public record ItemLimits -{ - [JsonPropertyName("healing")] - public GenerationData Healing - { - get; - set; - } - - [JsonPropertyName("drugs")] - public GenerationData Drugs - { - get; - set; - } - - [JsonPropertyName("stims")] - public GenerationData Stims - { - get; - set; - } - - [JsonPropertyName("looseLoot")] - public GenerationData LooseLoot - { - get; - set; - } - - [JsonPropertyName("magazines")] - public GenerationData Magazines - { - get; - set; - } - - [JsonPropertyName("grenades")] - public GenerationData Grenades + public required Dictionary Mod { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs index 1aac93b2..efef626e 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcChatResponse.cs @@ -5,21 +5,21 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PmcChatResponse : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-pmcchatresponse"; [JsonPropertyName("victim")] - public ResponseSettings Victim + public required ResponseSettings Victim { get; set; } [JsonPropertyName("killer")] - public ResponseSettings Killer + public required ResponseSettings Killer { get; set; @@ -36,7 +36,7 @@ public record ResponseSettings } [JsonPropertyName("responseTypeWeights")] - public Dictionary ResponseTypeWeights + public required Dictionary ResponseTypeWeights { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs index 138ca637..98358451 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/PmcConfig.cs @@ -8,7 +8,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record PmcConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -18,7 +18,7 @@ public record PmcConfig : BaseConfig /// What game version should the PMC have /// [JsonPropertyName("gameVersionWeight")] - public Dictionary GameVersionWeight + public required Dictionary GameVersionWeight { get; set; @@ -28,7 +28,7 @@ public record PmcConfig : BaseConfig /// What account type should the PMC have /// [JsonPropertyName("accountTypeWeight")] - public Dictionary AccountTypeWeight + public required Dictionary AccountTypeWeight { get; set; @@ -38,7 +38,7 @@ public record PmcConfig : BaseConfig /// Global whitelist/blacklist of vest loot for PMCs /// [JsonPropertyName("vestLoot")] - public SlotLootSettings VestLoot + public required SlotLootSettings VestLoot { get; set; @@ -48,7 +48,7 @@ public record PmcConfig : BaseConfig /// Global whitelist/blacklist of pocket loot for PMCs /// [JsonPropertyName("pocketLoot")] - public SlotLootSettings PocketLoot + public required SlotLootSettings PocketLoot { get; set; @@ -58,14 +58,14 @@ public record PmcConfig : BaseConfig /// Global whitelist/blacklist of backpack loot for PMCs /// [JsonPropertyName("backpackLoot")] - public SlotLootSettings BackpackLoot + public required SlotLootSettings BackpackLoot { get; set; } [JsonPropertyName("globalLootBlacklist")] - public List GlobalLootBlacklist + public required List GlobalLootBlacklist { get; set; @@ -75,7 +75,7 @@ public record PmcConfig : BaseConfig /// Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value /// [JsonPropertyName("useDifficultyOverride")] - public bool UseDifficultyOverride + public required bool UseDifficultyOverride { get; set; @@ -85,7 +85,7 @@ public record PmcConfig : BaseConfig /// Difficulty override e.g. "AsOnline/Hard" /// [JsonPropertyName("difficulty")] - public string Difficulty + public required string Difficulty { get; set; @@ -95,7 +95,7 @@ public record PmcConfig : BaseConfig /// Chance out of 100 to have a complete gun in backpack /// [JsonPropertyName("looseWeaponInBackpackChancePercent")] - public double LooseWeaponInBackpackChancePercent + public required double LooseWeaponInBackpackChancePercent { get; set; @@ -105,7 +105,7 @@ public record PmcConfig : BaseConfig /// Chance out of 100 to have an enhancement applied to PMC weapon /// [JsonPropertyName("weaponHasEnhancementChancePercent")] - public double WeaponHasEnhancementChancePercent + public required double WeaponHasEnhancementChancePercent { get; set; @@ -115,7 +115,7 @@ public record PmcConfig : BaseConfig /// MinMax count of weapons to have in backpack /// [JsonPropertyName("looseWeaponInBackpackLootMinMax")] - public MinMax LooseWeaponInBackpackLootMinMax + public required MinMax LooseWeaponInBackpackLootMinMax { get; set; @@ -132,7 +132,7 @@ public record PmcConfig : BaseConfig /// Percentage chance PMC will be USEC /// [JsonPropertyName("isUsec")] - public double IsUsec + public required double IsUsec { get; set; @@ -142,7 +142,7 @@ public record PmcConfig : BaseConfig /// WildSpawnType enum value USEC PMCs use /// [JsonPropertyName("usecType")] - public string UsecType + public required string UsecType { get; set; @@ -152,7 +152,7 @@ public record PmcConfig : BaseConfig /// WildSpawnType enum value BEAR PMCs use /// [JsonPropertyName("bearType")] - public string BearType + public required string BearType { get; set; @@ -169,28 +169,28 @@ public record PmcConfig : BaseConfig /// What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear /// [JsonPropertyName("pmcType")] - public Dictionary>> PmcType + public required Dictionary>> PmcType { get; set; } [JsonPropertyName("maxBackpackLootTotalRub")] - public List MaxBackpackLootTotalRub + public required List MaxBackpackLootTotalRub { get; set; } [JsonPropertyName("maxPocketLootTotalRub")] - public int MaxPocketLootTotalRub + public required int MaxPocketLootTotalRub { get; set; } [JsonPropertyName("maxVestLootTotalRub")] - public int MaxVestLootTotalRub + public required int MaxVestLootTotalRub { get; set; @@ -200,7 +200,7 @@ public record PmcConfig : BaseConfig /// How many levels above player level can a PMC be /// [JsonPropertyName("botRelativeLevelDeltaMax")] - public int BotRelativeLevelDeltaMax + public required int BotRelativeLevelDeltaMax { get; set; @@ -210,7 +210,7 @@ public record PmcConfig : BaseConfig /// How many levels below player level can a PMC be /// [JsonPropertyName("botRelativeLevelDeltaMin")] - public int BotRelativeLevelDeltaMin + public required int BotRelativeLevelDeltaMin { get; set; @@ -220,28 +220,28 @@ public record PmcConfig : BaseConfig /// Force a number of healing items into PMCs secure container to ensure they can heal /// [JsonPropertyName("forceHealingItemsIntoSecure")] - public bool ForceHealingItemsIntoSecure + public required bool ForceHealingItemsIntoSecure { get; set; } [JsonPropertyName("hostilitySettings")] - public Dictionary HostilitySettings + public required Dictionary HostilitySettings { get; set; } [JsonPropertyName("allPMCsHavePlayerNameWithRandomPrefixChance")] - public double AllPMCsHavePlayerNameWithRandomPrefixChance + public required double AllPMCsHavePlayerNameWithRandomPrefixChance { get; set; } [JsonPropertyName("locationSpecificPmcLevelOverride")] - public Dictionary> LocationSpecificPmcLevelOverride + public required Dictionary> LocationSpecificPmcLevelOverride { get; set; @@ -251,35 +251,35 @@ public record PmcConfig : BaseConfig /// Should secure container loot from usec.json/bear.json be added to pmc bots secure /// [JsonPropertyName("addSecureContainerLootFromBotConfig")] - public bool AddSecureContainerLootFromBotConfig + public required bool AddSecureContainerLootFromBotConfig { get; set; } [JsonPropertyName("addPrefixToSameNamePMCAsPlayerChance")] - public int? AddPrefixToSameNamePMCAsPlayerChance + public required int? AddPrefixToSameNamePMCAsPlayerChance { get; set; } [JsonPropertyName("lootItemLimitsRub")] - public List? LootItemLimitsRub + public required List? LootItemLimitsRub { get; set; } [JsonPropertyName("removeExistingPmcWaves")] - public bool? RemoveExistingPmcWaves + public required bool? RemoveExistingPmcWaves { get; set; } [JsonPropertyName("customPmcWaves")] - public Dictionary> CustomPmcWaves + public required Dictionary> CustomPmcWaves { get; set; @@ -347,23 +347,6 @@ public record HostilitySettings } } -public record PmcTypes -{ - [JsonPropertyName("usec")] - public string Usec - { - get; - set; - } - - [JsonPropertyName("bear")] - public string Bear - { - get; - set; - } -} - public record SlotLootSettings { /// @@ -374,7 +357,7 @@ public record SlotLootSettings { get; set; - } + } = []; /// /// Item tpl blacklist @@ -384,7 +367,7 @@ public record SlotLootSettings { get; set; - } + } = []; } public record MinMaxLootValue : MinMax @@ -400,21 +383,21 @@ public record MinMaxLootValue : MinMax public record MinMaxLootItemValue : MinMax { [JsonPropertyName("backpack")] - public MinMax Backpack + public required MinMax Backpack { get; set; } [JsonPropertyName("pocket")] - public MinMax Pocket + public required MinMax Pocket { get; set; } [JsonPropertyName("vest")] - public MinMax Vest + public required MinMax Vest { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs index d4f6ddec..782940d6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/QuestConfig.cs @@ -9,7 +9,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record QuestConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs index 7ea80c54..6f5b8680 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs @@ -6,7 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record RagfairConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs index d224262e..fa3e78d0 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RepairConfig.cs @@ -6,7 +6,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record RepairConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -44,7 +44,7 @@ public record RepairConfig : BaseConfig /// INT gain multiplier per repaired item type /// [JsonPropertyName("repairKitIntellectGainMultiplier")] - public IntellectGainValues RepairKitIntellectGainMultiplier + public required IntellectGainValues RepairKitIntellectGainMultiplier { get; set; @@ -54,21 +54,21 @@ public record RepairConfig : BaseConfig /// How much INT can be given to player per repair action /// [JsonPropertyName("maxIntellectGainPerRepair")] - public MaxIntellectGainValues MaxIntellectGainPerRepair + public required MaxIntellectGainValues MaxIntellectGainPerRepair { get; set; } [JsonPropertyName("weaponTreatment")] - public WeaponTreatmentRepairValues WeaponTreatment + public required WeaponTreatmentRepairValues WeaponTreatment { get; set; } [JsonPropertyName("repairKit")] - public RepairKit RepairKit + public required RepairKit RepairKit { get; set; @@ -159,28 +159,28 @@ public record WeaponTreatmentRepairValues public record RepairKit { [JsonPropertyName("armor")] - public BonusSettings Armor + public required BonusSettings Armor { get; set; } [JsonPropertyName("weapon")] - public BonusSettings Weapon + public required BonusSettings Weapon { get; set; } [JsonPropertyName("vest")] - public BonusSettings Vest + public required BonusSettings Vest { get; set; } [JsonPropertyName("headwear")] - public BonusSettings Headwear + public required BonusSettings Headwear { get; set; @@ -190,28 +190,28 @@ public record RepairKit public record BonusSettings { [JsonPropertyName("rarityWeight")] - public Dictionary RarityWeight + public required Dictionary RarityWeight { get; set; } [JsonPropertyName("bonusTypeWeight")] - public Dictionary BonusTypeWeight + public required Dictionary BonusTypeWeight { get; set; } [JsonPropertyName("Common")] - public Dictionary Common + public required Dictionary Common { get; set; } [JsonPropertyName("Rare")] - public Dictionary Rare + public required Dictionary Rare { get; set; @@ -221,7 +221,7 @@ public record BonusSettings public record BonusValues { [JsonPropertyName("valuesMinMax")] - public MinMax ValuesMinMax + public required MinMax ValuesMinMax { get; set; @@ -231,7 +231,7 @@ public record BonusValues /// What dura is buff active between (min max of current max) /// [JsonPropertyName("activeDurabilityPercentMinMax")] - public MinMax ActiveDurabilityPercentMinMax + public required MinMax ActiveDurabilityPercentMinMax { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs index 8511aca5..96a0e4bd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/ScavCaseConfig.cs @@ -6,42 +6,42 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record ScavCaseConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; } = "spt-scavcase"; [JsonPropertyName("rewardItemValueRangeRub")] - public Dictionary> RewardItemValueRangeRub + public required Dictionary> RewardItemValueRangeRub { get; set; } [JsonPropertyName("moneyRewards")] - public MoneyRewards MoneyRewards + public required MoneyRewards MoneyRewards { get; set; } [JsonPropertyName("ammoRewards")] - public AmmoRewards AmmoRewards + public required AmmoRewards AmmoRewards { get; set; } [JsonPropertyName("rewardItemParentBlacklist")] - public HashSet RewardItemParentBlacklist + public required HashSet RewardItemParentBlacklist { get; set; } [JsonPropertyName("rewardItemBlacklist")] - public HashSet RewardItemBlacklist + public required HashSet RewardItemBlacklist { get; set; @@ -79,28 +79,28 @@ public record MoneyRewards } [JsonPropertyName("rubCount")] - public MoneyLevels RubCount + public required MoneyLevels RubCount { get; set; } [JsonPropertyName("usdCount")] - public MoneyLevels UsdCount + public required MoneyLevels UsdCount { get; set; } [JsonPropertyName("eurCount")] - public MoneyLevels EurCount + public required MoneyLevels EurCount { get; set; } [JsonPropertyName("gpCount")] - public MoneyLevels GpCount + public required MoneyLevels GpCount { get; set; @@ -110,21 +110,21 @@ public record MoneyRewards public record MoneyLevels { [JsonPropertyName("common")] - public MinMax Common + public required MinMax Common { get; set; } [JsonPropertyName("rare")] - public MinMax Rare + public required MinMax Rare { get; set; } [JsonPropertyName("superrare")] - public MinMax SuperRare + public required MinMax SuperRare { get; set; @@ -141,14 +141,14 @@ public record AmmoRewards } [JsonPropertyName("ammoRewardBlacklist")] - public Dictionary> AmmoRewardBlacklist + public required Dictionary> AmmoRewardBlacklist { get; set; } [JsonPropertyName("ammoRewardValueRangeRub")] - public Dictionary> AmmoRewardValueRangeRub + public required Dictionary> AmmoRewardValueRangeRub { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs index 3aa616d4..a9d74581 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/SeasonalEventConfig.cs @@ -8,7 +8,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record SeasonalEventConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -25,7 +25,7 @@ public record SeasonalEventConfig : BaseConfig /// event / botType / equipSlot / itemid /// [JsonPropertyName("eventGear")] - public Dictionary>>> EventGear + public required Dictionary>>> EventGear { get; set; @@ -35,42 +35,42 @@ public record SeasonalEventConfig : BaseConfig /// event / bot type / equipSlot / itemid /// [JsonPropertyName("eventLoot")] - public Dictionary>>> EventLoot + public required Dictionary>>> EventLoot { get; set; } [JsonPropertyName("events")] - public List Events + public required List Events { get; set; } [JsonPropertyName("eventBotMapping")] - public Dictionary EventBotMapping + public required Dictionary EventBotMapping { get; set; } [JsonPropertyName("eventBossSpawns")] - public Dictionary>> EventBossSpawns + public required Dictionary>> EventBossSpawns { get; set; } [JsonPropertyName("eventWaves")] - public Dictionary>> EventWaves + public required Dictionary>> EventWaves { get; set; } [JsonPropertyName("gifterSettings")] - public List GifterSettings + public required List GifterSettings { get; set; @@ -80,7 +80,7 @@ public record SeasonalEventConfig : BaseConfig /// key = event, second key = map name /// [JsonPropertyName("hostilitySettingsForEvent")] - public Dictionary>> HostilitySettingsForEvent + public required Dictionary>> HostilitySettingsForEvent { get; set; @@ -90,7 +90,7 @@ public record SeasonalEventConfig : BaseConfig /// Ids of containers on locations that only have Christmas loot /// [JsonPropertyName("christmasContainerIds")] - public List ChristmasContainerIds + public required List ChristmasContainerIds { get; set; @@ -100,7 +100,7 @@ public record SeasonalEventConfig : BaseConfig /// Season - botType - location (body/feet/hands/head) /// [JsonPropertyName("botAppearanceChanges")] - public Dictionary>>> BotAppearanceChanges + public required Dictionary>>> BotAppearanceChanges { get; set; @@ -121,7 +121,7 @@ public record SeasonalEvent { get; set; - } + } = string.Empty; [JsonPropertyName("type")] public SeasonalEventType Type diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs index a51783b5..3e14e7fd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/TraderConfig.cs @@ -7,7 +7,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record TraderConfig : BaseConfig { [JsonPropertyName("kind")] - public string Kind + public override string Kind { get; set; @@ -18,7 +18,7 @@ public record TraderConfig : BaseConfig { get; set; - } + } = []; [JsonPropertyName("updateTimeDefault")] public int UpdateTimeDefault @@ -52,14 +52,14 @@ public record TraderConfig : BaseConfig } [JsonPropertyName("fence")] - public FenceConfig Fence + public required FenceConfig Fence { get; set; } [JsonPropertyName("moddedTraders")] - public ModdedTraders ModdedTraders + public required ModdedTraders ModdedTraders { get; set; @@ -73,20 +73,20 @@ public record UpdateTime { get; set; - } + } = string.Empty; [JsonPropertyName("traderId")] public string TraderId { get; set; - } + } = string.Empty; /// /// Seconds between trader resets /// [JsonPropertyName("seconds")] - public MinMax Seconds + public required MinMax Seconds { get; set; @@ -96,7 +96,7 @@ public record UpdateTime public record FenceConfig { [JsonPropertyName("discountOptions")] - public DiscountOptions DiscountOptions + public required DiscountOptions DiscountOptions { get; set; @@ -124,14 +124,14 @@ public record FenceConfig } [JsonPropertyName("weaponPresetMinMax")] - public MinMax WeaponPresetMinMax + public required MinMax WeaponPresetMinMax { get; set; } [JsonPropertyName("equipmentPresetMinMax")] - public MinMax EquipmentPresetMinMax + public required MinMax EquipmentPresetMinMax { get; set; @@ -152,14 +152,14 @@ public record FenceConfig } [JsonPropertyName("armorMaxDurabilityPercentMinMax")] - public ItemDurabilityCurrentMax ArmorMaxDurabilityPercentMinMax + public required ItemDurabilityCurrentMax ArmorMaxDurabilityPercentMinMax { get; set; } [JsonPropertyName("weaponDurabilityPercentMinMax")] - public ItemDurabilityCurrentMax WeaponDurabilityPercentMinMax + public required ItemDurabilityCurrentMax WeaponDurabilityPercentMinMax { get; set; @@ -169,7 +169,7 @@ public record FenceConfig /// Keyed to plate protection level /// [JsonPropertyName("chancePlateExistsInArmorPercent")] - public Dictionary ChancePlateExistsInArmorPercent + public required Dictionary ChancePlateExistsInArmorPercent { get; set; @@ -179,14 +179,14 @@ public record FenceConfig /// Key: item tpl /// [JsonPropertyName("itemStackSizeOverrideMinMax")] - public Dictionary?> ItemStackSizeOverrideMinMax + public required Dictionary?> ItemStackSizeOverrideMinMax { get; set; } [JsonPropertyName("itemTypeLimits")] - public Dictionary ItemTypeLimits + public required Dictionary ItemTypeLimits { get; set; @@ -196,7 +196,7 @@ public record FenceConfig /// Prevent duplicate offers of items of specific categories by parentId /// [JsonPropertyName("preventDuplicateOffersOfCategory")] - public List PreventDuplicateOffersOfCategory + public required List PreventDuplicateOffersOfCategory { get; set; @@ -213,7 +213,7 @@ public record FenceConfig /// Max rouble price before item is not listed on flea /// [JsonPropertyName("itemCategoryRoublePriceLimit")] - public Dictionary ItemCategoryRoublePriceLimit + public required Dictionary ItemCategoryRoublePriceLimit { get; set; @@ -223,7 +223,7 @@ public record FenceConfig /// Each slotid with % to be removed prior to listing on fence /// [JsonPropertyName("presetSlotsToRemoveChancePercent")] - public Dictionary PresetSlotsToRemoveChancePercent + public required Dictionary PresetSlotsToRemoveChancePercent { get; set; @@ -250,14 +250,14 @@ public record FenceConfig } [JsonPropertyName("blacklist")] - public HashSet Blacklist + public required HashSet Blacklist { get; set; } [JsonPropertyName("coopExtractGift")] - public CoopExtractReward CoopExtractGift + public required CoopExtractReward CoopExtractGift { get; set; @@ -294,14 +294,14 @@ public record FenceConfig public record ItemDurabilityCurrentMax { [JsonPropertyName("current")] - public MinMax Current + public required MinMax Current { get; set; } [JsonPropertyName("max")] - public MinMax Max + public required MinMax Max { get; set; @@ -318,14 +318,14 @@ public record CoopExtractReward : LootRequest } [JsonPropertyName("useRewardItemBlacklist")] - public bool UseRewardItemBlacklist + public new bool UseRewardItemBlacklist { get; set; } [JsonPropertyName("messageLocaleIds")] - public List MessageLocaleIds + public required List MessageLocaleIds { get; set; @@ -363,14 +363,14 @@ public record DiscountOptions } [JsonPropertyName("weaponPresetMinMax")] - public MinMax WeaponPresetMinMax + public required MinMax WeaponPresetMinMax { get; set; } [JsonPropertyName("equipmentPresetMinMax")] - public MinMax EquipmentPresetMinMax + public required MinMax EquipmentPresetMinMax { get; set; @@ -390,5 +390,5 @@ public record ModdedTraders { get; set; - } + } = []; } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs index e6c5b877..9baebccb 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/WeatherConfig.cs @@ -8,7 +8,7 @@ namespace SPTarkov.Server.Core.Models.Spt.Config; public record WeatherConfig : BaseConfig { [JsonPropertyName("kind")] - public string? Kind + public override string Kind { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs index 26063fb1..8f25a023 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Helper/WeightedRandomResult.cs @@ -2,13 +2,13 @@ namespace SPTarkov.Server.Core.Models.Spt.Helper; public record WeightedRandomResult { - public T Item + public required T Item { get; set; } - public int Index + public required int Index { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs index 556ca796..46af0ada 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/CircleCraftDetails.cs @@ -7,28 +7,28 @@ namespace SPTarkov.Server.Core.Models.Spt.Hideout; public record CircleCraftDetails { [JsonPropertyName("time")] - public long Time + public required long Time { get; set; } [JsonPropertyName("rewardType")] - public CircleRewardType? RewardType + public required CircleRewardType RewardType { get; set; } [JsonPropertyName("rewardAmountRoubles")] - public int? RewardAmountRoubles + public required int RewardAmountRoubles { get; set; } [JsonPropertyName("rewardDetails")] - public CraftTimeThreshold? RewardDetails + public required CraftTimeThreshold RewardDetails { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs index 10c9ecf3..d4559aa8 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Inventory/ItemSize.cs @@ -5,14 +5,14 @@ namespace SPTarkov.Server.Core.Models.Spt.Inventory; public record ItemSize { [JsonPropertyName("width")] - public int Width + public required int Width { get; set; } [JsonPropertyName("height")] - public int Height + public required int Height { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs index 08e22db7..104b8691 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/LocaleBase.cs @@ -8,21 +8,21 @@ public record LocaleBase [JsonPropertyName("global")] /// DO NOT USE THIS PROPERTY DIRECTLY, USE LOCALESERVICE INSTEAD /// THIS IS LAZY LOADED AND YOUR CHANGES WILL NOT BE SAVED - public Dictionary>>? Global + public required Dictionary>> Global { get; set; } [JsonPropertyName("menu")] - public Dictionary>? Menu + public required Dictionary> Menu { get; set; } [JsonPropertyName("languages")] - public Dictionary? Languages + public required Dictionary Languages { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs index f41de231..e6e4cd02 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/ServerBase.cs @@ -2,17 +2,20 @@ namespace SPTarkov.Server.Core.Models.Spt.Server; +/// +/// Model for Assets/database/server.json +/// public record ServerBase { [JsonPropertyName("ip")] - public string? Ip + public required string Ip { get; set; } [JsonPropertyName("port")] - public int? Port + public required int Port { get; set; diff --git a/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs index 244f4902..8d81188a 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotLootCacheService.cs @@ -559,24 +559,7 @@ public class BotLootCacheService( /// Bot role to hydrate protected void InitCacheForBotRole(string botRole) { - _lootCache.TryAdd(botRole, new BotLootCache - { - BackpackLoot = new Dictionary(), - PocketLoot = new Dictionary(), - VestLoot = new Dictionary(), - SecureLoot = new Dictionary(), - CombinedPoolLoot = new Dictionary(), - - SpecialItems = new Dictionary(), - GrenadeItems = new Dictionary(), - DrugItems = new Dictionary(), - FoodItems = new Dictionary(), - DrinkItems = new Dictionary(), - CurrencyItems = new Dictionary(), - HealingItems = new Dictionary(), - StimItems = new Dictionary() - } - ); + _lootCache.TryAdd(botRole, new BotLootCache()); } ///