Fix launcherV2 endpoint for loaded mods
This commit is contained in:
@@ -9,6 +9,7 @@ using SPTarkov.Server.Core.Services;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
using SPTarkov.Common.Annotations;
|
||||
using SPTarkov.Common.Extensions;
|
||||
using SPTarkov.Server.Core.Context;
|
||||
using Info = SPTarkov.Server.Core.Models.Eft.Profile.Info;
|
||||
|
||||
namespace SPTarkov.Server.Core.Controllers;
|
||||
@@ -23,7 +24,8 @@ public class LauncherV2Controller(
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ConfigServer _configServer,
|
||||
Watermark _watermark
|
||||
Watermark _watermark,
|
||||
ApplicationContext _applicationContext
|
||||
)
|
||||
{
|
||||
protected CoreConfig _coreConfig = _configServer.GetConfig<CoreConfig>();
|
||||
@@ -156,7 +158,15 @@ public class LauncherV2Controller(
|
||||
/// <returns></returns>
|
||||
public Dictionary<string, PackageJsonData> LoadedMods()
|
||||
{
|
||||
return new Dictionary<string, PackageJsonData>();
|
||||
var mods = _applicationContext?.GetLatestValue(ContextVariableType.LOADED_MOD_ASSEMBLIES).GetValue<List<SptMod>>();
|
||||
var result = new Dictionary<string, PackageJsonData>();
|
||||
|
||||
foreach (var sptMod in mods)
|
||||
{
|
||||
result.Add(sptMod.PackageJson.Name, sptMod.PackageJson);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user