Rcon & C#

As some of you know, I’m working on an Rcon Manger for COD4/5. Some of you want to know how I am parsing/prepping the command to be sent. I’ll share with you my method of parsing the command. I don’t want to divulge too much information as I’m not done with the project yet.

public byte[] prepCommand(string command)

{

byte[] bufferTemp = Encoding.ASCII.GetBytes(command);

byte[] bufferSend = new byte[bufferTemp.Length + 4];

//intial 5 characters as per standard

bufSend[0] = byte.Parse("255");

bufSend[1] = byte.Parse("255");

bufSend[2] = byte.Parse("255");

bufSend[3] = byte.Parse("255");

//copying bytes from rcon to send buffer

int j = 4;

for (int i = 0; i < bufferTemp.Length; i++)

{

bufferSend[j++] = bufferTemp[i];

}

return bufferSend;

}

About Dremation

I'm just a computer programmer/site desinger.
This entry was posted in Programming, tips and tagged , , , , , , . Bookmark the permalink.

One Response to Rcon & C#

  1. thanks for psoting the code

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>