Hi, Maybe I'm missing something but i'm having a little trouble with the multi-packet responses from RCON commands with the source engine.
>From what I can tell there's no way to tell when you've reached the end of the multi-packet stream. I've seen various random information about the new tcp/rcon protocol being 'broken' with multi-packet responses but I see no evidence of that. It appears to me that every packet has the proper size/request/command header bytes. However, I can see that there's no way to tell when you've read the LAST packet in a multi-packet stream. Obviously, if the first packet you've read is less than 4096 then you know it's the only packet. But that is the only case where you can be sure. And it's not possible to just keep reading packets until the size field is < 4096, as the sizes flucutate a little with each response. Can someone else tell me what I'm missing here? -- Jason Morriss http://www.psychostats.com/ On Sun, 22 Aug 2004, Alfred Reynolds wrote: > Date: Sun, 22 Aug 2004 18:40:00 -0700 > From: Alfred Reynolds <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > To: [EMAIL PROTECTED], [EMAIL PROTECTED] > Subject: [hlds_apps] Source RCON format > > Here is my first pass at writing a spec for the RCON format, feel free > to ask questions. > > > ---------------------------------------------------- > 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. > > The command packet format consists of: > > packet size (int) > request id (int) > command (int) > string1 (null delimited string) > string2 (null delimited string) > > > The packet size is 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 can be any value except for -1 (0xffffffff), it is used by > the client to de-multiplex outstanding command responses. > > Command must be: > SERVERDATA_EXECCOMMAND = 2 > or SERVERDATA_AUTH = 3 > > The meaning of the string values depends upon the command issued. > SERVERDATA_AUTH: > string1 is the rcon_password for the server. > string2 must be null (""); > > SERVERDATA_EXECCOMMAND: > 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 response packet is the same as the command packet, which is: > packet size (int) > request id (int) > command response (int) > string1 (null delimited string) > string2 (null delimited string) > > with valid command responses being: > SERVERDATA_RESPONSE_VALUE = 0 > or SERVERDATA_AUTH_RESPONSE = 2 > > > 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. > > > > > > _______________________________________________ > hlds_apps mailing list > [EMAIL PROTECTED] > http://list.valvesoftware.com/mailman/listinfo/hlds_apps > _______________________________________________ hlds_apps mailing list [EMAIL PROTECTED] http://list.valvesoftware.com/mailman/listinfo/hlds_apps
