Table of Contents

Class SourceRcon

Namespace
OpenGSQ.RconProtocols
Assembly
OpenGSQ.dll

Source RCON Protocol

public class SourceRcon : ProtocolBase, IDisposable
Inheritance
SourceRcon
Implements
Inherited Members

Constructors

SourceRcon(string, int, int)

Source RCON Protocol

public SourceRcon(string address, int port = 27015, int timeout = 5000)

Parameters

address string
port int
timeout int

Properties

FullName

Gets the full name of the protocol.

public override string FullName { get; }

Property Value

string

Methods

Authenticate(string)

Authenticates the client with the server using the provided password.

public Task Authenticate(string password)

Parameters

password string

The password to be used for authentication.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ArgumentException

Thrown when the password is null or empty.

InvalidPacketException

Thrown when the received packet type is not SERVERDATA_AUTH_RESPONSE.

AuthenticationException

Thrown when authentication fails.

TimeoutException

Thrown when the operation times out.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

SendCommand(string)

Sends a command to the server and waits for the response.

public Task<string> SendCommand(string command)

Parameters

command string

The command to be sent to the server.

Returns

Task<string>

A task that represents the asynchronous operation. The task result contains the server response to the command.

Exceptions

TimeoutException

Thrown when the operation times out.