Convert routers and callback sessionIds to MongoIds (#453)
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Controllers;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
using SPTarkov.Server.Core.Models.Spt.Logging;
|
||||
@@ -12,21 +13,21 @@ namespace SPTarkov.Server.Core.Callbacks;
|
||||
|
||||
[Injectable]
|
||||
public class ClientLogCallbacks(
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
ClientLogController _clientLogController,
|
||||
ConfigServer _configServer,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
IReadOnlyList<SptMod> _loadedMods
|
||||
HttpResponseUtil httpResponseUtil,
|
||||
ClientLogController clientLogController,
|
||||
ConfigServer configServer,
|
||||
ServerLocalisationService serverLocalisationService,
|
||||
IReadOnlyList<SptMod> loadedMods
|
||||
)
|
||||
{
|
||||
/// <summary>
|
||||
/// Handle /singleplayer/log
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ValueTask<string> ClientLog(string url, ClientLogRequest request, string sessionID)
|
||||
public ValueTask<string> ClientLog(string url, ClientLogRequest request, MongoId sessionID)
|
||||
{
|
||||
_clientLogController.ClientLog(request);
|
||||
return new ValueTask<string>(_httpResponseUtil.NullResponse());
|
||||
clientLogController.ClientLog(request);
|
||||
return new ValueTask<string>(httpResponseUtil.NullResponse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -35,38 +36,36 @@ public class ClientLogCallbacks(
|
||||
/// <returns></returns>
|
||||
public ValueTask<string> ReleaseNotes()
|
||||
{
|
||||
var data = _configServer.GetConfig<CoreConfig>().Release;
|
||||
var data = configServer.GetConfig<CoreConfig>().Release;
|
||||
|
||||
data.BetaDisclaimerText = ProgramStatics.MODS()
|
||||
? _serverLocalisationService.GetText("release-beta-disclaimer-mods-enabled")
|
||||
: _serverLocalisationService.GetText("release-beta-disclaimer");
|
||||
? serverLocalisationService.GetText("release-beta-disclaimer-mods-enabled")
|
||||
: serverLocalisationService.GetText("release-beta-disclaimer");
|
||||
|
||||
data.BetaDisclaimerAcceptText = _serverLocalisationService.GetText(
|
||||
data.BetaDisclaimerAcceptText = serverLocalisationService.GetText(
|
||||
"release-beta-disclaimer-accept"
|
||||
);
|
||||
data.ServerModsLoadedText = _serverLocalisationService.GetText(
|
||||
"release-server-mods-loaded"
|
||||
);
|
||||
data.ServerModsLoadedDebugText = _serverLocalisationService.GetText(
|
||||
data.ServerModsLoadedText = serverLocalisationService.GetText("release-server-mods-loaded");
|
||||
data.ServerModsLoadedDebugText = serverLocalisationService.GetText(
|
||||
"release-server-mods-debug-message"
|
||||
);
|
||||
data.ClientModsLoadedText = _serverLocalisationService.GetText("release-plugins-loaded");
|
||||
data.ClientModsLoadedDebugText = _serverLocalisationService.GetText(
|
||||
data.ClientModsLoadedText = serverLocalisationService.GetText("release-plugins-loaded");
|
||||
data.ClientModsLoadedDebugText = serverLocalisationService.GetText(
|
||||
"release-plugins-loaded-debug-message"
|
||||
);
|
||||
data.IllegalPluginsLoadedText = _serverLocalisationService.GetText(
|
||||
data.IllegalPluginsLoadedText = serverLocalisationService.GetText(
|
||||
"release-illegal-plugins-loaded"
|
||||
);
|
||||
data.IllegalPluginsExceptionText = _serverLocalisationService.GetText(
|
||||
data.IllegalPluginsExceptionText = serverLocalisationService.GetText(
|
||||
"release-illegal-plugins-exception"
|
||||
);
|
||||
data.ReleaseSummaryText = _serverLocalisationService.GetText("release-summary");
|
||||
data.ReleaseSummaryText = serverLocalisationService.GetText("release-summary");
|
||||
data.IsBeta =
|
||||
ProgramStatics.ENTRY_TYPE() is EntryType.BLEEDING_EDGE or EntryType.BLEEDING_EDGE_MODS;
|
||||
data.IsModdable = ProgramStatics.MODS();
|
||||
data.IsModded = _loadedMods.Count > 0;
|
||||
data.IsModded = loadedMods.Count > 0;
|
||||
|
||||
return new ValueTask<string>(_httpResponseUtil.NoBody(data));
|
||||
return new ValueTask<string>(httpResponseUtil.NoBody(data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -75,7 +74,7 @@ public class ClientLogCallbacks(
|
||||
/// <returns></returns>
|
||||
public ValueTask<string> BsgLogging()
|
||||
{
|
||||
var data = _configServer.GetConfig<CoreConfig>().BsgLogging;
|
||||
return new ValueTask<string>(_httpResponseUtil.NoBody(data));
|
||||
var data = configServer.GetConfig<CoreConfig>().BsgLogging;
|
||||
return new ValueTask<string>(httpResponseUtil.NoBody(data));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user