View Full Version : FTP/HTTP File downloads for JA

=X=Master HeX
07-24-2004, 01:26 AM
I'm just a few baby steps away from having ftp/http support in for clients connecting to servers. I've ran into a small snag and am lost for ideas. While I'm gone for the weekend I thought I'd let some of you ponder at ways of doing the following:

I have full ftp/http capabilities built into the client at this point. I am trying to hijack server downloads in some way to tell the client to download specific pk3 file from a location. I could do it very easy from in game while they play but that doesn't fix the issues of 2k downloads while connecting to the server.

What I need is a way to fool the client into connecting part way and getting download information from the server (for remote http/ftp pk3 files) before it actually connects to the server and does it's gimp download.

Any ideas ;)

My temp solution to this issue is throw public maps into the rotation and then while people are playing it would download the next map in the rotation (that the client doesn't have). I have threads and the ftp/http stuff all setup. It's really easy this way as I can just send the client a command to get a pk3 from a location or test if one is there. More of a pain in the ass to catch it while they are connecting.

Amidala from Chop Shop
07-24-2004, 07:44 PM
I hope you remember this post from the =X= forum:

6. Redirection of map downloads to specific URL's as is available in RTCW:ET. It is almost impossible to convince people to download custom maps, but this feature makes it easy and is widely used\liked by the RTCW:ET community:

"quick question actually. How many people are using the http/ftp downloads? Server wise and client wise? Do you know many server admins who use it? Any things you'd like to comment about it?"

"IMHO it's the best new server-side feature in a Q3-type engine ever. The servers I know that are using it are Timelord and the BoD clan server, but there are probably many more."

Here are the cvars:

set sv_maxRate "13000" // 10000 standard but poor for ET
set sv_dl_maxRate "42000" // increase/decerease if you have plenty/little spare bandwidth
set sv_allowDownload "0" // global toggle for both legacy download and web download
set sv_wwwDownload "0" // toggle to enable web download
set sv_wwwBaseURL "" // base URL for redirection
set sv_wwwDlDisconnected "0" // tell clients to perform their downloads while disconnected from the server
set sv_wwwFallbackURL "" // URL to send to if an http/ftp fails or is refused client side

Source code is here: http://www.splashdamage.com/modules.php?op=modload&name=Downloads&file=index&req=viewsdownload&sid=8

If xMod2 made this available to the Jedi Academy community it would be a HUGE selling point.

Maybe the people at www.splashdamage.com will share the part of the code that does that for RTCW:ET.

07-25-2004, 04:04 PM
Sounds like an interesting idea but wouldn't that majorly lag the players while their systems get the maps?

=X=Master HeX
07-26-2004, 05:59 PM
Depends on the connection and how much bandwidth I hog while it grabs the maps. I took a look at the splash dmg code and it looks like they had access to part of the q3 engine that I don't have access to in JKA. I'll be working on this all week though. I had a few ideas during my trip this weekend. =)

07-27-2004, 03:19 PM
*shrug* I don't know. sounds like you'd have to code a new network interface from scratch. I don't think it's worth it.

I'd suggest that you have it just display the map download url.

07-31-2004, 05:07 PM
i think i got you covered hex

assuming that you can pass the url of a specific file with the ftp/http cod you have in your client (i'm assuming you lifted something from lynx or a mozilla or whatever)

you need to implemnt 1 additional cvar that gets changed in the server's config for each map

so in the server's config instead of having

map mp/ctf_ns_streets

you'd need

map mp/ctf_ns_streets ; g_currentmapUrl www.whatever.com/ctf_ns_streets.pk3

now that you've got that cvar in, check out "void CG_ParseServerinfo( void )" in cg_servercmds.c this is where the client reads all the server's relavant cvars and is where you can send the g_currenmapUrl to the client without having them load the map. of course you'd need a client side struct to store the information in. i don't think it's really nessicary to store it clientside in a cvar

i don't think we can automatically being downloading in the client via your http/ftp module because it seems to be in the engine and outside the scope of the sdk

i could be wrong

but, if the server keeps automatic downloading off, and sends the map url to every client that tries to connect, then the clients can simpling run a command (when/if the map load fails) like /getmap (or something) that would pass the url from g_currentmapUrl (now stored in a clientside struct) to your http/ftp module and begin the tansfer and perhaps do /reconnect automatically when it's done?

or, check outvoid UI_DrawConnectScreen( qboolean overlay )

this function does the screen drawing for when the engine starts it's download, but since it's at the correct time, maaaaybe in


you could perform the key sequence to break out of the download (i think it's escape) and start your tranfer module? i guess it'd work.

now, care to share with us how you got http/ftp working? i've looked at serveral of the smaller command line ftp clients and i've got some ideas but it'd be really helpful if you'd share it with us