Class InteractiveClient
- Namespace
- Valheim.Testing.GameSessions
- Assembly
- Valheim.Testing.GameSessions.dll
Starts a game client inside a host's existing desktop session, where its display, GPU and signed-in Steam client are. A process started over SSH or from a service has none of these, so ClientSession cannot start a client on another machine.
- Windows (a PowerShell host): a scheduled task registered for the host user with "Run only when user is logged on" (an interactive token, never a stored password), under a unique name for this launch. Starting it runs a small launcher in the user's desktop session, which starts the game and records its process ID and start time. The task is always removed again, whatever happened.
- macOS: an SSH host bootstraps a run-owned LaunchAgent into its unlocked console user's GUI session; the agent starts the selected native or Rosetta slice and is removed after the exact client process stops.
A Linux host runs the dedicated server only; a Linux client is refused (System.PlatformNotSupportedException). The host refuses before anything starts when the user has no desktop session there (on Windows, also when it has more than one), when no Steam client runs as the user in it, when a required install file is missing or when the launch directory exists.
public static class InteractiveClient
- Inheritance
-
objectInteractiveClient
Methods
StartAsync(IGameHost, GameLaunch, string, TimeSpan, CancellationToken)
Starts launch in host's desktop session and returns the game's process, identified by
process ID and start time. launchDirectory is a new absolute directory on the host for this launch's evidence:
the recorded process identity (its pid file), and the game's standard output or the launcher's error.
A Mac agent keeps a non-secret launch spec there; other hosts discard theirs after launch. Secret variables are read here first; a missing one is refused before anything runs. Their values never enter the
composed script (which the host's wrapper writes to a temporary file): they follow it on standard input, the wrapper keeps
them in memory, and they reach only the game's environment (on Windows through a file in the user's temporary directory
that the launcher deletes as it reads it). They are redacted from every reply. It returns when the game process exists, not
when it is ready: wait for its log line or state through the host and a CliTunnel.
public static Task<InteractiveClientProcess> StartAsync(IGameHost host, GameLaunch launch, string launchDirectory, TimeSpan timeout, CancellationToken cancellation = default)
Parameters
hostIGameHostlaunchGameLaunchlaunchDirectorystringtimeoutTimeSpanHow long the start may take, at least 15 s. A reply lost past it is an unknown outcome: a client (and, on Windows, its task) may exist, named in the exception.
cancellationCancellationToken
Returns
- Task<InteractiveClientProcess>
StartAsync(SteamAccountHold, IGameHost, GameLaunch, string, TimeSpan, CancellationToken)
StartAsync(IGameHost, GameLaunch, string, TimeSpan, CancellationToken) on the leased Steam
account account: refused before anything runs on the host unless its lease is live, was taken for a client
on this host, and passed the signed-in check when the profile asks for one.
public static Task<InteractiveClientProcess> StartAsync(SteamAccountHold account, IGameHost host, GameLaunch launch, string launchDirectory, TimeSpan timeout, CancellationToken cancellation = default)
Parameters
accountSteamAccountHoldhostIGameHostlaunchGameLaunchlaunchDirectorystringtimeoutTimeSpancancellationCancellationToken
Returns
- Task<InteractiveClientProcess>