Ok, I will apologise now if I confuse anyone :P STRING1 and STRING2 are both NULL Terminated.
1: connect to server. REQUEST_ID = 0x02000000; COMMAND = 0x03000000; STRING1 = "PASSWORD\0"; // 9 bytes. STRING2 = "\0"; // 1 byte. PACKET_SIZE = sizeof(REQUEST_ID)+sizeof(COMMAND) PACKET_SIZE += sizeof(STRING1)+sizeof(STRING2) // So PACKET_SIZE in this case = 18 (0x12) So it will look like the following: 12 00 00 00 02 00 00 00 03 00 00 00 50 41 53 53 57 4F 52 44 00 00 2: send PACKET_SIZE REQUEST_ID COMMAND STRING1 STRING2 If correct the server should send back the following: PACKET_SIZE = 0x0A000000; REQUEST_ID = 0x00000000; COMMAND_RESPONSE = 0x00000000; STRING1 and STRING2 are both 0x00 PACKET_SIZE REQUEST_ID COMMAND_RESPONSE STRING1 STRING2 So it will look like the following: 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 If incorrect it will be the same apart from REQUEST_ID will = 0xFFFFFFFF So it will look like the following: 0A 00 00 00 FF FF FF FF 00 00 00 00 00 00 Hmm... Not too sure if it returns following first 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 to say that it has got the packet, then it sends the error incorrect packet. Ok, just looking at the doc, did a quick test... It seems that the server isnt responding correctly to the AUTH packet? It seems like it is responding that the rcon_password is correct even if its wrong. Either way it returns the following Packet: 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 But if you try and get it to say request for "users" you would do the following: // You should still be connected at this point. REQUEST_ID = 0x00000000; COMMAND = 0x02000000; STRING1 = ""users"\0"; // 5+2+1 bytes. // 5 for users, 2 for quotes either side and 1 for the nul term. STRING2 = "\0"; // 1 byte. PACKET_SIZE = sizeof(REQUEST_ID)+sizeof(COMMAND) PACKET_SIZE += sizeof(STRING1)+sizeof(STRING2) // So PACKET_SIZE in this case = 17 (0x11) So it will look like the following: 11 00 00 00 00 00 00 00 02 00 00 00 22 75 73 65 72 73 22 00 00 But you will either get the information you requested or you will get the following Packet: 0A 00 00 00 FF FF FF FF 02 00 00 00 00 00 PACKET_SIZE = 0x0A000000 REQUEST_ID = 0xFFFFFFFF COMMAND_RESPONSE = 0x02000000 STRING1 = 0x00 STRING1 = 0x00 But I am not 100% sure this info is correct, due to too many of the following packets are being returned even if using an incorrect password. 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 Paul Kirby > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of BrOk3R > Sent: Mon 23 August 2004 15:15 > To: [EMAIL PROTECTED] > Subject: RE: [hlds_apps] Source RCON format > > > Ok I have been testing the new rcon format and its seems like > in actual srcds version it isnt fully implemented or something. > > Here I write some of the problems I found. > > 1. Server always respond with a 10 bytes size packet. > 2. The server response for a SERVERDATA_AUTH packet always is > (rcon_password bad or good): > packet size..............10 > request id............... 0 > command.................. 0 > 3. The string response for a rcon command like 'say hello' > (after beeing well authed) is a 6 or 7 ascii strange characters. > > > > Maybe I am doing something wrong? > > Excuse my english. > > -----Mensaje original----- > De: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] En nombre de > BrOk3R Enviado el: lunes, 23 de agosto de 2004 13:38 > Para: [EMAIL PROTECTED] > Asunto: RE: [hlds_apps] Source RCON format > > Wop! If I send SERVERDATA_EXECCOMMAND prior SERVERDATA_AUTH > in the srcds console appear a "Bad password" message, but if > I try sending a SERVERDATA_AUTH with the good rcon_password > the server send the response 0xa. Is it wrong ? > > -----Mensaje original----- > De: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] En nombre de > BrOk3R Enviado el: lunes, 23 de agosto de 2004 13:21 > Para: [EMAIL PROTECTED] > Asunto: RE: [hlds_apps] Source RCON format > > I trying this rcon format with an srcds updated server and i > dont know if i doing something wrong but it doesnt work. > > What are the tcp port that I should use ? > > > -----Mensaje original----- > De: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] En nombre de > Alfred Reynolds Enviado el: lunes, 23 de agosto de 2004 3:40 > Para: [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Asunto: [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 > > > > _______________________________________________ > > 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 > _______________________________________________ hlds_apps mailing list [EMAIL PROTECTED] http://list.valvesoftware.com/mailman/listinfo/hlds_apps
