Support declared graceful stop and steam.update probe

- LifecycleActionTemplate 新增 gracefulStop:stop 动作可声明插件自有的优雅关闭命令、
  参数、环境、超时与 fallback;超时且 fallback=report 时任务失败,避免默认杀进程。
- 依赖探针新增 steam.update:通过 steamcmd +app_info_print 读取公开分支 buildid,
  与本地 appmanifest_<appid>.acf 比较,输出 installed/latest/update=yes|no|unknown。
- 依赖执行输入新增 ServerRoot,供探针定位插件声明的服务器安装目录。
This commit is contained in:
npc0-hue
2026-09-15 13:31:36 +08:00
parent a695aafd0f
commit 4e88199d18
7 changed files with 464 additions and 26 deletions
+13 -1
View File
@@ -97,7 +97,7 @@ func ValidateRunAutonomousLifecyclePlan(plan RunAutonomousLifecyclePlan) error {
}
}
for _, probe := range plan.DependencyProbes {
if !ValidLogicalFileKey(probe.Key) || !ValidLogicalFileKey(probe.TargetKey) || !validAutonomousToken(probe.Kind, 80) || probe.MinimumVersion != "" && !validAutonomousToken(probe.MinimumVersion, 80) {
if !ValidLogicalFileKey(probe.Key) || !ValidLogicalFileKey(probe.TargetKey) || !validAutonomousToken(probe.Kind, 80) || probe.MinimumVersion != "" && !validAutonomousToken(probe.MinimumVersion, 80) || probe.SteamAppID != "" && !validSteamAppID(probe.SteamAppID) {
return ValidationError("autonomous dependency probe is invalid")
}
}
@@ -244,6 +244,18 @@ func validAutonomousTarget(osName string, arch string) bool {
}
}
func validSteamAppID(value string) bool {
if value == "" || len(value) > 10 {
return false
}
for _, char := range value {
if char < '0' || char > '9' {
return false
}
}
return true
}
func validAutonomousToken(value string, maxRunes int) bool {
trimmed := strings.TrimSpace(value)
if trimmed == "" || trimmed != value || len([]rune(value)) > maxRunes {