Fix generated run lifecycle profile scope

This commit is contained in:
npc0-hue
2026-08-31 01:20:36 +08:00
parent 8194671656
commit fa2ce17ce3
4 changed files with 74 additions and 3 deletions
@@ -254,6 +254,24 @@ func defaultRunDistributionProfileKey(plugin domain.GamePlugin, profileKey strin
}
return profileKey
}
return firstRuntimeLifecycleProfileKey(plugin)
}
func lifecycleDefaultProfileKey(instance domain.ServerInstance, plugin domain.GamePlugin, profileKey string) string {
profileKey = strings.TrimSpace(profileKey)
if profileKey != "" {
if profile, ok := runtimeLifecycleProfileForKey(plugin.RuntimeProfiles, profileKey); ok {
return profile.Key
}
return profileKey
}
if instance.RunEndpointID != "" && instance.RunEndpointID == generatedRunEndpointID(instance.ID) {
return firstRuntimeLifecycleProfileKey(plugin)
}
return ""
}
func firstRuntimeLifecycleProfileKey(plugin domain.GamePlugin) string {
if len(plugin.RuntimeProfiles.LifecycleProfiles) == 0 {
return ""
}