Class CliTransport
A TCP attachment to a running ValheimCLI. Disposing it closes the socket, not the game process.
public sealed class CliTransport : IGameTransport, IGameThreadStatusTransport
- Inheritance
-
objectCliTransport
- Implements
Constructors
CliTransport(string, int)
Connect to host:port and require the command-completion protocol.
public CliTransport(string host, int port)
Parameters
hoststringportint
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
commandstringtimeoutTimeSpan
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.