SourceRCON
C++ Source RCON implementation
Install / Use
/learn @Phil25/SourceRCONREADME
C++ Source RCON implementation
Uses Valve's Source RCON protocol for communicating with remote Source engine servers.
Contents
Features ^
- Implemented as a C++ class
- Exposes a very simple interface
- Supports multi-packet responses
- Non-threaded, delays for larger reponses
- Connection timeout (default 4 seconds)
Notes about this implementation:
- This is not a standalone application.
- It works on UNIX systems only as of now.
Example Usage ^
Prints test.
srcon client = srcon("127.0.0.1", 27015, "password");
std::string response = client.send("echo test");
std::cout << response << std::endl;
Constructors ^
srcon(srcon_addr addr, int timeout=SRCON_DEFAULT_TIMEOUT)addr—srcon_addrstructtimeout— connection timeout in seconds (defaults to 4)
srcon(std::string address, int port, std::string pass, int timeout=SRCON_DEFAULT_TIMEOUT)address— address of the serverport— port of the serverpass— rcon password of the servertimeout— connection timeout in seconds (defaults to 4)
Address Structure ^
srcon_addr struct consists of:
std::string addr— address of the serverint port— port of the serverstd::string pass— rcon password of the server
Multi-packet Response ^
Using a method by Koraktor as explained here.
After each SERVERDATA_EXECCOMMAND request, a SERVERDATA_RESPONSE_VALUE packet is sent, which is used as a terminator package. This adds overhead to communication, but assures a reliable reception of all responses. For lengths of over 1024 bytes, the thread halts to let the buffer get filled (0.5 seconds).
Related Skills
node-connect
336.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
336.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.0kCommit, push, and open a PR
