querySingleServer gets stuck
by Robert Fritzen · in Torque Game Engine Advanced · 08/25/2011 (8:09 am) · 2 replies
Hello, So I've mentioned a few times, I've opted away from using a "master" server program, in place of an easier to use PHP interface.
The PHP side works perfectly, however, there appears to be a problem with one of the functions my script is heavily reliant on.
querySingleServer. I'm using this function to ping each server IP downloaded from the web server, but whenever it tries to use this function, it hits the IP, and get's stuck on the first ping (3). I'm trying to figure out if this is a known issue with TGEA 1.7.1 or if I need to be re-writing some of my scripts.
and the console output:
I should also note, if I press cancel after the first query, the server will show in the list... but the player count shows as "0/0".
The PHP side works perfectly, however, there appears to be a problem with one of the functions my script is heavily reliant on.
querySingleServer. I'm using this function to ping each server IP downloaded from the web server, but whenever it tries to use this function, it hits the IP, and get's stuck on the first ping (3). I'm trying to figure out if this is a known issue with TGEA 1.7.1 or if I need to be re-writing some of my scripts.
function queryGameServers() {
if($PGD::Server $= "" || $PGD::Server $= "NO_SERVERS") {
findAuthServer(1);
schedule(2500, 0, "queryGameServers");
return;
}
%connection = PGDConnection();
%connection.queryGameServer();
}
function PGDConnection::queryGameServer(%connection) {
echo("Master Querry");
%location = "/master/ISRPG/";
%reqHead = $PGD::List::List;
%host = $PGD::Server;
%seperator = getRandomSeperator(16);
%header = makeHeader("POST", %location, %host, "IS RPG Client", "Content-Type: multipart/form-data; boundary="@%seperator@"\r\n");
//
%dispo = makeDisposition( %seperator, mode, %reqHead, 1);
%header = %header @ "Content-Length:" SPC strLen(%dispo) @ "\r\n\r\n";
%connection.request = %header @ %dispo;
//
%connection.onFinish = "queryServersDone";
%check = %connection.PerformConnect(%host);
}
function PGDConnection::queryServersDone(%this, %response) {
%response = strReplace(%response, "LIST", "");
echo("SERVER:" @%response);
%serverCount = getWordCount(%response);
for(%i = 0; %i < %serverCount; %i++) {
//
%address = getWord(%response, %i);
if(strstr(%address, ":") != -1 && strstr(%address, ".") != -1) {
querySingleServer(%address, 0);
}
}
}and the console output:
Master Querry SERVER:130.126.61.39:28000 ServerQuery: start Refreshing server... 0 Pinging Server IP:130.126.61.39:28000 (3)... Server query canceled. ServerQuery: done One server found. 1
I should also note, if I press cancel after the first query, the server will show in the list... but the player count shows as "0/0".
About the author
Illinois Grad. Retired T3D Developer / Pack Dev.
Torque Owner Richard Ranft
Roostertail Games