1 # Automatic map downloads
3 ## Client-side configuration
5 Should already work without configuration. You can however use the following
6 cvars for further tuning (see xonotic.org/tools/cacs for more up-to-date information):
8 * `cl_curl_enabled`: download support enabled (master switch)
9 * `cl_curl_maxdownloads`: maximum number of downloads at once
10 * `cl_curl_maxspeed`: maximum total speed in KiB/s
12 Downloaded packages end up in `Xonotic/data/dlcache/` or
13 `~/.xonotic/data/dlcache/` and are only used till you exit Xonotic.
14 If you want to play them localy or use them to setup a server of your
15 own you can "accept" the packages by moving it one level up - right
16 next to your `config.cfg`.
18 You should regularly clean up your cache to save space and make the maps
19 you really want available from the menu.
21 ## Server-side configuration
23 First of all, you need a HTTP or FTP server to host your PK3s. You can either
24 use some web space provider, or set up your own. For this, use any FTP or HTTP
25 server software you want (HTTP: lighttpd, Apache, thttpd; FTP: Filezilla,
26 vsftpd). HTTP is to be preferred because it works better for firewalled
29 On the server, you need to set up where to download the PK3s of the maps you
30 are running. You can either use the cvar:
31 * `sv_curl_defaulturl` default download URL
33 to set it to some site, or put a file named "curl_urls.txt" in the data
34 directory of the following format:
41 where always the first wildcard pattern match is taken.
44 strale* http://stralemaps.invalid/
45 * http://all.the.other.stuff.invalid/id/here.php?pak=
46 foo* http://wont.get.here.invalid/
48 The pk3 name will be appended to the URL by DarkPlaces. Note that you NEED to
49 append a trailing slash if you refer to a directory. If you specify a "-" as
50 URL, the package will not be offered for download.
52 **Note:** HTTP**S** downloads are not supported for Xonotic Windows Clients! It works for the Linux client but you probably want to serve all players so it is advised to use `http://` in `sv_curl_defaulturl` or `curl_urls.txt`.
54 Some Apache config snippet for the `<VirtualHost>` to allow for Xonotic Clients to use HTTP while all other traffic get redirected to HTTPS would be:
57 RewriteCond %{HTTP_USER_AGENT} ^Xonotic
59 RewriteCond %{HTTPS} !=on
60 RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R=301,L]
63 More Information about the Referer:
65 The Referer is always set to dp://serverhost:serverport/, the User-Agent always starts with "Xonotic". Look at this sample log line:
67 `141.2.16.3 - - [06/Jun/2006:19:43:14 +0000] "GET /~polzer/temp/nexmaps.php?filename=o-fun.pk3 HTTP/1.1" 302 - "dp://141.2.16.3:26000/" "Xonotic Linux 21:26:17 Jun 6 2006"`
70 If you want to set up a redirection service, here is a sample PHP code for you
76 function findmap($filename)
78 # insert your database query or whatever you want here
79 if($filename == "foo.pk3")
80 return "http://barserver.invalid/foo.pk3";
84 function bailout($code, $title, $message)
86 header("HTTP/1.1 $code $title");
87 echo "<html><title>$title</title><h1>$title</h1>$message</html>";
91 $filename = $_GET['filename'];
93 $useragent = getenv("HTTP_USER_AGENT");
94 if(strpos($useragent, "Xonotic ") !== 0)
95 bailout(403, "Forbidden", "You're not a Xonotic client.");
97 $url = findmap($filename);
99 bailout(404, "Not Found", "Well... try another file name?");
101 header("HTTP/1.1 302 Moved Temporarily");
102 header("Location: $url");