Source RCON Protocol
6 exploror security scottsdale condos for sale global internet roaming disneys beauty and the beast paris hilton porn viola string instrument what state are you from urticaria rosas glasses spy sun wear nikon coolpix 5900 2003 fax server network printer scat movie downloads summer lovin metformin side effect ime out pullman area code xp pro administrator password clindamycin boat bumpers micheal eric dyson biography addressing a selection criteria for a job application top down bottom up approach tarot card readings skylar atlantic bayside city hampton in inn accupril animal comforter fur peerless faucets margot stiller nine songs pathophysiology of osteoarthritis sometime i feel ive got to run away 52 leather coats halejak blackassbuster free gallery mature women riu cancun amitriptyline information bride and groom cartoon comic sex lori lins ltd star ice hockey bikini contest new york auto auction evertt event center debra d andrea free hot lesbian sex mya ticket manufactured home dealer steven testa in regard writing real life street fight videos free digimon porn business online site turnkey web roca portugal lionel rosenblatt quotation marks punctuation rules thank you notes the ramones proses kehamilan military stud levitz furniture jewelry making 3000bc computer history dust sterling motor group uk kemp little solicitors sakar digital concepts deluxe bag redheads lake lots park rapids bathroom vanity design max lucado daily devotional verizon free ringtones jim morrison article chemise portable air compressor love it or hate it microsoft front page web templates daddies gay american greetings garden supply online online medical encyclopedia one step backward face smother galleries marion football clip art scream 4 picture automobile body painting repairing service business logos crafts de... local security policy xp home lifestyler treadmill photographic memory prada handbags turkey hunting secret mc cartney super bowl weather man tartar sauce tesselations electric radiant floor systems state birds information on lanl snow boarding 102.1 edge myspace.com site toronto universal studios discount ticket dog bowl horizon hobbies polymer clay crafts aljazeera english version funny home videos mask no fax fast cash tsubasa chronicle weapons used in ww2 fake nude alicia keys reverse mortgage info mike tyson news mwave sound card driver tatoo artist schools alone bed girl in shannon gleason actress en sexyservidoras list of free government grants background investigation photomerge tradin times nissan repair manual quest o-ring ingold holding pee bisodol grooved hardwood panels pet animals for sale loritab desperate teens seroquel for sleep web phone conferencing female escort service job corp ugly girl photos coralife k love spanish radio station furniture parts reloading supplies cellphone wallpaper www mypay com mississippi money for surveys billing course medical online box jelly fish habitat hendrix software sales polypropylene films honda shadow free music catalogs old car big black penis pic mads junker bowling green kentucky chevrolet my first ejaculation strange meeting by susan hill www.cmt.com ass movies lavasoft adaware freida railway hotel kalgoorlie felix trinidad musical theatre dance aig auto.com airline international pakistan pia sears home center private video texas department of motor vehicles indianapolis business listen my child and you shall hear today show amateur match london england sightseeing sapphic erotica lorrie morgan card digital kingston memory secure keyless remote abrams dan getty image refinishing cast iron bath tub summer days artist clip art complete book of cactus succulents discount ceiling fan system restore patchwork 6736 hc9 printable birthday cards jim zulevic mangarosa restaurant young pussy small tit ati mach64 gx 64 bit bachelor party sex backgammon game embroidery digitizing software uk horse racing tracks britany spears porn birth video cellular south free ringtones all hard sex 1914 studebaker This article was taken from a HLDS_APPS posting by Alfred Reynolds.
Additional Remarks have been added to Alfred's Documentation. This is taken from the KQuery Wiki, as unfortunately the page is defaced. One can dig deeply through the revision history to obtain the information, some of which is vital to creating a working implementation.. I have taken the liberty of echoing it here.
Source Server RCON format
The protocol is based around command/response packets encapsulated in a TCP/IP stream. The stream can have multiple outstanding commands and can be extended to allow for multiple sub-channels of data.
Sending
The command packet format consists of:
- packet size (int)
- the number of bytes from the start of the requestid to the end of string2 (including the null byte). It must be at least 10.
- request id (int)
- SERVERDATA_EXECCOMMAND / SERVERDATA_AUTH (int)
- SERVERDATA_AUTH is currently 3
- SERVERDATA_EXECCOMMAND is currently 2
- string1 (is the command to run).
- string2 must be null ("");
For RCON connections the first command must be a SERVERDATA_AUTH command. If a SERVERDATA_EXECCOMMAND command is sent prior to successful authentication then a SERVERDATA_AUTH_RESPONSE response packet with the failure condition is sent (see the response section for details). The INT's are 32 Bit Little Endian byte order.
Receiving
The response packet is the same as the command packet, which is:
- packet size (int)
- If the response spans over multiple packets only the first has these fields. The Other packets are just data.
- It seems to me, that this has been changed, my response are including those fields. --Plastofix 18:46, 19 Dec 2007 (PST)
- If the response spans over multiple packets only the first has these fields. The Other packets are just data.
- request id (int)
- command response (int)
- valid command responses being:
SERVERDATA_RESPONSE_VALUE = 0
or SERVERDATA_AUTH_RESPONSE = 2
- valid command responses being:
- string1 (null delimited string)
- string2 (null delimited string)
SERVERDATA_AUTH_RESPONSE is sent in response to a SERVERDATA_AUTH command (or to a SERVERDATA_EXECCOMMAND command if the connection is not successfully authenticated). Both strings are set to null. If the request id is -1 (0xffffffff) then the authentication attempt failed (due to a bad password). If the request id is the same value as sent in the command (i.e the value was mirrored back) then authentication was successful. Any other request id is an error and the SERVERDATA_AUTH command should be resent.
SERVERDATA_RESPONSE_VALUE is sent in response to a SERVERDATA_EXECCOMMAND command. string1 contains the response to the command and string2 is null (""). string1 is at most 4096 characters, so a single SERVERDATA_EXECCOMMAND command may result in multiple SERVERDATA_RESPONSE_VALUE response packets.
Additional Comments
These are additional comments added by an anonymous reader on the KQuery wiki. These are accurate and recommended (and in some cases required) for proper implementation of the RCON protocol in Source.
- Request ID is mirrored back properly
- CS:Source server sends one junk packet during the authentication step, before it responds with the correct authentication response.
- It seems this junk packet is also valid under HL2:DM, not just CS:Source, so probably applies to all Source games (unless Rcon stuff is done differently in other Source powered games by 3rd parties). --Bartk 12:13, 2 Oct 2006 (PDT)
- The packet size field does NOT include the size of the packet size field itself. That is why the minimum length is 10 -- four bytes for the two integers (request ID and command) plus two bytes for the potentially empty ASCIIZ strings.
- Make sure that you code the ability to handle multiple response "packets". With a 32-player server, it will use these commonly for status commands (for instance), just as HLDS often did. Also, keep in mind that you won't be able to read the whole "packet" at one time -- you need to keep reading in a loop until you receive the entire packet before processing it.
Implementations
A (hopefully comprehensive) listing of library implementations of the Source RCON protocol.
- Ruby RCon RCon library for Source and Quake RCON derivatives (such as HLDS) written in Ruby.
- C++ Sample class to do Source RCON in C++
- CLI A command-line program to issue RCON commands, written in C
- Python SRCDSpy Python Library to handle all Source Queries, including RCON
- C# C# Library and Sample Program (by Andrew Simpson)
- Java Java RCON Library for Source (also HL1, COD/2, and BF2)
- VB6 VisualBasic 6.0 (Source RCON only) sample up to you to process DataArrival (by: Jaime Gavin)