From c53d2a900166deed4b3015dcab3fdecf5eaf0000 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 3 Dec 2021 00:28:50 +0100 Subject: [PATCH] import mappaks and ctf configs --- ctf.cfg | 49 +++++++++++++++++ list2nix.sh | 19 +++++++ nixos-modules/quake3ded.nix | 4 +- pkgs/baseq3.nix | 26 +++++++-- pkgs/mappaks.nix | 103 ++++++++++++++++++++++++++++++++++++ q3config.cfg | 8 --- q3config_server.cfg | 1 - randomctfmaps.cfg | 28 ++++++++++ 8 files changed, 223 insertions(+), 15 deletions(-) create mode 100644 ctf.cfg create mode 100755 list2nix.sh create mode 100644 pkgs/mappaks.nix delete mode 100644 q3config.cfg create mode 100644 randomctfmaps.cfg diff --git a/ctf.cfg b/ctf.cfg new file mode 100644 index 0000000..27209cd --- /dev/null +++ b/ctf.cfg @@ -0,0 +1,49 @@ +// General Server Config +set sv_pure 1 // only server pk3 files are allowed +set sv_maxclients 16 +set g_allowvote 1 +set g_log "" // disables writing gamestats to log file +set pmove_fixed "1" // fps independent physics + +// team / match settings +set capturelimit 5 +set timelimit 15 +set fraglimit 30 +set g_gametype 4 // CTF +set g_teamAutoJoin "1" +set g_teamForceBalance "0" +set g_forcerespawn "10" +set g_friendlyFire "0" +set g_redTeam "Heinis" +set g_blueTeam "Schuftis" +set g_inactivity "300" +set g_warmup "20" +set g_doWarmup "1" +set g_quadfactor 3 +set g_weaponrespawn "5" +set g_weaponTeamRespawn "5" + +set g_enablebreath "1" // breathing effect (0: off, 1: on) +set g_enabledust "1" // dust effect by feet on particular maps (0: off, 1: on) + +// network +set snaps "40" +set sv_fps "40" // server fps +set sv_maxRate 25000 // set max allowable rate for a client. 8000 to 10000 recommended. Max: 25000 +set net_ip "0.0.0.0" //all interfaces +set net_port "27960" +set dedicated 2 // 1 = LAN, 2 = public/internet +set sv_lanForceRate 1 // forces LAN clients to the maximum rate instead of accepting client setting (1 is the default behaviour, backward compatible) +set g_syncronousClients "0" // enable only for server recording demos +set g_smoothclients "1" +set sv_allowDownload 8 // do not ask the client to disconnect when using HTTP/FTP downloads +set sv_dlURL "http://dl.misaxnet.de/cosmo" +set sv_dlURL "http://share.pedalkickers.de/fps/quake3" + +// bots +set bot_enable "1" // whether bots are allowed on the server +set bot_minplayers "4" // minimum players number +set bot_nochat "1" // einfach die Fresse halten +set g_spSkill "1" // bot difficulty + +exec "randomctfmaps.cfg" diff --git a/list2nix.sh b/list2nix.sh new file mode 100755 index 0000000..988d2ce --- /dev/null +++ b/list2nix.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +echo "{ fetchurl }:" +echo "{" +while read url; do + url=$(echo "$url"|sed -e 's/\r//') + filename=$(basename "$url") + if [[ "$filename" =~ \.pk3$ ]]; then + name=$(echo "$filename"|sed -e 's/\..*//') + sha256=$(nix-prefetch-url "$url" 2>/dev/null) + if [ -n "$sha256" ]; then + echo " $name = fetchurl {" + echo " url = \"$url\";" + echo " sha256 = \"$sha256\";" + echo " };" + fi + fi +done +echo "}" diff --git a/nixos-modules/quake3ded.nix b/nixos-modules/quake3ded.nix index 7dd31cc..df8f516 100644 --- a/nixos-modules/quake3ded.nix +++ b/nixos-modules/quake3ded.nix @@ -5,6 +5,8 @@ with pkgs; enable = true; openFirewall = true; baseq3 = self.packages.${pkgs.system}.baseq3; - extraConfig = builtins.readFile ../q3config.cfg; + extraConfig = '' + exec "ctf.cfg" + ''; }; } diff --git a/pkgs/baseq3.nix b/pkgs/baseq3.nix index e8a9c5a..c89a1bc 100644 --- a/pkgs/baseq3.nix +++ b/pkgs/baseq3.nix @@ -9,7 +9,8 @@ rec { name = "QuakeIII.iso"; sha256 = "1qgk5kx7mf75dvlf54x15dpvjvwwh27q6m3cgg8gyiv57hw20cp9"; }; - baseq3 = stdenv.mkDerivation { + + isoBaseq3 = stdenv.mkDerivation { name = "baseq3"; src = q3iso; nativeBuildInputs = [ p7zip ]; @@ -17,10 +18,25 @@ rec { 7z x $src ''; installPhase = '' - mkdir $out - cp -av baseq3/* $out/ - ln -s ${quake3pointrelease}/baseq3/* $out/ - ln -s ${../q3config_server.cfg} $out/q3config_server.cfg + cp -a baseq3 $out ''; }; + + mappaks = import ./mappaks.nix { inherit fetchurl; }; + + baseq3 = runCommand "baseq3" {} '' + mkdir $out + # pak0 + cp -av ${isoBaseq3}/* $out/ + # pak1..6 + ln -s ${quake3pointrelease}/baseq3/* $out/ + # mappaks + ${lib.concatMapStrings (name: '' + ln -s ${mappaks.${name}} $out/${name}.pk3 + '') (builtins.attrNames mappaks)} + # cfg + ln -s ${../q3config_server.cfg} $out/q3config_server.cfg + ln -s ${../ctf.cfg} $out/ctf.cfg + ln -s ${../randomctfmaps.cfg} $out/randomctfmaps.cfg + ''; } diff --git a/pkgs/mappaks.nix b/pkgs/mappaks.nix new file mode 100644 index 0000000..eee968a --- /dev/null +++ b/pkgs/mappaks.nix @@ -0,0 +1,103 @@ +{ fetchurl }: +{ + anodm3 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/anodm3.pk3"; + sha256 = "0c805il3xa10gx4blf1j7pj5qh8qrb0m4rrz8r59vd08wksnx1zs"; + }; + charon3dm13 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/charon3dm13.pk3"; + sha256 = "0ycvip8hqgkdc0xpwlsd9lwhbgrcsx2rjqmdrqmz7fgjpn91ymdr"; + }; + charon3dm8 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/charon3dm8.pk3"; + sha256 = "0vs8a505vw1iq7kig0kzgnq4mcj3ymps100dm36h3bd03d0dqxbh"; + }; + ct3ctf1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ct3ctf1.pk3"; + sha256 = "0cjpjkbfmi9a6sq2f6lrkfqqkcl9kfv5gwc48p0accqrv3l9d68n"; + }; + ctctf6 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctctf6.pk3"; + sha256 = "15wv39cc0vhg7qdqwdf7gl7kjr8m335nv4572fixiii0flaaiax8"; + }; + ctf13agony = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctf13agony.pk3"; + sha256 = "1d68z0a1zwh3x9p5iyyk97rfvcigkyiwmbswppv73qcmmz5svk61"; + }; + ctf13circle = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctf13circle.pk3"; + sha256 = "1x6pd87h37480dn3c7ffdlx8dnkmil1a8ds9k887788z34c6vw8z"; + }; + ctf13dream = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctf13dream.pk3"; + sha256 = "01zxgphc66h3r3hs8f7sin5g5pp8na52k6s9ji7mw2hcvr3zgky9"; + }; + ctf13ground_xt = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctf13ground_xt.pk3"; + sha256 = "0agvix36afn1q43xix0a678830bcdf9bjm0p7la2dxjr9pycr60x"; + }; + ctf13vast = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ctf13vast.pk3"; + sha256 = "1ddwpf5frnfnz9a7p266nj8cik7892vf6za48l52cw3ksxq8hrab"; + }; + eg_ctf1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/eg_ctf1.pk3"; + sha256 = "1y1ppc3b64ixm87b0q6l9spv3hhy0cr404309y4rdpj2f64wmlfz"; + }; + geit3ctf1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/geit3ctf1.pk3"; + sha256 = "1da4j3cf5nh3ldjl8fsig450z107jbq635siaca6qjyqb1jjb06z"; + }; + geit3ctf2 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/geit3ctf2.pk3"; + sha256 = "00ih8az1wjw16f4c4zx8k3fygbba8faw5s4xz5b8dbivck8wxv5r"; + }; + ironwoodctf = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ironwoodctf.pk3"; + sha256 = "0g7n1802z27s593hifyf3kxvs8frm57n45cifza76hsik4fxg889"; + }; + lun3dm5 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/lun3dm5.pk3"; + sha256 = "1l2fjlaayq55yn160bfad7c36pga9yk768waj6xr59018hxnpbw0"; + }; + maps-q3wctf = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/maps-q3wctf.pk3"; + sha256 = "0fa6x53gkr7ms84nci32dil8bgv9wrc90zizmk2hgcic8fsg8w5l"; + }; + nor3ctf1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/nor3ctf1.pk3"; + sha256 = "07kmw5jjmvidvjxgnkwxzgkyigglk8cz8niiv9xrmyklsgpnl8x1"; + }; + overkill = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/overkill.pk3"; + sha256 = "0xdjyblfs4yqgv5w73hqbq1amlbhcknfm1xqq53664scd3s7awib"; + }; + pak9hqq37 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/pak9hqq37.pk3"; + sha256 = "10jrhvq2gfs983xhdxdhcz54rm0268hsdhrshkq9qj90m9ikxmgg"; + }; + q3wpak1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/q3wpak1.pk3"; + sha256 = "0y18rk9lsxjw2zkrcijsqqaijqg5irknjbal0dmp701q4vqfg2vy"; + }; + quartzctf1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/quartzctf1.pk3"; + sha256 = "1ydmijnxxbsm5b7cyy38rq4d9r0v5g25nar9l7jpv3z7aqjnf2cd"; + }; + schadctf = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/schadctf.pk3"; + sha256 = "04w2297ihkcwy8djjz8km951rzmcfjcivnqd08j987jfhq9nc124"; + }; + storm3tourney8 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/storm3tourney8.pk3"; + sha256 = "10l835fnrh73d0g4a4yx19v1vgirvs57kavgabm9l40lryrbgm6c"; + }; + xcsv_bq3hi-res = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/xcsv_bq3hi-res.pk3"; + sha256 = "0nq2b63py77bgpafnbzhm20b2jplq5x9b365s38a2kk2bhnx2bx6"; + }; + ztn3dm1 = fetchurl { + url = "http://share.pedalkickers.de/fps/quake3/baseq3/ztn3dm1.pk3"; + sha256 = "0x1jrs0120mk6xbnc43vyaka8fayyz1w3wi325hqa6knrppl2xbh"; + }; +} diff --git a/q3config.cfg b/q3config.cfg deleted file mode 100644 index fcb0450..0000000 --- a/q3config.cfg +++ /dev/null @@ -1,8 +0,0 @@ -fraglimit 25 -capturelimit 5 -g_gametype 4 - -set m1 "capturelimit 8; map q3ctf1; set nextmap vstr m2" -set m2 "capturelimit 8; map q3ctf2 ; set nextmap vstr m3" -set m3 "capturelimit 8; map q3ctf3 ; set nextmap vstr m1" -vstr m1 diff --git a/q3config_server.cfg b/q3config_server.cfg index 3555596..ea8f71d 100644 --- a/q3config_server.cfg +++ b/q3config_server.cfg @@ -12,4 +12,3 @@ sets "Email" "astro@spaceboyz.net" sets "URL" "https://spaceboyz.net" sets "Location" "Valley of the clueless" sets "CPU" "2010s" -//sets "mappack" "http://www.myserver.com/mappack.zip" diff --git a/randomctfmaps.cfg b/randomctfmaps.cfg new file mode 100644 index 0000000..2469cc2 --- /dev/null +++ b/randomctfmaps.cfg @@ -0,0 +1,28 @@ +set d0 "set bot_minplayers 5 ; set capturelimit 3 ; set timelimit 15 ; set fraglimit 25; map ironwood ; set nextmap vstr d1" +set d1 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 12 ; set fraglimit 25; map q3wcp10 ; set nextmap vstr d2" +set d2 "set bot_minplayers 4 ; set capturelimit 8 ; set timelimit 15 ; set fraglimit 25; map 13dream ; set nextmap vstr d3" +set d3 "set bot_minplayers 3 ; set capturelimit 8 ; set timelimit 15 ; set fraglimit 25; map eg_ctf1 ; set nextmap vstr d4" +set d4 "set bot_minplayers 5 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wctf2 ; set nextmap vstr d5" +set d5 "set bot_minplayers 4 ; set capturelimit 7 ; set timelimit 10 ; set fraglimit 25; map 13vast ; set nextmap vstr d6" +set d6 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map schadctf ; set nextmap vstr d7" +set d7 "set bot_minplayers 4 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map geit3ctf1 ; set nextmap vstr d8" +set d8 "set bot_minplayers 4 ; set capturelimit 3 ; set timelimit 15 ; set fraglimit 25; map q3ctf3 ; set nextmap vstr d9" +set d9 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wcp14 ; set nextmap vstr d10" +set d10 "set bot_minplayers 4 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wcp13 ; set nextmap vstr d11" +set d11 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 10 ; set fraglimit 25; map q3wcp9 ; set nextmap vstr d12" +set d12 "set bot_minplayers 4 ; set capturelimit 8 ; set timelimit 10 ; set fraglimit 25; map q3ctf4 ; set nextmap vstr d13" +set d13 "set bot_minplayers 5 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map nor3ctf1 ; set nextmap vstr d14" +set d14 "set bot_minplayers 5 ; set capturelimit 8 ; set timelimit 15 ; set fraglimit 25; map ct3ctf1 ; set nextmap vstr d15" +set d15 "set bot_minplayers 5 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wctf1 ; set nextmap vstr d16" +set d16 "set bot_minplayers 4 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wcp11 ; set nextmap vstr d17" +set d17 "set bot_minplayers 4 ; set capturelimit 5 ; set timelimit 10 ; set fraglimit 25; map q3wcp1 ; set nextmap vstr d18" +set d18 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map geit3ctf2 ; set nextmap vstr d19" +set d19 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map 13circle ; set nextmap vstr d20" +set d20 "set bot_minplayers 4 ; set capturelimit 5 ; set timelimit 10 ; set fraglimit 25; map quartzctf1 ; set nextmap vstr d21" +set d21 "set bot_minplayers 5 ; set capturelimit 5 ; set timelimit 12 ; set fraglimit 25; map 13agony_ctf ; set nextmap vstr d22" +set d22 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 10 ; set fraglimit 25; map hctf3 ; set nextmap vstr d23" +set d23 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wxs2 ; set nextmap vstr d24" +set d24 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 15 ; set fraglimit 25; map q3wcp12 ; set nextmap vstr d25" +set d25 "set bot_minplayers 4 ; set capturelimit 7 ; set timelimit 15 ; set fraglimit 25; map ctctf6 ; set nextmap vstr d26" +set d26 "set bot_minplayers 3 ; set capturelimit 5 ; set timelimit 10 ; set fraglimit 25; map 13ground_xt ; set nextmap vstr d0" +vstr d0 \ No newline at end of file