Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug SQP ServerInfo Request not working

Discussion in 'Game Server Hosting' started by HamzaMuhammad, Aug 30, 2023.

  1. HamzaMuhammad


    Jan 17, 2022
    Hi, I am trying to use SQP to get the info of the server but I am unable to receive any data.
    I have started SQP in my server and I am able to get the challange ID but I am unable to receive the ServerInfo i request as it hangs.Using ReceiveAsync tells me that it is completed but i dont get any data as well.I am able to send the request successfully but not getting any reply from SQP. Below is my code for how I am requesting the data.

    Code (CSharp):
    2.         byte header = 0x01;
    3.         byte version = 0x80;
    4.         byte[] requestedChunk = BitConverter.GetBytes(challengeId);
    5.         byte[] queryRequest = new byte[2 + requestedChunk.Length];
    6.         queryRequest[0] = header;
    7.         queryRequest[1] = version;
    8.         Array.Copy(requestedChunk, 0, queryRequest, 2, requestedChunk.Length);
    10.         udpClient = new UdpClient();
    11.         //udpClient.Client.Blocking = false;
    12.         udpClient.Connect(IPAddress.Parse(allocation.ipv4"), 9010);
    13.        ipEndPoint = new IPEndPoint(IPAddress.Parse(allocation.ipv4"), 9010);
    14.         Console.WriteLine("Query Request="+queryRequest.Length);
    15.         var output=udpClient.SendAsync(queryRequest, queryRequest.Length);
    16.         while (output.Status == TaskStatus.Running)
    17.         {
    18.             Console.WriteLine("Send not complete");
    19.         }
    20.         Console.WriteLine("Data is faulted="+output.IsFaulted);
    21.         Console.WriteLine("Data is completed success="+output.IsCompletedSuccessfully);
    22.         Console.WriteLine("Data is completed="+output.IsCompleted);
    23.         Console.WriteLine("Data is canceled="+output.IsCanceled);
    25.         // byte[] queryResponse = udpClient.ReceiveAsync().Result.Buffer;
    26.         var outRecieve = udpClient.Receive(ref ipEndPoint);
    27.         Console.WriteLine("queryResponse length="+outRecieve.Length);