Jump to content
Xtreme .Net Talk

Recommended Posts

  • 1 month later...
Posted

Yeah, you will need to send the raw bytes for the query. Since they give the query structure in hex you will simply need to convert it to standard bytes.

 

Here's a method I came up with to do that:

private byte[] GetBytes(string hex)
{
   System.Collections.Generic.List<byte> bytes = new List<byte>();

   foreach (string hexChunk in System.Text.RegularExpressions.Regex.Split(hex.Trim(), @"\s+"))
   {
       bytes.Add((byte)Int32.Parse(hexChunk, System.Globalization.NumberStyles.HexNumber));
   }

   return bytes.ToArray();
}

Example call:

foreach (byte b in GetBytes("FF FF FF FF 55"))
{
   System.Diagnostics.Debug.WriteLine(b);
}

Once you figure out the byte structure you can just hard code the queries like the following:

byte[] detailsQuery = new byte[] { 255, 255, 255, 255, 54 };
byte[] rulesQuery = new byte[] { 255, 255, 255, 255, 86 };
byte[] playersQuery = new byte[] { 255, 255, 255, 255, 85 };

 

You can then just send the query like the following:

mySocket.Send(detailsQuery);

You will get back a stream of bytes that is structured as they described on that page. Reading it should be easy. The only tricky part will be the strings.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...