UrlGuy
11-05-2005, 03:15 AM
Hi,
I play this multiplayer fps game, which available games is displayed on a list using a game browser named 'GameSpy'.
I want to have a script that displays the list of games on my webpage.
I already have a script that displays info on a certain game, but this is not for a certain game, but rather to display the name of all games thats on the list.
I know its possible as people has already done this with Visual Basic, and was hoping it could be possible with PHP somehow. I have already played around alittle with fwrite, fread etc. but with no results.
Basicly what I need done is a script that sends some data, (the server recieves the data, and responds), and gets the output.
I'm not really sure its this simple, although I hope so.
I have used a packet logger with GameSpy when I refreshed the list, and every time I refresh my computer sends this data:
\list\cmp\gamename\ccrenegadedemo
The GameSpy server then responds somehow, and sends output back..
The format in which the reply is might look like this:
gamename\ccrenegadedemo\gamever\262\hostname\SOME GAME NAME\hostport\1337\*******\C&C_Under\gametype\C&C\numplayers\28\maxplayers\32\BW\2000000\CSVR\1\DED\1\DG\1\password\0\TC\0\FF\0\SC\550\final\\queryid\17922.1
This is basicly how the scripts that get info on a certain game gets its info, only its removing the slashes, sorting elements correctly etc.
But now I want to get info on all games thats available from the game list, not just one. I also dont know the IP's of the games that are up, only the IP for GameSpy's server that handles the queries. But this should be enough.
I did a test with fsockopen, fwrite, fread, stream_get_contents and alot of other functions on one of GameSpy's IP's: 207.38.11.14 and port: 28910 .
I sendt:
\list\cmp\gamename\ccrenegadedemo, and waited 30ms for reply, (I've tried more, and I also tried double slashes) but I get nothing back, I'm not even sure if I could expect a reply as I'm not 100% sure of the validity of my code. Anyways I didnt get anything back. Except when I tried print the var the fread was in. Then I got 'Resource ID#2', or something similar to this. I did is_array and print_r($myvar); although this didnt output anything at all, so didnt seem like an array.
Well over to the main problem, hm..
Anyone know how this can be done? Or give me some sample code that sends and recieves data using PHP?
Any help on this is greatly apprecciated!
Thanks in advance for all replies I may recieve..!
~UrlGuy
I play this multiplayer fps game, which available games is displayed on a list using a game browser named 'GameSpy'.
I want to have a script that displays the list of games on my webpage.
I already have a script that displays info on a certain game, but this is not for a certain game, but rather to display the name of all games thats on the list.
I know its possible as people has already done this with Visual Basic, and was hoping it could be possible with PHP somehow. I have already played around alittle with fwrite, fread etc. but with no results.
Basicly what I need done is a script that sends some data, (the server recieves the data, and responds), and gets the output.
I'm not really sure its this simple, although I hope so.
I have used a packet logger with GameSpy when I refreshed the list, and every time I refresh my computer sends this data:
\list\cmp\gamename\ccrenegadedemo
The GameSpy server then responds somehow, and sends output back..
The format in which the reply is might look like this:
gamename\ccrenegadedemo\gamever\262\hostname\SOME GAME NAME\hostport\1337\*******\C&C_Under\gametype\C&C\numplayers\28\maxplayers\32\BW\2000000\CSVR\1\DED\1\DG\1\password\0\TC\0\FF\0\SC\550\final\\queryid\17922.1
This is basicly how the scripts that get info on a certain game gets its info, only its removing the slashes, sorting elements correctly etc.
But now I want to get info on all games thats available from the game list, not just one. I also dont know the IP's of the games that are up, only the IP for GameSpy's server that handles the queries. But this should be enough.
I did a test with fsockopen, fwrite, fread, stream_get_contents and alot of other functions on one of GameSpy's IP's: 207.38.11.14 and port: 28910 .
I sendt:
\list\cmp\gamename\ccrenegadedemo, and waited 30ms for reply, (I've tried more, and I also tried double slashes) but I get nothing back, I'm not even sure if I could expect a reply as I'm not 100% sure of the validity of my code. Anyways I didnt get anything back. Except when I tried print the var the fread was in. Then I got 'Resource ID#2', or something similar to this. I did is_array and print_r($myvar); although this didnt output anything at all, so didnt seem like an array.
Well over to the main problem, hm..
Anyone know how this can be done? Or give me some sample code that sends and recieves data using PHP?
Any help on this is greatly apprecciated!
Thanks in advance for all replies I may recieve..!
~UrlGuy
