Class ClientActor
- Namespace
- Valheim.Testing.GameSessions
- Assembly
- Valheim.Testing.GameSessions.dll
One named game client of a run, from its open to its close. It is the one client open path (#258): Start() opens the client to its strictly pinned menu through its placement, once, and that open's kept logs, a failed startup's included, are the actor's (Logs) for the teardown scan. Where the client runs is its placement: this machine (OnThisMachine(string, ClientRunPlan, string, CancellationToken): launched, or attached to an operator's client, as the plan's mode says), or the host a campaign assigned it, in that host's desktop session or, for a local macOS host, this runner's GUI session, on its leased Steam identity (OpenClient(ClientRunPlan, string?, string?)). Game is the open client's in-game handle. Disposing it closes the client: it stops only a process it started, and detaches from an operator's.
public sealed class ClientActor
- Inheritance
-
objectClientActor
Properties
Game
The open client's in-game handle, strictly pinned at its menu when it opened.
public GameActor Game { get; }
Property Value
Logs
Every open's kept logs (its BepInEx log and Player.log), a startup that failed after its process started included, for the teardown scan once the client is closed.
public IReadOnlyList<RunLog> Logs { get; }
Property Value
- IReadOnlyList<RunLog>
Name
The client's name in the run, for example client or a campaign's client-a.
public string Name { get; }
Property Value
- string
Plan
The client's pinned input plan used when Start() opens it.
public ClientRunPlan Plan { get; }
Property Value
Session
The open client's session, or null before Start() and once it is closed.
public ClientSession? Session { get; }
Property Value
Methods
Dispose()
Closes the client, if open: it stops only a process it started, and detaches from an operator's. A client still opening is
closed when its open returns. An actor made with OnThisMachine(string, ClientRunPlan, string, CancellationToken) then removes its disposable copy (a client
whose stop failed keeps it, for valheim-test env recover).
public void Dispose()
OnThisMachine(string, ClientRunPlan, string, CancellationToken)
A client on this machine, its evidence (command record, process record, kept logs) written to output:
launched (Launch(ClientRunPlan, string, CancellationToken)) from a disposable copy of the plan's
install, which the actor makes when it opens and removes when it is disposed, or from the install itself with
InPlace; or attached to the operator's client
(Attach(ClientRunPlan, string, IGameTransport?)), as its mode says.
public static ClientActor OnThisMachine(string name, ClientRunPlan plan, string output, CancellationToken cancellation = default)
Parameters
namestringplanClientRunPlanoutputstringcancellationCancellationToken
Returns
Start()
Opens the client to its menu, plugins pinned, and returns its session; closing the session (or this actor) closes it. An actor opens its client once: its evidence (command and process records, kept logs) is that one open's.
public ClientSession Start()