From e48362ae6e2d4c2bb9f43559ca11282031d4ebf4 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 10 Apr 2024 22:49:26 +0100 Subject: [PATCH] Added setting to allow/deny player wiping a profile via launcher - default `true` --- project/assets/configs/core.json | 1 + project/src/controllers/LauncherController.ts | 10 ++++++++++ project/src/models/spt/config/ICoreConfig.ts | 1 + 3 files changed, 12 insertions(+) diff --git a/project/assets/configs/core.json b/project/assets/configs/core.json index cac90ca3..8b0291ae 100644 --- a/project/assets/configs/core.json +++ b/project/assets/configs/core.json @@ -5,6 +5,7 @@ "serverName": "SPT Server", "profileSaveIntervalSeconds": 15, "sptFriendNickname": "SPT", + "allowProfileWipe": true, "bsgLogging": { "verbosity": 6, "sendToServer": false diff --git a/project/src/controllers/LauncherController.ts b/project/src/controllers/LauncherController.ts index e3a1b441..0e280622 100644 --- a/project/src/controllers/LauncherController.ts +++ b/project/src/controllers/LauncherController.ts @@ -172,8 +172,18 @@ export class LauncherController return sessionID; } + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ public wipe(info: IRegisterData): string { + if (!this.coreConfig.allowProfileWipe) + { + return; + } + const sessionID = this.login(info); if (sessionID) diff --git a/project/src/models/spt/config/ICoreConfig.ts b/project/src/models/spt/config/ICoreConfig.ts index de65c646..21f61368 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; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes;