Implemented: GetKeepAlive, ClearCache, IsMagazine + stubbed out GenerateBot`

This commit is contained in:
Chomp
2025-01-13 16:41:13 +00:00
parent 71f554ed88
commit e35c125e02
4 changed files with 39 additions and 10 deletions
+2 -1
View File
@@ -323,7 +323,8 @@ public class GameController
/// <returns></returns>
public GameKeepAliveResponse GetKeepAlive(string sessionId)
{
throw new NotImplementedException();
_profileActivityService.SetActivityTimestamp(sessionId);
return new GameKeepAliveResponse(){ Message = "OK", UtcTime = _timeUtil.GetTimeStamp() };
}
/// <summary>
+3 -1
View File
@@ -110,7 +110,9 @@ public class BotGenerator
/// <returns>BotBase object</returns>
public BotBase GenerateBot(string sessionId, BotBase bot, BotType botJsonTemplate, BotGenerationDetails botGenerationDetails)
{
throw new NotImplementedException();
_logger.Error("NOT IMPLEMENTED BotGenerator.GenerateBot");
return new BotBase();
}
/// <summary>
+4 -4
View File
@@ -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() };
+30 -4
View File
@@ -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<string, BotLootCache> _lootCache = new();
public BotLootCacheService(
ILogger logger,
ItemHelper itemHelper,
PMCLootGenerator pmcLootGenerator,
RagfairPriceService ragfairPriceService,
ICloner cloner
)
{
_logger = logger;
_itemHelper = itemHelper;
_pmcLootGenerator = pmcLootGenerator;
_ragfairPriceService = ragfairPriceService;
_cloner = cloner;
}
/// <summary>
/// Remove cached bot loot data
/// </summary>
public void ClearCache()
{
throw new NotImplementedException();
_lootCache.Clear();
}
/// <summary>
@@ -76,7 +102,7 @@ public class BotLootCacheService
/// <returns></returns>
protected bool IsMagazine(Props props)
{
throw new NotImplementedException();
return props.ReloadMagType is not null;
}
/// <summary>