Table of Contents

Class Quake3

Namespace
OpenGSQ.Protocols
Assembly
OpenGSQ.dll

Quake3 Query Protocol

public class Quake3 : Quake2
Inheritance
Quake3
Inherited Members

Constructors

Quake3(string, int, int)

Initializes a new instance of the Quake3 class.

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

Parameters

host string

The IP address of the server.

port int

The port number of the server.

timeout int

The timeout for the connection in milliseconds.

Properties

FullName

Gets the full name of the protocol.

public override string FullName { get; }

Property Value

string

Methods

GetInfo(bool)

Gets the server information. If stripColor is true, color codes are removed from the server name.

public Task<Dictionary<string, string>> GetInfo(bool stripColor = true)

Parameters

stripColor bool

A boolean indicating whether to remove color codes from the server name.

Returns

Task<Dictionary<string, string>>

A dictionary containing the server information.

Exceptions

InvalidPacketException

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

TimeoutException

Thrown when the operation times out.

GetStatus(bool)

Gets the status of the server including information and players. If stripColor is true, color codes are removed from the server name and player names.

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

Parameters

stripColor bool

A boolean indicating whether to remove color codes from the server name and player names.

Returns

Task<Status>

A Status object containing the server information and players.

Exceptions

InvalidPacketException

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

TimeoutException

Thrown when the operation times out.

StripColor(string)

Removes color codes from a string.

public static string StripColor(string text)

Parameters

text string

The text to remove color codes from.

Returns

string

The text with color codes removed.