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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user