SRCDS Steam group


PHP - Steam Master Servers List
#1
Hello.
Can someone give me an example code of this?

Thank you.
Reply
#2
if you are on a linux webhost, you could use the programm quakestat and parse its output.
Here is an example: http://www.ulrich-block.de/?p=825

You would need to modify it of courcse.

Also you might want to take a look at http://gameq.sourceforge.net
I havent looked through the whole class but maybe you can find sth. usefull.
Interactive web based config creator for CS, CSS, TF2 and DODS
Creates server and client configs in an explained dialog.

You`ll also find precompiled debian gameserver kernels for download
Reply
#3
Well i can't make these to work for me.
I just want to get all avalable servers from the master.

Thanks.
Reply
#4
So you want many things/code and still you are not giving anything.
No data, no specified informations what you need exactly.

It like saying I want a car and not telling for wich porpuse and denying all offers you get...
Interactive web based config creator for CS, CSS, TF2 and DODS
Creates server and client configs in an explained dialog.

You`ll also find precompiled debian gameserver kernels for download
Reply
#5
(01-27-2011, 01:52 AM)Terrorkarotte Wrote:  So you want many things/code and still you are not giving anything.
No data, no specified informations what you need exactly.

It like saying I want a car and not telling for wich porpuse and denying all offers you get...

Hey.
I made it my self, at first i had problem with the "seed" but now everything is fine!
Thanks for the help!
Reply
#6
So how have you solved your problem?

How do you query the masterservers to get your data?
Interactive web based config creator for CS, CSS, TF2 and DODS
Creates server and client configs in an explained dialog.

You`ll also find precompiled debian gameserver kernels for download
Reply
#7
PHP Code:
<?php
$udp 
fsockopen("udp://hl2master.steampowered.com"27011$errno$errstr"2");
    
stream_set_timeout($udp"2");
    if (
$udp) {
        
$request "1\xFF0.0.0.0:0\type\d";
        
fwrite($udp$request.strlen($request));
        
$respond bin2hex(fread($udp6));
        if (
$respond == "ffffffff660a") {
            
$seID "0";
            while (
$respond) {
                
$seID++;
                
$a1 ord(fread($udp,1));
                
$a2 ord(fread($udp,1));
                
$a3 ord(fread($udp,1));
                
$a4 ord(fread($udp,1));
                
$a5 ord(fread($udp,1))*256+ord(fread($udp,1));
                
$serverIP $a1.".".$a2.".".$a3.".".$a4;
                
$serverPort $a5;
                if (
$serverIP != "0.0.0.0" AND $serverPort != "0") {
                    
$seedIP $serverIP;
                    
$seedPort $serverPort;
                }
                if (
$seedIP == "0.0.0.0" AND $seedPort == "0") {
                    
$request "1\xFF0.0.0.0:0\type\d";
                    
$seID "0";
                }
                if (
$serverIP == "0.0.0.0" AND $serverPort == "0") {
                    echo(
"Sending new request to master ...\n");
                    
$request "1\xFF".$seedIP.":".$seedPort."\type\d";
                    
fwrite($udp$request.strlen($request));
                } else {
                    echo(
$serverIP.":".$serverPort."\n");
                }
            }
            
fclose($udp);
        } else {
            echo(
"ERROR RESPOND! \n");
        }
    } else {
        echo(
"TIMEOUT ERROR\n");
    }
?>

Use the code above to get all game servers in the master.
Reply
#8
I just tested the above code and it does not work. I am in the process of making one, it will be done very soon Smile
~ trewq
Reply
#9
(01-27-2011, 09:24 PM)Goilio Wrote:  I just tested the above code and it does not work. I am in the process of making one, it will be done very soon Smile

It does work.. I'm using it right now!
If you get bad respond use this master server 72.165.61.153:27015

btw i use this in the console. don't run it in the browser Smile
Reply
#10
Ah kk I'm making one that will run in a browser. What part of the code makes it not work with a browser?
~ trewq
Reply
#11
(01-27-2011, 10:48 PM)Goilio Wrote:  Ah kk I'm making one that will run in a browser. What part of the code makes it not work with a browser?

I don't know Big Grin
When i run it into my browser i get Error 502 Bad Gateway, but when i run it in the console ( php5 /patch/script.php ) it works Smile
Reply
#12
Thats weird Toungue
~ trewq
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)