diff --git a/project/assets/configs/core.json b/project/assets/configs/core.json index b584fd0d..afda04a2 100644 --- a/project/assets/configs/core.json +++ b/project/assets/configs/core.json @@ -5,6 +5,10 @@ "serverName": "SPT Server", "profileSaveIntervalSeconds": 15, "sptFriendNickname": "SPT", + "release": { + "isBeta": true, + "betaDisclaimerTimeoutDelay": 30 + }, "fixes": { "fixShotgunDispersion": true, "removeModItemsFromProfile": false, diff --git a/project/assets/database/locales/server/en.json b/project/assets/database/locales/server/en.json index 5bdd9dd5..3a28fb1d 100644 --- a/project/assets/database/locales/server/en.json +++ b/project/assets/database/locales/server/en.json @@ -597,5 +597,7 @@ "launcher-profile_spteasystart": "Lots of Roubles/Dollars/Euros, Some QoL skills are level 20, trader rep maxed, starting level is 15, no quests completed", "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" + "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-summary": "" } diff --git a/project/src/callbacks/ClientLogCallbacks.ts b/project/src/callbacks/ClientLogCallbacks.ts index c62e22cd..c91c5038 100644 --- a/project/src/callbacks/ClientLogCallbacks.ts +++ b/project/src/callbacks/ClientLogCallbacks.ts @@ -1,6 +1,10 @@ import { ClientLogController } from "@spt-aki/controllers/ClientLogController"; 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"; import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { inject, injectable } from "tsyringe"; @@ -11,6 +15,8 @@ export class ClientLogCallbacks constructor( @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("ClientLogController") protected clientLogController: ClientLogController, + @inject("ConfigServer") protected configServer: ConfigServer, + @inject("LocalisationService") protected localisationService: LocalisationService, ) {} @@ -22,4 +28,15 @@ export class ClientLogCallbacks this.clientLogController.clientLog(info); return this.httpResponse.nullResponse(); } + + /** + * Handle /singleplayer/release + */ + public releaseNotes(): string + { + const data: IRelease = this.configServer.getConfig(ConfigTypes.CORE).release; + data.betaDisclaimer = this.localisationService.getText("beta-disclaimer"); + data.releaseSummary = this.localisationService.getText("release-summary"); + return this.httpResponse.noBody(data); + } } diff --git a/project/src/models/spt/config/ICoreConfig.ts b/project/src/models/spt/config/ICoreConfig.ts index e5ef1e81..fde68c82 100644 --- a/project/src/models/spt/config/ICoreConfig.ts +++ b/project/src/models/spt/config/ICoreConfig.ts @@ -9,6 +9,7 @@ export interface ICoreConfig extends IBaseConfig serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + release: IRelease; fixes: IGameFixes; features: IServerFeatures; /** Commit hash build server was created from */ @@ -17,6 +18,18 @@ export interface ICoreConfig extends IBaseConfig buildTime?: string; } +export interface IRelease +{ + // Enables the cool watermark in-game + isBeta: boolean; + // Disclaimer outlining the intended usage of bleeding edge + betaDisclaimer?: string; + // How long before the messagebox times out and closes the game + betaDisclaimerTimeoutDelay: number; + // Summary of release changes + releaseSummary?: string; +} + export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ diff --git a/project/src/routers/static/ClientLogStaticRouter.ts b/project/src/routers/static/ClientLogStaticRouter.ts index 4c183531..595703a7 100644 --- a/project/src/routers/static/ClientLogStaticRouter.ts +++ b/project/src/routers/static/ClientLogStaticRouter.ts @@ -13,6 +13,10 @@ export class ClientLogStaticRouter extends StaticRouter { return this.clientLogCallbacks.clientLog(url, info, sessionID); }), + new RouteAction("/singleplayer/release", (url: string, info: any, sessionID: string, output: string) => + { + return this.clientLogCallbacks.releaseNotes(); + }), ]); } }