From e88521fe54776b11219e88f6f8fab4f92e5fdff0 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 11 Jul 2024 09:58:54 +0100 Subject: [PATCH] Added ability to blacklist profile from being created in launcher (cherry picked from commit 5260b16a1810f0ea16793f9eae9bc8707c9096e4) --- project/assets/configs/core.json | 3 ++- project/src/controllers/LauncherController.ts | 6 +++++- project/src/models/spt/config/ICoreConfig.ts | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/project/assets/configs/core.json b/project/assets/configs/core.json index ff0b62ba..69c0d185 100644 --- a/project/assets/configs/core.json +++ b/project/assets/configs/core.json @@ -30,7 +30,8 @@ "commandUseLimits": { "StashRows": 15 } - } + }, + "createNewProfileTypesBlacklist": [] }, "customWatermarkLocaleKeys": [] } diff --git a/project/src/controllers/LauncherController.ts b/project/src/controllers/LauncherController.ts index 0b2e99b5..9b797732 100644 --- a/project/src/controllers/LauncherController.ts +++ b/project/src/controllers/LauncherController.ts @@ -43,10 +43,14 @@ export class LauncherController public connect(): IConnectResponse { + // Get all possible profile types + filter out any that are blacklisted + const profileKeys = Object.keys(this.databaseService.getProfiles()) + .filter((key) => !this.coreConfig.features.createNewProfileTypesBlacklist.includes(key)); + return { backendUrl: this.httpServerHelper.getBackendUrl(), name: this.coreConfig.serverName, - editions: Object.keys(this.databaseService.getProfiles()), + editions: profileKeys, profileDescriptions: this.getProfileDescriptions(), }; } diff --git a/project/src/models/spt/config/ICoreConfig.ts b/project/src/models/spt/config/ICoreConfig.ts index a1d1de61..1b53c3f7 100644 --- a/project/src/models/spt/config/ICoreConfig.ts +++ b/project/src/models/spt/config/ICoreConfig.ts @@ -87,6 +87,8 @@ export interface IServerFeatures autoInstallModDependencies: boolean compressProfile: boolean chatbotFeatures: IChatbotFeatures + /** Keyed to profile type e.g. "Standard" or "SPT Developer" */ + createNewProfileTypesBlacklist: string[] } export interface IChatbotFeatures