Table of Contents

Class DirectServerProcess

Namespace
Valheim.Testing.Game
Assembly
Valheim.Testing.Game.dll
public sealed class DirectServerProcess : IOwnedProcess
Inheritance
object
DirectServerProcess
Implements

Constructors

DirectServerProcess(ProcessStartInfo, string, params string[])

public DirectServerProcess(ProcessStartInfo start, string logPrefix, params string[] gameLogs)

Parameters

start ProcessStartInfo
logPrefix string
gameLogs string[]

Properties

HasExited

public bool HasExited { get; }

Property Value

bool

Id

public int Id { get; }

Property Value

int

Quit

How StopCleanly(TimeSpan, TimeSpan) asks the process to quit: Interrupt for a dedicated server (the default), CloseWindow for a game client.

public QuitRequest Quit { get; init; }

Property Value

QuitRequest

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Stop(TimeSpan)

Kills the process at once and waits up to timeout for it to exit.

public void Stop(TimeSpan timeout)

Parameters

timeout TimeSpan

StopCleanly(TimeSpan, TimeSpan)

Asks the process to quit as Quit says and waits up to quit; kills it only if it is still running then (or could not be asked). Keeps the logs either way.

public ProcessStop StopCleanly(TimeSpan quit, TimeSpan kill)

Parameters

quit TimeSpan
kill TimeSpan

Returns

ProcessStop

WaitForExitAsync(CancellationToken)

Completes with the exit code when the process exits; startup fails as soon as it does.

public Task<int> WaitForExitAsync(CancellationToken cancellation)

Parameters

cancellation CancellationToken

Returns

Task<int>