Source RCON Protocol

Send authenticated remote console commands to Source-engine game servers (Counter-Strike, Garry's Mod, ARK, Rust, Minecraft, ...) over the binary RCON protocol.

TsgcLib_RCON

TCP client for the Source RCON binary protocol — authenticate with the server password, send exec commands, parse the response.

Component class

TsgcLib_RCON

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Set host and password, send commands

Set the host, port and password on TsgcLib_RCON, connect, authenticate, then call ExecCommand for each console command.

uses
  sgcLibs;

var
  RCON: TsgcLib_RCON;
begin
  RCON := TsgcLib_RCON.Create(nil);
  RCON.Host     := 'gameserver.example.com';
  RCON.Port     := 27015;
  RCON.Password := 'rcon-password';

  RCON.OnResponse := procedure(Sender: TObject;
    const aResponse: string; const aPacket: TsgcRCON_Packet)
  begin
    Memo1.Lines.Add(aResponse);
  end;

  RCON.Connect;
  RCON.ExecCommand('status');
  RCON.ExecCommand('sv_gravity 800');
end;
// uses: sgcLibs
TsgcLib_RCON *RCON = new TsgcLib_RCON(this);
RCON->Host     = "gameserver.example.com";
RCON->Port     = 27015;
RCON->Password = "rcon-password";

RCON->Connect();
RCON->ExecCommand("status");

What's inside

Implements the Valve Source RCON binary protocol (SERVERDATA_AUTH / SERVERDATA_EXECCOMMAND) over plain TCP.

Authentication

On Connect the component sends a SERVERDATA_AUTH packet with the configured password and waits for SERVERDATA_AUTH_RESPONSE. OnAuthenticate reports success or failure.

Command execution

ExecCommand sends SERVERDATA_EXECCOMMAND with the requested console command. The server reply arrives as OnResponse with the parsed packet body.

Multi-packet responses

Source RCON splits large responses across multiple packets — the component reassembles them using the empty-response sentinel trick and surfaces a single concatenated string.

Broad game support

Works with every server implementing the Source RCON protocol: Counter-Strike, Garry's Mod, ARK: Survival Evolved, Rust, Squad, Project Zomboid, Minecraft (via plugins), and many more.

Plain TCP, plain text

Unlike the WebSocket components on this site, RCON is a raw TCP component (binary little-endian framing). No WebSocket transport is required.

Resilience

Hook OnDisconnect and OnError to handle remote drops or password rejections. Re-call Connect to re-authenticate.

Specifications & references

Authoritative sources for the protocol this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — RCON Full property, method and event reference for this component.
Demo Project — Demos\50.Other\02.RCON Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Remote-Manage Game Servers?

Download the free trial and run RCON commands from your Delphi applications.