Jump to content

Home

SW:BF Gamespy Query Script


DNACowboy

Recommended Posts

Originally posted by LoRdNaTaS

I have been working on a script for PHP but in my testing the connection just hangs. PHP finally times out but it does not retreive any info from the server. I have put that on the side for right now and am in the process of creating a stats system. I might get back to working in a week or so.

 

That's a shame - I have been watching this thread anticipating a PHP script... ah well I guess it will come in time.... :deathii:

Link to comment
Share on other sites

Many thanks for the php script KaeseGewitter! :)

 

Works a treat, had to do a little bit of fiddling, but seems to work fine... as my webserver (abyss) sits on the game server, I just use 127.0.0.1 (stops the darn thing timing out).

 

I'm also using a cut down version of PHP, so I cant throttle PHP Notice messages so I changed this line :-

 

if ($bytes_left['unread_bytes'] > 0)

{

$buf = fread($fp, $bytes_left['unread_bytes']);

}

 

Just to define the 'unread_bytes', for anyone else who may have problems with it.

 

 

Danke Schone!

Link to comment
Share on other sites

ah, I wasnt too sure what putting the ' ' marks around it did.

 

I figured it was a generic sort of define (like cast) method, and wouldnt affect its length. So um... outta my depth already, it defines the type, and not the length?

 

Hey, its been a few years since I have bothered to code... I vowed never to code again, and star wars has forced me back into it.

 

.... mumbles something about dark side and succumbing ...

 

My Effort

Link to comment
Share on other sites

sorry, I didn't understood you right, I thought you wrote something like this:

 

define unread_bytes = 1024;

 

So it was my fault, sry. Perhaps you should build a small design around my Script. just make a index.php (or any other name). Put into this index.php your HTML Code and then write this: <? include("status.php"); ?> at the point, where my script should be shown.

Link to comment
Share on other sites

In terms of the part of the script that sorts out which side is which, I've had a look and they dont always seem to tally.

 

ie the game may be rebels vs imperials, but Confederation / Republic would be showing.

 

So I just changed the code to this.

 

echo("<table width='600'><tr><td colspan=4><b>");

# Display "goodies"

echo($array[$ber2+4]);

echo (" - ".$array[$ber2+5]);

 

echo("</b></td><td colspan=4><b>");

# Display "badies"

echo($array[$ber2+6]);

echo (" - ".$array[$ber2+7]);

 

echo("</b></td></tr>");

Link to comment
Share on other sites

yea i still haven't figured out what the end team info is.

 

team_t and score_t are always the same..

 

REBEL or EMPIRE and the score_t is always 10 and 15..

 

i believe this may have been the Galactic Conquest feature they where going to put in (where score carried over from round to round)..

 

right now it is only good for determining the player set, GCW vs Republic..

Link to comment
Share on other sites

the only thing I have found the team_t is good for is determining the game type.

 

If Rebels & Empire then you are playing episode 4 - 6

If Rebulic and CIS then you are playing episode 1 - 3

 

But the score_t seems to have no use as of yet due to it never changes. I though it might be the ticket count but it seems that it is not.

Link to comment
Share on other sites

Just a quick question, how did anyone figure out what HEX codes to send to the server to query it?

 

$send = pack("H*", "FE");

$send .= pack("H*", "FD");

$send .= pack("H*", "00");

$send .= pack("H*", "04");

$send .= pack("H*", "05");

$send .= pack("H*", "06");

$send .= pack("H*", "07");

$send .= pack("H*", "FF");

$send .= pack("H*", "FF");

$send .= pack("H*", "FF");

 

... am just wondering if it responds to other HEX queries or not, y'see.

 

 

_edit_

Having engaged brain, I realised this must be the UDP query format. heh

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...