Added ability to blacklist profile from being created in launcher

(cherry picked from commit 5260b16a18)
This commit is contained in:
Dev 2024-07-11 09:58:54 +01:00
parent 0b9e61dcdc
commit e88521fe54
3 changed files with 9 additions and 2 deletions

View File

@ -30,7 +30,8 @@
"commandUseLimits": { "commandUseLimits": {
"StashRows": 15 "StashRows": 15
} }
} },
"createNewProfileTypesBlacklist": []
}, },
"customWatermarkLocaleKeys": [] "customWatermarkLocaleKeys": []
} }

View File

@ -43,10 +43,14 @@ export class LauncherController
public connect(): IConnectResponse 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 { return {
backendUrl: this.httpServerHelper.getBackendUrl(), backendUrl: this.httpServerHelper.getBackendUrl(),
name: this.coreConfig.serverName, name: this.coreConfig.serverName,
editions: Object.keys(this.databaseService.getProfiles()), editions: profileKeys,
profileDescriptions: this.getProfileDescriptions(), profileDescriptions: this.getProfileDescriptions(),
}; };
} }

View File

@ -87,6 +87,8 @@ export interface IServerFeatures
autoInstallModDependencies: boolean autoInstallModDependencies: boolean
compressProfile: boolean compressProfile: boolean
chatbotFeatures: IChatbotFeatures chatbotFeatures: IChatbotFeatures
/** Keyed to profile type e.g. "Standard" or "SPT Developer" */
createNewProfileTypesBlacklist: string[]
} }
export interface IChatbotFeatures export interface IChatbotFeatures