Table of Contents

Class CliTransport

Namespace
Valheim.Testing.Game
Assembly
Valheim.Testing.Game.dll

A TCP attachment to a running ValheimCLI. Disposing it closes the socket, not the game process.

public sealed class CliTransport : IGameTransport, IGameThreadStatusTransport
Inheritance
object
CliTransport
Implements

Constructors

CliTransport(string, int)

Connect to host:port and require the command-completion protocol.

public CliTransport(string host, int port)

Parameters

host string
port int

Exceptions

IOException

The plugin does not answer or cannot confirm command completion.

Methods

Dispose()

Close this TCP attachment without stopping the game.

public void Dispose()

Execute(string, TimeSpan)

Send one command with this call's timeout; a game-side refusal is returned for the actor to judge.

public CommandResult Execute(string command, TimeSpan timeout)

Parameters

command string
timeout TimeSpan

Returns

CommandResult

ReadStatus()

Read STATUS through a fresh connection, including while the game thread is busy.

public IReadOnlyDictionary<string, string> ReadStatus()

Returns

IReadOnlyDictionary<string, string>

Exceptions

IOException

The plugin does not answer or offers only the older state-line fallback.