UE2 - UT2kX UDPGameSpyQuery Help

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

mrgad

New Member
Jan 9, 2013
1
0
0
I've been trying to get this working for hours.

I'm trying to use a UDPLink to Query and Recieve Info from the UDPGameSpyQuery that runs on UT2004 GameServers

It's not working, I'm not sure if its how I'm formatting the query or that I'm using UDPLink wrong entirely.. Or something else?

Here is what I've gotten too so far:

my server query udplink class.
Code:
class ServerQuery extends UdpLink;
 
var PlayerController OwnerPC;
var IpAddr dest;
var string query;
 
event PreBeginPlay()
{
  BindPort();
}
 
function SendQuery(string IP, int Port, string myquery)
{
 StringToIpAddr(IP, dest);
 dest.port = Port;
 query = myquery;
 
 LinkMode=MODE_Text;
 
 OwnerPC.ClientMessage("SendText Result:" @SendText( dest, query ));
}
 
event ReceiveText(IpAddr Addr, string Text)
{
  if ( OwnerPC != None )
   OwnerPC.ClientMessage(Text);
}
 
event ReceiveLine(IpAddr Addr, string Text)
{
  if ( OwnerPC != None )
   OwnerPC.ClientMessage(Text);
}
 
defaultproperties
{
}

The function I'm using to send query, in a client side interaction
Code:
exec function Test( string IP, int Port, string Query )
{
  if ( SQ == None )
   SQ = xPC.Spawn(class'ServerQuery');
   
   if ( SQ != None )
   {
      SQ.OwnerPC = xPC;
      SQ.SendQuery(IP, Port, Query);
   }
}

Called it like so: TEST 123.123.123.123 7787 \\info\\
but thats not the only query I attempted. (been at this all night)

Got no Received events, oh & SendText() returns true. (Which I think means failed but couldn't find out for sure)

My 3 theories are:
I maybe need to bind to a specific port to receive data.
I'm not formatting the query properly.
I'm using UDPLink wrong entirely and have no idea what the hell I'm doing.

There is not alot of information about this online, well actually I couldn't find any real info whatsoever related to UDPGameSpyQuery or any sort of examples.

I really want to figure this out so I can use it too create a menu that shows current info from all the servers I host.
 
Last edited: