Add server configuration editor

This commit is contained in:
npc0-hue
2026-09-11 11:40:06 +08:00
parent 8c924b5928
commit 8e6d12f6f1
9 changed files with 277 additions and 33 deletions
@@ -3,11 +3,19 @@ import type { SCUMConfigField, SCUMConfigPatch, SCUMFeatureAvailability, SCUMSta
// These are safe fallback plugin catalogs. Plugin-owned declarations may narrow
// them per server, but a game version never enables or disables a feature.
export const configurationCatalog: readonly SCUMConfigField[] = [
{ key: "server-name", fileKey: "scum-server-settings", configKey: "ServerName", label: "服务器名称", description: "显示在服务器浏览器与玩家连接界面。", control: "text", defaultValue: "SCUM Server", restartImpact: "restart-required" },
{ key: "server-name", fileKey: "scum-server-settings", configKey: "scum.ServerName", label: "服务器名称", description: "显示在服务器浏览器与玩家连接界面。", control: "text", defaultValue: "SCUM Server", restartImpact: "restart-required" },
{ key: "game-port", fileKey: "scum-server-settings", configKey: "GamePort", label: "游戏端口", description: "玩家连接所使用的游戏端口。", control: "port", minimum: 1, maximum: 65535, defaultValue: "7779", restartImpact: "restart-required" },
{ key: "query-port", fileKey: "scum-server-settings", configKey: "QueryPort", label: "查询端口", description: "服务器查询和状态发现所使用的端口。", control: "port", minimum: 1, maximum: 65535, defaultValue: "27015", restartImpact: "restart-required" },
{ key: "max-players", fileKey: "scum-server-settings", configKey: "MaxPlayers", label: "最大玩家数", description: "允许同时进入服务器的玩家上限。", control: "number", minimum: 1, maximum: 128, defaultValue: "128", restartImpact: "restart-required" },
{ key: "welcome-message", fileKey: "scum-server-settings", configKey: "WelcomeMessage", label: "欢迎消息", description: "登录成功后由已声明的服务器扩展显示给玩家。", control: "text", defaultValue: "", restartImpact: "none" }
{ key: "max-players", fileKey: "scum-server-settings", configKey: "scum.MaxPlayers", label: "最大玩家数", description: "允许同时进入服务器的玩家上限。", control: "number", minimum: 1, maximum: 128, defaultValue: "128", restartImpact: "restart-required" },
{ key: "welcome-message", fileKey: "scum-server-settings", configKey: "scum.WelcomeMessage", label: "欢迎消息", description: "玩家登录后显示的欢迎消息。", control: "text", defaultValue: "", restartImpact: "none" },
{ key: "server-description", fileKey: "scum-server-settings", configKey: "scum.ServerDescription", label: "服务器描述", description: "显示在服务器列表中的详细描述。", control: "text", defaultValue: "", restartImpact: "restart-required" },
{ key: "server-password", fileKey: "scum-server-settings", configKey: "scum.ServerPassword", label: "服务器密码", description: "留空表示不设置连接密码。", control: "text", defaultValue: "", restartImpact: "restart-required" },
{ key: "server-playstyle", fileKey: "scum-server-settings", configKey: "scum.ServerPlaystyle", label: "服务器玩法", description: "服务器使用的玩法类型,例如 PVE 或 PVP。", control: "text", defaultValue: "PVE", restartImpact: "restart-required" },
{ key: "message-of-the-day", fileKey: "scum-server-settings", configKey: "scum.MessageOfTheDay", label: "每日公告", description: "玩家进入服务器后看到的每日公告。", control: "text", defaultValue: "", restartImpact: "none" },
{ key: "allow-first-person", fileKey: "scum-server-settings", configKey: "scum.AllowFirstPerson", label: "允许第一人称", description: "允许玩家使用第一人称视角。", control: "boolean", defaultValue: "True", restartImpact: "restart-required" },
{ key: "allow-third-person", fileKey: "scum-server-settings", configKey: "scum.AllowThirdPerson", label: "允许第三人称", description: "允许玩家使用第三人称视角。", control: "boolean", defaultValue: "True", restartImpact: "restart-required" },
{ key: "allow-global-chat", fileKey: "scum-server-settings", configKey: "scum.AllowGlobalChat", label: "允许公频聊天", description: "允许玩家使用公频聊天。", control: "boolean", defaultValue: "True", restartImpact: "none" },
{ key: "disable-base-building", fileKey: "scum-server-settings", configKey: "scum.DisableBaseBuilding", label: "禁用建家", description: "是否完全禁止玩家建造基地。", control: "boolean", defaultValue: "False", restartImpact: "restart-required" }
];
export const vehicleSpawnCatalog: readonly SCUMVehicleSpawnOption[] = [{ code: "BPC_Laika_C", label: "Laika" }, { code: "BPC_WolfsWagen_C", label: "WolfsWagen" }];
export const stateFieldCatalog: readonly Omit<SCUMStateField, "value" | "editable" | "reason">[] = [{ key: "skills.running", label: "跑步技能", minimum: 0, maximum: 1000000 }, { key: "attributes.strength", label: "力量属性", minimum: 1, maximum: 8 }, { key: "attributes.stamina", label: "体力", minimum: 0, maximum: 100000 }, { key: "attributes.dexterity", label: "敏捷", minimum: 0, maximum: 100000 }, { key: "attributes.intelligence", label: "智力", minimum: 0, maximum: 100000 }];