From baed8d2b901f0455c41f3c0b89aa894eb911ae69 Mon Sep 17 00:00:00 2001 From: hulkhan22 Date: Sat, 26 Apr 2025 23:56:48 +0200 Subject: [PATCH] Revert to a lock --- Libraries/SPTarkov.Server.Core/Controllers/BotController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs index 7525b2a7..90397713 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs @@ -39,6 +39,7 @@ public class BotController( { private readonly BotConfig _botConfig = _configServer.GetConfig(); private readonly PmcConfig _pmcConfig = _configServer.GetConfig(); + private static readonly Lock BotListLock = new(); /// /// Return the number of bot load-out varieties to be generated @@ -201,7 +202,10 @@ public class BotController( condition.Limit), // Choose largest between value passed in from request vs what's in bot.config _botHelper.IsBotPmc(condition.Role)); - result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId)); + lock (BotListLock) + { + result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId)); + } })).ToArray()); stopwatch.Stop();