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.
Send authenticated remote console commands to Source-engine game servers (Counter-Strike, Garry's Mod, ARK, Rust, Minecraft, ...) over the binary RCON protocol.
TCP client for the Source RCON binary protocol — authenticate with the server password, send exec commands, parse the response.
TsgcLib_RCON
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
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");
Implements the Valve Source RCON binary protocol (SERVERDATA_AUTH / SERVERDATA_EXECCOMMAND) over plain TCP.
On Connect the component sends a SERVERDATA_AUTH packet with the configured password and waits for SERVERDATA_AUTH_RESPONSE. OnAuthenticate reports success or failure.
ExecCommand sends SERVERDATA_EXECCOMMAND with the requested console command. The server reply arrives as OnResponse with the parsed packet body.
Source RCON splits large responses across multiple packets — the component reassembles them using the empty-response sentinel trick and surfaces a single concatenated string.
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.
Unlike the WebSocket components on this site, RCON is a raw TCP component (binary little-endian framing). No WebSocket transport is required.
Hook OnDisconnect and OnError to handle remote drops or password rejections. Re-call Connect to re-authenticate.
Authoritative sources for the protocol this component implements.
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. | Open | |
| Demo Project — Demos\50.Other\02.RCON Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |