millores en setup-quake

This commit is contained in:
2026-03-16 14:05:47 +01:00
parent c13beff6b5
commit c7c2da87d9
21 changed files with 308 additions and 57 deletions
+93 -38
View File
@@ -2,6 +2,41 @@
Tools for configuring PCs at a retro gaming fair.
## Deployment
Build all utilities first (see each utility's Quick start below). All binaries
land in a shared `dist/` folder at the repo root:
```
dist/
setup-network
setup-quake
config.ini ← single unified config for all utilities
```
Copy the entire `dist/` folder to a USB stick, then on each fair PC run the
relevant binary:
```bash
sudo ./setup-network 4
sudo ./setup-quake
```
### Configuration
Edit `config.ini` at the repo root before building (it gets copied to `dist/`
automatically by each `build.sh`):
```ini
[network]
subnet_root = 10.0.1
hostname_prefix = retro-alcoi-
[quake]
files_url = https://php.sustancia.synology.me/files/ioquake3-files.zip
install_dir = .q3a
```
## Utilities
### setup-network
@@ -21,7 +56,7 @@ sudo ./setup-network 4
# → IP: 10.0.1.4/24, hostname: retro-alcoi-4
```
See [`setup-network/`](setup-network/) for source and build instructions.
See [`setup-network/`](setup-network/) for source.
#### Quick start
@@ -30,24 +65,7 @@ cd setup-network/
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
bash build.sh
# Binary is at dist/setup-network
```
Copy `dist/setup-network` and `dist/config.ini` to a USB stick, then on each
fair PC:
```bash
sudo ./setup-network 4
```
#### Configuration
Edit `config.ini` (alongside the binary) before distributing:
```ini
[network]
subnet_root = 10.0.1
hostname_prefix = retro-alcoi-
# Binary is at ../dist/setup-network
```
#### How it works
@@ -68,7 +86,7 @@ Quake 3 data files from a private server to the real user's home directory.
sudo ./setup-quake
```
See [`setup-quake/`](setup-quake/) for source and build instructions.
See [`setup-quake/`](setup-quake/) for source.
#### Quick start
@@ -77,24 +95,7 @@ cd setup-quake/
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
bash build.sh
# Binary is at dist/setup-quake
```
Copy `dist/setup-quake` and `dist/config.ini` to a USB stick, then on each
fair PC:
```bash
sudo ./setup-quake
```
#### Configuration
Edit `config.ini` (alongside the binary) before distributing:
```ini
[quake]
files_url = https://php.sustancia.synology.me/files/ioquake3-files.zip
install_dir = .q3a
# Binary is at ../dist/setup-quake
```
#### How it works
@@ -103,3 +104,57 @@ install_dir = .q3a
2. Downloads the Quake 3 data files zip from the configured URL.
3. Extracts the data files to `~/.q3a` (resolved via `$SUDO_USER` so the real
user's home is used, not root's).
4. Fixes ownership of all extracted files to the real user (not root).
5. Locks `baseq3/autoexec.cfg` to read-only (444) — client mode.
#### Client mode (default)
After `setup-quake` all machines are clients. `autoexec.cfg` is read-only so
the game always starts at desktop resolution, fullscreen, with name "Jugador"
and auto-connects to the server at `10.0.1.200`.
Use `~/.q3a/scripts/client.sh` to launch the game.
#### Server mode
On the server machine (10.0.1.200), run after `setup-quake`:
```bash
~/.q3a/scripts/activate-server.sh
```
This restores write access to `autoexec.cfg`. Then use one of the server
launch scripts:
```
scripts/server-ctf.sh # CTF, no bots
scripts/server-ctf-bots.sh # CTF, bots fill server
scripts/server-dm.sh # Deathmatch, no bots
scripts/server-dm-bots.sh # Deathmatch, bots fill server
scripts/server-tdm.sh # Team Deathmatch, no bots
scripts/server-tdm-bots.sh # Team Deathmatch, bots fill server
```
#### Q3A data files zip
The zip extracted by `setup-quake` is hosted at `files_url` in `config.ini`.
Its source lives in `setup-quake/q3a/` in this repo (pak files excluded — add
them separately before zipping). Structure after extraction:
```
~/.q3a/
baseq3/
pak0pak8.pk3
autoexec.cfg ← client config (read-only after setup-quake)
autoexec_server.cfg ← server base settings, exec'd by server scripts
server_ctf.cfg / server_dm.cfg / server_tdm.cfg
levels_ctf.cfg / levels_dm.cfg / levels_tdm.cfg
bots.cfg / bots_easy.cfg / nobots.cfg
missionpack/
pak*.pk3
scripts/
client.sh
server-{ctf,dm,tdm}.sh
server-{ctf,dm,tdm}-bots.sh
activate-server.sh
```