Table of Contents

Class ConnectionStatusReading

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

One reading of cli_connection_status: ValheimCLI replies OK: connectionStatus=ErrorVersion, server=... (its console twin adds gameState=... before server=). The command is a diagnostic, so ValheimCLI answers it even while its standing expectations fail.

public sealed record ConnectionStatusReading
Inheritance
object
ConnectionStatusReading

Constructors

ConnectionStatusReading(GameConnectionStatus, string)

One reading of cli_connection_status: ValheimCLI replies OK: connectionStatus=ErrorVersion, server=... (its console twin adds gameState=... before server=). The command is a diagnostic, so ValheimCLI answers it even while its standing expectations fail.

public ConnectionStatusReading(GameConnectionStatus Status, string Server)

Parameters

Status GameConnectionStatus
Server string

Properties

Code

The game's number for Status, the error code a refusing server sends.

public int Code { get; }

Property Value

int

Server

public string Server { get; init; }

Property Value

string

Status

public GameConnectionStatus Status { get; init; }

Property Value

GameConnectionStatus

Methods

IsRefusal(GameConnectionStatus)

Whether status is one a refused or failed connection ends with (every Error... status).

public static bool IsRefusal(GameConnectionStatus status)

Parameters

status GameConnectionStatus

Returns

bool

Parse(IEnumerable<string>)

Parses the reply; refuses a missing or repeated status line and a status name this game build does not have.

public static ConnectionStatusReading Parse(IEnumerable<string> output)

Parameters

output IEnumerable<string>

Returns

ConnectionStatusReading

ParseStatus(string)

A status by the game's name (ErrorVersion); numbers and unknown names are refused.

public static GameConnectionStatus ParseStatus(string name)

Parameters

name string

Returns

GameConnectionStatus

Read(GameActor)

Reads the game's connection status once (read-only).

public static ConnectionStatusReading Read(GameActor actor)

Parameters

actor GameActor

Returns

ConnectionStatusReading

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.