Sending Rcon commands via UDP -
08-29-2002, 09:37 AM
Ho folks,
I'm trying to write my own little app in VB much like Crow Kings AutoKick. I know I have to use the Winsock control and send via UDP and that's all set up with the correct IP and Port but how exactly do I form the syntax to send and receive the info back???
If I use something along the lines of "rconpassord ****" or "rcon status" all I receive back is "ÿÿÿÿdisconnect"
It's driving me mad. Can someone throw me a few pointers please?
Re: Sending Rcon commands via UDP -
08-29-2002, 10:05 AM
[quote="mr.monkey":aa3b4]Ho folks,
I'm trying to write my own little app in VB much like Crow Kings AutoKick. I know I have to use the Winsock control and send via UDP and that's all set up with the correct IP and Port but how exactly do I form the syntax to send and receive the info back???
If I use something along the lines of "rconpassord ****" or "rcon status" all I receive back is "ÿÿÿÿdisconnect"
It's driving me mad. Can someone throw me a few pointers please?
Many thanks
Mr. Monkey[/quote:aa3b4]
um.... packet capture?
post this over in board of developers too.
Re: Sending Rcon commands via UDP -
08-29-2002, 11:48 PM
[quote="mr.monkey":53e33]Ho folks,
I'm trying to write my own little app in VB much like Crow Kings AutoKick. I know I have to use the Winsock control and send via UDP and that's all set up with the correct IP and Port but how exactly do I form the syntax to send and receive the info back???
If I use something along the lines of "rconpassord ****" or "rcon status" all I receive back is "ÿÿÿÿdisconnect"
It's driving me mad. Can someone throw me a few pointers please?
Many thanks
Mr. Monkey[/quote:53e33]
You need to include a header before you send the rcon text to the server.
Q3 (and thus MOHAA) have a 4 byte header at the beginning which should just be 0xff (ASCII 255) four times, plus an extra byte that MOHAA always has set to 2. You also should (must?) include each seperate word of the command it a seperate quote, as this is what the game itself does.
So, to send "rcon status" with a password of "bleh", you'd send:
255, 255, 255, 255, 2, and then the string rcon bleh "status".
I've got a quick C implementation [url=http://stats.clanfx.com/download/moh-rcon.c.txt:53e33]here[/url:53e33]. So something like:
would work in VB to get the header, and I have no desire in learning any more VB to do the rest. You similarly want to strip the header from the response.