aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/shione/srb2kart
diff options
context:
space:
mode:
authorRenken <renken@shione.net>2024-01-08 21:15:14 +0100
committerRenken <renken@shione.net>2024-05-12 16:49:29 +0200
commitd328f099129dc912289f607bd4913fcb44c73627 (patch)
tree99025a0758b4bb586bc1dc8a293f6bdf25671752 /deploy/shione/srb2kart
parent1d54e783ae1de8a68e2f7bc9ec90631c594c311f (diff)
downloadshione-d328f099129dc912289f607bd4913fcb44c73627.tar.gz
shione-d328f099129dc912289f607bd4913fcb44c73627.zip
deploy: shione: init srb2kart
Diffstat (limited to 'deploy/shione/srb2kart')
-rw-r--r--deploy/shione/srb2kart/README.md12
-rw-r--r--deploy/shione/srb2kart/dconfig.cfg5
-rw-r--r--deploy/shione/srb2kart/dkartconfig_base.cfg40
-rwxr-xr-xdeploy/shione/srb2kart/generate_dkartconfig.sh49
-rw-r--r--deploy/shione/srb2kart/mods/000-pre/p10
-rw-r--r--deploy/shione/srb2kart/mods/001-chars/c10
-rw-r--r--deploy/shione/srb2kart/mods/001-chars/c20
-rw-r--r--deploy/shione/srb2kart/mods/002-tracks/t10
-rw-r--r--deploy/shione/srb2kart/mods/003-post/po10
l---------deploy/shione/srb2kart/mods/index/c11
l---------deploy/shione/srb2kart/mods/index/c21
l---------deploy/shione/srb2kart/mods/index/p11
l---------deploy/shione/srb2kart/mods/index/po11
l---------deploy/shione/srb2kart/mods/index/t11
-rw-r--r--deploy/shione/srb2kart/setup.sh22
15 files changed, 133 insertions, 0 deletions
diff --git a/deploy/shione/srb2kart/README.md b/deploy/shione/srb2kart/README.md
new file mode 100644
index 0000000..c808807
--- /dev/null
+++ b/deploy/shione/srb2kart/README.md
@@ -0,0 +1,12 @@
+Quoting [this thread on srb2
+forum](https://mb.srb2.org/threads/dedicated.7063/).
+
+> Although that's the way it's often been used in practice, it's not actually
+> the case: adedserv.cfg is the counterpart of autoexec.cfg; dconfig.cfg of
+> config.cfg. This has important implications for setting the masterserver: it
+> works in the latter, but by the time the former is executed, it's too late.
+
+
+In this case, I'll put everything in `dconfig.cfg` and see later on if there
+are things I can delay to `adedserv.cfg`. I think the mods need to be
+broadcasted to the master server? I could be wrong here.
diff --git a/deploy/shione/srb2kart/dconfig.cfg b/deploy/shione/srb2kart/dconfig.cfg
new file mode 100644
index 0000000..7d2695b
--- /dev/null
+++ b/deploy/shione/srb2kart/dconfig.cfg
@@ -0,0 +1,5 @@
+addfile mods/000-pre/p1
+addfile mods/001-chars/c1
+addfile mods/001-chars/c2
+addfile mods/002-tracks/t1
+addfile mods/003-post/po1
diff --git a/deploy/shione/srb2kart/dkartconfig_base.cfg b/deploy/shione/srb2kart/dkartconfig_base.cfg
new file mode 100644
index 0000000..59d86a6
--- /dev/null
+++ b/deploy/shione/srb2kart/dkartconfig_base.cfg
@@ -0,0 +1,40 @@
+// SRB2Kart configuration file.
+execversion "10"
+flipcam4 "No"
+flipcam3 "No"
+flipcam2 "No"
+flipcam "No"
+homremoval "Yes"
+discordinvites "Everyone"
+pingmeasurement "Frames"
+showping "Always"
+maxdelaytimeout "10"
+maxdelay "20"
+cpusleep "1"
+skipmapcheck "Off"
+kicktime "10"
+jointimeout "210"
+nettimeout "210"
+blamecfail "Off"
+showjoinaddress "On"
+allowjoin "On"
+http_source "http://shione.net/srb2kart/assets"
+downloadspeed "32"
+noticedownload "Off"
+maxsend "51200"
+resynchattempts "2"
+maxplayers "16"
+kartvoices "Tasteful"
+kartdisplayspeed "Off"
+kartinvinsfx "SFX"
+kartcheck "Yes"
+kartminimap "4"
+server_contact "renken@shione.net"
+servername "shione"
+holepunchserver "relay.kartkrew.org"
+masterserver_nagattempts "5"
+masterserver_token ""
+masterserver_debug "Off"
+masterserver_timeout "5"
+masterserver_update_rate "15"
+masterserver "https://ms.kartkrew.org/ms/api"
diff --git a/deploy/shione/srb2kart/generate_dkartconfig.sh b/deploy/shione/srb2kart/generate_dkartconfig.sh
new file mode 100755
index 0000000..e2799d9
--- /dev/null
+++ b/deploy/shione/srb2kart/generate_dkartconfig.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -eux
+
+# Generates the portion of `dconfig.cfg` loading all necessary mod files in the
+# correct order.
+
+# The script assumes a hierarchy demonstrated by the following example.
+# mods/
+# 000-pre/
+# 001-chars/
+# 002-tracks/
+# 003-post/
+
+# This allows separation of mods based on category such as characters and
+# soundtracks but also serves as a poor man's dependency resolution between
+# groups of mods e.g., gameplay mods depending on specific characters. The same
+# approach can be used to solve dependency between mods found in the same
+# category, prefixing the mods with a sequence of digits *should* solve the
+# dependency problem e.g., `000-init-mod`, `001-mod-depending-on-000` and
+# `002-mod-depending-on-001`.
+
+# While it shouldn't be hard to support a depth of more than 1 subdirectory, it
+# seems impractical to me.
+
+if [ -e dkartconfig.cfg ]; then
+ rm -- dkartconfig.cfg
+fi
+
+cp -- dkartconfig_base.cfg dkartconfig.cfg
+
+# NOTE: `find` does not offer a way to guarantee a desired sort of its output.
+find mods -type f -printf 'addfile %p\n' | sort >dkartconfig.cfg
+
+if [ -e mods/index ]; then
+ rm -rf -- mods/index
+fi
+
+printf 'regenerating index...\n'
+mkdir -- mods/index
+cd -- mods/index
+
+# NOTE: Mods from different categories having the same name are not supported.
+# XXX: Please don't use newlines in filenames for the love of god.
+find .. -type f -print | while read -r file; do
+ ln -s "$file" .
+done
+
+cd -- -
diff --git a/deploy/shione/srb2kart/mods/000-pre/p1 b/deploy/shione/srb2kart/mods/000-pre/p1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/000-pre/p1
diff --git a/deploy/shione/srb2kart/mods/001-chars/c1 b/deploy/shione/srb2kart/mods/001-chars/c1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/001-chars/c1
diff --git a/deploy/shione/srb2kart/mods/001-chars/c2 b/deploy/shione/srb2kart/mods/001-chars/c2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/001-chars/c2
diff --git a/deploy/shione/srb2kart/mods/002-tracks/t1 b/deploy/shione/srb2kart/mods/002-tracks/t1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/002-tracks/t1
diff --git a/deploy/shione/srb2kart/mods/003-post/po1 b/deploy/shione/srb2kart/mods/003-post/po1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/003-post/po1
diff --git a/deploy/shione/srb2kart/mods/index/c1 b/deploy/shione/srb2kart/mods/index/c1
new file mode 120000
index 0000000..2a228a3
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/index/c1
@@ -0,0 +1 @@
+../001-chars/c1 \ No newline at end of file
diff --git a/deploy/shione/srb2kart/mods/index/c2 b/deploy/shione/srb2kart/mods/index/c2
new file mode 120000
index 0000000..ded63ff
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/index/c2
@@ -0,0 +1 @@
+../001-chars/c2 \ No newline at end of file
diff --git a/deploy/shione/srb2kart/mods/index/p1 b/deploy/shione/srb2kart/mods/index/p1
new file mode 120000
index 0000000..246ebb9
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/index/p1
@@ -0,0 +1 @@
+../000-pre/p1 \ No newline at end of file
diff --git a/deploy/shione/srb2kart/mods/index/po1 b/deploy/shione/srb2kart/mods/index/po1
new file mode 120000
index 0000000..a72410e
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/index/po1
@@ -0,0 +1 @@
+../003-post/po1 \ No newline at end of file
diff --git a/deploy/shione/srb2kart/mods/index/t1 b/deploy/shione/srb2kart/mods/index/t1
new file mode 120000
index 0000000..5a1373a
--- /dev/null
+++ b/deploy/shione/srb2kart/mods/index/t1
@@ -0,0 +1 @@
+../002-tracks/t1 \ No newline at end of file
diff --git a/deploy/shione/srb2kart/setup.sh b/deploy/shione/srb2kart/setup.sh
new file mode 100644
index 0000000..70eb956
--- /dev/null
+++ b/deploy/shione/srb2kart/setup.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -eux
+
+# Install both build and runtime dependencies.
+#
+# Build dependencies are install just in case srb2kart needs to be compiled on
+# shione.
+apt install \
+ make \
+ git \
+ nasm \
+ gcc \
+ libsdl2-mixer-dev \
+ libpng-dev \
+ libcurl4-openssl-dev \
+ libgme-dev \
+ libopenmpt-dev
+
+# The user `srb2kart` is used by default here.
+su srb2kart
+cd --