I already know how to query Source servers (Gmod, HL2, DOTA2, CSS, etc.) to see if they are online, have players, get ping times, etc, using PHP, Perl, etc.
What I am trying to figure out is how would I download a map from the server using PHP (or any other language). I have tried to find any documentation on this and I am not having any luck. If I know the IP and PORT of a GMOD server, for example, there must be a way to ask the server for the the map. I would already know the map name (since a query returns the map name).
To explain a little more... When you connect to a server to play on it, the server sends the maps, materials, sounds, etc., to your PC. These files can come from the game server directory, or they can come from a webserver that the game server uses. This is known as FastDL.
I really would like to be able to ask the game server for a map and then download it. If that is not possible, is there a way to ask the game server what web server it uses for FastDL? If so, I could download the map from that web server.
Any help would be appreciated.
No.
nope
Definitely possible, you're gonna have a hard time doing it in PHP though.
I'd suggest you start up wireshark, set up a server with known information and then look through the packets and see where the sv_downloadurl entry appears - then, reverse engineering and see what you need to send to receive that data.
Uh good luck
you'll need to send an auth token before it even begins to send you the convars or the map
getting info on the source auth is pretty hard
[QUOTE=dajoh;37457555]Definitely possible, you're gonna have a hard time doing it in PHP though.[/QUOTE]
you literally might as well say no
do you think he really plans on recreating the connection process to retrieve a map
Now that I think about it, it would make sense that the client is authenticating first, before the game server sends the cache, maps, etc. This would be really difficult to do, or at least more work than I want to have to do. I was hoping it was as simple as it is to query the server, but it doesn't seem like it will be.
The the server returned sv_downloadurl in the server variables, I could at least use that info to grab the files from the web server (assuming the game server is using one). But I have not seen sv_downloadurl in the variable list for any servers. Oh well. I guess this is just something I will not mess with.
Thanks for the responses everyone!
The easiest way to do this, if you still want to, is to automatically launch the appropriate game with command line parameters to connect to the server.
You'd have to find a way to detect when the client has finished loading... perhaps monitor the player list in the server info?
Then it's just a case of reading the file from the maps folder.
This would be fine for once-off hobby thing, but wouldn't hold up for any proper project... obviously.
[QUOTE=dajoh;37457555]Definitely possible, you're gonna have a hard time doing it in PHP though.[/QUOTE]
Not that I would recommend it, but it's doable in PHP. I know this from first-hand experience.
The hard part is getting an AppTicket to use in the authentication process.
You will have to code a simple Steam client that can get VAC & auth tokens for these games, and then you'll have to recreate the connection process for every game. It's not easy but definitely not impossible.
Sorry, you need to Log In to post a reply to this thread.