Table of Contents

Class Doom3

Namespace
OpenGSQ.Protocols
Assembly
OpenGSQ.dll

Doom3 Protocol

public class Doom3 : ProtocolBase
Inheritance
Doom3
Inherited Members

Constructors

Doom3(string, int, int)

Initializes a new instance of the Doom3 class.

public Doom3(string host, int port, int timeout = 5000)

Parameters

host string

The host to connect to.

port int

The port to connect to.

timeout int

The connection timeout in milliseconds.

Properties

FullName

Gets the full name of the protocol.

public override string FullName { get; }

Property Value

string

Methods

GetStatus(bool)

Asynchronously retrieves the status of the game server.

public Task<Status> GetStatus(bool stripColor = true)

Parameters

stripColor bool

A boolean indicating whether to strip color codes from the player names.

Returns

Task<Status>

A Status object containing the server information and player list.

Remarks

This function sends a request to the game server and processes the response to extract server information and player details. If the 'stripColor' parameter is set to True, color codes in player names are removed. The function returns a Status object which includes a dictionary of server information and a list of players.

Exceptions

InvalidPacketException

Thrown when the packet header does not match the expected header.

TimeoutException

Thrown when the operation times out.

StripColors(string)

Strips color codes from the input text.

public static string StripColors(string text)

Parameters

text string

The text to strip color codes from.

Returns

string

The text with color codes removed.