Add server mod check to cool debug message (!258)

needs merged with: https://dev.sp-tarkov.com/SPT-AKI/Modules/pulls/95

Get a bool from the server to indicate server mods being present and send to the client

Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/258
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
This commit is contained in:
Cj 2024-03-11 22:03:14 +00:00 committed by chomp
parent 38b96f43b0
commit 8397e4690b
3 changed files with 42 additions and 7 deletions

View File

@ -598,6 +598,13 @@
"launcher-profile_sptzerotohero": "Start with almost nothing, no Roubles/Dollars/Euros, no trader rep, 1 knife, no quests completed",
"launcher-profile_sptdeveloper": "Testing profile, starting level is 69, lots of Roubles/Dollars/Euros, USEC start with all quests ready to start, BEAR start with all quests ready to hand in, invincibility balaclava",
"launcher-missing_property": "Profile: %s is missing a descriptionLocaleKey property",
"beta-disclaimer": "By pressing OK you agree that no support is offered and that this is for bug testing only. NOT actual gameplay. Mods are disabled. New profiles may be required frequently. Report all bugs in the reports channel in discord, or on the issues page on the website. If you don't press OK by the time specified, the game will close.",
"release-beta-disclaimer": "By pressing OK you agree that no support is offered and that this is for bug testing only. NOT actual gameplay. Mods are disabled. New profiles may be required frequently. Report all bugs in the reports channel in discord, or on the issues page on the website. If you don't press OK by the time specified, the game will close.",
"release-beta-disclaimer-accept": "User accepted the beta disclaimer",
"release-server-mods-loaded": "One or more server mods exist on a mod enabled build, reports will be invalid until removed. See the top of the server for loaded server mods to remove to report issues again.",
"release-server-mods-debug-message": "Server mods loaded",
"release-plugins-loaded": "One or more plugins exist on a mod enabled build, reports will be invalid until removed. See the following list for what to remove to report issues again:",
"release-plugins-loaded-debug-message": "Client mods loaded",
"release-illegal-plugins-loaded": "One or more non-whitelisted plugins were detected. Mods are not allowed in BleedingEdge builds of SPT. Illegal plugins:",
"release-illegal-plugins-exception": "Non-debug client mods have been detected. Mods are not allowed in BleedingEdge builds of SPT - please remove them before playing!",
"release-summary": ""
}

View File

@ -1,4 +1,5 @@
import { ClientLogController } from "@spt-aki/controllers/ClientLogController";
import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { ICoreConfig, IRelease } from "@spt-aki/models/spt/config/ICoreConfig";
@ -17,6 +18,7 @@ export class ClientLogCallbacks
@inject("ClientLogController") protected clientLogController: ClientLogController,
@inject("ConfigServer") protected configServer: ConfigServer,
@inject("LocalisationService") protected localisationService: LocalisationService,
@inject("ModLoadOrder") protected modLoadOrder: ModLoadOrder,
)
{}
@ -35,10 +37,20 @@ export class ClientLogCallbacks
public releaseNotes(): string
{
const data: IRelease = this.configServer.getConfig<ICoreConfig>(ConfigTypes.CORE).release;
data.betaDisclaimer = this.localisationService.getText("beta-disclaimer");
data.releaseSummary = this.localisationService.getText("release-summary");
data.betaDisclaimerText = this.localisationService.getText("release-beta-disclaimer");
data.betaDisclaimerAcceptText = this.localisationService.getText("release-beta-disclaimer-accept");
data.serverModsLoadedText = this.localisationService.getText("release-server-mods-loaded");
data.serverModsLoadedDebugText = this.localisationService.getText("release-server-mods-debug-message");
data.clientModsLoadedText = this.localisationService.getText("release-plugins-loaded");
data.clientModsLoadedDebugText = this.localisationService.getText("release-plugins-loaded-debug-message");
data.illegalPluginsLoadedText = this.localisationService.getText("release-illegal-plugins-loaded");
data.illegalPluginsExceptionText = this.localisationService.getText("release-illegal-plugins-exception");
data.releaseSummaryText = this.localisationService.getText("release-summary");
data.isBeta = globalThis.G_WATERMARK_ENABLED;
data.isModdable = globalThis.G_MODS_ENABLED;
data.isModded = this.modLoadOrder.getLoadOrder().length > 0 ? true : false;
return this.httpResponse.noBody(data);
}

View File

@ -20,16 +20,32 @@ export interface ICoreConfig extends IBaseConfig
export interface IRelease
{
// Disclaimer outlining the intended usage of bleeding edge
betaDisclaimerText?: string;
// Text logged when users agreed to terms
betaDisclaimerAcceptText: string;
// Server mods loaded message
serverModsLoadedText: string;
// Server mods loaded debug message text
serverModsLoadedDebugText: string;
// Client mods loaded message
clientModsLoadedText: string;
// Client mods loaded debug message text
clientModsLoadedDebugText: string;
// Illegal plugins log message
illegalPluginsLoadedText: string;
// Illegal plugins exception
illegalPluginsExceptionText: string;
// Summary of release changes
releaseSummaryText?: string;
// Enables the cool watermark in-game
isBeta?: boolean;
// Whether mods are enabled
isModdable?: boolean;
// Disclaimer outlining the intended usage of bleeding edge
betaDisclaimer?: string;
// Are mods loaded on the server?
isModded: boolean;
// How long before the messagebox times out and closes the game
betaDisclaimerTimeoutDelay: number;
// Summary of release changes
releaseSummary?: string;
}
export interface IGameFixes