Fix declared server config file reads
This commit is contained in:
@@ -441,6 +441,7 @@
|
||||
"directoryKey": "scum-config",
|
||||
"label": "ServerSettings.ini",
|
||||
"kind": "config",
|
||||
"targetKey": "SCUM/Saved/Config/WindowsServer/ServerSettings.ini",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
@@ -448,6 +449,7 @@
|
||||
"directoryKey": "scum-config",
|
||||
"label": "AdminUsers.ini",
|
||||
"kind": "config",
|
||||
"targetKey": "SCUM/Saved/Config/WindowsServer/AdminUsers.ini",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
@@ -455,6 +457,7 @@
|
||||
"directoryKey": "scum-config",
|
||||
"label": "BannedUsers.ini",
|
||||
"kind": "config",
|
||||
"targetKey": "SCUM/Saved/Config/WindowsServer/BannedUsers.ini",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
@@ -462,6 +465,7 @@
|
||||
"directoryKey": "scum-config",
|
||||
"label": "WhitelistUsers.ini",
|
||||
"kind": "config",
|
||||
"targetKey": "SCUM/Saved/Config/WindowsServer/WhitelistedUsers.ini",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
},
|
||||
"$defs": {
|
||||
"pluginLogicalDirectory": { "type": "object", "required": ["key", "label", "scope"], "additionalProperties": false, "properties": { "key": { "$ref": "#/$defs/logicalKey" }, "label": { "type": "string", "minLength": 1, "maxLength": 60 }, "scope": { "enum": ["config", "logs"] } } },
|
||||
"pluginLogicalFile": { "type": "object", "required": ["key", "directoryKey", "label", "kind"], "additionalProperties": false, "properties": { "key": { "$ref": "#/$defs/logicalKey" }, "directoryKey": { "$ref": "#/$defs/logicalKey" }, "label": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "enum": ["config", "log"] }, "streamKey": { "$ref": "#/$defs/logicalKey" }, "editable": { "type": "boolean" } } },
|
||||
"pluginLogicalFile": { "type": "object", "required": ["key", "directoryKey", "label", "kind"], "additionalProperties": false, "properties": { "key": { "$ref": "#/$defs/logicalKey" }, "directoryKey": { "$ref": "#/$defs/logicalKey" }, "label": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "enum": ["config", "log"] }, "streamKey": { "$ref": "#/$defs/logicalKey" }, "targetKey": { "$ref": "#/$defs/relativePathRef" }, "editable": { "type": "boolean" } } },
|
||||
"pluginConfigField": { "type": "object", "required": ["key", "fileKey", "configKey", "label", "description", "control", "restartImpact"], "additionalProperties": false, "properties": { "key": { "$ref": "#/$defs/logicalKey" }, "fileKey": { "$ref": "#/$defs/logicalKey" }, "configKey": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$", "maxLength": 120 }, "label": { "type": "string", "minLength": 1, "maxLength": 80 }, "description": { "type": "string", "minLength": 1, "maxLength": 240 }, "control": { "enum": ["text", "number", "boolean", "port"] }, "minimum": { "type": "integer", "minimum": 0, "maximum": 65535 }, "maximum": { "type": "integer", "minimum": 0, "maximum": 65535 }, "defaultValue": { "type": "string", "maxLength": 120 }, "restartImpact": { "enum": ["none", "restart-required"] } } },
|
||||
"pluginAssetFile": {
|
||||
"type": "object",
|
||||
|
||||
@@ -347,7 +347,7 @@ describe("plugin manifest validation", () => {
|
||||
fileWorkspace?: {
|
||||
defaultDirectoryKey: string;
|
||||
directories: Array<{ key: string; label: string; scope: string }>;
|
||||
files: Array<{ key: string; directoryKey: string; label: string; kind: string; streamKey?: string; editable?: boolean }>;
|
||||
files: Array<{ key: string; directoryKey: string; label: string; kind: string; streamKey?: string; targetKey?: string; editable?: boolean }>;
|
||||
configFields: Array<{ key: string; fileKey: string; configKey: string; label: string }>;
|
||||
};
|
||||
runtimeProfiles?: { lifecycleProfiles?: Array<{ key: string; capabilities?: string[] }>; logSources?: Array<{ key: string }>; clientManagers?: unknown[] };
|
||||
@@ -382,6 +382,7 @@ describe("plugin manifest validation", () => {
|
||||
expect(manifest.fileWorkspace?.defaultDirectoryKey).toBe("scum-config");
|
||||
expect(manifest.fileWorkspace?.directories.map((directory) => `${directory.key}:${directory.scope}`)).toEqual(expect.arrayContaining(["scum-config:config", "scum-logs:logs"]));
|
||||
expect(manifest.fileWorkspace?.files.map((file) => file.key)).toEqual(expect.arrayContaining(["scum-server-settings", "scum-admin-users", "scum-chat-log", "scum-performance-log"]));
|
||||
expect(manifest.fileWorkspace?.files.find((file) => file.key === "scum-server-settings")?.targetKey).toBe("SCUM/Saved/Config/WindowsServer/ServerSettings.ini");
|
||||
expect(manifest.fileWorkspace?.configFields.map((field) => field.key)).toEqual(expect.arrayContaining(["server-name", "max-players", "welcome-message", "server-description", "server-playstyle"]));
|
||||
expect(manifest.runtimeProfiles?.lifecycleProfiles?.find((profile) => profile.key === "scum-client")).toBeUndefined();
|
||||
expect(manifest.runtimeProfiles?.logSources?.map((source) => source.key)).toEqual(expect.arrayContaining(["scum-chat-events", "scum-server-events", "scum-login-events", "scum-trade-events"]));
|
||||
|
||||
Reference in New Issue
Block a user