diff --git a/Core/Controllers/GameController.cs b/Core/Controllers/GameController.cs index 82bf910a..23a90972 100644 --- a/Core/Controllers/GameController.cs +++ b/Core/Controllers/GameController.cs @@ -323,7 +323,8 @@ public class GameController /// public GameKeepAliveResponse GetKeepAlive(string sessionId) { - throw new NotImplementedException(); + _profileActivityService.SetActivityTimestamp(sessionId); + return new GameKeepAliveResponse(){ Message = "OK", UtcTime = _timeUtil.GetTimeStamp() }; } /// diff --git a/Core/Generators/BotGenerator.cs b/Core/Generators/BotGenerator.cs index 4144b83a..8481cdb2 100644 --- a/Core/Generators/BotGenerator.cs +++ b/Core/Generators/BotGenerator.cs @@ -110,7 +110,9 @@ public class BotGenerator /// BotBase object public BotBase GenerateBot(string sessionId, BotBase bot, BotType botJsonTemplate, BotGenerationDetails botGenerationDetails) { - throw new NotImplementedException(); + _logger.Error("NOT IMPLEMENTED BotGenerator.GenerateBot"); + + return new BotBase(); } /// diff --git a/Core/Generators/PlayerScavGenerator.cs b/Core/Generators/PlayerScavGenerator.cs index 83bc4831..45d4e396 100644 --- a/Core/Generators/PlayerScavGenerator.cs +++ b/Core/Generators/PlayerScavGenerator.cs @@ -126,10 +126,10 @@ public class PlayerScavGenerator // Persist previous scav data into new scav scavData.Id = existingScavDataClone.Id ?? pmcDataClone.Savage; scavData.SessionId = existingScavDataClone.SessionId ?? pmcDataClone.SessionId; - scavData.Skills = this.GetScavSkills(existingScavDataClone); - scavData.Stats = this.GetScavStats(existingScavDataClone); - scavData.Info.Level = this.GetScavLevel(existingScavDataClone); - scavData.Info.Experience = this.GetScavExperience(existingScavDataClone); + scavData.Skills = GetScavSkills(existingScavDataClone); + scavData.Stats = GetScavStats(existingScavDataClone); + scavData.Info.Level = GetScavLevel(existingScavDataClone); + scavData.Info.Experience = GetScavExperience(existingScavDataClone); scavData.Quests = existingScavDataClone.Quests ?? []; scavData.TaskConditionCounters = existingScavDataClone.TaskConditionCounters ?? new(); scavData.Notes = existingScavDataClone.Notes ?? new() { DataNotes = new() }; diff --git a/Core/Services/BotLootCacheService.cs b/Core/Services/BotLootCacheService.cs index 49d2a01a..02dde678 100644 --- a/Core/Services/BotLootCacheService.cs +++ b/Core/Services/BotLootCacheService.cs @@ -1,19 +1,45 @@ -using Core.Annotations; +using Core.Annotations; +using Core.Generators; +using Core.Helpers; using Core.Models.Eft.Common.Tables; using Core.Models.Spt.Bots; -using Props = Core.Models.Eft.Common.Props; +using Core.Utils.Cloners; +using ILogger = Core.Models.Utils.ILogger; namespace Core.Services; [Injectable(InjectionType.Singleton)] public class BotLootCacheService { + private readonly ILogger _logger; + private readonly ItemHelper _itemHelper; + private readonly PMCLootGenerator _pmcLootGenerator; + private readonly RagfairPriceService _ragfairPriceService; + private readonly ICloner _cloner; + + private readonly Dictionary _lootCache = new(); + + public BotLootCacheService( + ILogger logger, + ItemHelper itemHelper, + PMCLootGenerator pmcLootGenerator, + RagfairPriceService ragfairPriceService, + ICloner cloner + ) + { + _logger = logger; + _itemHelper = itemHelper; + _pmcLootGenerator = pmcLootGenerator; + _ragfairPriceService = ragfairPriceService; + _cloner = cloner; + } + /// /// Remove cached bot loot data /// public void ClearCache() { - throw new NotImplementedException(); + _lootCache.Clear(); } /// @@ -76,7 +102,7 @@ public class BotLootCacheService /// protected bool IsMagazine(Props props) { - throw new NotImplementedException(); + return props.ReloadMagType is not null; } ///