From f8ce007a640574112e886aa3855a8a74f6fb0f50 Mon Sep 17 00:00:00 2001 From: CWX Date: Wed, 29 Jan 2025 11:28:13 +0000 Subject: [PATCH] give GetAiBotBrainTypes response a type --- Libraries/Core/Controllers/BotController.cs | 24 ++++++++++++++----- Libraries/Core/Models/Spt/Config/BotConfig.cs | 4 +++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Libraries/Core/Controllers/BotController.cs b/Libraries/Core/Controllers/BotController.cs index 09a669f1..5e11c797 100644 --- a/Libraries/Core/Controllers/BotController.cs +++ b/Libraries/Core/Controllers/BotController.cs @@ -17,6 +17,7 @@ using Core.Utils.Cloners; using SptCommon.Extensions; using LogLevel = Core.Models.Spt.Logging.LogLevel; using System.Diagnostics; +using System.Text.Json.Serialization; using Microsoft.Extensions.Logging; namespace Core.Controllers; @@ -447,14 +448,25 @@ public class BotController( return botCap.Value; } - public object GetAiBotBrainTypes() + public AiBotBrainTypes GetAiBotBrainTypes() { - // TODO: Returns `any` in the node server - return new + return new AiBotBrainTypes { - pmc = _pmcConfig.PmcType, - assault = _botConfig.AssaultBrainType, - playerScav = _botConfig.PlayerScavBrainType, + PmcType = _pmcConfig.PmcType, + Assault = _botConfig.AssaultBrainType, + PlayerScav = _botConfig.PlayerScavBrainType, }; } } + +public record AiBotBrainTypes +{ + [JsonPropertyName("pmc")] + public Dictionary>> PmcType { get; set; } + + [JsonPropertyName("assault")] + public Dictionary> Assault { get; set; } + + [JsonPropertyName("playerScav")] + public Dictionary> PlayerScav { get; set; } +} diff --git a/Libraries/Core/Models/Spt/Config/BotConfig.cs b/Libraries/Core/Models/Spt/Config/BotConfig.cs index 95b60972..190fef95 100644 --- a/Libraries/Core/Models/Spt/Config/BotConfig.cs +++ b/Libraries/Core/Models/Spt/Config/BotConfig.cs @@ -458,7 +458,9 @@ public record NighttimeChanges /// [JsonPropertyName("equipmentModsModifiers")] public Dictionary EquipmentModsModifiers { get; set; } - //public Dictionary WeaponModsModifiers { get; set; } //TODO + + [JsonPropertyName("weaponModsModifiers")] + public Dictionary WeaponModsModifiers { get; set; } // TODO: currently not in use anywhere } public record EquipmentFilterDetails