sgcWebSockets · Technical Document

RCON Protocol

Source RCON protocol client — Valve / Source-engine remote console TCP client for Delphi.

Overview

Source RCON protocol client — Valve / Source-engine remote console TCP client for Delphi. The component is part of the sgcWebSockets library.

At a glance

Component class
TsgcLib_RCON
Standards / spec
Source RCON Protocol — Valve Developer Wiki
Transports
TCP, TLS
Platforms
Windows, macOS, Linux, iOS, Android
Frameworks
VCL, FireMonkey, Lazarus / FPC
Edition
Standard / Professional / Enterprise

Features

Technical specification

Standards & specsSource RCON Protocol — Valve Developer Wiki
Component classTsgcLib_RCON (unit sgcLib_RCON)
FrameworksVCL, FireMonkey, Lazarus / FPC
PlatformsWindows, macOS, Linux, iOS, Android

Main properties

The principal published / public properties used to configure and drive the component. Consult the online help for the full list.

ActivePublished or public property used to configure or query the component.
OnAuthenticatePublished or public property used to configure or query the component.
RCON_OptionsPublished or public property used to configure or query the component.
OnConnectPublished or public property used to configure or query the component.
OnDisconnectPublished or public property used to configure or query the component.
OnResponsePublished or public property used to configure or query the component.
OnExceptionPublished or public property used to configure or query the component.
NotifyEventsPublished or public property used to configure or query the component.
VersionPublished or public property used to configure or query the component.

Main methods

The principal public methods exposed by the component.

ExecCommand()Public procedure exposed by the component.

Quick Start

Drop the component on a form, configure the properties below and activate it. The snippet that follows shows the typical Send Commands configuration sourced from the online help.

About this scenario. Use the method ExecCommand to send commands to the server. The responses will be available OnResponse Event.

Delphi (VCL / FireMonkey)

oRCON := TsgcLib_RCON.Create(nil);
oRCON.RCON_Options.Host := '127.0.0.1';
oRCON.RCON_Options.Port := 25575;
oRCON.RCON_Options.Password := 'test';
oRCON.Active := True;
<br/>

procedure OnAuthenticate(Sender: TObject; Authenticated: Boolean; const aPacket: TsgcRCON_Packet);
begin
if Authenticated then
DoLog('#authenticated')
else
DoLog('#not authenticated');
end;
<br/>

procedure OnResponse(Sender: TObject; const aResponse: string; const aPacket: TsgcRCON_Packet);
begin
DoLog(aResponse);
end;

C++ Builder

TsgcLib_RCON oRCON = new TsgcLib_RCON();
oRCON->RCON_Options->Host = "127.0.0.1";
oRCON->RCON_Options->Port = 25575;
oRCON->RCON_Options->Password = "test";
oRCON->Active = true;
<br/>

void OnAuthenticate(TObject *Sender, bool Authenticated, const TsgcRCON_Packet *aPacket)
{
if (Authenticated == true)
{
DoLog("#authenticated");
}
else
{
DoLog("#not authenticated");
}
}
<br/>

void OnResponse(Object *Sender, const string aResponse, const TsgcRCON_Packet *aPacket)
{
DoLog(aResponse);
}

.NET (C#)

TsgcLib_RCON oRCON = new TsgcLib_RCON();
oRCON.RCON_Options.Host = "127.0.0.1";
oRCON.RCON_Options.Port = 25575;
oRCON.RCON_Options.Password = "test";
oRCON.Active = true;
<br/>

void OnAuthenticate(TObject Sender, bool Authenticated, const TsgcRCON_Packet aPacket)
{
if (Authenticated == true)
{
DoLog("#authenticated");
}
else
{
DoLog("#not authenticated");
}
}
<br/>

void OnResponse(Object Sender, const string aResponse, const TsgcRCON_Packet aPacket)
{
DoLog(aResponse);
}

Sources used to build this document

Every external claim links back to a primary source. The online-help references decode the canonical deep-link the company maintains for this component.

Document scope. This document covers the publicly-documented surface of the RCON Protocol component shipped with sgcWebSockets. For full property, method and event reference consult the online help linked above.