Mapdownload
Mapdownload
Mapdownload
______________
CLIENT SIDE:
Should already work without configuration. You can however use the following
cvars for further tuning (see xonotic.org/tools/cacs for more up-to-date
information):
You should regularily clean up your cache to save space and make the maps
you really want available from the menu.
SERVER SIDE:
First of all, you need a HTTP or FTP server to host your PK3s. You can either
use some web space provider, or set up your own. For this, use any FTP or HTTP
server software you want (HTTP: lighttpd, Apache, thttpd; FTP: Filezilla,
vsftpd). HTTP is to be preferred because it works better for firewalled
players.
On the server, you need to set up where to download the PK3s of the maps you
are running. You can either use the cvar
pattern url
pattern url
pattern url
...
data* -
strale* http://stralemaps.invalid/
* http://all.the.other.stuff.invalid/id/here.php?pak=
foo* http://wont.get.here.invalid/
The pk3 name will be appended to the URL by DarkPlaces. Note that you NEED to
append a trailing slash if you refer to a directory. If you specify a "-" as
URL, the package will not be offered for download.
If you want to set up a redirection service, here is a sample PHP code for you
to start from:
<?
function findmap($filename)
{
# insert your database query or whatever you want here
if($filename == "foo.pk3")
return "http://barserver.invalid/foo.pk3";
return FALSE;
}
$filename = $_GET['filename'];
$useragent = getenv("HTTP_USER_AGENT");
if(strpos($useragent, "Xonotic ") !== 0)
bailout(403, "Forbidden", "You're not a Xonotic client.");
$url = findmap($filename);
if(!$url)
bailout(404, "Not Found", "Well... try another file name?");
?>