title: Parse Remote Console protocol values from a UDP payload
body: <p>I am trying to throw together a quick Remote Console server in the next hour as quickly as possible, but ran into an issue.</p>
  
  <p>I am using this very simple packet protocol...
  <a href="http://www.codeproject.com/KB/game/gameRcon.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/game/gameRcon.aspx</a></p>
  
  <p>How can I get the rest of the packet string split up properly? After those 5 bytes, it should be a space, then "rcon passwordhere", then space, then I can take the rest as a single string. I mainly just need to get the "passwordhere" part and the rest of the packet as a string after that.</p>
  
  <pre><code>public void StartServer()
  {
      System.Text.ASCIIEncoding encode = new System.Text.ASCIIEncoding();
  
      IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 28960);
      UdpClient socket = new UdpClient(ipep);
  
      IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
  
      // Receive Packet
      byte[] data = socket.Receive(ref sender);
  
      if (data[0] == byte.Parse("255") &amp;&amp;
          data[1] == byte.Parse("255") &amp;&amp;
          data[2] == byte.Parse("255") &amp;&amp;
          data[3] == byte.Parse("255") &amp;&amp;
          data[4] == byte.Parse("02"))
      {
          // Check Password String
  
          // Execute Command
      }
  }
  </code></pre>