package steam

import (
    "fmt"

    "zlh-agent/internal/state"
)

func InstallRust(cfg state.Config) error {
    dir, err := EnsureGameDir(cfg)
    if err != nil {
        return err
    }

    login := SteamLoginArgs(cfg)
    appID := "258550" // Rust Dedicated Server

    args := []string{
        "+login", login,
        "+force_install_dir", dir,
        "+app_update", appID, "validate",
        "+quit",
    }

    if err := RunSteamCMD(args...); err != nil {
        return fmt.Errorf("rust install failed: %w", err)
    }

    return nil
}
