diff --git a/platform_web/components/ServerConfigEditor.tsx b/platform_web/components/ServerConfigEditor.tsx
index e8f1d76..aa266f3 100644
--- a/platform_web/components/ServerConfigEditor.tsx
+++ b/platform_web/components/ServerConfigEditor.tsx
@@ -115,7 +115,7 @@ export function ServerConfigEditor({ instance, operations, requester, onClose }:
{message && }
{error && workspace && }
{loading && }
- {!loading && mode === "friendly" &&
{fields.length === 0 && 该配置文件没有声明可视化字段,请切换到源码模式。}{fields.map((field) => setValues((current) => ({ ...current, [field.key]: value }))} />)}
}
+ {!loading && mode === "friendly" && {fields.length === 0 &&
该配置文件没有声明可视化字段,请切换到源码模式。}{configFieldGroups(fields).map((group) =>
{group.label}
{group.fields.map((field) => setValues((current) => ({ ...current, [field.key]: value }))} />)})}
}
{!loading && mode === "source" && }
@@ -131,5 +131,14 @@ function ConfigField({ field, value, onChange }: { field: PluginConfigFieldRespo
return ;
}
+function configFieldGroups(fields: PluginConfigFieldResponse[]): Array<{ label: string; fields: PluginConfigFieldResponse[] }> {
+ const groups = new Map();
+ for (const field of fields) {
+ const label = field.configKey.startsWith("scum.Server") || field.configKey.startsWith("scum.Welcome") || field.configKey.startsWith("scum.Message") ? "服务器基础" : field.configKey.includes("Zombie") || field.configKey.includes("Character") || field.configKey.includes("Animal") ? "世界与生物" : field.configKey.includes("Vehicle") || field.configKey.includes("Fuel") ? "载具" : field.configKey.includes("Raid") || field.configKey.includes("Quest") || field.configKey.includes("NewPlayer") ? "玩法规则" : "其他设置";
+ groups.set(label, [...(groups.get(label) ?? []), field]);
+ }
+ return [...groups.entries()].map(([label, groupFields]) => ({ label, fields: groupFields }));
+}
+
function configOperationKey(operation: string, serverId: string, fileKey: string): string { return `web:server-config:${operation}:${serverId}:${fileKey}`; }
function formatReadTime(value: string): string { const date = new Date(value); return Number.isNaN(date.getTime()) ? value : date.toLocaleString("zh-CN"); }
diff --git a/plugins/examples/scum-server-plugin/features/schemas.ts b/plugins/examples/scum-server-plugin/features/schemas.ts
index 9f71783..8215637 100644
--- a/plugins/examples/scum-server-plugin/features/schemas.ts
+++ b/plugins/examples/scum-server-plugin/features/schemas.ts
@@ -15,7 +15,25 @@ export const configurationCatalog: readonly SCUMConfigField[] = [
{ 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" }
+ { key: "disable-base-building", fileKey: "scum-server-settings", configKey: "scum.DisableBaseBuilding", label: "禁用建家", description: "是否完全禁止玩家建造基地。", control: "boolean", defaultValue: "False", restartImpact: "restart-required" },
+ { key: "allow-map-screen", fileKey: "scum-server-settings", configKey: "scum.AllowMapScreen", label: "允许地图", description: "是否允许玩家打开地图。", control: "boolean", defaultValue: "True", restartImpact: "none" },
+ { key: "allow-kill-claiming", fileKey: "scum-server-settings", configKey: "scum.AllowKillClaiming", label: "允许领取击杀", description: "是否允许玩家领取击杀奖励。", control: "boolean", defaultValue: "True", restartImpact: "none" },
+ { key: "allow-coma", fileKey: "scum-server-settings", configKey: "scum.AllowComa", label: "允许昏迷", description: "是否启用昏迷机制。", control: "boolean", defaultValue: "True", restartImpact: "restart-required" },
+ { key: "allow-mines-and-traps", fileKey: "scum-server-settings", configKey: "scum.AllowMinesAndTraps", label: "允许地雷和陷阱", description: "是否允许使用地雷和陷阱。", control: "boolean", defaultValue: "False", restartImpact: "restart-required" },
+ { key: "allow-events", fileKey: "scum-server-settings", configKey: "scum.AllowEvents", label: "允许服务器事件", description: "是否启用服务器事件。", control: "boolean", defaultValue: "True", restartImpact: "restart-required" },
+ { key: "logout-timer", fileKey: "scum-server-settings", configKey: "scum.LogoutTimer", label: "下线倒计时", description: "玩家下线前的倒计时秒数。", control: "number", minimum: 0, maximum: 3600, defaultValue: "60", restartImpact: "restart-required" },
+ { key: "fame-gain-multiplier", fileKey: "scum-server-settings", configKey: "scum.FameGainMultiplier", label: "声望获取倍率", description: "玩家获得声望的倍率。", control: "number", minimum: 0, maximum: 100, defaultValue: "1", restartImpact: "none" },
+ { key: "max-allowed-characters", fileKey: "scum-server-settings", configKey: "scum.MaxAllowedCharacters", label: "世界角色上限", description: "世界中同时存在的角色数量上限。", control: "number", minimum: -1, maximum: 10000, defaultValue: "500", restartImpact: "restart-required" },
+ { key: "max-allowed-zombies", fileKey: "scum-server-settings", configKey: "scum.MaxAllowedZombies", label: "僵尸上限", description: "世界中同时存在的僵尸数量上限。", control: "number", minimum: -1, maximum: 10000, defaultValue: "300", restartImpact: "restart-required" },
+ { key: "max-allowed-animals", fileKey: "scum-server-settings", configKey: "scum.MaxAllowedAnimals", label: "动物上限", description: "世界中同时存在的动物数量上限。", control: "number", minimum: -1, maximum: 10000, defaultValue: "-1", restartImpact: "restart-required" },
+ { key: "exterior-zombie-amount", fileKey: "scum-server-settings", configKey: "scum.ExteriorZombieAmountModifier", label: "室外僵尸倍率", description: "室外僵尸数量倍率。", control: "number", minimum: 0, maximum: 100, defaultValue: "3.9", restartImpact: "restart-required" },
+ { key: "interior-zombie-amount", fileKey: "scum-server-settings", configKey: "scum.InteriorZombieAmountModifier", label: "室内僵尸倍率", description: "室内僵尸数量倍率。", control: "number", minimum: 0, maximum: 100, defaultValue: "2.8", restartImpact: "restart-required" },
+ { key: "fuel-drain-multiplier", fileKey: "scum-server-settings", configKey: "scum.FuelDrainFromEngineMultiplier", label: "车辆耗油倍率", description: "车辆发动机燃油消耗倍率。", control: "number", minimum: 0, maximum: 100, defaultValue: "1", restartImpact: "none" },
+ { key: "vehicle-inactivity-time", fileKey: "scum-server-settings", configKey: "scum.MaximumTimeOfVehicleInactivity", label: "车辆不活跃时间", description: "车辆不活跃后被处理的时间。", control: "text", defaultValue: "168:10:00", restartImpact: "restart-required" },
+ { key: "log-vehicle-destroyed", fileKey: "scum-server-settings", configKey: "scum.LogVehicleDestroyed", label: "记录车辆摧毁", description: "是否记录车辆被摧毁事件。", control: "boolean", defaultValue: "True", restartImpact: "none" },
+ { key: "raid-protection-type", fileKey: "scum-server-settings", configKey: "scum.RaidProtectionType", label: "抄家保护类型", description: "服务器抄家保护规则类型。", control: "number", minimum: 0, maximum: 10, defaultValue: "3", restartImpact: "restart-required" },
+ { key: "quests-enabled", fileKey: "scum-server-settings", configKey: "scum.QuestsEnabled", label: "启用任务", description: "是否启用商人任务系统。", control: "boolean", defaultValue: "True", restartImpact: "none" },
+ { key: "new-player-protection", fileKey: "scum-server-settings", configKey: "scum.EnableNewPlayerProtection", label: "新人保护", description: "是否启用新人保护。", control: "boolean", defaultValue: "True", 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[] = [{ 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 }];
diff --git a/plugins/examples/scum-server-plugin/manifest.json b/plugins/examples/scum-server-plugin/manifest.json
index 5499c12..8c007f1 100644
--- a/plugins/examples/scum-server-plugin/manifest.json
+++ b/plugins/examples/scum-server-plugin/manifest.json
@@ -704,6 +704,60 @@
"control": "boolean",
"defaultValue": "False",
"restartImpact": "restart-required"
+ },
+ {
+ "key": "allow-map-screen", "fileKey": "scum-server-settings", "configKey": "scum.AllowMapScreen", "label": "允许地图", "description": "是否允许玩家打开地图。", "control": "boolean", "defaultValue": "True", "restartImpact": "none"
+ },
+ {
+ "key": "allow-kill-claiming", "fileKey": "scum-server-settings", "configKey": "scum.AllowKillClaiming", "label": "允许领取击杀", "description": "是否允许玩家领取击杀奖励。", "control": "boolean", "defaultValue": "True", "restartImpact": "none"
+ },
+ {
+ "key": "allow-coma", "fileKey": "scum-server-settings", "configKey": "scum.AllowComa", "label": "允许昏迷", "description": "是否启用昏迷机制。", "control": "boolean", "defaultValue": "True", "restartImpact": "restart-required"
+ },
+ {
+ "key": "allow-mines-and-traps", "fileKey": "scum-server-settings", "configKey": "scum.AllowMinesAndTraps", "label": "允许地雷和陷阱", "description": "是否允许使用地雷和陷阱。", "control": "boolean", "defaultValue": "False", "restartImpact": "restart-required"
+ },
+ {
+ "key": "allow-events", "fileKey": "scum-server-settings", "configKey": "scum.AllowEvents", "label": "允许服务器事件", "description": "是否启用服务器事件。", "control": "boolean", "defaultValue": "True", "restartImpact": "restart-required"
+ },
+ {
+ "key": "logout-timer", "fileKey": "scum-server-settings", "configKey": "scum.LogoutTimer", "label": "下线倒计时", "description": "玩家下线前的倒计时秒数。", "control": "number", "minimum": 0, "maximum": 3600, "defaultValue": "60", "restartImpact": "restart-required"
+ },
+ {
+ "key": "fame-gain-multiplier", "fileKey": "scum-server-settings", "configKey": "scum.FameGainMultiplier", "label": "声望获取倍率", "description": "玩家获得声望的倍率。", "control": "number", "minimum": 0, "maximum": 100, "defaultValue": "1", "restartImpact": "none"
+ },
+ {
+ "key": "max-allowed-characters", "fileKey": "scum-server-settings", "configKey": "scum.MaxAllowedCharacters", "label": "世界角色上限", "description": "世界中同时存在的角色数量上限。", "control": "number", "minimum": 0, "maximum": 10000, "defaultValue": "500", "restartImpact": "restart-required"
+ },
+ {
+ "key": "max-allowed-zombies", "fileKey": "scum-server-settings", "configKey": "scum.MaxAllowedZombies", "label": "僵尸上限", "description": "世界中同时存在的僵尸数量上限。", "control": "number", "minimum": 0, "maximum": 10000, "defaultValue": "300", "restartImpact": "restart-required"
+ },
+ {
+ "key": "max-allowed-animals", "fileKey": "scum-server-settings", "configKey": "scum.MaxAllowedAnimals", "label": "动物上限", "description": "世界中同时存在的动物数量上限。", "control": "number", "minimum": 0, "maximum": 10000, "defaultValue": "-1", "restartImpact": "restart-required"
+ },
+ {
+ "key": "exterior-zombie-amount", "fileKey": "scum-server-settings", "configKey": "scum.ExteriorZombieAmountModifier", "label": "室外僵尸倍率", "description": "室外僵尸数量倍率。", "control": "number", "minimum": 0, "maximum": 100, "defaultValue": "3.9", "restartImpact": "restart-required"
+ },
+ {
+ "key": "interior-zombie-amount", "fileKey": "scum-server-settings", "configKey": "scum.InteriorZombieAmountModifier", "label": "室内僵尸倍率", "description": "室内僵尸数量倍率。", "control": "number", "minimum": 0, "maximum": 100, "defaultValue": "2.8", "restartImpact": "restart-required"
+ },
+ {
+ "key": "fuel-drain-multiplier", "fileKey": "scum-server-settings", "configKey": "scum.FuelDrainFromEngineMultiplier", "label": "车辆耗油倍率", "description": "车辆发动机燃油消耗倍率。", "control": "number", "minimum": 0, "maximum": 100, "defaultValue": "1", "restartImpact": "none"
+ },
+ {
+ "key": "vehicle-inactivity-time", "fileKey": "scum-server-settings", "configKey": "scum.MaximumTimeOfVehicleInactivity", "label": "车辆不活跃时间", "description": "车辆不活跃后被处理的时间。", "control": "text", "defaultValue": "168:10:00", "restartImpact": "restart-required"
+ },
+ {
+ "key": "log-vehicle-destroyed", "fileKey": "scum-server-settings", "configKey": "scum.LogVehicleDestroyed", "label": "记录车辆摧毁", "description": "是否记录车辆被摧毁事件。", "control": "boolean", "defaultValue": "True", "restartImpact": "none"
+ },
+ {
+ "key": "raid-protection-type", "fileKey": "scum-server-settings", "configKey": "scum.RaidProtectionType", "label": "抄家保护类型", "description": "服务器抄家保护规则类型。", "control": "number", "minimum": 0, "maximum": 10, "defaultValue": "3", "restartImpact": "restart-required"
+ },
+ {
+ "key": "quests-enabled", "fileKey": "scum-server-settings", "configKey": "scum.QuestsEnabled", "label": "启用任务", "description": "是否启用商人任务系统。", "control": "boolean", "defaultValue": "True", "restartImpact": "none"
+ },
+ {
+ "key": "new-player-protection", "fileKey": "scum-server-settings", "configKey": "scum.EnableNewPlayerProtection", "label": "新人保护", "description": "是否启用新人保护。", "control": "boolean", "defaultValue": "True", "restartImpact": "restart-required"
}
]
},