mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-26 23:00:32 +01:00
Compare commits
86
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e64092553 | ||
|
|
1d506bb952 | ||
|
|
3c7ed45e6f | ||
|
|
8bc9c179cb | ||
|
|
5388f2f418 | ||
|
|
09123e997c | ||
|
|
d9e9c86e56 | ||
|
|
d0acb3bd61 | ||
|
|
be29b20fe2 | ||
|
|
75743bb5c7 | ||
|
|
41473a55d2 | ||
|
|
51150d617c | ||
|
|
1042811584 | ||
|
|
0a46688c3d | ||
|
|
686e7c8774 | ||
|
|
1fc3a35079 | ||
|
|
27f79d3eb9 | ||
|
|
5653960e78 | ||
|
|
a8b85a09c0 | ||
|
|
bd362e1e2f | ||
|
|
b09a3ea739 | ||
|
|
04cfd1a12c | ||
|
|
2b40b42f75 | ||
|
|
43c8f6eebe | ||
|
|
5177040890 | ||
|
|
815d3a0ca5 | ||
|
|
1095223b2b | ||
|
|
7fb941b0b2 | ||
|
|
933cad12b3 | ||
|
|
0a8584b260 | ||
|
|
8e8fa4d760 | ||
|
|
3a2c4649e8 | ||
|
|
32604c8e7e | ||
|
|
07c8430b5a | ||
|
|
667c2f29a0 | ||
|
|
6036adfa2d | ||
|
|
9ef32d4304 | ||
|
|
5e27f3a27b | ||
|
|
68d8048333 | ||
|
|
dc7feb1c41 | ||
|
|
24ddaecd78 | ||
|
|
dedb3755d4 | ||
|
|
d86e8b01ee | ||
|
|
3a917551ca | ||
|
|
d17ecdd6ad | ||
|
|
3c7fe4594c | ||
|
|
63fd36775e | ||
|
|
83ae96e2d7 | ||
|
|
99c2030784 | ||
|
|
fbc71b42de | ||
|
|
cfb212fed9 | ||
|
|
782f4ce1bd | ||
|
|
f1066974ca | ||
|
|
384d9ba5d0 | ||
|
|
4cb621cd26 | ||
|
|
4e9de9a11c | ||
|
|
4ab042e144 | ||
|
|
962c3eca45 | ||
|
|
ce95f7deed | ||
|
|
a20ced034c | ||
|
|
ef0e3be45b | ||
|
|
5744d2d174 | ||
|
|
fc22e8467d | ||
|
|
9a1160573f | ||
|
|
1d38b3f936 | ||
|
|
a689a8a3fa | ||
|
|
038252b1ae | ||
|
|
61621e6513 | ||
|
|
1d79584ea4 | ||
|
|
577f718a63 | ||
|
|
b68d259c81 | ||
|
|
600edf7bb9 | ||
|
|
0b3b6f0749 | ||
|
|
343716689d | ||
|
|
a0f22cbba7 | ||
|
|
9f04a51259 | ||
|
|
1ea29f7675 | ||
|
|
47981601da | ||
|
|
a4e4bd8317 | ||
|
|
d97c98c726 | ||
|
|
3975480a3b | ||
|
|
9044950d78 | ||
|
|
9d7436bd64 | ||
|
|
951b8387dd | ||
|
|
cdce33647a | ||
|
|
34c17f11fc |
No files matched your search
@@ -99,7 +99,7 @@ jobs:
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
python -m pytest -q tools/test_linux_port.py tools/test_android_asm_convert.py tools/test_host_watch_hash.py tools/test_touch_menu.py tools/harness tools/test_profile.py tools/stagekit/tests tools/test_net_compare.py
|
||||
python -m pytest -q tools/test_linux_port.py tools/test_android_asm_convert.py tools/test_android_mirror_uploads.py tools/test_android_ce_texture_cache.py tools/test_host_watch_hash.py tools/test_touch_menu.py tools/harness tools/test_profile.py tools/stagekit/tests tools/test_net_compare.py
|
||||
python tools/test_light_storage.py
|
||||
|
||||
- name: Compile cache
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
name: Server image
|
||||
|
||||
# The dedicated server's container image (deploy/docker), made from a
|
||||
# release's halo-linux-release.zip, and the Helm chart's checks
|
||||
# (deploy/helm/opence-server).
|
||||
#
|
||||
# - After each successful Build of main (which publishes release build-<n>):
|
||||
# the image of that release, checked, pushed to
|
||||
# ghcr.io/opencommunityedition/opence-server as sha-<commit>, build-<n> and
|
||||
# latest, and signed keyless with cosign (this workflow's GitHub identity).
|
||||
# - Weekly, the latest release's image again, for Debian's fixes.
|
||||
# - By hand, any release's (latest moves only for the newest).
|
||||
#
|
||||
# The checks (no game data in CI: it is never published): the image runs as
|
||||
# 10001:10001; started on a read-only root without maps it writes its
|
||||
# settings to /state, says "server: no usable maps" and exits 2; halo
|
||||
# --version answers; the health check fails with nothing listening.
|
||||
#
|
||||
# Verify:
|
||||
# cosign verify ghcr.io/opencommunityedition/opence-server:latest \
|
||||
# --certificate-identity-regexp '^https://github\.com/OpenCommunityEdition/OpenCE/\.github/workflows/server-image\.yml@' \
|
||||
# --certificate-oidc-issuer https://token.actions.githubusercontent.com
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Build]
|
||||
types: [completed]
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: "23 5 * * 1"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: "The release to build the image of: a tag (build-206) or latest"
|
||||
default: latest
|
||||
|
||||
concurrency:
|
||||
group: server-image-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/opencommunityedition/opence-server
|
||||
|
||||
jobs:
|
||||
chart:
|
||||
# (off: Mjolnir VR ships no dedicated server image)
|
||||
if: ${{ false }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
|
||||
- uses: azure/setup-helm@v4
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
set -euo pipefail
|
||||
chart=deploy/helm/opence-server
|
||||
for values in "$chart"/ci/*-values.yaml; do
|
||||
helm lint "$chart" --strict -f "$values"
|
||||
helm template ci "$chart" -f "$values" > /dev/null
|
||||
done
|
||||
# the maps are never in the image: without game data the chart refuses to render
|
||||
if helm template ci "$chart" > /dev/null 2>&1; then
|
||||
echo "::error::the chart renders without gameData"; exit 1
|
||||
fi
|
||||
|
||||
- name: Unit tests
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# (Helm 4 checks plugins' signatures, which helm-unittest does not publish)
|
||||
if helm version --short | grep -q '^v3'; then verify=; else verify=--verify=false; fi
|
||||
helm plugin install https://github.com/helm-unittest/helm-unittest $verify
|
||||
helm unittest deploy/helm/opence-server
|
||||
|
||||
image:
|
||||
# (off: Mjolnir VR ships no dedicated server image)
|
||||
if: ${{ false }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 20
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
# keyless signing: the workflow's OIDC token gets a short-lived Sigstore certificate
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
|
||||
- name: Release
|
||||
id: release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
EVENT: ${{ github.event_name }}
|
||||
RUN_NUMBER: ${{ github.event.workflow_run.run_number }}
|
||||
WANTED: ${{ inputs.release }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
case "$EVENT" in
|
||||
workflow_run) tag="build-$RUN_NUMBER" ;;
|
||||
workflow_dispatch) tag="${WANTED:-latest}" ;;
|
||||
*) tag=latest ;;
|
||||
esac
|
||||
newest="$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName)"
|
||||
if [ "$tag" = latest ]; then
|
||||
tag="$newest"
|
||||
fi
|
||||
commit="$(gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json targetCommitish -q .targetCommitish)"
|
||||
gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern halo-linux-release.zip --dir deploy/docker
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
echo "commit=$commit" >> "$GITHUB_OUTPUT"
|
||||
echo "newest=$([ "$tag" = "$newest" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
||||
echo "Release $tag (commit $commit; the newest: $newest)"
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
TAG: ${{ steps.release.outputs.tag }}
|
||||
COMMIT: ${{ steps.release.outputs.commit }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker build --pull -t opence-server:ci \
|
||||
--build-arg RELEASE=halo-linux-release.zip \
|
||||
--label org.opencontainers.image.source="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
|
||||
--label org.opencontainers.image.revision="$COMMIT" \
|
||||
--label org.opencontainers.image.version="$TAG" \
|
||||
--label org.opencontainers.image.licenses=AGPL-3.0-or-later \
|
||||
--label org.opencontainers.image.title="OpenCE dedicated server" \
|
||||
deploy/docker
|
||||
|
||||
- name: Smoke test
|
||||
run: |
|
||||
set -euo pipefail
|
||||
[ "$(docker image inspect -f '{{.Config.User}}' opence-server:ci)" = 10001:10001 ] \
|
||||
|| { echo "::error::the image does not run as 10001:10001"; exit 1; }
|
||||
docker run --rm --read-only --entrypoint /opt/opence/halo opence-server:ci --version | tee version.txt
|
||||
grep -Eq '^OpenCE build-[0-9]+ \(network version [0-9]+\)$' version.txt \
|
||||
|| { echo "::error::halo --version did not answer"; exit 1; }
|
||||
# without maps, on a read-only root with /state the one writable folder
|
||||
docker volume create smoke-state > /dev/null
|
||||
status=0
|
||||
timeout 60 docker run --name smoke --read-only --cap-drop ALL --security-opt no-new-privileges \
|
||||
--tmpfs /tmp -v smoke-state:/state -e HALO_SERVER_WEB_PASSWORD=ci-smoke-password \
|
||||
opence-server:ci > server.log 2>&1 || status=$?
|
||||
cat server.log
|
||||
docker rm -f smoke > /dev/null
|
||||
[ "$status" = 2 ] || { echo "::error::the server without maps exited with $status, not 2"; exit 1; }
|
||||
grep -qF 'server: no usable maps' server.log \
|
||||
|| { echo "::error::no 'server: no usable maps' line"; exit 1; }
|
||||
if grep -qF 'server: ready' server.log; then echo "::error::the server said it was ready"; exit 1; fi
|
||||
docker run --rm -v smoke-state:/state --entrypoint /bin/bash opence-server:ci -c 'test -s /state/config.toml' \
|
||||
|| { echo "::error::no /state/config.toml"; exit 1; }
|
||||
# the health check, with nothing listening
|
||||
if docker run --rm --entrypoint /opt/opence/healthz.sh opence-server:ci; then
|
||||
echo "::error::the health check passed with no server"; exit 1
|
||||
fi
|
||||
docker volume rm smoke-state > /dev/null
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
if: github.repository == 'OpenCommunityEdition/OpenCE'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: sigstore/cosign-installer@v3
|
||||
if: github.repository == 'OpenCommunityEdition/OpenCE'
|
||||
|
||||
- name: Push and sign
|
||||
if: github.repository == 'OpenCommunityEdition/OpenCE'
|
||||
env:
|
||||
TAG: ${{ steps.release.outputs.tag }}
|
||||
COMMIT: ${{ steps.release.outputs.commit }}
|
||||
NEWEST: ${{ steps.release.outputs.newest }}
|
||||
IDENTITY: ^https://github\.com/${{ github.repository }}/\.github/workflows/server-image\.yml@
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tags=("sha-${COMMIT:0:7}" "$TAG")
|
||||
if [ "$NEWEST" = true ]; then
|
||||
tags+=(latest)
|
||||
fi
|
||||
for tag in "${tags[@]}"; do
|
||||
docker tag opence-server:ci "$IMAGE:$tag"
|
||||
docker push "$IMAGE:$tag"
|
||||
done
|
||||
ref="$(docker image inspect -f '{{index .RepoDigests 0}}' "$IMAGE:$TAG")"
|
||||
test -n "$ref"
|
||||
cosign sign --yes "$ref"
|
||||
cosign verify "$ref" --certificate-identity-regexp "$IDENTITY" \
|
||||
--certificate-oidc-issuer https://token.actions.githubusercontent.com > /dev/null
|
||||
{
|
||||
echo "Pushed and signed $ref as ${tags[*]}."
|
||||
echo
|
||||
echo "Verify: cosign verify $IMAGE:$TAG --certificate-identity-regexp '$IDENTITY' --certificate-oidc-issuer https://token.actions.githubusercontent.com"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -15,19 +15,20 @@ end.
|
||||
| Path | Contents |
|
||||
| --- | --- |
|
||||
| `source/` | The game: 466 C files of the decompilation, compiled as they are with few changes (each marked, below) |
|
||||
| `port/linux/src/` | The platform layer the three ports share: Direct3D 8 on OpenGL (`d3d8_gl.c`), DirectSound and XInput on SDL3, files, threads, memory, sockets, settings (`port_config.c`), the mods folder (`port_mods.c`), internet play (`p2p*.c`) |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), streamer mode's word filter (`text_filter*.c`), touch, FOV and more |
|
||||
| `port/linux/src/` | The platform layer the three ports share: Direct3D 8 on OpenGL (`d3d8_gl.c`), DirectSound and XInput on SDL3, files, threads, memory, sockets, settings (`port_config.c`), the mods folder (`port_mods.c`), internet play (`p2p*.c`), the dedicated server's platform side (`server_*.c`: the mode, the log, the rotation's grammar, HTTP, RCON, the master servers' publisher) and the master servers' list (`master_list.c`) |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, OpenCE's gametypes (`game_modes.c`, `infection.c`, `gun_game.c`), map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), streamer mode's word filter (`text_filter*.c`), the dedicated server's director, commands, gametypes and status (`server_*.c`), touch, FOV and more |
|
||||
| `port/linux/include/` | The port's headers: the limits (`halo_port_limits.h`, with `HALO_PORT_NETWORK_VERSION`), capacities (`halo_port_capacity.h`), the prefix header, `halo_linux_source_fixups.h` (port functions the game's sources call) |
|
||||
| `port/include/xdk/` | Stand-ins for the Xbox SDK's headers (declarations only) |
|
||||
| `port/windows/` | The Windows build's own files (`win32_*.c`, headers) |
|
||||
| `port/android/` | The Android app: the guest runtime, the host library (`host/`), the Java app (`app/`), host imports (`host_imports.list`) |
|
||||
| `port/web/` | The web build: its runtime (`src/`: entry, sockets inside the page, memory watch), the page and its service worker (`site/`), the SDL port, tests |
|
||||
| `port/assets/` | What the builds embed or ship: high-res HUD (`hud/`), fonts, titles, menus (`menus/`), icons, network brokers |
|
||||
| `port/assets/` | What the builds embed or ship: high-res HUD (`hud/`), fonts, titles, menus (`menus/`), icons, network brokers and master servers, the dedicated server's web page (`server_ui/`) |
|
||||
| `port/third_party/` | Vendored libraries, each with a README naming its upstream, version and checksum |
|
||||
| `port/tools/` | Stand-alone tools (`cache_file_report.c`) |
|
||||
| `tools/` | Build scripts (`linux_build.py`, `windows_build.py`, `android_build.py`, `web_build.py`, `ci_build.py`, `web_serve.py`), generators (`ce_menus.py`, `port_settings.py`, `hud_assets.py`, `title_assets.py`, `embed_assets.py`, `xdk_headers.py`), tests, and `stagekit/` (scenarios staged and instrumented on the real engine, no retail assets) |
|
||||
| `docs/` | Longer design notes (`custom_edition_caches.md`, `mods.md`) |
|
||||
| `tools/` | Build scripts (`linux_build.py`, `windows_build.py`, `android_build.py`, `web_build.py`, `ci_build.py`, `web_serve.py`), generators (`ce_menus.py`, `port_settings.py`, `hud_assets.py`, `title_assets.py`, `embed_assets.py`, `server_ui_embed.py`, `xdk_headers.py`), the dedicated server's protocol simulator and remote console (`server_sim.py`, `opence_rcon.py`), tests, and `stagekit/` (scenarios staged and instrumented on the real engine, no retail assets) |
|
||||
| `docs/` | Longer design notes (`custom_edition_caches.md`, `mods.md`, `dedicated_server.md`, `master_protocol.md`) |
|
||||
| `pgo/` | Profile-guided optimisation profiles |
|
||||
| `deploy/` | Running a dedicated server: systemd, Docker, Pterodactyl, Helm, PufferPanel, MCSManager, example gametypes |
|
||||
| `assets/` | Game data for local runs (gitignored: `maps/`, `custom_maps/`) |
|
||||
| `.github/workflows/` | CI: builds every platform on each push, publishes releases from `main` |
|
||||
|
||||
@@ -94,6 +95,8 @@ python tools/test_death_timing.py
|
||||
python -m pytest -q tools/test_web_build.py # the web build's graph, sockets, menus
|
||||
node --test "port/web/tests/*.test.js" # the web page's importer and service worker
|
||||
node port/web/tests/webrtc_native.mjs chromium firefox # the native builds' WebRTC with browsers (Playwright)
|
||||
python -m pytest -q tools/test_dedicated_server.py # the dedicated server with clients (needs assets/maps)
|
||||
python -m pytest -q tools/test_server_sim.py tools/test_egg.py # the server's web page and protocol simulator, the egg
|
||||
python -m pytest -q tools/test_net_compare.py # net_compare.py's judging of logs, its copies and their processes
|
||||
python tools/net_compare.py --a build/linux/halo --b <other build> --data <game data> --swap
|
||||
# two builds in one network game, in step (retail maps: local only)
|
||||
@@ -110,6 +113,9 @@ Running the game without a person at it:
|
||||
several copies play on one machine on different loopback addresses
|
||||
(`HALO_NET_ADDRESS`, `HALO_NET_BROADCAST`). `NETCODE.md` describes the
|
||||
test settings.
|
||||
- `halo --server` is a dedicated server (`docs/dedicated_server.md`), and
|
||||
`halo --probe [<invite>]` prints a game's advertisement as JSON and exits;
|
||||
`tools/test_dedicated_server.py` runs both with clients.
|
||||
- `debug.exit_after`, `debug.hidden_window`, `debug.null_renderer`,
|
||||
`debug.menu_open` (start on one menu screen), `debug.telnet_console`.
|
||||
- Use a virtual display (Xvfb, with `SDL_VIDEO_DRIVER=x11`) for windowed
|
||||
@@ -231,6 +237,8 @@ The decompilation's upstream, punpckhdq/halo, is AGPL 3.0 from 17 October
|
||||
| [port/web/README.md](port/web/README.md) | The web build, the page, the game data in the browser, limits, how it operates, hosting on GitHub Pages |
|
||||
| [port/include/xdk/README.md](port/include/xdk/README.md) | How the SDK declarations were written and are checked |
|
||||
| [docs/custom_edition_caches.md](docs/custom_edition_caches.md) | Loading and converting Custom Edition maps, and the evidence for each layout |
|
||||
| [docs/dedicated_server.md](docs/dedicated_server.md) | The dedicated server: its command line, exit codes, commands, HTTP API, RCON, events and files |
|
||||
| [docs/master_protocol.md](docs/master_protocol.md) | The master servers' protocol: publishing, the probe, the signed list |
|
||||
| [docs/mods.md](docs/mods.md) | Mods: folders of Halo PC tag files whose sounds, bitmaps, text and models play over a map's on one machine |
|
||||
| [port/assets/text_filter/README.md](port/assets/text_filter/README.md) | Streamer mode's words: Surge AI's list, the review, the allowed words |
|
||||
| [port/assets/menus/README.md](port/assets/menus/README.md) | The menu files' format and how to write them again |
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
weapons' reticles): redraws by MrBruh (`port/assets/hud`), based on
|
||||
reference photos by Aerocatia. The sniper rifle's zoom labels (2x, 10x)
|
||||
are set in Overpass (`port/assets/fonts`).
|
||||
- **The menus' mouse cursor** (the blue arrow the menus show for the
|
||||
mouse): by pugzysixtyfour (`port/assets/cursor`).
|
||||
|
||||
## Third-party art
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!healthz.sh
|
||||
!*.zip
|
||||
@@ -0,0 +1,2 @@
|
||||
# a release zip copied here to build the image from (README.md, "Building it")
|
||||
*.zip
|
||||
@@ -0,0 +1,60 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
#
|
||||
# The dedicated server (docs/dedicated_server.md) as a container image, made
|
||||
# from a release's halo-linux-release.zip (the portable build: halo, its
|
||||
# libSDL3.so.0, brokers.txt, masters.txt):
|
||||
#
|
||||
# docker build -t opence-server deploy/docker
|
||||
# docker build -t opence-server --build-arg RELEASE=https://github.com/OpenCommunityEdition/OpenCE/releases/download/build-206/halo-linux-release.zip deploy/docker
|
||||
# docker build -t opence-server --build-arg RELEASE=halo-linux-release.zip deploy/docker (a zip in deploy/docker)
|
||||
#
|
||||
# The game data is never in the image: mount the folder that holds maps/ at
|
||||
# /data, read-only. /state is the only folder the server writes (config.toml,
|
||||
# the save root with its map cache, the logs), so the root can be read-only.
|
||||
# deploy/docker/README.md says how to run it.
|
||||
|
||||
FROM debian:bookworm-slim AS release
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# a URL, or a file beside this Dockerfile
|
||||
ARG RELEASE=https://github.com/OpenCommunityEdition/OpenCE/releases/latest/download/halo-linux-release.zip
|
||||
ADD ${RELEASE} /tmp/halo-linux-release.zip
|
||||
COPY healthz.sh /opt/opence/healthz.sh
|
||||
RUN unzip -q /tmp/halo-linux-release.zip -d /opt/opence \
|
||||
&& test -f /opt/opence/halo \
|
||||
&& chmod 0755 /opt/opence/halo /opt/opence/healthz.sh \
|
||||
&& if [ -f /opt/opence/halo-server ]; then chmod 0755 /opt/opence/halo-server; fi
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
# The 32-bit C runtime; the release's own libSDL3.so.0 needs nothing more for
|
||||
# a server, which opens no window or sound device. ca-certificates: the
|
||||
# master servers and the update check are HTTPS.
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends libc6:i386 libgcc-s1:i386 ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& groupadd -g 10001 opence \
|
||||
&& useradd -u 10001 -g 10001 -d /state -M -s /usr/sbin/nologin opence \
|
||||
&& mkdir -p /data /state \
|
||||
&& chown 10001:10001 /state
|
||||
COPY --from=release /opt/opence /opt/opence
|
||||
ENV HALO_SERVER=1 \
|
||||
HALO_CONFIG_FILE=/state/config.toml \
|
||||
HALO_DATA_ROOT=/data \
|
||||
HALO_SAVE_ROOT=/state/saves \
|
||||
HALO_LOG_ROOT=/state/logs \
|
||||
HALO_NET_TUNNEL_PORT=2302 \
|
||||
HALO_SERVER_WEB_BIND=0.0.0.0 \
|
||||
HALO_SERVER_WEB_PORT=8080 \
|
||||
HOME=/state
|
||||
VOLUME ["/state"]
|
||||
# Internet play's tunnel, and the web page, API and RCON (publish it on the
|
||||
# host's loopback, or behind a proxy with TLS). System link's 5150, 5151 and
|
||||
# 5153 are for a local network only.
|
||||
EXPOSE 2302/udp 8080/tcp
|
||||
USER 10001:10001
|
||||
WORKDIR /state
|
||||
HEALTHCHECK --interval=15s --timeout=3s --start-period=60s --retries=3 CMD ["/opt/opence/healthz.sh"]
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT ["/opt/opence/halo", "--server"]
|
||||
@@ -0,0 +1,134 @@
|
||||
# The dedicated server in a container
|
||||
|
||||
`ghcr.io/opencommunityedition/opence-server` is the dedicated server
|
||||
(`docs/dedicated_server.md`) as a container image: a release's
|
||||
`halo-linux-release.zip` on Debian 12 with the 32-bit C runtime, run as
|
||||
`halo --server` by the user 10001. CI builds it from each release
|
||||
(`.github/workflows/server-image.yml`) and signs it with cosign; the tags are
|
||||
`latest`, the release's (`build-206`) and `sha-<commit>`.
|
||||
|
||||
The game data is never in the image. Mount the folder that holds `maps/`
|
||||
(from your own copy of the game: port/linux/README.md, "Game data") at
|
||||
`/data`, read-only. Without it the server exits with code 2 and says which
|
||||
maps it looked for.
|
||||
|
||||
## Running it
|
||||
|
||||
```sh
|
||||
docker run -d --name halo --restart unless-stopped \
|
||||
--read-only --cap-drop ALL --security-opt no-new-privileges --tmpfs /tmp \
|
||||
-p 2302:2302/udp -p 127.0.0.1:8080:8080 \
|
||||
-v /srv/halo/data:/data:ro -v halo-state:/state \
|
||||
-e HALO_SERVER_NAME="My server" \
|
||||
-e HALO_SERVER_ROTATION="bloodgulch:ctf, sidewinder:team_slayer" \
|
||||
-e HALO_SERVER_WEB_PASSWORD=changeme-please \
|
||||
ghcr.io/opencommunityedition/opence-server:latest
|
||||
docker logs -f halo
|
||||
```
|
||||
|
||||
Or with Compose: `compose.yaml` beside this file runs the same, with the
|
||||
settings taken from the shell or a `.env` file
|
||||
(`HALO_DATA=/srv/halo/data`, `HALO_SERVER_NAME=...`). Its `https` profile
|
||||
adds Caddy in front of the web port, with a certificate for
|
||||
`HALO_WEB_DOMAIN`:
|
||||
|
||||
```sh
|
||||
HALO_DATA=/srv/halo/data docker compose -f deploy/docker/compose.yaml up -d
|
||||
HALO_WEB_DOMAIN=halo.example.org docker compose -f deploy/docker/compose.yaml --profile https up -d
|
||||
```
|
||||
|
||||
The Compose file puts both on a network of its own, `172.30.80.0/24`, with
|
||||
Caddy at the fixed address `172.30.80.10` and the server's
|
||||
`HALO_SERVER_WEB_TRUSTED_PROXY` set to it: the server believes Caddy's
|
||||
`X-Forwarded-For`, `-Host` and `-Proto`, so its rate limits and log name the
|
||||
visitor rather than Caddy, and the session cookie is `Secure`. If that
|
||||
subnet overlaps one of the host's, change the subnet, Caddy's
|
||||
`ipv4_address` and the variable together.
|
||||
|
||||
`docker stop` sends SIGTERM: the game in progress goes to its postgame,
|
||||
the players are told, the listing is withdrawn, and the server exits 0
|
||||
within the 15 seconds Compose waits (`docker stop -t 15` otherwise).
|
||||
|
||||
## Folders
|
||||
|
||||
| Path | What |
|
||||
| --- | --- |
|
||||
| `/opt/opence` | The release: `halo`, `libSDL3.so.0`, `brokers.txt`, `masters.txt`, `healthz.sh`, the licences (read-only) |
|
||||
| `/data` | The game data: `maps/`, and if you have them `custom_maps/`, `gametypes/` and `init.txt` (yours, read-only) |
|
||||
| `/state` | The only folder written: `config.toml` (`HALO_CONFIG_FILE`), `publisher.key` beside it, the save root `saves/` with the map cache (about 115 MB), `logs/` (`debug.txt`, `bans.txt`, `cheaters.txt`) |
|
||||
|
||||
The image sets `HALO_CONFIG_FILE=/state/config.toml` rather than linking
|
||||
`config.toml` beside the executable into the volume: the settings file is
|
||||
then in the volume from the first start, and nothing in `/opt/opence` is
|
||||
written. The server writes every setting there at the first start, with
|
||||
the generated web password if none was given.
|
||||
|
||||
## Settings
|
||||
|
||||
Every setting is an environment variable (port/linux/README.md, "Dedicated
|
||||
server", and docs/dedicated_server.md). A variable that is set wins over
|
||||
`config.toml`, and the web page's settings cannot change it. The image sets:
|
||||
|
||||
| Variable | Value |
|
||||
| --- | --- |
|
||||
| `HALO_SERVER` | `1` |
|
||||
| `HALO_CONFIG_FILE` | `/state/config.toml` |
|
||||
| `HALO_DATA_ROOT` | `/data` |
|
||||
| `HALO_SAVE_ROOT` | `/state/saves` |
|
||||
| `HALO_LOG_ROOT` | `/state/logs` |
|
||||
| `HALO_NET_TUNNEL_PORT` | `2302` |
|
||||
| `HALO_SERVER_WEB_BIND` | `0.0.0.0` (within the container; publish the port on `127.0.0.1` or behind TLS) |
|
||||
| `HALO_SERVER_WEB_PORT` | `8080` |
|
||||
|
||||
The ones most often given: `HALO_SERVER_NAME`, `HALO_SERVER_ROTATION`,
|
||||
`HALO_SERVER_MAX_PLAYERS`, `HALO_SERVER_PASSWORD`, `HALO_SERVER_PUBLIC`,
|
||||
`HALO_SERVER_MOTD`, `HALO_SERVER_WEB_PASSWORD`, `HALO_NET_PUBLIC_ADDRESS`,
|
||||
`HALO_SERVER_PUBLISHER_KEY` (the master servers' key, as 64 hex
|
||||
characters; `docker run --rm -v halo-state:/state <image> --keygen` makes one
|
||||
into the volume instead), `HALO_SERVER_INSTANCE`, `HALO_SERVER_REGION`,
|
||||
`HALO_SERVER_LOG_FORMAT=json`.
|
||||
|
||||
A tunnel port other than 2302 is published as the same number on both sides
|
||||
(`-e HALO_NET_TUNNEL_PORT=2303 -p 2303:2303/udp`), as the server offers its
|
||||
own port to joiners. Behind a NAT that STUN cannot see through, give the
|
||||
public address and port in `HALO_NET_PUBLIC_ADDRESS`.
|
||||
|
||||
## Health
|
||||
|
||||
`HEALTHCHECK` runs `/opt/opence/healthz.sh`, which asks `GET /healthz` on
|
||||
the web port (bash's `/dev/tcp`: the image has no curl) and is healthy on a
|
||||
200: the server is hosting (lobby, loading, playing or postgame) and its
|
||||
frames run. With `HALO_SERVER_WEB_PORT=0` it always passes.
|
||||
|
||||
## Building it
|
||||
|
||||
```sh
|
||||
docker build -t opence-server deploy/docker # the latest release
|
||||
docker build -t opence-server --build-arg RELEASE=https://github.com/OpenCommunityEdition/OpenCE/releases/download/build-206/halo-linux-release.zip deploy/docker
|
||||
```
|
||||
|
||||
A build of your own (`python tools/ci_build.py linux release` leaves
|
||||
`dist/halo-linux-release/`) goes in as a zip beside the Dockerfile:
|
||||
|
||||
```sh
|
||||
(cd dist/halo-linux-release && zip -qr ../../deploy/docker/halo-linux-release.zip .)
|
||||
docker build -t opence-server --build-arg RELEASE=halo-linux-release.zip deploy/docker
|
||||
```
|
||||
|
||||
`RELEASE` is a URL or a file beside the Dockerfile. The image is 32-bit
|
||||
x86 and runs on amd64 hosts only.
|
||||
|
||||
## Networking
|
||||
|
||||
Bridge networking works for internet play: the tunnel port is published one
|
||||
to one, and the server needs no hole punching of its own. System link
|
||||
(UDP 5150 and 5151, TCP 5150 and 5153) finds other machines only with
|
||||
`--network host`.
|
||||
|
||||
Verify an image's signature:
|
||||
|
||||
```sh
|
||||
cosign verify ghcr.io/opencommunityedition/opence-server:latest \
|
||||
--certificate-identity-regexp '^https://github\.com/OpenCommunityEdition/OpenCE/\.github/workflows/server-image\.yml@' \
|
||||
--certificate-oidc-issuer https://token.actions.githubusercontent.com
|
||||
```
|
||||
@@ -0,0 +1,92 @@
|
||||
# The dedicated server with Docker Compose (deploy/docker/README.md):
|
||||
#
|
||||
# docker compose -f deploy/docker/compose.yaml up -d
|
||||
# docker compose -f deploy/docker/compose.yaml --profile https up -d (with Caddy in front of the web port)
|
||||
#
|
||||
# HALO_DATA is the folder that holds maps/ (and custom_maps/, gametypes/),
|
||||
# mounted read-only; settings come from the environment below or from a
|
||||
# .env file beside this one.
|
||||
name: opence
|
||||
|
||||
services:
|
||||
server:
|
||||
image: ${OPENCE_IMAGE:-ghcr.io/opencommunityedition/opence-server:latest}
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
tmpfs:
|
||||
- /tmp
|
||||
ports:
|
||||
- "${HALO_NET_TUNNEL_PORT:-2302}:${HALO_NET_TUNNEL_PORT:-2302}/udp"
|
||||
# (the web page on the host's loopback only; Caddy reaches it on the
|
||||
# compose network)
|
||||
- "127.0.0.1:${HALO_SERVER_WEB_PORT:-8080}:${HALO_SERVER_WEB_PORT:-8080}/tcp"
|
||||
volumes:
|
||||
- ${HALO_DATA:-./data}:/data:ro
|
||||
- state:/state
|
||||
# A variable named without a value is passed only when it is set (in the
|
||||
# shell or .env): one that is set wins over config.toml, and sv_set
|
||||
# cannot change it.
|
||||
environment:
|
||||
- HALO_NET_TUNNEL_PORT=${HALO_NET_TUNNEL_PORT:-2302}
|
||||
- HALO_SERVER_WEB_PORT=${HALO_SERVER_WEB_PORT:-8080}
|
||||
- HALO_SERVER_NAME
|
||||
- HALO_SERVER_ROTATION
|
||||
- HALO_SERVER_MAX_PLAYERS
|
||||
- HALO_SERVER_PASSWORD
|
||||
- HALO_SERVER_PUBLIC
|
||||
- HALO_SERVER_MOTD
|
||||
# (8 characters or more; unset: one is made at the first start, printed
|
||||
# in the log and kept in the state volume's config.toml)
|
||||
- HALO_SERVER_WEB_PASSWORD
|
||||
- HALO_NET_PUBLIC_ADDRESS
|
||||
- HALO_SERVER_PUBLISHER_KEY
|
||||
- HALO_SERVER_INSTANCE
|
||||
- HALO_SERVER_REGION
|
||||
- HALO_SERVER_LOG_FORMAT
|
||||
# Caddy's address on the network below (the https profile): its
|
||||
# X-Forwarded-For, -Host and -Proto are believed, so the page's rate
|
||||
# limits and log name the visitor, and its session cookie is Secure.
|
||||
# Nothing else has this address.
|
||||
- HALO_SERVER_WEB_TRUSTED_PROXY=172.30.80.10
|
||||
networks:
|
||||
- opence
|
||||
stop_grace_period: 15s
|
||||
|
||||
# HTTPS for the web page, with a certificate from Let's Encrypt for
|
||||
# HALO_WEB_DOMAIN (which must resolve to this host, ports 80 and 443 open).
|
||||
caddy:
|
||||
image: caddy:2
|
||||
profiles: [https]
|
||||
restart: unless-stopped
|
||||
depends_on: [server]
|
||||
ports:
|
||||
- "80:80/tcp"
|
||||
- "443:443/tcp"
|
||||
- "443:443/udp"
|
||||
command: ["caddy", "reverse-proxy", "--from", "${HALO_WEB_DOMAIN:-halo.example.org}", "--to", "server:${HALO_SERVER_WEB_PORT:-8080}"]
|
||||
volumes:
|
||||
- caddy-data:/data
|
||||
- caddy-config:/config
|
||||
networks:
|
||||
opence:
|
||||
# (server.web_trusted_proxy above; outside the range Docker hands
|
||||
# out, so no other container takes it)
|
||||
ipv4_address: 172.30.80.10
|
||||
|
||||
# A fixed subnet, so that Caddy's address is known in advance. Containers
|
||||
# other than Caddy get addresses from ip_range only. Change it (and the two
|
||||
# addresses above) if it overlaps a network of the host's.
|
||||
networks:
|
||||
opence:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.30.80.0/24
|
||||
ip_range: 172.30.80.128/25
|
||||
gateway: 172.30.80.1
|
||||
|
||||
volumes:
|
||||
state:
|
||||
caddy-data:
|
||||
caddy-config:
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# The image's health check: GET /healthz on the web port, healthy on a 200
|
||||
# (the server answers 200 while it hosts and its frames run, 503 otherwise).
|
||||
# Bash's /dev/tcp, as the image has no curl.
|
||||
port="${HALO_SERVER_WEB_PORT:-8080}"
|
||||
# (no web port: nothing to ask)
|
||||
if [ -z "$port" ] || [ "$port" = 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
{ exec 3<>"/dev/tcp/127.0.0.1/$port"; } 2>/dev/null || exit 1
|
||||
printf 'GET /healthz HTTP/1.1\r\nHost: 127.0.0.1:%s\r\nConnection: close\r\n\r\n' "$port" >&3 || exit 1
|
||||
IFS=' ' read -r -t 3 version status _ <&3 || exit 1
|
||||
exec 3<&-
|
||||
case "$version" in
|
||||
HTTP/1.*) ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
[ "$status" = 200 ]
|
||||
@@ -0,0 +1,29 @@
|
||||
# Big team slayer: first team to 50 kills, vehicles as Halo PC places them.
|
||||
# Play it with server.rotation entries such as bloodgulch:btb_slayer.
|
||||
base = "team_slayer"
|
||||
name = "BTB Slayer"
|
||||
|
||||
[universal]
|
||||
teams = true
|
||||
score_to_win = 50
|
||||
lives = 0
|
||||
respawn_time = 5
|
||||
health = 100
|
||||
weapon_set = "normal"
|
||||
vehicle_set = "default"
|
||||
radar = true
|
||||
friend_indicators = true
|
||||
|
||||
[options]
|
||||
time_limit = 20
|
||||
friendly_fire = "shields_only"
|
||||
friendly_fire_penalty = 5
|
||||
vehicle_respawn_time = 60
|
||||
auto_team_balance = true
|
||||
radar_players = "friends"
|
||||
team_vehicles = "pc"
|
||||
|
||||
[slayer]
|
||||
no_death_bonus = false
|
||||
no_kill_penalty = false
|
||||
kill_in_order = false
|
||||
@@ -0,0 +1,27 @@
|
||||
# Capture the flag as players remember it: three captures, the flag must be
|
||||
# at home to score.
|
||||
base = "ctf"
|
||||
name = "Classic CTF"
|
||||
|
||||
[universal]
|
||||
teams = true
|
||||
score_to_win = 3
|
||||
respawn_time = 5
|
||||
weapon_set = "normal"
|
||||
vehicle_set = "default"
|
||||
radar = true
|
||||
|
||||
[options]
|
||||
time_limit = 25
|
||||
friendly_fire = "off"
|
||||
vehicle_respawn_time = 90
|
||||
auto_team_balance = true
|
||||
radar_players = "friends"
|
||||
team_vehicles = "pc"
|
||||
|
||||
[ctf]
|
||||
assault = false
|
||||
reset_on_capture = false
|
||||
flag_must_reset = false
|
||||
flag_at_home_to_score = true
|
||||
single_flag_time = 0
|
||||
@@ -0,0 +1,17 @@
|
||||
# King of the hill whose hill moves about the map, for teams.
|
||||
base = "team_king"
|
||||
name = "Moving Hill"
|
||||
|
||||
[universal]
|
||||
teams = true
|
||||
score_to_win = 3
|
||||
respawn_time = 5
|
||||
radar = true
|
||||
|
||||
[options]
|
||||
time_limit = 15
|
||||
friendly_fire = "off"
|
||||
auto_team_balance = true
|
||||
|
||||
[king]
|
||||
moving_hill = true
|
||||
@@ -0,0 +1,23 @@
|
||||
# Free for all slayer to 25 kills, starting with a pistol and an assault rifle.
|
||||
base = "slayer"
|
||||
name = "Lone Wolves"
|
||||
|
||||
[universal]
|
||||
teams = false
|
||||
score_to_win = 25
|
||||
respawn_time = 3
|
||||
health = 100
|
||||
radar = false
|
||||
|
||||
[options]
|
||||
time_limit = 15
|
||||
radar_players = "none"
|
||||
loadout = "custom"
|
||||
primary_weapon = "pistol"
|
||||
secondary_weapon = "assault_rifle"
|
||||
team_vehicles = "pc"
|
||||
|
||||
[slayer]
|
||||
no_death_bonus = false
|
||||
no_kill_penalty = false
|
||||
kill_in_order = false
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec "$(dirname "$0")/halo" --server "$@"
|
||||
@@ -0,0 +1,3 @@
|
||||
# Not part of the packaged chart: unit tests and CI values files.
|
||||
tests/
|
||||
ci/
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v2
|
||||
name: opence-server
|
||||
description: >-
|
||||
The OpenCE dedicated server: a headless Halo: Combat Evolved host that plays games one after
|
||||
another, with no window, sound or player of its own. The game data (maps) is mounted from a
|
||||
volume you provide.
|
||||
type: application
|
||||
version: 0.1.0
|
||||
kubeVersion: ">=1.29.0-0"
|
||||
# Informational only: which image runs is set by image.repository, image.tag and image.digest.
|
||||
appVersion: "latest"
|
||||
home: https://github.com/OpenCommunityEdition/OpenCE
|
||||
sources:
|
||||
- https://github.com/OpenCommunityEdition/OpenCE/tree/main/deploy/helm/opence-server
|
||||
keywords:
|
||||
- halo
|
||||
- game-server
|
||||
@@ -0,0 +1,111 @@
|
||||
# opence-server
|
||||
|
||||
The OpenCE dedicated server (`docs/dedicated_server.md`) on Kubernetes: one
|
||||
pod of the image `ghcr.io/opencommunityedition/opence-server`
|
||||
(`deploy/docker`), its tunnel port behind a UDP Service, its web page behind
|
||||
a ClusterIP Service, probes on `GET /healthz`, and a NetworkPolicy.
|
||||
|
||||
The game data is never in the image or the chart: give a volume that holds
|
||||
`maps/` from your own copy of the game.
|
||||
|
||||
## Quick start
|
||||
|
||||
```sh
|
||||
kubectl create namespace halo
|
||||
# a claim (or an NFS export) holding maps/, read-only is enough
|
||||
helm install halo deploy/helm/opence-server -n halo \
|
||||
--set gameData.existingClaim=halo-maps \
|
||||
--set server.name="My server" \
|
||||
--set persistence.enabled=true
|
||||
kubectl -n halo logs -f deploy/halo-opence-server
|
||||
```
|
||||
|
||||
The admin password of the web page is made at the first install and kept in
|
||||
the release's Secret (NOTES.txt prints the command that shows it), unless
|
||||
`web.password` or `web.existingSecret` gives one. Reach the page with
|
||||
`kubectl -n halo port-forward deploy/halo-opence-server 8080`, or put an
|
||||
Ingress with TLS in front of the `-web` Service (and allow its namespace
|
||||
in `networkPolicy.webFrom`).
|
||||
|
||||
## Values
|
||||
|
||||
`values.yaml` describes each value. Each one under `server`, `web`,
|
||||
`network` and `publisherKey` is one of the server's `HALO_*` variables:
|
||||
|
||||
| Value | Variable |
|
||||
| --- | --- |
|
||||
| `server.name` | `HALO_SERVER_NAME` (15 characters) |
|
||||
| `server.rotation` (a list) | `HALO_SERVER_ROTATION`, joined with commas |
|
||||
| `server.maxPlayers` | `HALO_SERVER_MAX_PLAYERS` |
|
||||
| `server.public` | `HALO_SERVER_PUBLIC` |
|
||||
| `server.lobbySeconds` | `HALO_SERVER_LOBBY_SECONDS` |
|
||||
| `server.motd` | `HALO_SERVER_MOTD` |
|
||||
| `server.logFormat` | `HALO_SERVER_LOG_FORMAT` |
|
||||
| `server.instance`, `server.region` | `HALO_SERVER_INSTANCE`, `HALO_SERVER_REGION` |
|
||||
| `server.masterPublish` | `HALO_SERVER_MASTER_PUBLISH` |
|
||||
| `server.password` | `HALO_SERVER_PASSWORD` (from a Secret) |
|
||||
| `publisherKey` | `HALO_SERVER_PUBLISHER_KEY` (from a Secret) |
|
||||
| `web.port` | `HALO_SERVER_WEB_PORT` (0: none, and no probes) |
|
||||
| `web.password`, `web.existingSecret` | `HALO_SERVER_WEB_PASSWORD` (from a Secret) |
|
||||
| `web.moderatorPassword` | `HALO_SERVER_WEB_MODERATOR_PASSWORD` (from a Secret) |
|
||||
| `network.tunnelPort` | `HALO_NET_TUNNEL_PORT` |
|
||||
| `network.publicAddress` | `HALO_NET_PUBLIC_ADDRESS` |
|
||||
| `customMaps` | `HALO_CUSTOM_MAPS_ROOT=/custom_maps` |
|
||||
|
||||
The chart also sets `HALO_SERVER=1`, `HALO_CONFIG_FILE=/state/config.toml`,
|
||||
`HALO_DATA_ROOT=/data`, `HALO_SAVE_ROOT=/state/saves`,
|
||||
`HALO_LOG_ROOT=/state/logs`, `HALO_SERVER_CONSOLE=false` (a pod has no
|
||||
standard input) and, with a web port, `HALO_SERVER_WEB_BIND=0.0.0.0` (the
|
||||
kubelet's probes reach the pod's address). Any other setting goes in
|
||||
`extraEnv`, which comes last and so overrides the chart's.
|
||||
|
||||
A variable the chart sets wins over `config.toml`, and neither `sv_set` nor
|
||||
the web page's settings can change it. So the values under `server` are
|
||||
unset by default (empty, `[]` or `null`): the chart then sets no variable,
|
||||
and the setting is `config.toml`'s (or the server's default, which
|
||||
`values.yaml` names), changeable from the web page and kept in the state
|
||||
volume. Give a value only for a setting you want fixed.
|
||||
|
||||
## Web password
|
||||
|
||||
With neither `web.password` nor `web.existingSecret`, the chart makes an
|
||||
admin password at the first install and keeps it in the release's Secret;
|
||||
on an upgrade it finds that Secret again with `lookup`. `helm template`,
|
||||
and GitOps tools that render with it (Argo CD, Flux's dry runs,
|
||||
Kustomize's Helm support), have no cluster to look in: each render makes a
|
||||
new password, and the Secret changes at every sync. There, create the Secret
|
||||
yourself and name it:
|
||||
|
||||
```sh
|
||||
kubectl -n halo create secret generic halo-web \
|
||||
--from-literal=web-password="$(openssl rand -base64 18)" \
|
||||
--from-literal=web-moderator-password="$(openssl rand -base64 18)"
|
||||
helm template halo deploy/helm/opence-server -n halo \
|
||||
--set gameData.existingClaim=halo-maps --set web.existingSecret=halo-web
|
||||
```
|
||||
|
||||
(or a SealedSecret or an External Secrets object of the same name).
|
||||
`web.key` and `web.moderatorKey` name its keys; the moderator's is
|
||||
optional.
|
||||
|
||||
## Networking
|
||||
|
||||
`service.type` is `LoadBalancer` with `externalTrafficPolicy: Local` by
|
||||
default, so that the server sees the players' own addresses (its bans and
|
||||
limits are by address). `NodePort` works too; `ClusterIP` is for tests. The
|
||||
tunnel's Service port and `network.tunnelPort` should be the same number, as
|
||||
the server offers its own port to joiners; behind a NAT that STUN cannot see
|
||||
through, give the forwarded address in `network.publicAddress`.
|
||||
|
||||
The NetworkPolicy lets anyone reach the tunnel port and only `webFrom` the
|
||||
web port, and lets the pod reach DNS, TCP 1883 (the MQTT brokers) and 443
|
||||
(the master servers) and any UDP port on public addresses.
|
||||
|
||||
## Tests
|
||||
|
||||
```sh
|
||||
helm lint deploy/helm/opence-server --strict -f deploy/helm/opence-server/ci/full-values.yaml
|
||||
helm unittest deploy/helm/opence-server
|
||||
```
|
||||
|
||||
`.github/workflows/server-image.yml` runs both.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Every option the chart has, for lint and the schema check (not installed: the NFS server is made
|
||||
# up).
|
||||
image:
|
||||
tag: build-206@sha256:0000000000000000000000000000000000000000000000000000000000000000
|
||||
imagePullSecrets:
|
||||
- name: registry-credentials
|
||||
gameData:
|
||||
nfs:
|
||||
server: nfs.example.com
|
||||
path: /exports/halo
|
||||
subPath: xbox
|
||||
customMaps:
|
||||
existingClaim: halo-custom-maps
|
||||
server:
|
||||
name: Example server
|
||||
rotation: [bloodgulch:ctf_classic, sidewinder:team_slayer+score=50, hangemhigh:king_moving]
|
||||
maxPlayers: 24
|
||||
public: true
|
||||
lobbySeconds: 20
|
||||
motd: Welcome
|
||||
logFormat: json
|
||||
instance: eu-1
|
||||
region: eu
|
||||
masterPublish: true
|
||||
password:
|
||||
existingSecret: halo-join
|
||||
key: password
|
||||
publisherKey:
|
||||
existingSecret: halo-publisher
|
||||
key: seed
|
||||
web:
|
||||
port: 8080
|
||||
existingSecret: halo-web
|
||||
key: admin
|
||||
moderatorKey: moderator
|
||||
network:
|
||||
tunnelPort: 2303
|
||||
publicAddress: halo.example.com:2303
|
||||
extraEnv:
|
||||
- name: HALO_SERVER_EMPTY_SECONDS
|
||||
value: "60"
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: standard
|
||||
annotations:
|
||||
example.com/keep: "true"
|
||||
service:
|
||||
type: LoadBalancer
|
||||
port: 2303
|
||||
nodePort: 30703
|
||||
annotations:
|
||||
example.com/address: 192.0.2.10
|
||||
externalTrafficPolicy: Local
|
||||
loadBalancerSourceRanges: [0.0.0.0/0]
|
||||
tolerations:
|
||||
- key: dedicated
|
||||
operator: Equal
|
||||
value: games
|
||||
effect: NoSchedule
|
||||
podAnnotations:
|
||||
example.com/scrape: "true"
|
||||
podLabels:
|
||||
team: games
|
||||
probes:
|
||||
liveness:
|
||||
periodSeconds: 30
|
||||
readiness:
|
||||
enabled: false
|
||||
networkPolicy:
|
||||
webFrom:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: ingress-nginx
|
||||
extraEgress:
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: 203.0.113.0/24
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8443
|
||||
extraObjects:
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-extra'
|
||||
data:
|
||||
hello: world
|
||||
@@ -0,0 +1,6 @@
|
||||
# The smallest install that renders: no maps (an emptyDir in their place), so the server exits with
|
||||
# code 2 and the pod goes into CrashLoopBackOff. A real install gives gameData.existingClaim or
|
||||
# gameData.nfs instead.
|
||||
gameData:
|
||||
volume:
|
||||
emptyDir: {}
|
||||
@@ -0,0 +1,33 @@
|
||||
OpenCE dedicated server {{ .Chart.Version }}: {{ include "opence-server.fullname" . }} in namespace {{ .Release.Namespace }}.
|
||||
|
||||
Rotation: {{ join ", " .Values.server.rotation | default "the server's default" }}.
|
||||
{{- if kindIs "invalid" .Values.server.public }}
|
||||
Listed in everyone's server browser{{ with .Values.server.name }} as "{{ . }}"{{ end }}, unless config.toml or the web page turns server.public off.
|
||||
{{- else if .Values.server.public }}
|
||||
Listed in everyone's server browser{{ with .Values.server.name }} as "{{ . }}"{{ end }}.
|
||||
{{- else }}
|
||||
Not listed: players join with the invite link from the log, or on the LAN.
|
||||
{{- end }}
|
||||
|
||||
The log (the ready line, players, games):
|
||||
|
||||
kubectl -n {{ .Release.Namespace }} logs -f deploy/{{ include "opence-server.fullname" . }}
|
||||
|
||||
Players reach UDP port {{ .Values.service.port }} through Service {{ include "opence-server.fullname" . }} ({{ .Values.service.type }}).
|
||||
{{- if eq .Values.service.type "ClusterIP" }}
|
||||
A ClusterIP Service is not reachable from outside the cluster: set service.type to LoadBalancer or
|
||||
NodePort for internet play.
|
||||
{{- end }}
|
||||
{{- if gt (int .Values.web.port) 0 }}
|
||||
|
||||
The web page, API and remote console:
|
||||
|
||||
kubectl -n {{ .Release.Namespace }} port-forward deploy/{{ include "opence-server.fullname" . }} {{ .Values.web.port }}
|
||||
open http://127.0.0.1:{{ .Values.web.port }}/
|
||||
{{- if not .Values.web.existingSecret }}
|
||||
|
||||
The admin password:
|
||||
|
||||
kubectl -n {{ .Release.Namespace }} get secret {{ include "opence-server.secretName" . }} -o jsonpath='{.data.{{ .Values.web.key }}}' | base64 -d
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,84 @@
|
||||
{{/* The objects' name: fullnameOverride, else the release name if it contains the chart's name,
|
||||
else <release>-<chart>. */}}
|
||||
{{- define "opence-server.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.labels" -}}
|
||||
{{ include "opence-server.selectorLabels" . }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "opence-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/* repository:tag, repository:tag@digest, or repository@digest; an empty tag is the appVersion. */}}
|
||||
{{- define "opence-server.image" -}}
|
||||
{{- $image := .Values.image -}}
|
||||
{{- $ref := $image.repository -}}
|
||||
{{- $tag := toString ($image.tag | default .Chart.AppVersion) -}}
|
||||
{{- if $image.digest }}{{ $tag = regexReplaceAll "@.*$" $tag "" }}{{ if hasPrefix "sha256:" $tag }}{{ $tag = "" }}{{ end }}{{ end -}}
|
||||
{{- if hasPrefix "sha256:" $tag }}{{ $ref = printf "%s@%s" $ref $tag }}
|
||||
{{- else if $tag }}{{ $ref = printf "%s:%s" $ref $tag }}{{ end -}}
|
||||
{{- if and $image.digest (not (contains "@" $ref)) }}{{ $ref = printf "%s@%s" $ref $image.digest }}{{ end -}}
|
||||
{{- $ref -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.stateClaim" -}}
|
||||
{{- .Values.persistence.existingClaim | default (printf "%s-state" (include "opence-server.fullname" .)) -}}
|
||||
{{- end }}
|
||||
|
||||
{{/* The chart's Secret: the web passwords it makes or is given, the join password, the publisher
|
||||
key. */}}
|
||||
{{- define "opence-server.secretName" -}}
|
||||
{{- printf "%s-secrets" (include "opence-server.fullname" .) -}}
|
||||
{{- end }}
|
||||
|
||||
{{/* The Secret holding the web password: web.existingSecret, else the chart's. */}}
|
||||
{{- define "opence-server.webSecret" -}}
|
||||
{{- .Values.web.existingSecret | default (include "opence-server.secretName" .) -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.hasGameData" -}}
|
||||
{{- with .Values.gameData -}}
|
||||
{{- if or .existingClaim (and .nfs.server .nfs.path) .volume }}true{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opence-server.hasCustomMaps" -}}
|
||||
{{- with .Values.customMaps -}}
|
||||
{{- if or .existingClaim (and .nfs.server .nfs.path) .volume }}true{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/* A volume source of gameData or customMaps (the dict), read-only. */}}
|
||||
{{- define "opence-server.volumeSource" -}}
|
||||
{{- if .existingClaim }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .existingClaim }}
|
||||
readOnly: true
|
||||
{{- else if and .nfs.server .nfs.path }}
|
||||
nfs:
|
||||
server: {{ .nfs.server }}
|
||||
path: {{ .nfs.path }}
|
||||
readOnly: true
|
||||
{{- else }}
|
||||
{{- toYaml .volume }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,198 @@
|
||||
{{- if not (include "opence-server.hasGameData" .) }}
|
||||
{{- fail "gameData: set existingClaim, nfs.server and nfs.path, or volume - the server needs the game's maps, which are never in the image" }}
|
||||
{{- end }}
|
||||
{{- $fullname := include "opence-server.fullname" . }}
|
||||
{{- $secret := include "opence-server.secretName" . }}
|
||||
{{- $webPort := int .Values.web.port }}
|
||||
{{- $env := list }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER" "value" "1") }}
|
||||
{{- $env = append $env (dict "name" "HALO_CONFIG_FILE" "value" "/state/config.toml") }}
|
||||
{{- $env = append $env (dict "name" "HALO_DATA_ROOT" "value" "/data") }}
|
||||
{{- $env = append $env (dict "name" "HALO_SAVE_ROOT" "value" "/state/saves") }}
|
||||
{{- $env = append $env (dict "name" "HALO_LOG_ROOT" "value" "/state/logs") }}
|
||||
{{- if include "opence-server.hasCustomMaps" . }}
|
||||
{{- $env = append $env (dict "name" "HALO_CUSTOM_MAPS_ROOT" "value" "/custom_maps") }}
|
||||
{{- end }}
|
||||
{{- /* (a pod has no standard input to read commands from) */}}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_CONSOLE" "value" "false") }}
|
||||
{{- $env = append $env (dict "name" "HALO_NET_TUNNEL_PORT" "value" (toString (int .Values.network.tunnelPort))) }}
|
||||
{{- with .Values.network.publicAddress }}
|
||||
{{- $env = append $env (dict "name" "HALO_NET_PUBLIC_ADDRESS" "value" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.name }}
|
||||
{{- if gt (len .) 15 }}
|
||||
{{- fail "server.name: 15 characters at most" }}
|
||||
{{- end }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_NAME" "value" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.rotation }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_ROTATION" "value" (join ", " .)) }}
|
||||
{{- end }}
|
||||
{{- /* (a value left null is not set, so that config.toml, sv_set and the web page's settings can
|
||||
change it) */}}
|
||||
{{- if not (kindIs "invalid" .Values.server.maxPlayers) }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_MAX_PLAYERS" "value" (toString (int .Values.server.maxPlayers))) }}
|
||||
{{- end }}
|
||||
{{- if not (kindIs "invalid" .Values.server.public) }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_PUBLIC" "value" (toString .Values.server.public)) }}
|
||||
{{- end }}
|
||||
{{- if not (kindIs "invalid" .Values.server.lobbySeconds) }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_LOBBY_SECONDS" "value" (toString (int .Values.server.lobbySeconds))) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.motd }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_MOTD" "value" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.logFormat }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_LOG_FORMAT" "value" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.instance }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_INSTANCE" "value" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.region }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_REGION" "value" .) }}
|
||||
{{- end }}
|
||||
{{- if not (kindIs "invalid" .Values.server.masterPublish) }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_MASTER_PUBLISH" "value" (toString .Values.server.masterPublish)) }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.password.existingSecret }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" .Values.server.password.existingSecret "key" .Values.server.password.key))) }}
|
||||
{{- else if .Values.server.password.value }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" $secret "key" .Values.server.password.key))) }}
|
||||
{{- end }}
|
||||
{{- if .Values.publisherKey.existingSecret }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_PUBLISHER_KEY" "valueFrom" (dict "secretKeyRef" (dict "name" .Values.publisherKey.existingSecret "key" .Values.publisherKey.key))) }}
|
||||
{{- else if .Values.publisherKey.value }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_PUBLISHER_KEY" "valueFrom" (dict "secretKeyRef" (dict "name" $secret "key" .Values.publisherKey.key))) }}
|
||||
{{- end }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_WEB_PORT" "value" (toString $webPort)) }}
|
||||
{{- if gt $webPort 0 }}
|
||||
{{- /* (the kubelet's probes reach the pod's own address, not its loopback) */}}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_WEB_BIND" "value" "0.0.0.0") }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_WEB_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" (include "opence-server.webSecret" .) "key" .Values.web.key))) }}
|
||||
{{- if .Values.web.existingSecret }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_WEB_MODERATOR_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" .Values.web.existingSecret "key" .Values.web.moderatorKey "optional" true))) }}
|
||||
{{- else if .Values.web.moderatorPassword }}
|
||||
{{- $env = append $env (dict "name" "HALO_SERVER_WEB_MODERATOR_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" $secret "key" .Values.web.moderatorKey))) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $probe := dict "httpGet" (dict "path" "/healthz" "port" "web") }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
spec:
|
||||
# One server owns the tunnel port and the address players reach it at.
|
||||
replicas: 1
|
||||
strategy:
|
||||
{{- toYaml .Values.strategy | nindent 4 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "opence-server.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "opence-server.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
# The server never calls the Kubernetes API.
|
||||
automountServiceAccountToken: false
|
||||
enableServiceLinks: false
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: opence-server
|
||||
image: {{ include "opence-server.image" . | quote }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
env:
|
||||
{{- toYaml $env | nindent 12 }}
|
||||
{{- with .Values.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tunnel
|
||||
containerPort: {{ .Values.network.tunnelPort }}
|
||||
protocol: UDP
|
||||
{{- if gt $webPort 0 }}
|
||||
- name: web
|
||||
containerPort: {{ $webPort }}
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
{{- if gt $webPort 0 }}
|
||||
{{- range $name := list "startup" "readiness" "liveness" }}
|
||||
{{- $p := index $.Values.probes $name }}
|
||||
{{- if $p.enabled }}
|
||||
{{ $name }}Probe:
|
||||
{{- toYaml (merge (omit $p "enabled") $probe) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: game-data
|
||||
mountPath: /data
|
||||
readOnly: true
|
||||
{{- with .Values.gameData.subPath }}
|
||||
subPath: {{ . }}
|
||||
{{- end }}
|
||||
# config.toml, publisher.key, the save root and its map cache, the logs
|
||||
- name: state
|
||||
mountPath: /state
|
||||
{{- if include "opence-server.hasCustomMaps" . }}
|
||||
- name: custom-maps
|
||||
mountPath: /custom_maps
|
||||
readOnly: true
|
||||
{{- with .Values.customMaps.subPath }}
|
||||
subPath: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
volumes:
|
||||
- name: game-data
|
||||
{{- include "opence-server.volumeSource" .Values.gameData | trim | nindent 10 }}
|
||||
- name: state
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "opence-server.stateClaim" . }}
|
||||
{{- else }}
|
||||
emptyDir:
|
||||
sizeLimit: {{ .Values.persistence.emptyDirSizeLimit }}
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
emptyDir:
|
||||
sizeLimit: 64Mi
|
||||
{{- if include "opence-server.hasCustomMaps" . }}
|
||||
- name: custom-maps
|
||||
{{- include "opence-server.volumeSource" .Values.customMaps | trim | nindent 10 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- range .Values.extraObjects }}
|
||||
---
|
||||
{{ tpl (toYaml .) $ }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,66 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
{{- $np := .Values.networkPolicy }}
|
||||
# In: the players' UDP on the tunnel port, and the web port from webFrom alone. Out: DNS, TCP to
|
||||
# the MQTT brokers and the master servers, UDP to the internet (STUN, the players' ports); nothing
|
||||
# on the private ranges.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ include "opence-server.fullname" . }}
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "opence-server.selectorLabels" . | nindent 6 }}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- ports:
|
||||
- protocol: UDP
|
||||
port: {{ .Values.network.tunnelPort }}
|
||||
{{- with $np.from }}
|
||||
from:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and $np.webFrom (gt (int .Values.web.port) 0) }}
|
||||
- ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.web.port }}
|
||||
from:
|
||||
{{- toYaml $np.webFrom | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $np.extraIngress }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
egress:
|
||||
- to:
|
||||
{{- toYaml $np.dns.to | nindent 8 }}
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
- protocol: TCP
|
||||
port: 53
|
||||
{{- if or $np.internet.tcpPorts $np.internet.udp }}
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: {{ $np.internet.cidr }}
|
||||
{{- with $np.internet.except }}
|
||||
except:
|
||||
{{- toYaml . | nindent 14 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
{{- range $np.internet.tcpPorts }}
|
||||
- protocol: TCP
|
||||
port: {{ . }}
|
||||
{{- end }}
|
||||
{{- if $np.internet.udp }}
|
||||
# every UDP port: STUN (19302, 3478) and the players' own
|
||||
- protocol: UDP
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $np.extraEgress }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{- $data := dict }}
|
||||
{{- if and (gt (int .Values.web.port) 0) (not .Values.web.existingSecret) }}
|
||||
{{- $password := .Values.web.password }}
|
||||
{{- if $password }}
|
||||
{{- if lt (len $password) 8 }}
|
||||
{{- fail "web.password: 8 characters or more (the server refuses a shorter one beyond loopback)" }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- /* made once, then kept from the Secret the release already has */}}
|
||||
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "opence-server.secretName" .) }}
|
||||
{{- if and $existing $existing.data (hasKey $existing.data .Values.web.key) }}
|
||||
{{- $password = index $existing.data .Values.web.key | b64dec }}
|
||||
{{- else }}
|
||||
{{- $password = randAlphaNum 24 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $_ := set $data .Values.web.key ($password | b64enc) }}
|
||||
{{- with .Values.web.moderatorPassword }}
|
||||
{{- if lt (len .) 8 }}
|
||||
{{- fail "web.moderatorPassword: 8 characters or more" }}
|
||||
{{- end }}
|
||||
{{- $_ := set $data $.Values.web.moderatorKey (. | b64enc) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and .Values.server.password.value (not .Values.server.password.existingSecret) }}
|
||||
{{- $_ := set $data .Values.server.password.key (.Values.server.password.value | b64enc) }}
|
||||
{{- end }}
|
||||
{{- if and .Values.publisherKey.value (not .Values.publisherKey.existingSecret) }}
|
||||
{{- if not (regexMatch "^[0-9a-f]{64}$" .Values.publisherKey.value) }}
|
||||
{{- fail "publisherKey.value: the 64 lower-case hex characters of the seed (halo --server --keygen)" }}
|
||||
{{- end }}
|
||||
{{- $_ := set $data .Values.publisherKey.key (.Values.publisherKey.value | b64enc) }}
|
||||
{{- end }}
|
||||
{{- if $data }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "opence-server.secretName" . }}
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- toYaml $data | nindent 2 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{- if and .Values.web.service.enabled (gt (int .Values.web.port) 0) }}
|
||||
# The web page, its API and the remote console, inside the cluster only: for an Ingress with TLS,
|
||||
# or kubectl port-forward.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "opence-server.fullname" . }}-web
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
{{- with .Values.web.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
{{- include "opence-server.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
- name: web
|
||||
port: {{ .Values.web.service.port }}
|
||||
targetPort: web
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
@@ -0,0 +1,40 @@
|
||||
# The tunnel port, UDP: the one port players need.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "opence-server.fullname" . }}
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
{{- with .Values.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if ne .Values.service.type "ClusterIP" }}
|
||||
{{- with .Values.service.externalTrafficPolicy }}
|
||||
externalTrafficPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
{{- with .Values.service.loadBalancerClass }}
|
||||
loadBalancerClass: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "opence-server.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
- name: tunnel
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: tunnel
|
||||
protocol: UDP
|
||||
{{- if and (ne .Values.service.type "ClusterIP") .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "opence-server.stateClaim" . }}
|
||||
labels:
|
||||
{{- include "opence-server.labels" . | nindent 4 }}
|
||||
{{- with .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- toYaml .Values.persistence.accessModes | nindent 4 }}
|
||||
{{- with .Values.persistence.storageClass }}
|
||||
storageClassName: {{ . }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,221 @@
|
||||
suite: deployment
|
||||
templates:
|
||||
- templates/deployment.yaml
|
||||
set:
|
||||
gameData.existingClaim: halo-maps
|
||||
tests:
|
||||
- it: refuses to render without game data, which is never in the image
|
||||
set:
|
||||
gameData.existingClaim: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "gameData: set existingClaim"
|
||||
|
||||
- it: mounts an existing claim read-only at /data
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.template.spec.volumes[0]'
|
||||
value: { name: game-data, persistentVolumeClaim: { claimName: halo-maps, readOnly: true } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].volumeMounts'
|
||||
content: { name: game-data, mountPath: /data, readOnly: true }
|
||||
|
||||
- it: mounts an NFS export read-only, with a subPath
|
||||
set:
|
||||
gameData: { existingClaim: "", nfs: { server: nfs.example.com, path: /halo }, subPath: xbox }
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.template.spec.volumes[0]'
|
||||
value: { name: game-data, nfs: { server: nfs.example.com, path: /halo, readOnly: true } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].volumeMounts'
|
||||
content: { name: game-data, mountPath: /data, readOnly: true, subPath: xbox }
|
||||
|
||||
- it: takes any other volume source
|
||||
set:
|
||||
gameData: { existingClaim: "", volume: { emptyDir: {} } }
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.template.spec.volumes[0]'
|
||||
value: { name: game-data, emptyDir: {} }
|
||||
|
||||
- it: runs one replica, replaced not rolled, hardened
|
||||
asserts:
|
||||
- equal: { path: spec.replicas, value: 1 }
|
||||
- equal: { path: spec.strategy.type, value: Recreate }
|
||||
- equal: { path: spec.template.spec.automountServiceAccountToken, value: false }
|
||||
- equal: { path: spec.template.spec.securityContext.runAsNonRoot, value: true }
|
||||
- equal: { path: spec.template.spec.securityContext.runAsUser, value: 10001 }
|
||||
- equal: { path: spec.template.spec.securityContext.seccompProfile.type, value: RuntimeDefault }
|
||||
- equal: { path: 'spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem', value: true }
|
||||
- equal: { path: 'spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation', value: false }
|
||||
- equal: { path: 'spec.template.spec.containers[0].securityContext.capabilities.drop', value: [ALL] }
|
||||
- equal: { path: spec.template.spec.nodeSelector, value: { kubernetes.io/os: linux, kubernetes.io/arch: amd64 } }
|
||||
- equal: { path: spec.template.spec.terminationGracePeriodSeconds, value: 15 }
|
||||
- exists: { path: 'spec.template.spec.containers[0].resources.limits.memory' }
|
||||
|
||||
- it: sets the server's paths and mode
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER, value: "1" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_CONFIG_FILE, value: /state/config.toml } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_DATA_ROOT, value: /data } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SAVE_ROOT, value: /state/saves } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_LOG_ROOT, value: /state/logs } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_CONSOLE, value: "false" } }
|
||||
|
||||
- it: maps the values to the HALO_ variables
|
||||
set:
|
||||
server:
|
||||
name: Test server
|
||||
rotation: [bloodgulch:ctf, "sidewinder:team_slayer+score=50"]
|
||||
maxPlayers: 24
|
||||
public: false
|
||||
lobbySeconds: 30
|
||||
motd: Hello
|
||||
logFormat: json
|
||||
instance: eu-1
|
||||
region: eu
|
||||
masterPublish: false
|
||||
network: { tunnelPort: 2303, publicAddress: "halo.example.com:2303" }
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_NAME, value: Test server } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_ROTATION, value: "bloodgulch:ctf, sidewinder:team_slayer+score=50" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_MAX_PLAYERS, value: "24" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_PUBLIC, value: "false" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_LOBBY_SECONDS, value: "30" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_MOTD, value: Hello } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_LOG_FORMAT, value: json } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_INSTANCE, value: eu-1 } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_REGION, value: eu } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_MASTER_PUBLISH, value: "false" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_NET_TUNNEL_PORT, value: "2303" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_NET_PUBLIC_ADDRESS, value: "halo.example.com:2303" } }
|
||||
- equal: { path: 'spec.template.spec.containers[0].ports[0]', value: { name: tunnel, containerPort: 2303, protocol: UDP } }
|
||||
|
||||
- it: leaves empty values to config.toml
|
||||
asserts:
|
||||
- notContains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_NAME, value: "" } }
|
||||
- notContains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_MOTD, value: "" } }
|
||||
- notContains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_NET_PUBLIC_ADDRESS, value: "" } }
|
||||
|
||||
- it: leaves the settings the values do not give to config.toml, sv_set and the web page
|
||||
asserts:
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_ROTATION")]' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_MAX_PLAYERS")]' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_PUBLIC")]' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_LOBBY_SECONDS")]' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_LOG_FORMAT")]' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].env[?(@.name == "HALO_SERVER_MASTER_PUBLISH")]' }
|
||||
|
||||
- it: sets a false or zero value that is given
|
||||
set:
|
||||
server: { public: false, masterPublish: false, lobbySeconds: 0 }
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_PUBLIC, value: "false" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_MASTER_PUBLISH, value: "false" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_LOBBY_SECONDS, value: "0" } }
|
||||
|
||||
- it: refuses a name longer than the game's 15 characters (the values' schema, or the template)
|
||||
set:
|
||||
server.name: "A name too long!"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "server.name|/server/name|15 characters"
|
||||
|
||||
- it: takes the web password from the chart's Secret, bound beyond loopback for the probes
|
||||
release: { name: opence-server }
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_WEB_PORT, value: "8080" } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_WEB_BIND, value: 0.0.0.0 } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].env'
|
||||
content: { name: HALO_SERVER_WEB_PASSWORD, valueFrom: { secretKeyRef: { name: opence-server-secrets, key: web-password } } }
|
||||
- contains: { path: 'spec.template.spec.containers[0].ports', content: { name: web, containerPort: 8080, protocol: TCP } }
|
||||
|
||||
- it: takes the passwords and the publisher key from existing Secrets
|
||||
set:
|
||||
web: { existingSecret: halo-web, key: admin, moderatorKey: moderator }
|
||||
server.password: { existingSecret: halo-join, key: password }
|
||||
publisherKey: { existingSecret: halo-publisher, key: seed }
|
||||
asserts:
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].env'
|
||||
content: { name: HALO_SERVER_WEB_PASSWORD, valueFrom: { secretKeyRef: { name: halo-web, key: admin } } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].env'
|
||||
content: { name: HALO_SERVER_WEB_MODERATOR_PASSWORD, valueFrom: { secretKeyRef: { name: halo-web, key: moderator, optional: true } } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].env'
|
||||
content: { name: HALO_SERVER_PASSWORD, valueFrom: { secretKeyRef: { name: halo-join, key: password } } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].env'
|
||||
content: { name: HALO_SERVER_PUBLISHER_KEY, valueFrom: { secretKeyRef: { name: halo-publisher, key: seed } } }
|
||||
|
||||
- it: probes GET /healthz on the web port
|
||||
asserts:
|
||||
- equal: { path: 'spec.template.spec.containers[0].startupProbe.httpGet', value: { path: /healthz, port: web } }
|
||||
- equal: { path: 'spec.template.spec.containers[0].readinessProbe.httpGet', value: { path: /healthz, port: web } }
|
||||
- equal: { path: 'spec.template.spec.containers[0].livenessProbe.httpGet', value: { path: /healthz, port: web } }
|
||||
- equal: { path: 'spec.template.spec.containers[0].startupProbe.failureThreshold', value: 60 }
|
||||
|
||||
- it: drops a probe that is turned off
|
||||
set:
|
||||
probes.liveness.enabled: false
|
||||
asserts:
|
||||
- notExists: { path: 'spec.template.spec.containers[0].livenessProbe' }
|
||||
- exists: { path: 'spec.template.spec.containers[0].readinessProbe' }
|
||||
|
||||
- it: has no web port, password or probes with web.port 0
|
||||
set:
|
||||
web.port: 0
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_WEB_PORT, value: "0" } }
|
||||
- notContains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_SERVER_WEB_BIND, value: 0.0.0.0 } }
|
||||
- lengthEqual: { path: 'spec.template.spec.containers[0].ports', count: 1 }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].startupProbe' }
|
||||
- notExists: { path: 'spec.template.spec.containers[0].livenessProbe' }
|
||||
|
||||
- it: puts extraEnv after the chart's variables, so it can override them
|
||||
set:
|
||||
extraEnv: [{ name: HALO_SERVER_LOBBY_SECONDS, value: "5" }]
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.template.spec.containers[0].env[-1:]'
|
||||
value: { name: HALO_SERVER_LOBBY_SECONDS, value: "5" }
|
||||
|
||||
- it: keeps the state in an emptyDir without persistence
|
||||
asserts:
|
||||
- contains: { path: spec.template.spec.volumes, content: { name: state, emptyDir: { sizeLimit: 1Gi } } }
|
||||
- lengthEqual: { path: spec.template.spec.volumes, count: 3 }
|
||||
|
||||
- it: uses the claim with persistence
|
||||
release: { name: opence-server }
|
||||
set:
|
||||
persistence.enabled: true
|
||||
asserts:
|
||||
- contains: { path: spec.template.spec.volumes, content: { name: state, persistentVolumeClaim: { claimName: opence-server-state } } }
|
||||
|
||||
- it: mounts a custom_maps claim read-only, with its variable
|
||||
set:
|
||||
customMaps: { existingClaim: halo-custom-maps, subPath: ce }
|
||||
asserts:
|
||||
- contains: { path: 'spec.template.spec.containers[0].env', content: { name: HALO_CUSTOM_MAPS_ROOT, value: /custom_maps } }
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content: { name: custom-maps, persistentVolumeClaim: { claimName: halo-custom-maps, readOnly: true } }
|
||||
- contains:
|
||||
path: 'spec.template.spec.containers[0].volumeMounts'
|
||||
content: { name: custom-maps, mountPath: /custom_maps, readOnly: true, subPath: ce }
|
||||
|
||||
- it: takes a tag with a digest, and lets digest replace it
|
||||
set:
|
||||
image.tag: build-206@sha256:1111111111111111111111111111111111111111111111111111111111111111
|
||||
image.digest: sha256:2222222222222222222222222222222222222222222222222222222222222222
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.template.spec.containers[0].image'
|
||||
value: ghcr.io/opencommunityedition/opence-server:build-206@sha256:2222222222222222222222222222222222222222222222222222222222222222
|
||||
|
||||
- it: uses the appVersion as the default tag
|
||||
asserts:
|
||||
- equal: { path: 'spec.template.spec.containers[0].image', value: "ghcr.io/opencommunityedition/opence-server:latest" }
|
||||
@@ -0,0 +1,39 @@
|
||||
suite: network policy
|
||||
templates:
|
||||
- templates/networkpolicy.yaml
|
||||
tests:
|
||||
- it: lets anyone reach the tunnel port, and nothing else in
|
||||
asserts:
|
||||
- equal: { path: spec.policyTypes, value: [Ingress, Egress] }
|
||||
- equal: { path: spec.ingress, value: [{ ports: [{ protocol: UDP, port: 2302 }] }] }
|
||||
|
||||
- it: allows DNS, TCP 1883 and 443 and all UDP to public addresses only
|
||||
asserts:
|
||||
- equal: { path: 'spec.egress[0].ports', value: [{ protocol: UDP, port: 53 }, { protocol: TCP, port: 53 }] }
|
||||
- equal: { path: 'spec.egress[1].to[0].ipBlock.cidr', value: 0.0.0.0/0 }
|
||||
- contains: { path: 'spec.egress[1].to[0].ipBlock.except', content: 10.0.0.0/8 }
|
||||
- contains: { path: 'spec.egress[1].to[0].ipBlock.except', content: 192.168.0.0/16 }
|
||||
- equal: { path: 'spec.egress[1].ports', value: [{ protocol: TCP, port: 1883 }, { protocol: TCP, port: 443 }, { protocol: UDP }] }
|
||||
|
||||
- it: lets webFrom reach the web port
|
||||
set:
|
||||
networkPolicy.webFrom: [{ namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: ingress-nginx } } }]
|
||||
asserts:
|
||||
- equal:
|
||||
path: 'spec.ingress[1]'
|
||||
value: { ports: [{ protocol: TCP, port: 8080 }], from: [{ namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: ingress-nginx } } }] }
|
||||
|
||||
- it: narrows the players' sources and follows the tunnel port
|
||||
set:
|
||||
network.tunnelPort: 2303
|
||||
networkPolicy.from: [{ ipBlock: { cidr: 198.51.100.0/24 } }]
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ingress
|
||||
value: [{ ports: [{ protocol: UDP, port: 2303 }], from: [{ ipBlock: { cidr: 198.51.100.0/24 } }] }]
|
||||
|
||||
- it: renders nothing when off
|
||||
set:
|
||||
networkPolicy.enabled: false
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
@@ -0,0 +1,21 @@
|
||||
suite: persistence
|
||||
templates:
|
||||
- templates/state-pvc.yaml
|
||||
release:
|
||||
name: opence-server
|
||||
tests:
|
||||
- it: makes no claim without persistence
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
- it: makes the state claim with persistence
|
||||
set:
|
||||
persistence: { enabled: true, size: 3Gi, storageClass: fast }
|
||||
asserts:
|
||||
- equal: { path: metadata.name, value: opence-server-state }
|
||||
- equal: { path: spec.resources.requests.storage, value: 3Gi }
|
||||
- equal: { path: spec.storageClassName, value: fast }
|
||||
- it: makes none for an existing claim
|
||||
set:
|
||||
persistence: { enabled: true, existingClaim: mine }
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
@@ -0,0 +1,48 @@
|
||||
suite: secret
|
||||
templates:
|
||||
- templates/secret.yaml
|
||||
release:
|
||||
name: opence-server
|
||||
tests:
|
||||
- it: makes a web password when none is given
|
||||
asserts:
|
||||
- hasDocuments: { count: 1 }
|
||||
- isKind: { of: Secret }
|
||||
- equal: { path: metadata.name, value: opence-server-secrets }
|
||||
- matchRegex: { path: data.web-password, pattern: "^[A-Za-z0-9+/]{32}$" }
|
||||
|
||||
- it: keeps a given web password, join password and publisher key
|
||||
set:
|
||||
web.password: correct-horse
|
||||
server.password.value: letmein
|
||||
publisherKey.value: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
||||
asserts:
|
||||
- equal: { path: data.web-password, value: Y29ycmVjdC1ob3JzZQ== }
|
||||
- equal: { path: data.password, value: bGV0bWVpbg== }
|
||||
- exists: { path: data.publisher-key }
|
||||
|
||||
- it: refuses a short web password
|
||||
set:
|
||||
web.password: short
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "8 characters or more"
|
||||
|
||||
- it: refuses a publisher key that is not 64 hex characters
|
||||
set:
|
||||
publisherKey.value: not-a-key
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "64 lower-case hex"
|
||||
|
||||
- it: makes none when every secret comes from elsewhere
|
||||
set:
|
||||
web.existingSecret: halo-web
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
|
||||
- it: makes none without a web port or secrets
|
||||
set:
|
||||
web.port: 0
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
@@ -0,0 +1,43 @@
|
||||
suite: service
|
||||
templates:
|
||||
- templates/service.yaml
|
||||
- templates/service-web.yaml
|
||||
release:
|
||||
name: opence-server
|
||||
tests:
|
||||
- it: exposes the tunnel port over UDP on a load balancer that keeps the players' addresses
|
||||
template: templates/service.yaml
|
||||
asserts:
|
||||
- equal: { path: metadata.name, value: opence-server }
|
||||
- equal: { path: spec.type, value: LoadBalancer }
|
||||
- equal: { path: spec.externalTrafficPolicy, value: Local }
|
||||
- equal: { path: 'spec.ports[0]', value: { name: tunnel, port: 2302, targetPort: tunnel, protocol: UDP } }
|
||||
|
||||
- it: ignores externalTrafficPolicy and nodePort on a ClusterIP Service
|
||||
template: templates/service.yaml
|
||||
set:
|
||||
service: { type: ClusterIP, nodePort: 30702 }
|
||||
asserts:
|
||||
- notExists: { path: spec.externalTrafficPolicy }
|
||||
- notExists: { path: 'spec.ports[0].nodePort' }
|
||||
|
||||
- it: sets a fixed node port
|
||||
template: templates/service.yaml
|
||||
set:
|
||||
service: { type: NodePort, nodePort: 30702 }
|
||||
asserts:
|
||||
- equal: { path: 'spec.ports[0].nodePort', value: 30702 }
|
||||
|
||||
- it: keeps the web port inside the cluster
|
||||
template: templates/service-web.yaml
|
||||
asserts:
|
||||
- equal: { path: metadata.name, value: opence-server-web }
|
||||
- equal: { path: spec.type, value: ClusterIP }
|
||||
- equal: { path: 'spec.ports[0]', value: { name: web, port: 8080, targetPort: web, protocol: TCP } }
|
||||
|
||||
- it: has no web Service without a web port
|
||||
template: templates/service-web.yaml
|
||||
set:
|
||||
web.port: 0
|
||||
asserts:
|
||||
- hasDocuments: { count: 0 }
|
||||
@@ -0,0 +1,445 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||
"title": "opence-server values",
|
||||
"description": "Strict where the chart defines the structure; free-form where values pass through to Kubernetes. values.yaml describes each value.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"definitions": {
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 65535
|
||||
},
|
||||
"volume": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"existingClaim": {
|
||||
"type": "string"
|
||||
},
|
||||
"nfs": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"server": {
|
||||
"type": "string"
|
||||
},
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"volume": {
|
||||
"type": "object"
|
||||
},
|
||||
"subPath": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"secretValue": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "string"
|
||||
},
|
||||
"existingSecret": {
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"probe": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"initialDelaySeconds": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"periodSeconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"timeoutSeconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"failureThreshold": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"successThreshold": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"terminationGracePeriodSeconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"global": {
|
||||
"type": "object"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"fullnameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"repository"
|
||||
],
|
||||
"properties": {
|
||||
"repository": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"tag": {
|
||||
"type": [
|
||||
"string",
|
||||
"number"
|
||||
]
|
||||
},
|
||||
"digest": {
|
||||
"type": "string",
|
||||
"pattern": "^(sha256:[0-9a-f]{64})?$"
|
||||
},
|
||||
"pullPolicy": {
|
||||
"enum": [
|
||||
"Always",
|
||||
"IfNotPresent",
|
||||
"Never"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"imagePullSecrets": {
|
||||
"type": "array"
|
||||
},
|
||||
"gameData": {
|
||||
"$ref": "#/definitions/volume"
|
||||
},
|
||||
"customMaps": {
|
||||
"$ref": "#/definitions/volume"
|
||||
},
|
||||
"server": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 15,
|
||||
"pattern": "^[ -~]*$"
|
||||
},
|
||||
"rotation": {
|
||||
"type": "array",
|
||||
"maxItems": 64,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"maxPlayers": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 2,
|
||||
"maximum": 127
|
||||
},
|
||||
"public": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"lobbySeconds": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 0,
|
||||
"maximum": 300
|
||||
},
|
||||
"motd": {
|
||||
"type": "string",
|
||||
"maxLength": 127
|
||||
},
|
||||
"logFormat": {
|
||||
"enum": [
|
||||
"",
|
||||
"text",
|
||||
"json",
|
||||
null
|
||||
]
|
||||
},
|
||||
"instance": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9_-]{0,32}$"
|
||||
},
|
||||
"region": {
|
||||
"type": "string",
|
||||
"maxLength": 16
|
||||
},
|
||||
"masterPublish": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"password": {
|
||||
"$ref": "#/definitions/secretValue"
|
||||
}
|
||||
}
|
||||
},
|
||||
"publisherKey": {
|
||||
"$ref": "#/definitions/secretValue"
|
||||
},
|
||||
"web": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 65535
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"existingSecret": {
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"moderatorPassword": {
|
||||
"type": "string"
|
||||
},
|
||||
"moderatorKey": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"service": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"port": {
|
||||
"$ref": "#/definitions/port"
|
||||
},
|
||||
"annotations": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"tunnelPort": {
|
||||
"$ref": "#/definitions/port"
|
||||
},
|
||||
"publicAddress": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extraEnv": {
|
||||
"type": "array"
|
||||
},
|
||||
"persistence": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"existingClaim": {
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"type": "string"
|
||||
},
|
||||
"storageClass": {
|
||||
"type": "string"
|
||||
},
|
||||
"accessModes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"annotations": {
|
||||
"type": "object"
|
||||
},
|
||||
"emptyDirSizeLimit": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"service": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"ClusterIP",
|
||||
"NodePort",
|
||||
"LoadBalancer"
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"$ref": "#/definitions/port"
|
||||
},
|
||||
"nodePort": {
|
||||
"type": [
|
||||
"string",
|
||||
"integer"
|
||||
]
|
||||
},
|
||||
"annotations": {
|
||||
"type": "object"
|
||||
},
|
||||
"labels": {
|
||||
"type": "object"
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"enum": [
|
||||
"",
|
||||
"Cluster",
|
||||
"Local"
|
||||
]
|
||||
},
|
||||
"loadBalancerClass": {
|
||||
"type": "string"
|
||||
},
|
||||
"loadBalancerSourceRanges": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "object"
|
||||
},
|
||||
"resources": {
|
||||
"type": "object"
|
||||
},
|
||||
"nodeSelector": {
|
||||
"type": "object"
|
||||
},
|
||||
"affinity": {
|
||||
"type": "object"
|
||||
},
|
||||
"tolerations": {
|
||||
"type": "array"
|
||||
},
|
||||
"priorityClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"podAnnotations": {
|
||||
"type": "object"
|
||||
},
|
||||
"podLabels": {
|
||||
"type": "object"
|
||||
},
|
||||
"terminationGracePeriodSeconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"podSecurityContext": {
|
||||
"type": "object"
|
||||
},
|
||||
"securityContext": {
|
||||
"type": "object"
|
||||
},
|
||||
"probes": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"startup": {
|
||||
"$ref": "#/definitions/probe"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/probe"
|
||||
},
|
||||
"liveness": {
|
||||
"$ref": "#/definitions/probe"
|
||||
}
|
||||
}
|
||||
},
|
||||
"networkPolicy": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"from": {
|
||||
"type": "array"
|
||||
},
|
||||
"webFrom": {
|
||||
"type": "array"
|
||||
},
|
||||
"dns": {
|
||||
"type": "object"
|
||||
},
|
||||
"internet": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cidr": {
|
||||
"type": "string"
|
||||
},
|
||||
"except": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"tcpPorts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/port"
|
||||
}
|
||||
},
|
||||
"udp": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extraIngress": {
|
||||
"type": "array"
|
||||
},
|
||||
"extraEgress": {
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extraObjects": {
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
# opence-server: the OpenCE dedicated server (docs/dedicated_server.md). One replica: the server
|
||||
# owns its tunnel port and the address players reach it at.
|
||||
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
image:
|
||||
repository: ghcr.io/opencommunityedition/opence-server
|
||||
# Empty: the chart's appVersion (latest). A release's tag (build-206) or sha-<commit> pins it;
|
||||
# <tag>@sha256:... as Argo CD Image Updater writes it works too.
|
||||
tag: ""
|
||||
# sha256:... ; replaces any digest in tag.
|
||||
digest: ""
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
imagePullSecrets: []
|
||||
|
||||
# The game data: the folder that holds maps/ (and custom_maps/, gametypes/ and init.txt if you have
|
||||
# them), from your own copy of the game. It is never in the image. Mounted read-only at /data
|
||||
# (HALO_DATA_ROOT). One source is required.
|
||||
gameData:
|
||||
# An existing PersistentVolumeClaim.
|
||||
existingClaim: ""
|
||||
# Or an NFS export.
|
||||
nfs:
|
||||
server: ""
|
||||
path: ""
|
||||
# Or any other volume source, as in a pod's volumes (without the name), e.g.
|
||||
# {hostPath: {path: /srv/halo, type: Directory}}. Without maps/ui.map and the rotation's maps the
|
||||
# server exits with code 2 and says which maps it looked for, and the pod goes into
|
||||
# CrashLoopBackOff.
|
||||
volume: {}
|
||||
# The folder within the volume that holds maps/. Empty: the volume's root.
|
||||
subPath: ""
|
||||
|
||||
# A custom_maps folder of its own (Custom Edition maps with bitmaps.map, sounds.map and loc.map),
|
||||
# mounted read-only at /custom_maps (HALO_CUSTOM_MAPS_ROOT). Optional: without one the server uses
|
||||
# gameData's custom_maps/.
|
||||
customMaps:
|
||||
existingClaim: ""
|
||||
nfs:
|
||||
server: ""
|
||||
path: ""
|
||||
volume: {}
|
||||
subPath: ""
|
||||
|
||||
# The server's settings, as its HALO_* environment variables (docs/dedicated_server.md and
|
||||
# port/linux/README.md, "Dedicated server"). A value given here wins over config.toml, and sv_set
|
||||
# and the web page's settings cannot change it. Each is unset by default (empty, or null): the
|
||||
# setting is then config.toml's, or the server's default (named below), and can be changed from
|
||||
# the web page.
|
||||
server:
|
||||
# server.name: 15 characters of printable ASCII (default "OpenCE Server").
|
||||
name: ""
|
||||
# server.rotation: map[:gametype[+rule=value...]] entries, played in turn, e.g.
|
||||
# [bloodgulch:ctf, sidewinder:team_slayer, prisoner:slayer] (the default).
|
||||
rotation: []
|
||||
# server.max_players: 2 to 127 (default 16).
|
||||
maxPlayers: null
|
||||
# server.public: list the server in everyone's server browser (default true).
|
||||
public: null
|
||||
# server.lobby_seconds (default 15).
|
||||
lobbySeconds: null
|
||||
# server.motd: a notice each player is shown on joining.
|
||||
motd: ""
|
||||
# server.log_format: text or json (default text).
|
||||
logFormat: ""
|
||||
# server.instance and server.region, as the master servers list them.
|
||||
instance: ""
|
||||
region: ""
|
||||
# server.master_publish: publish the server to the official master servers (needs a publisher
|
||||
# key, below; default true).
|
||||
masterPublish: null
|
||||
# server.password: the password the server browser asks for. value, or a key of an existing
|
||||
# Secret; empty for none.
|
||||
password:
|
||||
value: ""
|
||||
existingSecret: ""
|
||||
key: password
|
||||
|
||||
# The master servers' publisher key (HALO_SERVER_PUBLISHER_KEY): the 64 hex characters of the seed
|
||||
# halo --server --keygen writes. value, or a key of an existing Secret; empty: the state volume's
|
||||
# publisher.key, if there is one.
|
||||
publisherKey:
|
||||
value: ""
|
||||
existingSecret: ""
|
||||
key: publisher-key
|
||||
|
||||
# The web page, its API and the remote console (server.web_port), on which the probes ask
|
||||
# GET /healthz. 0 turns them off, and the probes with them.
|
||||
web:
|
||||
port: 8080
|
||||
# The admin password (server.web_password, 8 characters or more), from existingSecret's key, else
|
||||
# from password, else made at the first install and kept in the chart's Secret. The made one is
|
||||
# found again with lookup on upgrades, which helm template and GitOps tools (Argo CD, Flux's
|
||||
# dry runs) cannot do: they make a new one at each render. Give password or existingSecret
|
||||
# there (README.md, "Web password").
|
||||
password: ""
|
||||
existingSecret: ""
|
||||
key: web-password
|
||||
# server.web_moderator_password, from the same Secret's moderatorKey when it has one.
|
||||
moderatorPassword: ""
|
||||
moderatorKey: web-moderator-password
|
||||
# A ClusterIP Service for the web port, for an Ingress (with TLS) or kubectl port-forward.
|
||||
service:
|
||||
enabled: true
|
||||
port: 8080
|
||||
annotations: {}
|
||||
|
||||
network:
|
||||
# network.tunnel_port: the UDP port of internet play, which the Service exposes.
|
||||
tunnelPort: 2302
|
||||
# network.public_address: host[:port] players reach the tunnel port at, when the cluster is behind
|
||||
# a NAT that STUN cannot see through. Empty: what STUN finds.
|
||||
publicAddress: ""
|
||||
|
||||
# More environment variables, as in a pod spec ({name, value} or {name, valueFrom}); they come after
|
||||
# the chart's, so the same name overrides it.
|
||||
extraEnv: []
|
||||
|
||||
# /state: config.toml (HALO_CONFIG_FILE), publisher.key, the save root with its map cache (about
|
||||
# 115 MB for the multiplayer maps), the logs. Without persistence an emptyDir: the cache is built
|
||||
# again at each start, and settings changed from the web page are lost.
|
||||
persistence:
|
||||
enabled: false
|
||||
existingClaim: ""
|
||||
size: 2Gi
|
||||
storageClass: ""
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
annotations: {}
|
||||
emptyDirSizeLimit: 1Gi
|
||||
|
||||
# The tunnel port's Service. Players reach it from outside the cluster, so a real deployment needs
|
||||
# LoadBalancer or NodePort.
|
||||
service:
|
||||
type: LoadBalancer
|
||||
port: 2302
|
||||
nodePort: ""
|
||||
annotations: {}
|
||||
labels: {}
|
||||
# Local keeps the players' own addresses (no SNAT to a node), which bans and the server's limits
|
||||
# rely on.
|
||||
externalTrafficPolicy: Local
|
||||
loadBalancerClass: ""
|
||||
loadBalancerSourceRanges: []
|
||||
|
||||
strategy:
|
||||
type: Recreate
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 192Mi
|
||||
limits:
|
||||
memory: 600Mi
|
||||
|
||||
# The image is 32-bit x86 Linux code, which runs on amd64 nodes only.
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
kubernetes.io/arch: amd64
|
||||
affinity: {}
|
||||
tolerations: []
|
||||
priorityClassName: ""
|
||||
|
||||
podAnnotations: {}
|
||||
podLabels: {}
|
||||
|
||||
# SIGTERM ends the game in progress, tells the players and exits 0; a second signal, or 5 seconds
|
||||
# on, exits at once.
|
||||
terminationGracePeriodSeconds: 15
|
||||
|
||||
podSecurityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 10001
|
||||
runAsGroup: 10001
|
||||
fsGroup: 10001
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
|
||||
# GET /healthz on the web port: 200 while the server hosts (lobby, loading, playing, postgame) and
|
||||
# its frames run. Each probe's fields override these; enabled: false drops it.
|
||||
probes:
|
||||
startup:
|
||||
enabled: true
|
||||
periodSeconds: 2
|
||||
failureThreshold: 60
|
||||
timeoutSeconds: 2
|
||||
readiness:
|
||||
enabled: true
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
timeoutSeconds: 2
|
||||
liveness:
|
||||
enabled: true
|
||||
periodSeconds: 20
|
||||
failureThreshold: 3
|
||||
timeoutSeconds: 3
|
||||
|
||||
networkPolicy:
|
||||
enabled: true
|
||||
# Who may reach the tunnel port. Empty: anyone (players are on the internet).
|
||||
from: []
|
||||
# Who may reach the web port, as NetworkPolicy peers (an Ingress controller's namespace, say).
|
||||
# Empty: no pod; kubectl port-forward and the kubelet's probes still reach it.
|
||||
webFrom: []
|
||||
dns:
|
||||
to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
# The internet: TCP to the MQTT brokers (1883) and the master servers (443), and UDP to anywhere
|
||||
# (STUN, and the players' own ports). The private ranges are excepted.
|
||||
internet:
|
||||
cidr: 0.0.0.0/0
|
||||
except:
|
||||
- 10.0.0.0/8
|
||||
- 172.16.0.0/12
|
||||
- 192.168.0.0/16
|
||||
- 100.64.0.0/10
|
||||
- 169.254.0.0/16
|
||||
tcpPorts:
|
||||
- 1883
|
||||
- 443
|
||||
udp: true
|
||||
extraIngress: []
|
||||
extraEgress: []
|
||||
|
||||
# More objects to render with the release (templated).
|
||||
extraObjects: []
|
||||
@@ -0,0 +1,31 @@
|
||||
# init.txt: commands a dedicated server runs once at its start, one a line,
|
||||
# as if typed at its console (docs/dedicated_server.md, "Commands"). Copy
|
||||
# this file to init.txt in the data folder (server.init_file), and take the
|
||||
# "# " off the lines you want. Lines starting with # or ; are comments.
|
||||
#
|
||||
# Settings are better given in config.toml or as HALO_* variables; these are
|
||||
# for what changes from one start to the next.
|
||||
|
||||
# The rotation, replacing server.rotation (and written to it):
|
||||
# sv_rotation_set bloodgulch:ctf, sidewinder:team_slayer+score=50, hangemhigh:king_moving
|
||||
# sv_rotation_add prisoner:slayer+time=10
|
||||
# sv_rotation_begin 2
|
||||
|
||||
# The game's name, players and notice (sv_set of the server.* settings):
|
||||
# sv_name My server
|
||||
# sv_maxplayers 12
|
||||
# sv_motd Welcome. Be nice; admins are watching.
|
||||
# sv_public 1
|
||||
# sv_password secret
|
||||
|
||||
# Any setting the server lists in sv_settings:
|
||||
# sv_set server.lobby_seconds 20
|
||||
# sv_set server.empty_seconds 60
|
||||
|
||||
# A first game other than the rotation's, which goes on after it:
|
||||
# sv_map bloodgulch ctf_classic
|
||||
|
||||
# The state of the server, in the log:
|
||||
# sv_status
|
||||
|
||||
# The game's own console commands run too, with the owner's role.
|
||||
@@ -0,0 +1,40 @@
|
||||
# The dedicated server on MCSManager
|
||||
|
||||
`mcsmanager-config.json` holds two MCSManager quick-install entries for the
|
||||
dedicated server (`docs/dedicated_server.md`). Each unzips a release's
|
||||
`halo-linux-release.zip` into the instance's folder and runs
|
||||
`./halo --server` there, stopped with `quit`.
|
||||
|
||||
| Entry | How it runs |
|
||||
| --- | --- |
|
||||
| Host | On the node itself, which needs the 32-bit C runtime (Debian and Ubuntu: `dpkg --add-architecture i386 && apt install libc6:i386`) |
|
||||
| Docker | In a container of `ghcr.io/ptero-eggs/games:source` (Debian 12 with the 32-bit libraries), the instance's folder mounted at `/workspace` |
|
||||
|
||||
## Using it
|
||||
|
||||
1. Add the entries to the node's quick-install list, and create an
|
||||
instance from one.
|
||||
2. Upload the `maps/` folder of your own copy of the game into the
|
||||
instance's folder. Without `maps/ui.map` and the rotation's maps the
|
||||
server exits with code 2 and says which maps it looked for.
|
||||
3. Start it.
|
||||
|
||||
## Folders
|
||||
|
||||
The Docker entry's container is made again at each start, so it sets
|
||||
`HALO_SAVE_ROOT=/workspace/saves` and `HALO_LOG_ROOT=/workspace/logs`: the
|
||||
save root with the map cache (about 115 MB, built at the first start) and
|
||||
the logs stay in the instance's folder rather than in the container. The
|
||||
host entry keeps the save root in the home folder of the daemon's user
|
||||
(`~/.local/share/halo-linux`), which every host instance of that user
|
||||
shares; give each its own with
|
||||
`HALO_SAVE_ROOT=saves` (in the instance's environment, or as
|
||||
`env HALO_SAVE_ROOT=saves ./halo --server` for its start command).
|
||||
`config.toml` is written beside `halo` at the first start.
|
||||
|
||||
## Ports
|
||||
|
||||
UDP 2302 is the tunnel port, the one players need; the web page, its API
|
||||
and the remote console are on 127.0.0.1:8080. A second instance on the node
|
||||
needs ports of its own: `HALO_NET_TUNNEL_PORT` and `HALO_SERVER_WEB_PORT`,
|
||||
and for the Docker entry its published ports to match.
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"_comment": "MCSManager quick-install entries for the OpenCE dedicated server (docs/dedicated_server.md). Each package unzips the release into the instance's folder; put the maps/ folder of your own copy of the game beside halo before the first start. Settings: config.toml beside halo, written at the first start, or HALO_* variables.",
|
||||
"languages": [
|
||||
{
|
||||
"label": "English",
|
||||
"value": "en_us"
|
||||
}
|
||||
],
|
||||
"packages": [
|
||||
{
|
||||
"language": "en_us",
|
||||
"platform": "Linux",
|
||||
"title": "OpenCE Dedicated Server",
|
||||
"category": "Halo: Combat Evolved",
|
||||
"runtime": "Linux x86-64 with 32-bit libraries",
|
||||
"hardware": "1 CPU core, 600 MB of memory",
|
||||
"size": "45 MB, and the game data you upload",
|
||||
"author": "OpenCE",
|
||||
"targetLink": "https://github.com/OpenCommunityEdition/OpenCE/releases/latest/download/halo-linux-release.zip",
|
||||
"description": "The dedicated server run on the node itself, which needs the 32-bit C runtime (Debian and Ubuntu: dpkg --add-architecture i386 && apt install libc6:i386). Open UDP 2302; the web page is on http://127.0.0.1:8080/.",
|
||||
"remark": "Host",
|
||||
"setupInfo": {
|
||||
"nickname": "OpenCE Dedicated Server",
|
||||
"startCommand": "./halo --server",
|
||||
"stopCommand": "quit",
|
||||
"ie": "utf-8",
|
||||
"oe": "utf-8",
|
||||
"type": "universal",
|
||||
"tag": [
|
||||
"halo",
|
||||
"opence"
|
||||
],
|
||||
"processType": "general",
|
||||
"updateCommand": "",
|
||||
"crlf": 1,
|
||||
"actionCommandList": [
|
||||
{
|
||||
"name": "Status",
|
||||
"command": "sv_status"
|
||||
},
|
||||
{
|
||||
"name": "Players",
|
||||
"command": "sv_players"
|
||||
},
|
||||
{
|
||||
"name": "Next map",
|
||||
"command": "sv_map_next"
|
||||
},
|
||||
{
|
||||
"name": "Reload settings",
|
||||
"command": "sv_reload"
|
||||
}
|
||||
],
|
||||
"eventTask": {
|
||||
"autoStart": false,
|
||||
"autoRestart": true,
|
||||
"ignore": false
|
||||
},
|
||||
"terminalOption": {
|
||||
"haveColor": false,
|
||||
"pty": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"language": "en_us",
|
||||
"platform": "Linux",
|
||||
"title": "OpenCE Dedicated Server",
|
||||
"category": "Halo: Combat Evolved",
|
||||
"runtime": "Linux x86-64 with 32-bit libraries",
|
||||
"hardware": "1 CPU core, 600 MB of memory",
|
||||
"size": "45 MB, and the game data you upload",
|
||||
"author": "OpenCE",
|
||||
"targetLink": "https://github.com/OpenCommunityEdition/OpenCE/releases/latest/download/halo-linux-release.zip",
|
||||
"description": "The dedicated server in a container of ghcr.io/ptero-eggs/games:source (Debian 12 with the 32-bit libraries), the instance's folder mounted as its working folder; the save root (with the map cache) and the logs are kept in it, as the container is made again at each start. Publishes UDP 2302 and the web page on the node's 127.0.0.1:8080 (each instance on a node needs ports of its own).",
|
||||
"remark": "Docker",
|
||||
"setupInfo": {
|
||||
"nickname": "OpenCE Dedicated Server",
|
||||
"startCommand": "./halo --server",
|
||||
"stopCommand": "quit",
|
||||
"ie": "utf-8",
|
||||
"oe": "utf-8",
|
||||
"type": "universal",
|
||||
"tag": [
|
||||
"halo",
|
||||
"opence"
|
||||
],
|
||||
"processType": "docker",
|
||||
"updateCommand": "",
|
||||
"crlf": 1,
|
||||
"actionCommandList": [
|
||||
{
|
||||
"name": "Status",
|
||||
"command": "sv_status"
|
||||
},
|
||||
{
|
||||
"name": "Players",
|
||||
"command": "sv_players"
|
||||
},
|
||||
{
|
||||
"name": "Next map",
|
||||
"command": "sv_map_next"
|
||||
},
|
||||
{
|
||||
"name": "Reload settings",
|
||||
"command": "sv_reload"
|
||||
}
|
||||
],
|
||||
"eventTask": {
|
||||
"autoStart": false,
|
||||
"autoRestart": true,
|
||||
"ignore": false
|
||||
},
|
||||
"terminalOption": {
|
||||
"haveColor": false,
|
||||
"pty": false
|
||||
},
|
||||
"docker": {
|
||||
"image": "ghcr.io/ptero-eggs/games:source",
|
||||
"ports": [
|
||||
"2302:2302/udp",
|
||||
"127.0.0.1:8080:8080/tcp"
|
||||
],
|
||||
"extraVolumes": [],
|
||||
"networkMode": "bridge",
|
||||
"networkAliases": [],
|
||||
"env": [
|
||||
"HALO_SERVER_WEB_BIND=0.0.0.0",
|
||||
"HALO_SAVE_ROOT=/workspace/saves",
|
||||
"HALO_LOG_ROOT=/workspace/logs"
|
||||
],
|
||||
"memory": 600,
|
||||
"workingDir": "/workspace/",
|
||||
"changeWorkdir": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
# The dedicated server on Pterodactyl and Pelican
|
||||
|
||||
`egg-opence-dedicated-server.json` is an egg (`PTDL_v2`) that installs a
|
||||
release of OpenCE from GitHub and runs it as a dedicated server
|
||||
(`docs/dedicated_server.md`). Pelican imports the same file.
|
||||
|
||||
## Importing it
|
||||
|
||||
1. Admin > Nests (Pelican: Eggs) > Import Egg, and choose the file.
|
||||
2. Create a server with the egg. Its primary allocation is the tunnel port
|
||||
(`network.tunnel_port`, UDP): the one port players need, from 1025 up
|
||||
(the container cannot bind lower ports).
|
||||
3. Upload the game data: the `maps/` folder of your own copy of the game
|
||||
(port/linux/README.md, "Game data"), into the server's folder over SFTP
|
||||
(the panel's SFTP details, on the Settings tab). Without `maps/ui.map`
|
||||
and the rotation's maps the server stops at once with exit code 2 and
|
||||
says which maps it looked for.
|
||||
4. Start it. The panel shows it running once it prints its ready line
|
||||
(`server: ready`, or `"msg":"ready (` with `server.log_format = "json"`).
|
||||
|
||||
## Files
|
||||
|
||||
| Path (in `/home/container`) | What |
|
||||
| --- | --- |
|
||||
| `halo`, `halo-server`, `libSDL3.so.0`, `brokers.txt`, `masters.txt`, the licences | The release (replaced on Reinstall) |
|
||||
| `maps/` | The game data (yours) |
|
||||
| `custom_maps/` | Custom Edition maps, with `bitmaps.map`, `sounds.map` and `loc.map` (shared with players who join) |
|
||||
| `gametypes/*.toml` | Gametypes of your own (the release adds examples, never replacing yours) |
|
||||
| `init.txt` | Commands run at each start (`init.txt.example` has examples) |
|
||||
| `config.toml` | Every setting, written at the first start |
|
||||
| `publisher.key` | The master servers' key: made by `./halo --server --keygen` on any machine with the release and uploaded, or given as the Publisher key variable instead |
|
||||
| `logs/` | `debug.txt`, `bans.txt`, `cheaters.txt` |
|
||||
|
||||
Reinstall (Settings tab) downloads the release again, the one the Release
|
||||
variable names, and keeps `config.toml`, `init.txt`, `publisher.key`,
|
||||
`gametypes/`, `custom_maps/`, `maps/` and `logs/`.
|
||||
|
||||
## Variables
|
||||
|
||||
Every variable is one of the server's settings, by its environment name
|
||||
(docs/dedicated_server.md and port/linux/README.md, "Dedicated server"). A
|
||||
variable wins over `config.toml`, and the web page's settings cannot
|
||||
change it.
|
||||
|
||||
| Variable | Setting |
|
||||
| --- | --- |
|
||||
| Release (`OPENCE_RELEASE`) | `latest` or a tag (`build-206`); used by Reinstall |
|
||||
| Server name (`HALO_SERVER_NAME`) | `server.name`, 15 characters |
|
||||
| Rotation (`HALO_SERVER_ROTATION`) | `server.rotation` |
|
||||
| Max players (`HALO_SERVER_MAX_PLAYERS`) | `server.max_players` |
|
||||
| Join password (`HALO_SERVER_PASSWORD`) | `server.password` |
|
||||
| Public (`HALO_SERVER_PUBLIC`) | `server.public` |
|
||||
| Message of the day (`HALO_SERVER_MOTD`) | `server.motd` |
|
||||
| Lobby seconds (`HALO_SERVER_LOBBY_SECONDS`) | `server.lobby_seconds` |
|
||||
| Web UI port (`HALO_SERVER_WEB_PORT`) | `server.web_port`; 0 for none |
|
||||
| Web UI password (`HALO_SERVER_WEB_PASSWORD`) | `server.web_password` |
|
||||
| Public address (`HALO_NET_PUBLIC_ADDRESS`) | `network.public_address` |
|
||||
| Publisher key (`HALO_SERVER_PUBLISHER_KEY`) | The master servers' key itself, in place of `publisher.key` |
|
||||
| Instance name (`HALO_SERVER_INSTANCE`) | `server.instance` |
|
||||
| Region (`HALO_SERVER_REGION`) | `server.region` |
|
||||
| Log format (`HALO_SERVER_LOG_FORMAT`) | `server.log_format` |
|
||||
|
||||
The startup command sets `HALO_NET_TUNNEL_PORT` to the primary allocation's
|
||||
port and `HALO_LOG_ROOT` to `logs/`. Two variables are the administrator's
|
||||
only: Web UI bind (`0.0.0.0`, as the allocation's address is the node's,
|
||||
not the container's) and GitHub repository (`OpenCommunityEdition/OpenCE`).
|
||||
|
||||
## The web page
|
||||
|
||||
The admin page, its API and the remote console need a second allocation:
|
||||
the node's administrator adds one to the server (or raises its allocation
|
||||
limit so the owner can, on the Network tab). Give its port as Web UI port
|
||||
and a password of 8 characters or more as Web UI password, restart, and
|
||||
open `http://<allocation address>:<port>/`. The page has no TLS of its own:
|
||||
put it behind a reverse proxy with HTTPS for anything but a private network.
|
||||
|
||||
## Stopping and restarting
|
||||
|
||||
The panel's Stop sends SIGINT, which the server takes as SIGTERM: the game
|
||||
in progress goes to its postgame, the players are told, the listing is
|
||||
withdrawn, and it exits 0. The console's `quit` command does the same, but
|
||||
Wings counts an exit it did not ask for as a crash and starts the server
|
||||
again; use Stop. `sv_restart` exits with code 5, which Wings also takes as a
|
||||
crash and restarts, which is what it asks for.
|
||||
|
||||
Updates: `server.auto_update` is for servers that own their files; on a
|
||||
panel, change the Release variable (or keep `latest`) and Reinstall, by hand
|
||||
or as a schedule.
|
||||
|
||||
## Checking the egg
|
||||
|
||||
`python tools/egg_build.py` copies `install.sh` into the egg and checks it;
|
||||
`python -m pytest -q tools/test_egg.py` checks the egg and runs `install.sh`
|
||||
in a `debian:bookworm-slim` container against a release served locally.
|
||||
@@ -0,0 +1,203 @@
|
||||
{
|
||||
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||
"meta": {
|
||||
"version": "PTDL_v2",
|
||||
"update_url": null
|
||||
},
|
||||
"exported_at": "2026-10-24T00:00:00+00:00",
|
||||
"name": "OpenCE Dedicated Server",
|
||||
"author": "opence@halocombatevolved.com",
|
||||
"description": "A dedicated server of OpenCE, the port of Halo: Combat Evolved: hosts multiplayer games one after another, with no window, sound or player of its own. Installs a release from GitHub. The game data is yours to upload: put the maps/ folder of your own copy of the game in the server's folder over SFTP; the server does not start without it.",
|
||||
"features": [],
|
||||
"docker_images": {
|
||||
"Debian 12 with 32-bit libraries (Pterodactyl)": "ghcr.io/ptero-eggs/games:source",
|
||||
"Debian 12 with 32-bit libraries (Pelican)": "ghcr.io/pelican-eggs/games:source"
|
||||
},
|
||||
"file_denylist": [],
|
||||
"startup": "HALO_NET_TUNNEL_PORT={{SERVER_PORT}} HALO_LOG_ROOT=/home/container/logs ./halo --server",
|
||||
"config": {
|
||||
"files": "{}",
|
||||
"startup": "{\r\n \"done\": [\r\n \"server: ready\",\r\n \"\\\"msg\\\":\\\"ready (\"\r\n ]\r\n}",
|
||||
"logs": "{}",
|
||||
"stop": "^C"
|
||||
},
|
||||
"scripts": {
|
||||
"installation": {
|
||||
"script": "#!/bin/bash\n# The OpenCE dedicated server egg's installation script (Pterodactyl and\n# Pelican), run as root in ghcr.io/ptero-eggs/installers:debian with the\n# server's folder at /mnt/server. tools/egg_build.py copies it into\n# egg-opence-dedicated-server.json.\n#\n# OPENCE_RELEASE: \"latest\" or a release tag (build-206).\n# OPENCE_REPOSITORY: the GitHub repository (owner/name) to download from.\n#\n# A reinstall replaces the release's files and keeps the owner's:\n# config.toml, init.txt, publisher.key, gametypes/, custom_maps/, maps/ and\n# logs/. The panel ignores this script's exit code, so each failure says\n# what went wrong.\n\nset -u\n\nSERVER_DIR=\"${SERVER_DIR:-/mnt/server}\"\nRELEASE=\"${OPENCE_RELEASE:-latest}\"\nREPOSITORY=\"${OPENCE_REPOSITORY:-OpenCommunityEdition/OpenCE}\"\nGITHUB_URL=\"${OPENCE_GITHUB_URL:-https://github.com}\"\nGITHUB_API=\"${OPENCE_GITHUB_API:-https://api.github.com}\"\nASSET=halo-linux-release.zip\n\nfail() {\n\techo \"INSTALL FAILED: $*\"\n\texit 1\n}\n\nif ! [[ \"$REPOSITORY\" =~ ^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$ ]]; then\n\tfail \"the repository \\\"$REPOSITORY\\\" is not owner/name\"\nfi\nif [ -z \"$RELEASE\" ] || [ \"$RELEASE\" = latest ]; then\n\t# (no API call, so no rate limit)\n\turl=\"$GITHUB_URL/$REPOSITORY/releases/latest/download/$ASSET\"\nelse\n\tif ! [[ \"$RELEASE\" =~ ^[A-Za-z0-9._-]+$ ]]; then\n\t\tfail \"the release \\\"$RELEASE\\\" is not a tag name (build-206) or latest\"\n\tfi\n\techo \"Looking up release $RELEASE of $REPOSITORY\"\n\trelease_json=\"$(curl -fsSL --retry 3 -H 'Accept: application/vnd.github+json' \\\n\t\t\"$GITHUB_API/repos/$REPOSITORY/releases/tags/$RELEASE\")\" \\\n\t\t|| fail \"no release $RELEASE in $REPOSITORY (or GitHub's API did not answer)\"\n\turl=\"$(printf '%s' \"$release_json\" | jq -r --arg name \"$ASSET\" \\\n\t\t'[.assets[]? | select(.name == $name) | .browser_download_url][0] // empty')\"\n\t[ -n \"$url\" ] || fail \"release $RELEASE has no $ASSET\"\nfi\n\nmkdir -p \"$SERVER_DIR\" || fail \"cannot make $SERVER_DIR\"\ncd \"$SERVER_DIR\" || fail \"cannot enter $SERVER_DIR\"\n\nwork=\"$(mktemp -d)\" || fail \"cannot make a temporary folder\"\ntrap 'rm -rf \"$work\"' EXIT\n\necho \"Downloading $url\"\ncurl -fL --retry 3 --progress-bar -o \"$work/$ASSET\" \"$url\" || fail \"the download of $url failed\"\nunzip -tq \"$work/$ASSET\" > /dev/null || fail \"$ASSET is not a zip file\"\nmkdir \"$work/release\"\nunzip -q \"$work/$ASSET\" -d \"$work/release\" || fail \"cannot unzip $ASSET\"\n[ -f \"$work/release/halo\" ] || fail \"$ASSET has no halo executable\"\n\n# the release's files, over the old release's; the owner's are never in it,\n# and gametypes/ only adds the examples not already there\nfor entry in \"$work/release\"/* \"$work/release\"/.[!.]*; do\n\t[ -e \"$entry\" ] || continue\n\tname=\"$(basename \"$entry\")\"\n\tcase \"$name\" in\n\tconfig.toml | init.txt | publisher.key | custom_maps | maps | logs)\n\t\tcontinue\n\t\t;;\n\tgametypes)\n\t\tmkdir -p gametypes\n\t\tcp -rn \"$entry\"/. gametypes/\n\t\tcontinue\n\t\t;;\n\tesac\n\trm -rf \"./$name\"\n\tcp -a \"$entry\" \"./$name\" || fail \"cannot copy $name\"\ndone\n\nchmod 0755 halo\nif [ ! -f halo-server ]; then\n\tprintf '#!/bin/sh\\nexec \"$(dirname \"$0\")/halo\" --server \"$@\"\\n' > halo-server\nfi\nchmod 0755 halo-server\nmkdir -p maps custom_maps gametypes logs\n\necho \"Checking that the server runs\"\nif version=\"$(HOME=\"$work\" HALO_SAVE_ROOT=\"$work/saves\" timeout 30 ./halo --version 2>&1)\"; then\n\techo \"$version\"\nelse\n\techo \"WARNING: ./halo --version did not run. The server needs the 32-bit C runtime\"\n\techo \"WARNING: (the egg's ghcr.io/ptero-eggs/games:source image has it):\"\n\techo \"$version\"\nfi\n\nif [ ! -f maps/ui.map ]; then\n\techo \"No game data yet: upload your maps/ folder (ui.map and the multiplayer maps)\"\n\techo \"over SFTP into the server's folder before starting it.\"\nfi\necho \"Installation completed\"\n",
|
||||
"container": "ghcr.io/ptero-eggs/installers:debian",
|
||||
"entrypoint": "bash"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "Release",
|
||||
"description": "A release tag (build-206) or latest. A change takes effect on Reinstall (Settings tab), which keeps config.toml, init.txt, gametypes/, custom_maps/ and maps/.",
|
||||
"env_variable": "OPENCE_RELEASE",
|
||||
"default_value": "latest",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|max:40|regex:/^[A-Za-z0-9._-]+$/",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Server name",
|
||||
"description": "The game's name in the lobby and the server browser: 15 characters of printable ASCII.",
|
||||
"env_variable": "HALO_SERVER_NAME",
|
||||
"default_value": "OpenCE Server",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|max:15|regex:/^[\\x20-\\x7E]+$/",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Rotation",
|
||||
"description": "The games played one after another, separated by commas: map:gametype, with +rule=value after a gametype (bloodgulch:ctf, sidewinder:team_slayer+score=50). A gametype is a built-in's name or a gametypes/<name>.toml of yours.",
|
||||
"env_variable": "HALO_SERVER_ROTATION",
|
||||
"default_value": "bloodgulch:ctf, sidewinder:team_slayer, prisoner:slayer",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|max:4096",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Max players",
|
||||
"description": "2 to 127.",
|
||||
"env_variable": "HALO_SERVER_MAX_PLAYERS",
|
||||
"default_value": "16",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|integer|between:2,127",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Join password",
|
||||
"description": "The password the server browser asks for; empty for none. The invite link joins without it.",
|
||||
"env_variable": "HALO_SERVER_PASSWORD",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|max:64",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Public",
|
||||
"description": "List the server in everyone's server browser.",
|
||||
"env_variable": "HALO_SERVER_PUBLIC",
|
||||
"default_value": "true",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|in:true,false",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Message of the day",
|
||||
"description": "A notice each player is shown on joining (127 characters); empty for none.",
|
||||
"env_variable": "HALO_SERVER_MOTD",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|max:127",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Lobby seconds",
|
||||
"description": "Seconds the lobby counts down before each game (0 to 300).",
|
||||
"env_variable": "HALO_SERVER_LOBBY_SECONDS",
|
||||
"default_value": "15",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|integer|between:0,300",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Web UI port",
|
||||
"description": "0: no web page. Else the port of an additional allocation (Network tab) for the admin page, its API and the remote console, at http://<allocation address>:<port>/; it needs a web UI password.",
|
||||
"env_variable": "HALO_SERVER_WEB_PORT",
|
||||
"default_value": "0",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|integer|between:0,65535",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Web UI password",
|
||||
"description": "The admin password of the web page, 8 characters or more.",
|
||||
"env_variable": "HALO_SERVER_WEB_PASSWORD",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|min:8|max:64",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Public address",
|
||||
"description": "host[:port] offered to joiners first, for a node behind a NAT that STUN cannot see through; usually empty.",
|
||||
"env_variable": "HALO_NET_PUBLIC_ADDRESS",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|max:253",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Publisher key",
|
||||
"description": "Your approved key for the master servers that list dedicated servers: the 64 hex characters of the seed ./halo --server --keygen writes to publisher.key. Empty: the key file, if there is one; the server is not listed on the masters without one.",
|
||||
"env_variable": "HALO_SERVER_PUBLISHER_KEY",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|regex:/^[0-9a-f]{64}$/",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Instance name",
|
||||
"description": "Tells this server from your others on the master servers: letters, digits, dashes.",
|
||||
"env_variable": "HALO_SERVER_INSTANCE",
|
||||
"default_value": "main",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|alpha_dash|max:32",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Region",
|
||||
"description": "A label in the server browser (eu, na-east); empty for none.",
|
||||
"env_variable": "HALO_SERVER_REGION",
|
||||
"default_value": "",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "nullable|string|alpha_dash|max:16",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Log format",
|
||||
"description": "The console's lines: text, or json for a log collector.",
|
||||
"env_variable": "HALO_SERVER_LOG_FORMAT",
|
||||
"default_value": "text",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|string|in:text,json",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Web UI bind",
|
||||
"description": "The container's address the web port listens on: all of them, as the allocation's address is the node's.",
|
||||
"env_variable": "HALO_SERVER_WEB_BIND",
|
||||
"default_value": "0.0.0.0",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|string|in:0.0.0.0",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "GitHub repository",
|
||||
"description": "owner/name the installation downloads the release from.",
|
||||
"env_variable": "OPENCE_REPOSITORY",
|
||||
"default_value": "OpenCommunityEdition/OpenCE",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|string|max:100|regex:/^[A-Za-z0-9._-]+\\/[A-Za-z0-9._-]+$/",
|
||||
"field_type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
# The OpenCE dedicated server egg's installation script (Pterodactyl and
|
||||
# Pelican), run as root in ghcr.io/ptero-eggs/installers:debian with the
|
||||
# server's folder at /mnt/server. tools/egg_build.py copies it into
|
||||
# egg-opence-dedicated-server.json.
|
||||
#
|
||||
# OPENCE_RELEASE: "latest" or a release tag (build-206).
|
||||
# OPENCE_REPOSITORY: the GitHub repository (owner/name) to download from.
|
||||
#
|
||||
# A reinstall replaces the release's files and keeps the owner's:
|
||||
# config.toml, init.txt, publisher.key, gametypes/, custom_maps/, maps/ and
|
||||
# logs/. The panel ignores this script's exit code, so each failure says
|
||||
# what went wrong.
|
||||
|
||||
set -u
|
||||
|
||||
SERVER_DIR="${SERVER_DIR:-/mnt/server}"
|
||||
RELEASE="${OPENCE_RELEASE:-latest}"
|
||||
REPOSITORY="${OPENCE_REPOSITORY:-OpenCommunityEdition/OpenCE}"
|
||||
GITHUB_URL="${OPENCE_GITHUB_URL:-https://github.com}"
|
||||
GITHUB_API="${OPENCE_GITHUB_API:-https://api.github.com}"
|
||||
ASSET=halo-linux-release.zip
|
||||
|
||||
fail() {
|
||||
echo "INSTALL FAILED: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ! [[ "$REPOSITORY" =~ ^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$ ]]; then
|
||||
fail "the repository \"$REPOSITORY\" is not owner/name"
|
||||
fi
|
||||
if [ -z "$RELEASE" ] || [ "$RELEASE" = latest ]; then
|
||||
# (no API call, so no rate limit)
|
||||
url="$GITHUB_URL/$REPOSITORY/releases/latest/download/$ASSET"
|
||||
else
|
||||
if ! [[ "$RELEASE" =~ ^[A-Za-z0-9._-]+$ ]]; then
|
||||
fail "the release \"$RELEASE\" is not a tag name (build-206) or latest"
|
||||
fi
|
||||
echo "Looking up release $RELEASE of $REPOSITORY"
|
||||
release_json="$(curl -fsSL --retry 3 -H 'Accept: application/vnd.github+json' \
|
||||
"$GITHUB_API/repos/$REPOSITORY/releases/tags/$RELEASE")" \
|
||||
|| fail "no release $RELEASE in $REPOSITORY (or GitHub's API did not answer)"
|
||||
url="$(printf '%s' "$release_json" | jq -r --arg name "$ASSET" \
|
||||
'[.assets[]? | select(.name == $name) | .browser_download_url][0] // empty')"
|
||||
[ -n "$url" ] || fail "release $RELEASE has no $ASSET"
|
||||
fi
|
||||
|
||||
mkdir -p "$SERVER_DIR" || fail "cannot make $SERVER_DIR"
|
||||
cd "$SERVER_DIR" || fail "cannot enter $SERVER_DIR"
|
||||
|
||||
work="$(mktemp -d)" || fail "cannot make a temporary folder"
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
|
||||
echo "Downloading $url"
|
||||
curl -fL --retry 3 --progress-bar -o "$work/$ASSET" "$url" || fail "the download of $url failed"
|
||||
unzip -tq "$work/$ASSET" > /dev/null || fail "$ASSET is not a zip file"
|
||||
mkdir "$work/release"
|
||||
unzip -q "$work/$ASSET" -d "$work/release" || fail "cannot unzip $ASSET"
|
||||
[ -f "$work/release/halo" ] || fail "$ASSET has no halo executable"
|
||||
|
||||
# the release's files, over the old release's; the owner's are never in it,
|
||||
# and gametypes/ only adds the examples not already there
|
||||
for entry in "$work/release"/* "$work/release"/.[!.]*; do
|
||||
[ -e "$entry" ] || continue
|
||||
name="$(basename "$entry")"
|
||||
case "$name" in
|
||||
config.toml | init.txt | publisher.key | custom_maps | maps | logs)
|
||||
continue
|
||||
;;
|
||||
gametypes)
|
||||
mkdir -p gametypes
|
||||
cp -rn "$entry"/. gametypes/
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
rm -rf "./$name"
|
||||
cp -a "$entry" "./$name" || fail "cannot copy $name"
|
||||
done
|
||||
|
||||
chmod 0755 halo
|
||||
if [ ! -f halo-server ]; then
|
||||
printf '#!/bin/sh\nexec "$(dirname "$0")/halo" --server "$@"\n' > halo-server
|
||||
fi
|
||||
chmod 0755 halo-server
|
||||
mkdir -p maps custom_maps gametypes logs
|
||||
|
||||
echo "Checking that the server runs"
|
||||
if version="$(HOME="$work" HALO_SAVE_ROOT="$work/saves" timeout 30 ./halo --version 2>&1)"; then
|
||||
echo "$version"
|
||||
else
|
||||
echo "WARNING: ./halo --version did not run. The server needs the 32-bit C runtime"
|
||||
echo "WARNING: (the egg's ghcr.io/ptero-eggs/games:source image has it):"
|
||||
echo "$version"
|
||||
fi
|
||||
|
||||
if [ ! -f maps/ui.map ]; then
|
||||
echo "No game data yet: upload your maps/ folder (ui.map and the multiplayer maps)"
|
||||
echo "over SFTP into the server's folder before starting it."
|
||||
fi
|
||||
echo "Installation completed"
|
||||
@@ -0,0 +1,49 @@
|
||||
# The dedicated server on PufferPanel
|
||||
|
||||
`template.json` is a PufferPanel template for the dedicated server
|
||||
(`docs/dedicated_server.md`), run in PufferPanel's host environment: it
|
||||
downloads a release's `halo-linux-release.zip` into the server's folder,
|
||||
runs `./halo --server` there, and stops it by writing `quit` to its
|
||||
standard input.
|
||||
|
||||
## Using it
|
||||
|
||||
1. The node needs the 32-bit C runtime (Debian and Ubuntu:
|
||||
`dpkg --add-architecture i386 && apt install libc6:i386`). The template
|
||||
mounts `/lib32` and `/usr/lib32` into PufferPanel's sandbox, which does
|
||||
not otherwise; without them the 32-bit `halo` cannot start.
|
||||
2. Add the template (Templates, New, and paste the file), and create a
|
||||
server from it.
|
||||
3. Upload the `maps/` folder of your own copy of the game into the
|
||||
server's folder. Without `maps/ui.map` and the rotation's maps the server
|
||||
exits with code 2 and says which maps it looked for.
|
||||
4. Start it.
|
||||
|
||||
## Ports
|
||||
|
||||
The **Tunnel port** (UDP, 2302 by default) is the one port players need.
|
||||
The **Web UI port** is the web page, its API and the remote console, on
|
||||
127.0.0.1 only. Its default is 8090, because PufferPanel itself listens on
|
||||
8080. Each server on a node needs a tunnel port and a web port of its own
|
||||
(or a web port of 0, for none).
|
||||
|
||||
## Files
|
||||
|
||||
Everything the server writes stays in its folder: `config.toml` (every
|
||||
setting, written at the first start, with the web page's admin password if
|
||||
none was given), `saves/` (`HALO_SAVE_ROOT`: the profiles and the map cache,
|
||||
about 115 MB, built at the first start), `logs/` (`HALO_LOG_ROOT`:
|
||||
`debug.txt`, `bans.txt`, `cheaters.txt`) and `status.json`
|
||||
(`server.status_file`, the status every 2 seconds).
|
||||
|
||||
The template's variables are passed as `HALO_*` variables, which win over
|
||||
`config.toml`: `sv_set` and the web page cannot change those settings.
|
||||
|
||||
## PufferPanel versions
|
||||
|
||||
The template is in the format of PufferPanel 2's templates (`run.command`
|
||||
as a string, `run.stop` as the command written to standard input). We have
|
||||
not confirmed how PufferPanel 3 imports it, nor the form of its standard
|
||||
input settings; if a server made from it on PufferPanel 3 does not stop
|
||||
with `quit`, set its stop to send `quit` to standard input (or SIGTERM,
|
||||
which the server takes as well) in the server's settings.
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"type": "opence",
|
||||
"display": "OpenCE Dedicated Server",
|
||||
"install": [
|
||||
{
|
||||
"type": "download",
|
||||
"files": [
|
||||
"${release_url}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "command",
|
||||
"commands": [
|
||||
"unzip -o halo-linux-release.zip",
|
||||
"rm -f halo-linux-release.zip",
|
||||
"chmod 0755 halo halo-server",
|
||||
"mkdir -p maps custom_maps gametypes saves logs",
|
||||
"./halo --version"
|
||||
]
|
||||
}
|
||||
],
|
||||
"run": {
|
||||
"command": "./halo --server",
|
||||
"stop": "quit",
|
||||
"workingDirectory": "",
|
||||
"pre": [],
|
||||
"post": [],
|
||||
"environmentVars": {
|
||||
"HALO_NET_TUNNEL_PORT": "${port}",
|
||||
"HALO_SERVER_NAME": "${name}",
|
||||
"HALO_SERVER_ROTATION": "${rotation}",
|
||||
"HALO_SERVER_MAX_PLAYERS": "${max_players}",
|
||||
"HALO_SERVER_PUBLIC": "${public}",
|
||||
"HALO_SERVER_WEB_PORT": "${web_port}",
|
||||
"HALO_SERVER_LOG_FORMAT": "${log_format}",
|
||||
"HALO_SERVER_STATUS_FILE": "status.json",
|
||||
"HALO_SAVE_ROOT": "saves",
|
||||
"HALO_LOG_ROOT": "logs"
|
||||
},
|
||||
"autostart": false,
|
||||
"autorecover": true,
|
||||
"autorestart": false
|
||||
},
|
||||
"data": {
|
||||
"release_url": {
|
||||
"type": "string",
|
||||
"display": "Release",
|
||||
"desc": "The release's halo-linux-release.zip: .../releases/latest/download/halo-linux-release.zip, or .../releases/download/<tag>/halo-linux-release.zip. Used when the server is installed again.",
|
||||
"required": true,
|
||||
"value": "https://github.com/OpenCommunityEdition/OpenCE/releases/latest/download/halo-linux-release.zip",
|
||||
"userEdit": true
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"display": "Tunnel port",
|
||||
"desc": "The UDP port of internet play (network.tunnel_port), the one port players need.",
|
||||
"required": true,
|
||||
"value": 2302,
|
||||
"userEdit": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"display": "Server name",
|
||||
"desc": "The game's name in the server browser: 15 characters of printable ASCII.",
|
||||
"required": true,
|
||||
"value": "OpenCE Server",
|
||||
"userEdit": true
|
||||
},
|
||||
"rotation": {
|
||||
"type": "string",
|
||||
"display": "Rotation",
|
||||
"desc": "The games played one after another: map:gametype entries separated by commas.",
|
||||
"required": true,
|
||||
"value": "bloodgulch:ctf, sidewinder:team_slayer, prisoner:slayer",
|
||||
"userEdit": true
|
||||
},
|
||||
"max_players": {
|
||||
"type": "integer",
|
||||
"display": "Max players",
|
||||
"desc": "2 to 127.",
|
||||
"required": true,
|
||||
"value": 16,
|
||||
"userEdit": true
|
||||
},
|
||||
"public": {
|
||||
"type": "boolean",
|
||||
"display": "Public",
|
||||
"desc": "List the server in everyone's server browser.",
|
||||
"required": true,
|
||||
"value": true,
|
||||
"userEdit": true
|
||||
},
|
||||
"web_port": {
|
||||
"type": "integer",
|
||||
"display": "Web UI port",
|
||||
"desc": "The web page, its API and the remote console, on 127.0.0.1 (server.web_port); 0 for none. Each server on a node needs a port of its own, and not PufferPanel's own (8080). The admin password is printed at the first start and kept in config.toml.",
|
||||
"required": true,
|
||||
"value": 8090,
|
||||
"userEdit": true
|
||||
},
|
||||
"log_format": {
|
||||
"type": "option",
|
||||
"display": "Log format",
|
||||
"desc": "The console's lines.",
|
||||
"required": true,
|
||||
"value": "text",
|
||||
"userEdit": true,
|
||||
"options": [
|
||||
{
|
||||
"value": "text",
|
||||
"display": "Text"
|
||||
},
|
||||
{
|
||||
"value": "json",
|
||||
"display": "JSON"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"type": "host",
|
||||
"mounts": [
|
||||
"/lib32",
|
||||
"/usr/lib32"
|
||||
]
|
||||
},
|
||||
"supportedEnvironments": [
|
||||
{
|
||||
"type": "host",
|
||||
"mounts": [
|
||||
"/lib32",
|
||||
"/usr/lib32"
|
||||
]
|
||||
}
|
||||
],
|
||||
"requirements": {
|
||||
"os": "linux",
|
||||
"arch": "amd64"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
d04e8b101007d1641cace8b95fcca76f7f44709f6885c3d031b52394dbdf9376
|
||||
@@ -0,0 +1,52 @@
|
||||
# The dedicated server under systemd
|
||||
|
||||
`halo-server@.service` runs the dedicated server (`docs/dedicated_server.md`)
|
||||
as a templated unit: one instance for each folder
|
||||
`/opt/opence/servers/<name>`, all sharing one release in `/opt/opence/bin`
|
||||
and one read-only copy of the game data in `/opt/opence/data`.
|
||||
|
||||
| Path | What |
|
||||
| --- | --- |
|
||||
| `/opt/opence/bin/` | The release (`halo-linux-release.zip`, unzipped) |
|
||||
| `/opt/opence/data/` | The game data, only read: `maps/`, `custom_maps/`, `gametypes/` |
|
||||
| `/opt/opence/servers/<name>/` | The instance's own, the only folder it may write: `config.toml`, `init.txt`, `publisher.key`, `server.env`, `saves/` (the map cache), `logs/` |
|
||||
|
||||
## Installing
|
||||
|
||||
```sh
|
||||
sudo useradd --system --home-dir /opt/opence --shell /usr/sbin/nologin halo
|
||||
sudo install -d -o halo -g halo -m 0750 /opt/opence/servers/main
|
||||
sudo cp deploy/systemd/halo-server@.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now halo-server@main
|
||||
journalctl -u halo-server@main -f
|
||||
```
|
||||
|
||||
Open UDP 2302 (the instance's `network.tunnel_port`) in the firewall.
|
||||
|
||||
## Settings
|
||||
|
||||
`server.env` in the instance's folder holds its settings as `HALO_*`
|
||||
variables, one a line (port/linux/README.md, "Dedicated server"). A
|
||||
variable set there wins over `config.toml`, and `sv_set` and the web page
|
||||
cannot change it; leave out what you want to change from the web page.
|
||||
|
||||
A second instance on the machine needs ports of its own, and its own
|
||||
loopback address for system link:
|
||||
|
||||
```sh
|
||||
HALO_NET_TUNNEL_PORT=2303
|
||||
HALO_SERVER_WEB_PORT=8081
|
||||
HALO_NET_ADDRESS=127.0.0.2
|
||||
HALO_NET_BROADCAST=127.0.0.1
|
||||
```
|
||||
|
||||
The web port stays on 127.0.0.1 unless `server.env` says otherwise (and
|
||||
then it needs a password, and TLS in front of it).
|
||||
|
||||
## Exit codes
|
||||
|
||||
Exit code 5 (`sv_restart`, or an update installed) restarts the server; 2
|
||||
(no usable maps) and 3 (bad configuration) do not, as a restart would fail
|
||||
the same way. The unit has no console (`StandardInput=null`): commands come
|
||||
from `init.txt` and the web port.
|
||||
@@ -0,0 +1,96 @@
|
||||
# A dedicated server under systemd (docs/dedicated_server.md), one instance
|
||||
# for each folder /opt/opence/servers/<name>:
|
||||
#
|
||||
# /opt/opence/bin/ the release (halo-linux-release.zip, unzipped)
|
||||
# /opt/opence/data/ the game data, shared by every instance and
|
||||
# only read: maps/, custom_maps/, gametypes/
|
||||
# /opt/opence/servers/<name>/ the instance's own: config.toml, init.txt,
|
||||
# publisher.key, server.env, logs/, saves/
|
||||
#
|
||||
# server.env holds the instance's settings as HALO_* variables, one a line.
|
||||
# A second instance on the machine needs its own ports, and its own loopback
|
||||
# address for system link:
|
||||
#
|
||||
# HALO_NET_TUNNEL_PORT=2303
|
||||
# HALO_SERVER_WEB_PORT=8081
|
||||
# HALO_NET_ADDRESS=127.0.0.2
|
||||
# HALO_NET_BROADCAST=127.0.0.1
|
||||
#
|
||||
# Install:
|
||||
# sudo useradd --system --home-dir /opt/opence --shell /usr/sbin/nologin halo
|
||||
# sudo install -d -o halo -g halo -m 0750 /opt/opence/servers/main
|
||||
# sudo cp deploy/systemd/halo-server@.service /etc/systemd/system/
|
||||
# sudo systemctl daemon-reload
|
||||
# sudo systemctl enable --now halo-server@main
|
||||
# journalctl -u halo-server@main -f
|
||||
#
|
||||
# Open UDP 2302 (each instance's network.tunnel_port) in the firewall. The
|
||||
# web port stays on 127.0.0.1 unless server.env says otherwise.
|
||||
#
|
||||
# Exit code 5 (sv_restart, or an update installed) restarts the server;
|
||||
# 2 (no usable maps) and 3 (bad configuration) do not, as a restart would
|
||||
# fail the same way.
|
||||
[Unit]
|
||||
Description=OpenCE dedicated server %i
|
||||
Documentation=https://github.com/OpenCommunityEdition/OpenCE/blob/main/docs/dedicated_server.md
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=halo
|
||||
Group=halo
|
||||
WorkingDirectory=/opt/opence/servers/%i
|
||||
Environment=HOME=/opt/opence/servers/%i
|
||||
Environment=HALO_CONFIG_FILE=/opt/opence/servers/%i/config.toml
|
||||
Environment=HALO_DATA_ROOT=/opt/opence/data
|
||||
Environment=HALO_SAVE_ROOT=/opt/opence/servers/%i/saves
|
||||
Environment=HALO_LOG_ROOT=/opt/opence/servers/%i/logs
|
||||
Environment=HALO_SERVER_INIT_FILE=/opt/opence/servers/%i/init.txt
|
||||
Environment=HALO_NET_TUNNEL_PORT=2302
|
||||
EnvironmentFile=-/opt/opence/servers/%i/server.env
|
||||
ExecStartPre=/bin/mkdir -p /opt/opence/servers/%i/logs /opt/opence/servers/%i/saves
|
||||
ExecStart=/opt/opence/bin/halo --server
|
||||
# (no console: commands come from init.txt and the web port)
|
||||
StandardInput=null
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
KillSignal=SIGTERM
|
||||
TimeoutStopSec=15
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
RestartForceExitStatus=5
|
||||
RestartPreventExitStatus=2 3
|
||||
# (no privileges, nothing writable but the instance's folder)
|
||||
NoNewPrivileges=yes
|
||||
CapabilityBoundingSet=
|
||||
AmbientCapabilities=
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/opt/opence/servers/%i
|
||||
ProtectHome=yes
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelLogs=yes
|
||||
ProtectControlGroups=yes
|
||||
ProtectClock=yes
|
||||
ProtectHostname=yes
|
||||
ProtectProc=invisible
|
||||
RestrictAddressFamilies=AF_INET AF_UNIX AF_NETLINK
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
RestrictSUIDSGID=yes
|
||||
LockPersonality=yes
|
||||
MemoryDenyWriteExecute=yes
|
||||
# (a 32-bit x86 program)
|
||||
SystemCallArchitectures=native x86
|
||||
SystemCallFilter=@system-service
|
||||
SystemCallFilter=~@privileged
|
||||
SystemCallErrorNumber=EPERM
|
||||
UMask=0027
|
||||
MemoryMax=600M
|
||||
TasksMax=64
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,761 @@
|
||||
# The dedicated server: reference
|
||||
|
||||
`halo --server` runs the game as a host with no window, sound or player of
|
||||
its own: other machines join it on the LAN, by its invite link or from the
|
||||
server browser, as they join any host. `port/linux/README.md`, "Dedicated
|
||||
server", says how to run one; this document is the reference for what it
|
||||
takes and answers: the command line, the exit codes, the commands, the
|
||||
HTTP API, the remote console (RCON) over WebSocket, the events, the log and
|
||||
the files. `docs/master_protocol.md` is the master servers' protocol, which
|
||||
the server publishes to and the server browser reads.
|
||||
|
||||
The code is `port/linux/src/server_*.c` (the platform side: the mode, the
|
||||
standard input, the log, the rotation's grammar, the HTTP and WebSocket
|
||||
server, the master servers' publisher) and `port/linux/game/server_*.c`
|
||||
(the game side: the director that plays one game after another, the
|
||||
commands, the gametypes, the status). The Android and web builds have no
|
||||
dedicated server: they compile those files to nothing, but for
|
||||
`server_json.c` (the JSON reader, which the server browser's list of master
|
||||
servers uses in every build) and `server_rotation.c` (the rotation's
|
||||
grammar and the gametype rules), which every build compiles.
|
||||
|
||||
## Panels and fleets
|
||||
|
||||
A game panel (Pterodactyl, PufferPanel, MCSManager: `deploy/`) runs one
|
||||
server and reads its standard output; `deploy/systemd` and `deploy/docker`
|
||||
run servers on one machine. For many servers on many machines, `opence-fleet`
|
||||
([github.com/OpenCommunityEdition/opence-fleet](https://github.com/OpenCommunityEdition/opence-fleet))
|
||||
is one control plane over them all: an agent on each machine runs the
|
||||
servers and drives each through this document's API, as the owner from
|
||||
the machine itself (`server.web_owner_password`, below). What it relies on
|
||||
is named in the status's and the RCON's `capabilities`: `owner_web` (the
|
||||
owner's role over the web, from loopback), `ban_address` (`sv_ban_address`,
|
||||
`POST /api/bans`), `stop` (`sv_stop`, `POST /api/stop`, the `drain` event),
|
||||
`event_addresses` (addresses in the player events) and `identity` (the
|
||||
status's `pid`, `instance`...).
|
||||
|
||||
## Command line
|
||||
|
||||
| Argument | What it does |
|
||||
| --- | --- |
|
||||
| `--server` | Dedicated server mode (as `HALO_SERVER=1` or `server.enabled = true`) |
|
||||
| `--config <path>` | The settings file; default `config.toml` beside the executable. `HALO_CONFIG_FILE`, when it is set, wins over `--config` |
|
||||
| `--version` | Prints `OpenCE build-<n> (network version <v>)` and exits 0 |
|
||||
| `--keygen` | Writes a new publisher key (`server.publisher_key_file`) unless one exists, prints its public key and key id, exits 0; exits 3 when the key cannot be made, read or written |
|
||||
| `--sign <text>` | Prints the publisher key's Ed25519 signature of the text, in hex (an application's proof of key), exits 0; exits 3 without a text or a usable key |
|
||||
| `--probe [<invite>]` | A look at a server, for a list site that shows its state: joins nothing and never starts a server (whatever `--server`, `HALO_SERVER` or `server.enabled` say). It finds the invite's game over its tunnel (without an invite, the LAN's first) and prints it as one line of JSON, the game of the invite's host alone (never another game that answers), and exits 0; when nothing answers in 30 seconds it prints `{"ok":false,"error":"no game answered in 30 seconds"}` and exits 1. Internet play is as set (`network.online`, on by default), which an invite needs |
|
||||
| `--help` | Prints these, exits 0 |
|
||||
|
||||
`--version`, `--help`, `--keygen`, `--sign` and `--probe` write no settings: the
|
||||
settings file is read, never completed or made. `--probe` wins over
|
||||
`--server`, `HALO_SERVER` and `server.enabled`: a probe never writes to
|
||||
`config.toml`.
|
||||
|
||||
A probe's line:
|
||||
|
||||
```json
|
||||
{"ok":true,"name":"OpenCE Server","map":"bloodgulch","gametype":"ctf","players":5,"max_players":16,
|
||||
"teams":true,"in_progress":true,"open":true,"dedicated":true,"network_version":38,"kind":0}
|
||||
```
|
||||
|
||||
`gametype` is the game engine's name (`ctf`, `slayer`, `oddball`, `king`,
|
||||
`race`, or `none`), `kind` the OpenCE gametype's kind the host sends (0 for
|
||||
none), `open` whether it takes players now.
|
||||
|
||||
The release has a `halo-server` script beside `halo`, which runs
|
||||
`halo --server` with its arguments.
|
||||
|
||||
## Exit codes and signals
|
||||
|
||||
| Code | Meaning |
|
||||
| --- | --- |
|
||||
| 0 | Stopped: `quit`, `sv_stop` (now, or at the end of its drain), SIGTERM or SIGINT |
|
||||
| 1 | A fatal error in the game (a halt, a map that failed to load); the last error lines were logged. The process exits within 5 seconds of the error, even when what runs at the exit (a hook, a listing's withdrawal) does not return |
|
||||
| 2 | No usable game data: `maps/ui.map`, or every rotation map, missing or not a cache file; nothing was bound |
|
||||
| 3 | Bad server configuration: no rotation entry that can be played (and `server.rotation_fallback` off), `server.web_port` past 65535, a web port the server may not bind (a port below 1024 without the right to it) or whose `server.web_bind` is an address the machine does not have, or a web password (admin, moderator or viewer) shorter than 8 characters with the web port bound beyond loopback (on loopback, a warning), or the owner's (`server.web_owner_password`) shorter than 8 wherever it is bound; `--keygen` or `--sign` failing. An entry that cannot be played (a bad gametype file among them) is left out with a warning: the server stops only when none is left |
|
||||
| 4 | A port in use: the tunnel's UDP port, or the web port (another program listens on it) |
|
||||
| 5 | Restart asked for (`sv_restart`, now or at the end of its drain, or an update installed: `server.auto_update = "install"` installs a new release once the server has been empty for 10 minutes, on a thread of its own: the server goes on meanwhile, and stops with 5 once it is empty again (a player who joined during the install plays on). An install that fails is tried again at the next check, 6 hours on) |
|
||||
| 128 + n | Stopped by signal n: a second SIGTERM or SIGINT, or the shutdown not done 5 seconds after the first |
|
||||
|
||||
SIGTERM and SIGINT stop the server: a game in progress goes to its
|
||||
postgame, every machine is told, the listings are withdrawn, and it exits 0.
|
||||
SIGHUP reloads the server's settings, the rotation and the gametype files
|
||||
(`sv_reload`). SIGUSR1 prints the status on standard output. SIGPIPE and
|
||||
SIGTTIN are ignored.
|
||||
|
||||
## Standard output
|
||||
|
||||
One line per event, for the operator and the panel:
|
||||
|
||||
```
|
||||
2026-10-19T18:03:11Z INFO server: ready (tunnel 2302/udp, web 127.0.0.1:8080, listing public)
|
||||
2026-10-19T18:03:40Z INFO player: Milenko joined (slot 0, machine 1)
|
||||
2026-10-19T18:04:02Z INFO game: started: CTF on bloodgulch, 2 players
|
||||
```
|
||||
|
||||
The fields are the time (UTC), the level (`INFO`, `WARN`, `ERROR`), the
|
||||
category (`server`, `lobby`, `game`, `player`, `chat`, `moderation`, `net`,
|
||||
`master`, `console`, `health`) and the text. `server: ready` is printed once,
|
||||
when the lobby is open and, for a public server, its listing has been
|
||||
published (or 10 seconds on, as the brokers are other people's): it is the
|
||||
line a panel waits for. With `server.log_format = "json"` each line is an
|
||||
object instead, and the line a panel waits for holds `"msg":"ready (`:
|
||||
|
||||
```json
|
||||
{"time":"2026-10-19T18:03:11Z","level":"info","cat":"server","msg":"ready (tunnel 2302/udp, ...)"}
|
||||
```
|
||||
|
||||
Every line is also kept in the log the web's viewers read (`/api/log`,
|
||||
`sv_log`, the RCON's `log` events), but for these, which go to standard
|
||||
output alone: the web password a first start makes, the invite (a
|
||||
private server's lets anyone in; `/api/status` gives it to admins), and
|
||||
the owner's console, the commands typed on standard input or read from the
|
||||
init file and what they answered (a password's command is shown as `(a
|
||||
password's command)` there too).
|
||||
|
||||
A health line comes once a minute: `health: players=3 frame_ms_max=4.1
|
||||
frame_ms_avg=1.20 cpu=2.1% rss=96MB` (the longest and the mean frame of
|
||||
the last minute, in milliseconds). Standard error keeps the platform
|
||||
layer's `halo-linux:` lines, and `debug.txt` everything, as for a player's
|
||||
game.
|
||||
|
||||
## Commands
|
||||
|
||||
The same commands come from standard input, `server.init_file` (run once at
|
||||
the start, a command a line, `#`, `;` and `//` starting comments), the telnet
|
||||
console (`debug.telnet_console`, loopback), the RCON, `POST /api/command`
|
||||
and the web page. Each runs on the game's thread between frames. Every
|
||||
command has a role; a caller may run it if their role is that one or above:
|
||||
**viewer** < **moderator** < **admin** < **owner** (standard input, the
|
||||
init file and the telnet console are the owner's: whoever holds the
|
||||
process; so is a sign-in to the web or the RCON with
|
||||
`server.web_owner_password` from the machine itself: "Signing in"). When
|
||||
standard input ends and `server.console_exit_on_eof` is on, its last line
|
||||
runs, whether or not a line's end ended it, and then the server stops.
|
||||
|
||||
A `<player>` is a slot number (`sv_players` lists them) or the start of a
|
||||
name; a name that begins more than one player's is refused. A `<duration>`
|
||||
is a number and a unit (`45s`, `30m`, `2h`, `7d`, `1w`), a bare number of
|
||||
minutes, or `forever`; ten years at most. A word in quotes (`"two words"`)
|
||||
is one word.
|
||||
|
||||
A command's text (a notice, a reason, `sv_set`'s value, a name) is kept to
|
||||
printable ASCII: control characters (a line's end, a tab) and other bytes
|
||||
outside it are dropped, as are the quotes around the whole text, and
|
||||
standard input's and the init file's lines are cleaned so before they run.
|
||||
The web is stricter where it takes a value as it is: `PUT /api/settings`
|
||||
refuses a value with a control character (`schema`), and nothing is changed
|
||||
for that setting. A command's reply is sent whole, however many lines.
|
||||
|
||||
Commands that are not the server's (the game's own console commands, the
|
||||
scripts' globals and functions) need the owner role: from the web or the
|
||||
RCON they are refused (`not a command of the server's`) but to the owner's
|
||||
session. The server's
|
||||
commands come first, so `kick` and `ban` are always the server's below, not
|
||||
the game's console commands of those names.
|
||||
|
||||
| Command | Role | What it does |
|
||||
| --- | --- | --- |
|
||||
| `help [command]` | viewer | The commands, or one command's use |
|
||||
| `sv_status [--json]` | viewer | The server's state, map, gametype, players, uptime, games played, network version, listing and next game |
|
||||
| `sv_players [--json]` | viewer | Each player's slot, name, team, score, kills, deaths, assists, ping and machine; with the owner role or `server.log_addresses`, their address and hardware id |
|
||||
| `sv_rotation` (`sv_mapcycle`), `sv_maps`, `sv_gametypes`, `sv_version`, `sv_log [n]` | viewer | Lists: the rotation, the maps there are, the gametypes, the build, the log's last n lines |
|
||||
| `sv_bans` (`sv_banlist`), `sv_settings` | admin | Lists: the bans of `bans.txt`, the settings `sv_set` changes |
|
||||
| `sv_masters`, `sv_publisher` | viewer | The master servers and how each answered; the publisher key's id and public key (never its seed) |
|
||||
| `say <text>` (`sv_say`) | moderator | A notice on every machine's screen |
|
||||
| `tell <player> <text>` | moderator | A notice on one player's machine |
|
||||
| `kick <player>` (`sv_kick`) | moderator | Drops the player's machine; it may join again |
|
||||
| `ban <player> [<duration>] [<reason>]` (`sv_ban`) | moderator (a day at most), admin | Drops the player's machine and bans its address and hardware id, for the duration (else for ever). A moderator must give a duration of a day or less: a ban for ever, or longer, is refused |
|
||||
| `unban <number\|address\|hardware id>` (`sv_unban`) | admin | Takes a ban out of `bans.txt`; the machine may join again at once, by the LAN or the internet |
|
||||
| `sv_ban_address <address\|hardware id> [<duration>] [<reason>]` | admin | Bans an IPv4 address (`a.b.c.d`) or a hardware id (up to 32 hex digits), its machine here or not: its line in `bans.txt` as `ban` writes it (the other part `none`), so that `sv_bans`, `unban` and `GET /api/bans` see it, and a machine present of that address or hardware id is dropped as `ban` drops it (`player_left`'s reason `banned`). Answers `ban <n> added` (`n`: its number in `sv_bans`) |
|
||||
| `mute <player> [<minutes>]`, `unmute <player>` | moderator | The host's mute of a player's chat and voice for everyone |
|
||||
| `sv_map <map> [<gametype>]`, `sv_map <entry>` | moderator | Plays that game (or a rotation entry, `map:gametype+rule=value`; a co-op one too), below |
|
||||
| `sv_map_next` (`sv_next`) | moderator | Ends the game without its scores and plays the rotation's next |
|
||||
| `sv_end_game` | moderator | Ends the game: its scores, then the next |
|
||||
| `sv_rotation_set <entries>`, `sv_rotation_add <entry>`, `sv_rotation_del <n>`, `sv_rotation_begin [<n>]` (`sv_mapcycle_add`, `_del`, `_begin`) | admin | Changes the rotation (written to `server.rotation`, 4096 characters at most) |
|
||||
| `sv_set <setting> <value>` | admin | Changes one of the server's settings, now where it can be, and in `config.toml` (below); a setting its environment variable sets is refused. A value is 256 characters at most |
|
||||
| `sv_name <name>`, `sv_maxplayers <n>`, `sv_password [<password>]`, `sv_public <0\|1>`, `sv_motd <text>` | admin | `sv_set` of `server.name`, `server.max_players`, `server.password`, `server.public`, `server.motd` |
|
||||
| `sv_reload` | admin | Reads `config.toml`'s server settings, the rotation and the gametype files again (as SIGHUP) |
|
||||
| `sv_stop [now\|game\|empty] [<notice>]`, `sv_stop cancel` | owner | Stops the server (exit code 0): `now` (the default) as `quit` does; `game` once the game being played is over, `empty` once nobody plays (a drain, below); `cancel` the drain waiting. The notice is said to every machine first |
|
||||
| `sv_restart [now\|game\|empty] [<notice>]`, `sv_restart cancel` | owner | As `sv_stop`, with exit code 5 (restart me) |
|
||||
| `quit` (`exit`) | owner | Stops the server (exit code 0) |
|
||||
|
||||
`sv_map`'s game is played as soon as it can be, and its answer says when:
|
||||
`next: <entry> (now)` in the lobby before its start was sent (the lobby
|
||||
takes the entry, and the rotation's entry it replaced is played after it),
|
||||
`(now: this game ends)` while a game is played (it ends at once, without
|
||||
its scores), and `(once this game is over)` once the lobby's start was sent
|
||||
or while a map loads (it is the next game). `sv_map` of the game being
|
||||
played plays it again. The rotation goes on after it.
|
||||
|
||||
A drain (`sv_stop` or `sv_restart` with `game` or `empty`, `POST
|
||||
/api/stop`) is a stop that waits: the listings are withdrawn as `sv_public
|
||||
0` withdraws them (a new invite, the masters told), without the setting
|
||||
changing; new machines are refused as while a map loads (the game is not
|
||||
open: the LAN's search shows it closed, a join by the invite is told the
|
||||
game is not open); then the server stops. With `game` it stops once no
|
||||
game is played nor about to be: at once in the lobby with nobody in it, or
|
||||
with no countdown running (fewer players than `server.min_players`);
|
||||
otherwise once the game played (or about to start) is over and its
|
||||
postgame shown. With `empty` it stops once nobody is on the server (at once
|
||||
if nobody is now). `sv_stop cancel` (or `sv_restart cancel`) ends the
|
||||
drain: the server is listed again as `server.public` says and takes new
|
||||
players. A `drain` event says each (`after`: `now`, `game`, `empty` or
|
||||
`cancel`), and the stop that ends a drain has the `shutdown` reason
|
||||
`drained`. `/api/status`'s `drain` is the drain waiting, or `null`.
|
||||
|
||||
A co-op entry (`<level>:coop`) is ended as a game is: by `sv_end_game`,
|
||||
`sv_map_next`, `sv_map`, `server.empty_seconds` and `server.idle_minutes`.
|
||||
It has no scores: the server goes back to the lobby at once (no postgame),
|
||||
and a level won ends it with `game_ended`'s reason `score`.
|
||||
|
||||
`sv_set` (and the settings of the web page, `PUT /api/settings`) changes
|
||||
these settings, which `sv_settings` and `GET /api/settings` list:
|
||||
`server.name`, `server.max_players`, `server.min_players`,
|
||||
`server.password`, `server.public`, `server.rotation_fallback`,
|
||||
`server.lobby_seconds`, `server.postgame_seconds`, `server.empty_seconds`,
|
||||
`server.idle_minutes`, `server.team_start`, `server.motd`,
|
||||
`server.frame_rate`, `server.web_password`,
|
||||
`server.web_moderator_password`, `server.log_format`,
|
||||
`server.log_addresses`, `server.status_file`, `server.auto_update`,
|
||||
`server.coop_difficulty`, `server.region`, `server.master_publish`,
|
||||
`server.chat_filter`, `server.chat_filter_slurs`, `server.chat_filter_swearing`,
|
||||
`server.chat_filter_insults`,
|
||||
`server.master_publish_address`, `server.metrics`, and `network.text_chat`,
|
||||
`network.voice_lobby`, `network.voice_mode`, `network.voice_kbps`,
|
||||
`network.votekick`, `network.votekick_minutes`,
|
||||
`network.votekick_ban_minutes`, `network.map_share`,
|
||||
`network.map_share_upload`, `network.public_address`,
|
||||
`network.coop_friendly_fire`, `network.coop_player_collisions`,
|
||||
`network.coop_ally_friendly_fire` and `network.shield_effects`. Of them,
|
||||
`server.status_file`, `server.auto_update` and `server.log_addresses` need
|
||||
the owner role: from the web's admin, `sv_set` of one of them (`POST
|
||||
/api/command`) answers `403 forbidden`, and `PUT /api/settings` leaves it
|
||||
out, in its `errors` with the code `forbidden` and the message `<setting>
|
||||
needs the owner role (the server's console)`; the owner's session changes
|
||||
them both ways. A web password is empty or
|
||||
8 characters or more. A value outside a setting's choices or range is
|
||||
refused (`400 failed` from `sv_set`, `schema` in `PUT /api/settings`'s
|
||||
`errors`), with `<setting> takes a whole number from <min> to <max>` (or
|
||||
`from <min>`) or `<setting> is one of <a>|<b>|<c>`; a choice may be given
|
||||
in either case, and is kept as the table spells it:
|
||||
|
||||
| Setting | Choices or range |
|
||||
| --- | --- |
|
||||
| `server.max_players` | 2 to 127 |
|
||||
| `server.min_players` | 1 to 16 |
|
||||
| `server.lobby_seconds`, `server.postgame_seconds` | 0 to 300 |
|
||||
| `server.empty_seconds`, `server.idle_minutes` | 0 or more |
|
||||
| `server.frame_rate` | 30 to 120 |
|
||||
| `server.team_start` | `one`, `both`, `skip` |
|
||||
| `server.log_format` | `text`, `json` |
|
||||
| `server.auto_update` | `off`, `check`, `install` |
|
||||
| `server.coop_difficulty` | `easy`, `normal`, `hard`, `impossible` |
|
||||
| `network.text_chat` | `on`, `links`, `off` |
|
||||
| `server.chat_filter` | `off`, `censor`, `block` |
|
||||
| `server.chat_filter_slurs`, `server.chat_filter_swearing`, `server.chat_filter_insults` | `off`, `severe`, `strong`, `mild` |
|
||||
| `network.voice_mode` | `off`, `team_proximity`, `team_enemy_proximity`, `team_global`, `team_global_enemy_proximity` |
|
||||
| `network.voice_kbps` | 8 to 64 |
|
||||
| `network.votekick_minutes` | 0 to 60 |
|
||||
| `network.votekick_ban_minutes` | 1 to 1440 |
|
||||
| `network.map_share_upload` | 16 to 20480 |
|
||||
| `network.coop_friendly_fire` | `off`, `on`, `shields_only`, `explosives_only` |
|
||||
| `network.shield_effects` | `stock`, `glow`, `light_show`, `overshield`, `glow_overshield`, `light_show_overshield`, `players` |
|
||||
|
||||
A dedicated server may also keep words out of its chat and its players'
|
||||
names (`server.chat_filter`, off by default): the words of streamer mode's
|
||||
list, by group, each group from the least severity its setting names
|
||||
(`server.chat_filter_slurs`, `mild` by default: every slur;
|
||||
`server.chat_filter_swearing` and `server.chat_filter_insults`, `off`).
|
||||
`censor` shows a line's words as stars to everyone; `block` refuses the
|
||||
line (its sender is told "Your line was not sent: it has words this server
|
||||
does not allow") and refuses at the door a machine whose player's name has
|
||||
them, which an updated game shows as "The host refused: your player name"
|
||||
(an older one says the game is closed). Each is logged (`chat filter: …`,
|
||||
`refusing a machine … its name has words the server's filter keeps out`).
|
||||
Links are `network.text_chat`'s, refused by default. A list of words is
|
||||
not a moderator: spaced letters and look-alikes get past it.
|
||||
|
||||
A dedicated server's text chat is its `network.text_chat`'s, listed or
|
||||
not: `on` by default (lines with links refused), `links`, or `off`, live
|
||||
(`sv_set network.text_chat off`). A game a player hosts has no text chat
|
||||
while it is listed in the server browser; a dedicated server is the
|
||||
exception, and the players who join it from the browser's dedicated servers
|
||||
have the chat as it says, as long as a master server lists it (the
|
||||
masters' word that it is an approved operator's; a listing's own flag is
|
||||
not enough, so a dedicated server listed by the brokers alone, before its
|
||||
operator is approved, has none for them).
|
||||
|
||||
The settings `sv_set` does not change (`server.web_viewer_password`,
|
||||
`server.web_owner_password`, `server.web_port`, `server.web_bind`, `server.web_trusted_proxy`, the
|
||||
paths, the master servers' files...) are changed in `config.toml` or their
|
||||
environment variables: `sv_reload` reads the file's `server.*` settings
|
||||
again, and the web port and its address are bound once, at the start. The
|
||||
rotation is changed by the `sv_rotation_*` commands.
|
||||
|
||||
## HTTP
|
||||
|
||||
The server listens on `server.web_port` (8080; 0 for none) at
|
||||
`server.web_bind` (`127.0.0.1`, an IPv4 address). Bound beyond loopback,
|
||||
every web password that is set (admin, moderator, viewer) must have 8
|
||||
characters or more, else the server exits with code 3; the owner's
|
||||
(`server.web_owner_password`) must have 8 or more wherever the port is
|
||||
bound. The page (`/`), the API
|
||||
(`/api/...`), the RCON (`/ws`), `/healthz` and `/metrics` share the port.
|
||||
|
||||
Requests are HTTP/1.1 (or 1.0), `GET`, `HEAD`, `POST`, `PUT` or `DELETE`
|
||||
(`HEAD` is answered as `GET` is, without the body, and counts as a read,
|
||||
as a `GET`; `/api/login` takes `POST` alone), a head of 8 KB at most whose
|
||||
lines end with CRLF (a bare LF, a CR inside a line, or more after the empty
|
||||
line that ends it: `400 bad_request`) and a body of 64 KB at most, sent within 10 seconds of the
|
||||
connection's opening or of its last answer (a connection that sends
|
||||
nothing is closed then too). `Transfer-Encoding` and `Expect` are refused.
|
||||
24 connections are taken at once; when they are all taken, the oldest that
|
||||
waits for a request (no RCON, no request being answered) is closed for a
|
||||
new one. A client that does not read its answers is read no further once
|
||||
256 KB of them wait, and is closed past 2 MB.
|
||||
|
||||
Every request but `/healthz` counts against its address's allowance, the
|
||||
page's files, `/metrics`, a sign-in and the RCON's upgrades (`/ws`) too: 60
|
||||
a minute, or 600 with a session (429 `rate_limited` past it, with
|
||||
`Retry-After: 60`). Behind `server.web_trusted_proxy`, a request's address
|
||||
is the last entry of its `X-Forwarded-For` (the one the proxy appended: an
|
||||
IPv4 address, `a.b.c.d` or `a.b.c.d:port`, or an IPv6 one, `v6`, `[v6]` or
|
||||
`[v6]:port`), and its `X-Forwarded-Host` and `X-Forwarded-Proto` are
|
||||
believed, whether or not it sends `X-Forwarded-For`; from any other
|
||||
address they are ignored. IPv6 clients are counted by their /64: one
|
||||
host's addresses share its allowance and its lockouts. Every answer is JSON
|
||||
(`Content-Type: application/json`) unless said, with
|
||||
`Cache-Control: no-store`, `X-Content-Type-Options: nosniff`,
|
||||
`Referrer-Policy: same-origin` (under `no-referrer` a browser would send
|
||||
the page's own changes with `Origin: null`) and
|
||||
`Content-Security-Policy: default-src 'self'; frame-ancestors 'none'`.
|
||||
|
||||
### Signing in
|
||||
|
||||
`POST /api/login` with `{"password":"…"}` answers
|
||||
`{"ok":true,"token":"<64 hex>","role":"admin","csrf":"<32 hex>","expires":<unix seconds>}`
|
||||
and sets the cookie `opence_session=<token>; HttpOnly; SameSite=Strict;
|
||||
Path=/`, with `Secure` when the request came through
|
||||
`server.web_trusted_proxy` with `X-Forwarded-Proto: https` (never from
|
||||
another address, whatever it says). The admin password
|
||||
(`server.web_password`) gives the admin role, the moderator password
|
||||
(`server.web_moderator_password`) the moderator role, the viewer password
|
||||
(`server.web_viewer_password`) the viewer role; `{"by":"…"}` beside the
|
||||
password names who signed in, in the log. A session lasts 12 hours, or 30
|
||||
minutes without a request (the RCON's messages do not count: a page left
|
||||
open asks `GET /api/session` now and then); 16 are kept at most, of every
|
||||
role.
|
||||
|
||||
The owner's password (`server.web_owner_password`, empty by default: none)
|
||||
gives the owner role, for a supervisor on the server's own machine (a
|
||||
fleet's agent, a panel's daemon): what standard input may do, over the
|
||||
API and the RCON (`quit`, `sv_stop`, `sv_restart`, `POST /api/stop`, the
|
||||
owner's settings by `sv_set` and `PUT /api/settings`, the game's own
|
||||
console commands by `POST /api/command`, the players' addresses and
|
||||
hardware ids in `/api/players` and the events). It signs in only when the
|
||||
connection's own peer address is in `127.0.0.0/8` and is not the trusted
|
||||
proxy's: never by `X-Forwarded-For`, and never through
|
||||
`server.web_trusted_proxy`, even one on the machine itself. From any other
|
||||
address the right owner's password is refused with `403 forbidden` (the
|
||||
RCON's `auth`: `{"code":"forbidden"}`, and the connection closes 1008),
|
||||
and counts toward the address's lockout as a wrong password does. An
|
||||
owner's session is used from the machine itself alone, as it was begun
|
||||
(from elsewhere its token is no session: `401`, the RCON's `auth` with it
|
||||
`denied`). A password that is also another role's gives the owner role
|
||||
from the machine itself and the other role from elsewhere: give the owner
|
||||
a password of its own.
|
||||
|
||||
A script passes `Authorization: Bearer <token>`. The page passes the
|
||||
cookie, and on every request that changes something the header
|
||||
`X-CSRF-Token: <csrf>`; the `Origin` of such a request (and of the
|
||||
WebSocket's) must be the server's own. An `Origin: null` is taken only
|
||||
when the browser's `Sec-Fetch-Site` says `same-origin`.
|
||||
|
||||
`POST /api/logout` ends the session (with the `X-CSRF-Token` by the
|
||||
cookie; `GET` answers 405). `GET /api/session` answers
|
||||
`{"ok":true,"role":…,"csrf":…,"expires":…}`, or 401.
|
||||
|
||||
When `server.web_password`, `server.web_moderator_password`,
|
||||
`server.web_viewer_password` or `server.web_owner_password` changes
|
||||
(`sv_set` and the settings change the first two; `sv_reload` reads any of
|
||||
them from `config.toml`), the sessions of its role end and that role's RCON
|
||||
connections close (1008, `the password changed`).
|
||||
|
||||
Five wrong passwords from an address (an IPv6 one's /64) in 10 minutes
|
||||
lock it out for 10 minutes (429), and no more than 30 passwords a minute
|
||||
are checked in all. `/api/login` takes `POST` alone (any other method:
|
||||
405).
|
||||
|
||||
### Errors
|
||||
|
||||
```json
|
||||
{"ok":false,"error":{"code":"forbidden","message":"needs the admin role"}}
|
||||
```
|
||||
|
||||
| Status | Codes |
|
||||
| --- | --- |
|
||||
| 400 | `bad_request`, `schema` (a field missing or out of range), `failed` (the command ran and failed: its lines in `lines`), `rejected` (rotation entries: `rejected[]`), `invalid` (a gametype file: `line`) |
|
||||
| 401 | `denied` (no session, or a wrong password) |
|
||||
| 403 | `forbidden` (the role; the owner's password from beyond the machine), `csrf`, `origin` |
|
||||
| 404 | `not_found` (also a command that is not one, a player or a ban that is not there) |
|
||||
| 405 | `method` |
|
||||
| 409 | `pinned` (a setting its environment variable sets), `changed` (a player's action whose slot holds another player now: the current name in `name`, nothing done) |
|
||||
| 413 | `too_large` |
|
||||
| 426 | `bad_request` (the WebSocket's version is not 13) |
|
||||
| 429 | `rate_limited`, `locked` (with `Retry-After`) |
|
||||
| 500 | `internal` (out of memory, a file that cannot be written) |
|
||||
| 503 | `loading` (the game did not answer in 20 seconds, as while a map loads; with `Retry-After: 5`), `starting`, `busy` (8 RCON connections already; with `Retry-After: 5`) |
|
||||
|
||||
### Endpoints
|
||||
|
||||
| Method, path | Role | Body → answer |
|
||||
| --- | --- | --- |
|
||||
| `GET /healthz` | none | `200 {"state":"lobby"}` (or `loading`, `playing`, `postgame`) while the server hosts and its frames run; `503` with `{"state":"starting"}`, `{"state":"stalled"}` (no frame for a minute) or the other state otherwise |
|
||||
| `GET /metrics` | none (`server.metrics`) | Prometheus text |
|
||||
| `GET /api/status` | viewer | The status (below) |
|
||||
| `GET /api/players` | viewer | `{"ok":true,"players":[<player>…]}` (with `address` and `hwid` for the owner, or every role with `server.log_addresses`) |
|
||||
| `POST /api/players/{slot}/kick` | moderator | `{"name":"<the player's name, checked>"}` → `{"ok":true,"lines":[…]}`, or `409 changed` when the slot holds another player |
|
||||
| `POST /api/players/{slot}/ban` | moderator | `{"name":…,"duration":"1d","reason":"…"}` (no duration: for ever, which a moderator's ban cannot be: `400 failed`) |
|
||||
| `POST /api/players/{slot}/mute` | moderator | `{"name":…,"minutes":10}` |
|
||||
| `POST /api/players/{slot}/unmute` | moderator | `{"name":…}` |
|
||||
| `POST /api/players/{slot}/tell` | moderator | `{"name":…,"text":"…"}` |
|
||||
| `POST /api/say` | moderator | `{"text":"…"}` |
|
||||
| `GET /api/rotation` | viewer | `{"ok":true,"index":0,"entries":[<entry>…],"next":<entry>}` |
|
||||
| `PUT /api/rotation` | admin | `{"entries":["bloodgulch:ctf",…]}` → the rotation, or `400 rejected` with `"error":{…,"rejected":[{"index":1,"entry":"…","reason":"…"}]}` and nothing changed |
|
||||
| `POST /api/rotation/next` | moderator | `{}`: `sv_map_next` |
|
||||
| `POST /api/rotation/play` | moderator | `{"map":"…","gametype":"…"}`: `sv_map` (a map or gametype that cannot be played: `400 failed`) |
|
||||
| `GET /api/gametypes` | viewer | `{"ok":true,"builtin":["slayer",…],"schema":{"fields":[<field>…]},"files":[{"name":…,"base":…,"description":…,"error":null}]}` (`builtin`: the Xbox's gametypes, then OpenCE's; a file that cannot be read has `base` and `description` empty and `error` saying why) |
|
||||
| `GET /api/gametypes/{name}` | viewer | `{"ok":true,"name":…,"text":"<the TOML>"}` |
|
||||
| `PUT /api/gametypes/{name}` | admin | `{"text":"<TOML>"}` → `{"ok":true}`, or `400 invalid` with `line` and `message` (a name is `a`–`z`, `0`–`9`, `_` and `-`, 32 at most) |
|
||||
| `DELETE /api/gametypes/{name}` | admin | `{"ok":true}` |
|
||||
| `GET /api/maps` | viewer | `{"ok":true,"maps":[{"name":"bloodgulch","level":"levels\\test\\bloodgulch\\bloodgulch","kind":"xbox","title":"Blood Gulch"}…]}` (`kind`: `xbox` or `custom`; `title` is the map's display name, else its `name`) |
|
||||
| `GET /api/bans` | admin | `{"ok":true,"bans":[{"n":0,"when":"2026-10-19 18:00:00","ip":"…","hwid":"…","players":"…","reason":"…","until":<unix>\|null}…]}` |
|
||||
| `POST /api/bans` | admin | `{"ip":"203.0.113.5","hwid":"…","names":"…","duration":"1d","reason":"…"}` (`ip` or `hwid`, or both; the rest may be left out: no duration is for ever) → `{"ok":true,"n":<the new ban's number in GET /api/bans>}`: `sv_ban_address`, a machine present of the address or the hardware id dropped; `400 schema` for an address that is not IPv4, a hardware id that is not hex, a duration that is not one |
|
||||
| `DELETE /api/bans/{n}` | admin | `{"ok":true}` |
|
||||
| `GET /api/settings` | admin | `{"ok":true,"settings":[<setting>…]}` |
|
||||
| `PUT /api/settings` | admin | `{"server.name":"…","server.max_players":16,"server.public":true,…}` (a value as JSON, a boolean, a number or a string, or its text: `"true"`, `"16"`; `null` empties it) → `{"ok":true,"applied":["server.name"],"errors":[{"name":…,"code":…,"message":…}]}`; each setting is changed or refused on its own |
|
||||
| `POST /api/command` | the command's | `{"line":"sv_status"}` (511 characters at most) → `{"ok":true,"lines":["…"]}`, or a refusal (`failed`, `forbidden`, `not_found`, `pinned`) with the command's `lines` |
|
||||
| `POST /api/stop` | owner | `{"after":"now\|game\|empty","notice":"…","restart":false}` (`notice` and `restart` may be left out) or `{"cancel":true}` → `{"ok":true,"lines":["…"]}`: `sv_stop` (`sv_restart` with `restart`) `after notice`, or `sv_stop cancel` (`400 failed` with no drain waiting); `400 schema` for another `after` |
|
||||
| `GET /api/log?after=<n>&limit=<m>` | viewer | `{"ok":true,"lines":[{"n":12,"time":<ms>,"level":"info","cat":"game","text":"…"}…],"next":12,"missed":0}` (`limit` 1 to 1024, 256 by default; the chat's lines for admins only) |
|
||||
| `GET /api/events?after=<seq>` | viewer | `{"ok":true,"events":[<event>…],"next":<seq>,"missed":0}` (`player_joined` and `player_left` with `address` and `hwid` for the owner, or every role with `server.log_addresses`) |
|
||||
| `GET /ws` | | The RCON (below) |
|
||||
| `GET /`, `/app.js`, `/app.css`, `/icon.svg` | none | The page (`server.web_ui`) |
|
||||
|
||||
`next` is the `after` of the next request: the last line's `n` (or event's
|
||||
`seq`) read. An `after` past the latest (as after a restart) reads from the
|
||||
start. `missed` counts lines or events that left the ring (2048 lines, 512
|
||||
events) before they were asked for.
|
||||
|
||||
### The status
|
||||
|
||||
```json
|
||||
{"ok":true,"time":1760900000123,"name":"OpenCE Server","state":"playing",
|
||||
"build":"build-206","network_version":38,"uptime":3600,"games_hosted":4,
|
||||
"map":"bloodgulch","level":"levels\\test\\bloodgulch\\bloodgulch","gametype":"ctf","variant":"CTF","teams":true,
|
||||
"players":5,"max_players":16,"machines":5,"countdown":-1,"game_seconds":312,"team_scores":[2,1],
|
||||
"listing":{"online":true,"public":true,"password":false,"invite":"halo://join/…"},
|
||||
"rotation":{"index":0,"count":3,"next":{"text":"sidewinder:team_slayer","map":"sidewinder","gametype":"team_slayer"}},
|
||||
"frame_ms_max":4.1,"frame_ms_avg":1.2,"tick_ms_avg":1.2,
|
||||
"masters":[{"url":"https://master1.example.org","listed":true,"probe":"ok","code":"","message":"","updated":1760899990}],
|
||||
"update":{"available":false,"build":""},
|
||||
"drain":null,
|
||||
"pid":4021,"started":1760896400,"instance":"eu-1","region":"eu","tunnel_port":2302,
|
||||
"publisher_key_id":"3f9a2c7d1e5b8a04","web_port":8080,
|
||||
"capabilities":["events","status","rotation","settings","bans","owner_web","ban_address","stop","event_addresses","identity"]}
|
||||
```
|
||||
|
||||
`state` is `waiting` (the menus settling), `hosting` (making the game),
|
||||
`lobby`, `loading`, `playing`, `postgame` or `stopping`. `countdown` is the
|
||||
lobby's seconds left, `-1` when it is not counting. `team_scores` is `null`
|
||||
in a game without teams. `frame_ms_max` and `frame_ms_avg` are the longest
|
||||
and the mean frame of the last minute (`tick_ms_avg` is the mean again, for
|
||||
older readers). `invite` is given to admins only (empty for others). An entry of the rotation is
|
||||
`{"text":"sidewinder:team_slayer+score=50","map":"sidewinder","gametype":"team_slayer","rules":{"score":50},"rejected":null}`
|
||||
(`rejected` is why it cannot be played, else `null`). `drain` is the
|
||||
drain waiting (`sv_stop game`...), `{"after":"game","restart":false,"since":<unix
|
||||
seconds>}`, else `null`. `pid` is the server's process, `started` when it
|
||||
started (seconds since 1970), `instance` the name the master servers know
|
||||
it by (`server.instance`, else the slug of `server.name` they are given),
|
||||
`region` `server.region`, `tunnel_port` the tunnel's UDP port
|
||||
(`network.tunnel_port`; 0 when `network.online` is off), `publisher_key_id`
|
||||
the publisher key's id (16 hex digits; empty without a key: `sv_publisher`)
|
||||
and `web_port` `server.web_port`. `capabilities` is the RCON's hello's. The rotation's
|
||||
`index` (in the status and `GET /api/rotation`) is the entry being played,
|
||||
`-1` while an `sv_map` game is played or before the first lobby; `next` is
|
||||
the entry after the one played last (the first while none has been).
|
||||
|
||||
A player is
|
||||
`{"slot":0,"name":"Milenko","team":0,"score":3,"kills":3,"deaths":1,"assists":0,"ping":42,"machine":1,"joined":1760899000,"muted":false}`;
|
||||
with the owner role, or `server.log_addresses`, also
|
||||
`"address":"203.0.113.5","hwid":"…"`. `team` is 0 (red), 1 (blue) or -1
|
||||
(no teams); `ping` is in milliseconds, `null` when it is not known yet.
|
||||
`client` is the player's machine's build as its game tells it (shortly
|
||||
after it joins), for every role:
|
||||
`{"build":282,"flavor":"release","version":"OpenCE Linux | build 282 (release)","repository":"OpenCommunityEdition/OpenCE","mods":["trollface 1.0"]}`
|
||||
(`build` 0 for a build CI did not number, `repository` empty when the build
|
||||
does not know it, `mods` the mods it plays in their load order, each its
|
||||
folder and its version), or `null` from a game that does not tell it. It is
|
||||
what the player's game says, which a changed build can make anything.
|
||||
|
||||
A setting is
|
||||
`{"name":"server.name","type":"string","value":"OpenCE Server","default":"OpenCE Server","comment":"…","env":"HALO_SERVER_NAME","pinned":false,"secret":false,"choices":null,"min":null,"max":null}`;
|
||||
`type` is `boolean`, `integer`, `real` or `string`, and `value` and
|
||||
`default` are of that type in JSON (`true`, `16`, `"OpenCE Server"`); a
|
||||
reader should also take their text (`"true"`, `"16"`), which older servers
|
||||
sent. `choices` lists a word setting's words, `min` and `max` bound a
|
||||
number's, each `null` where there is none (the table above). `env` is
|
||||
`null` for a setting no environment variable sets. A secret one (the
|
||||
passwords) has `value` and `default` empty and `"set":true` when it is
|
||||
set. `pinned` is a setting
|
||||
its environment variable (`env`) sets: it cannot be changed.
|
||||
|
||||
A gametype schema field is
|
||||
`{"key":"score_to_win","alias":"score","table":"universal","engine":"all","type":"integer","min":0,"max":999,"choices":null,"default":null,"description":"…"}`
|
||||
(`table`: the gametype file's table it goes in, `universal`, `options`,
|
||||
`ctf`, `slayer`, `oddball`, `king` or `race`; `engine`: `all`, or the game
|
||||
engine whose table it is; `type`: `integer`, `boolean` or `choice`).
|
||||
|
||||
## The RCON
|
||||
|
||||
`GET /ws` with `Upgrade: websocket` and the subprotocol `opence-rcon-1`.
|
||||
Every frame is text holding one JSON object. The server speaks first:
|
||||
|
||||
```
|
||||
→ {"type":"hello","protocol":1,"server":"OpenCE Server","build":"build-206","network_version":38,
|
||||
"capabilities":["events","status","rotation","settings","bans","owner_web","ban_address","stop","event_addresses","identity"]}
|
||||
← {"type":"auth","password":"…","by":"paul"} or {"type":"auth","token":"<session token>"}
|
||||
→ {"type":"auth","ok":true,"role":"admin"}
|
||||
→ {"type":"auth","ok":false,"error":{"code":"denied"}} and the connection closes (1008)
|
||||
← {"type":"command","id":1,"line":"kick Milenko"} or {"type":"command","id":1,"command":"say","args":["two words"]}
|
||||
→ {"type":"reply","id":1,"ok":true,"lines":["Milenko kicked by the host"]}
|
||||
→ {"type":"reply","id":2,"ok":false,"lines":["…why…"]} (the command ran and failed)
|
||||
→ {"type":"reply","id":3,"ok":false,"lines":[],"error":{"code":"busy","message":"…"}} (not run)
|
||||
← {"type":"subscribe","events":["player","chat","game","moderation","status","log","master"],"after":1830}
|
||||
→ {"type":"event","seq":1831,"time":1760900000123,"event":"player_joined","slot":3,"name":"Milenko",…,"replay":true}
|
||||
→ {"type":"event","seq":1831,"time":…,"event":"status","status":{…the status…}} (at the subscribe, then every 2 s)
|
||||
→ {"type":"event","time":…,"event":"log","n":5120,"level":"info","cat":"game","text":"…"} (no seq: n is its sequence)
|
||||
← {"type":"ping"}
|
||||
→ {"type":"pong"}
|
||||
→ {"type":"overflow"} and the connection closes (1013): the client read too slowly
|
||||
→ {"type":"error","id":…,"error":{"code":"…","message":"…"}} (an unknown type, a malformed message)
|
||||
```
|
||||
|
||||
A connection signed in with the page's cookie (on the same origin) needs no
|
||||
`auth` message: its `hello` is followed by `{"type":"auth","ok":true,…}`.
|
||||
The `capabilities` say what the server has beyond the first release's
|
||||
(`events`, `status`, `rotation`, `settings`, `bans`): `owner_web`,
|
||||
`ban_address`, `stop`, `event_addresses` and `identity` ("Panels and
|
||||
fleets"); a client checks for one before it uses it. The owner's password
|
||||
signs in from the server's own machine alone ("Signing in").
|
||||
A command is a `line`, or a `command` and its `args`, which the server
|
||||
joins with spaces, quoting an argument that holds a space or is empty (511
|
||||
characters in all at most). Ids are the client's (a number or a string),
|
||||
echoed in the reply; each command gets exactly one reply. A connection
|
||||
runs one command at a time: a command sent before the last one's reply is
|
||||
not run. A reply whose command ran has `ok` and the command's `lines`, and
|
||||
no `error`, whether it succeeded or failed; one that was not run has `ok`
|
||||
false, no lines and an `error`: `denied` (not signed in), `rate_limited`
|
||||
(32 commands a second, in bursts of 64), `bad_request` (no command, or too
|
||||
long), `busy` (another command's reply is awaited) or `loading` (the game
|
||||
did not answer in 20 seconds; the command may still have run, and is never
|
||||
sent again by the server). `after` replays the events still in the ring
|
||||
since that sequence number, marked `"replay":true`. A connection holds 1024
|
||||
messages for the client at most; 8 connections are taken at once (a ninth
|
||||
upgrade answers `503 busy`), and each upgrade counts against its address's
|
||||
allowance (above). The
|
||||
event groups are `player` (`player_joined`, `player_left`, `map_share`), `chat`
|
||||
(`chat`), `game` (`lobby_opened`, `countdown`, `game_started`,
|
||||
`game_ended`, `postgame`, `score`, `kill`), `moderation` (`kick`, `ban`,
|
||||
`unban`, `mute`, `unmute`, `speed_hack`), `status` (`status`), `log`
|
||||
(`log`, each log line as `{"n","level","cat","text"}`), `master`
|
||||
(`master`), and `server` (`server_started`, `reloaded`, `warning`,
|
||||
`drain`, `shutdown`), which every subscriber gets.
|
||||
The log's lines of the `chat` category go to the `chat` group, the others
|
||||
to `log`.
|
||||
`status` and `log` events go to their subscribers as they come and are
|
||||
not kept in the ring: `after` does not replay them (`/api/log` reads the
|
||||
log's own ring). A `status` event's `seq` is the latest event's (no new
|
||||
number: the same one comes again until another event), and a `log` event
|
||||
has no `seq`: its `n`, the log line's number and `/api/log`'s cursor, is
|
||||
its sequence. A client keeps one cursor for the events (`seq`, of the
|
||||
events of the ring) and another for the log's lines (`n`); a client that
|
||||
reconnects with `after` may get events it had, and drops those whose `seq`
|
||||
it has seen (a `status` event is never dropped so).
|
||||
|
||||
## Events
|
||||
|
||||
Every event has `seq` (rising, never reused while the server runs; a
|
||||
`status` event has the latest one's, a `log` event none: above), `time`
|
||||
(milliseconds since the epoch) and `event`:
|
||||
|
||||
| Event | Fields |
|
||||
| --- | --- |
|
||||
| `server_started` | `name, build, network_version, pid, started, instance, region, tunnel_port, publisher_key_id, web_port` (as the status's), `rotation[]` (the entries' texts) |
|
||||
| `lobby_opened` | `map, gametype, variant` (the gametype's name as the game shows it), `teams, index` (the rotation's entry) |
|
||||
| `countdown` | `seconds` (-1: paused) |
|
||||
| `game_started` | `map, gametype, variant, teams, team_scores[]` (team games), `players[]` |
|
||||
| `game_ended` | `map, gametype, variant, teams, reason` (`score`, `time`, `idle`, `empty`, `command`, `next`), `duration` (seconds), `team_scores[]` (team games), `players[]` |
|
||||
| `postgame` | `seconds` |
|
||||
| `player_joined` | `slot, name, team, machine`; `address, hwid` for the owner, or every role with `server.log_addresses` |
|
||||
| `player_left` | `slot, name, reason` (`left`; `kicked` and `banned` when the server's `kick`, `ban` or `sv_ban_address` dropped the machine, `banned` for a speed hack's drop too); `address, hwid` (as it joined) as `player_joined`'s |
|
||||
| `chat` | `channel` (`everyone`, `team`, `vehicle`), `slot, name, text` (admins only; the lines the host sends on) |
|
||||
| `kill` | `killer, victim` (slots; -1 for none), `weapon` (the killer's weapon's or the killing object's tag name, or null), `friendly_fire` |
|
||||
| `score` | `map, gametype, variant, teams, team_scores[]` (team games), `players[]` (once a second at most, on a change) |
|
||||
| `kick`, `ban`, `unban`, `mute`, `unmute` | `name, by, reason?, until?` |
|
||||
| `speed_hack` | `machine, names, rate, ahead_ticks, action` (`kicked`, or `unverified`: its datagrams alone said so, and it stays) |
|
||||
| `map_share` | `machine, map, state` (`asked`, `downloading` at each tenth, `downloaded` or `failed` once for each request), `progress` (0 to 100: a percentage already) |
|
||||
| `warning` | `text` (a newer release, with `server.auto_update`) |
|
||||
| `reloaded` | `rotation_changed, rejected[]` (`{"entry","reason"}` of each entry left out) |
|
||||
| `master` | `url, listed, probe, code, message` |
|
||||
| `drain` | `after` (`now`, `game`, `empty`, `cancel`), `restart` (exit code 5), `notice` (empty for none) |
|
||||
| `shutdown` | `reason` (`quit`, `sv_stop`, `sv_restart`, `drained`: a drain's end, `signal <n>`, `update installed`, `nothing to play`, `debug.exit_after`), `code` (the exit code) |
|
||||
|
||||
Players in events are as in `/api/players` for the viewer role (no
|
||||
addresses), but for `player_joined` and `player_left`, which carry the
|
||||
player's address and hardware id (`""` when not known) to the owner, and to
|
||||
every role when `server.log_addresses` is on (`/api/players`' rule), in the
|
||||
RCON's events, their replay and `GET /api/events` alike. `variant` is the gametype's name as the game shows it (`Co-op`
|
||||
in a co-op entry).
|
||||
|
||||
## Bans
|
||||
|
||||
A ban is a line of `bans.txt` (in `paths.logs`, else the data root). A
|
||||
timed ban is kept out by its line's `until=` alone, and ends then. A ban
|
||||
for ever, and a machine dropped for cheating, also keep the machine out
|
||||
for the rest of the run by its address, its real address or its hardware
|
||||
id. `sv_ban_address` and `POST /api/bans` write such a line for an address
|
||||
or a hardware id with no player of it needed (the part not given is
|
||||
`none`). `unban` takes the line out and readmits the machine by
|
||||
the line's address or hardware id, whether it joins on the LAN or by
|
||||
internet play.
|
||||
|
||||
## The rotation
|
||||
|
||||
`server.rotation` (and `sv_rotation_set`, `PUT /api/rotation`) is a list of
|
||||
entries, `map[:gametype[+rule=value...]]`, separated by commas, semicolons
|
||||
or new lines; a line that begins with `#` is a comment (to its line's end,
|
||||
commas and all). The text is 4096 characters at most (the entries past it
|
||||
are left out, with a warning), an entry 255 characters and the list 64
|
||||
entries. `config.toml` keeps a string setting of up to 4096 characters, so
|
||||
a rotation that long is saved whole and read back after a restart.
|
||||
|
||||
- The map is a multiplayer map's name (`bloodgulch`: the Xbox's
|
||||
`maps/<name>.map`, else a Custom Edition map of `custom_maps`),
|
||||
`custom_maps\<name>` (a Custom Edition map; `/` is taken for `\`), or a
|
||||
level's path (`levels\test\bloodgulch\bloodgulch`). A campaign level is
|
||||
played as co-op only: `<level>:coop`, at `server.coop_difficulty`.
|
||||
- The gametype (`slayer` when there is none) is a built-in's name
|
||||
(`slayer`, `team_slayer`, `slayer_pro`, `elimination`, `phantoms`,
|
||||
`endurance`, `rockets`, `snipers`, `stalker`, `ctf`, `ironctf`,
|
||||
`ctf_pro`, `invasion`, `oddball`, `team_oddball`, `reverse_tag`,
|
||||
`accumulation`, `juggernaut`, `king`, `team_king`, `king_pro`,
|
||||
`crazy_king`, `race`, `team_race`, `rally`, `team_rally`, and Halo PC's
|
||||
names `ffa`, `ffa_slayer`, `teamslayer`, `tslayer`, `koth`, `team_koth`,
|
||||
`iron_ctf`, `teamrace`, `teamoddball`), an OpenCE gametype's (`swat`,
|
||||
`infection`, `gun_game`, `hardcore`, `hardcore_ctf`, `hardcore_oddball`,
|
||||
`hardcore_king`), a gametype file's name (`gametypes/<name>.toml`), or
|
||||
`file=<name>` (a gametype a player's game saved, below). A gametype's
|
||||
name is letters, digits, `_`, `-` and `.`, in any case.
|
||||
- A rule is a gametype rule's name or its short name (`score`, `time`,
|
||||
`weapons`, `ff`...; `GET /api/gametypes`'s schema lists them), with a
|
||||
value it takes; a rule of another game engine than the gametype's is
|
||||
refused. 48 rules at most; a rule given twice is the last.
|
||||
|
||||
An entry that cannot be played (a map that is not there, a bad gametype
|
||||
file, a rule out of range) is left out with a warning, at the start and at
|
||||
`sv_reload`; `sv_rotation_set` and `PUT /api/rotation` change nothing when
|
||||
one of their entries cannot be played.
|
||||
|
||||
A change of the rotation (`sv_rotation_*`, `PUT /api/rotation`,
|
||||
`sv_reload`) keeps its place: the next game is the entry after the one
|
||||
played last, found again in the new list (the first entry only when none
|
||||
has been played yet). `sv_reload` takes the rotation again when its text
|
||||
changed, and also when only its entries' rejections changed (a map or a
|
||||
gametype file added or taken out since).
|
||||
|
||||
`server.team_start` decides how a team game starts. `one` (the default)
|
||||
starts it with the players of one team. `both` waits, saying nothing,
|
||||
for a player on each team. `skip`, when one player waits for a team game
|
||||
that `sv_map` did not ask for, plays the rotation's next entry without
|
||||
teams instead (if it has one); it is checked when the lobby opens and
|
||||
again when its countdown would begin. With no entry left, the server
|
||||
stops with exit code 3 (2 when no rotation map is there), or plays
|
||||
`bloodgulch:slayer` with `server.rotation_fallback`.
|
||||
|
||||
## Gametype files
|
||||
|
||||
A gametype file, `gametypes/<name>.toml` (the name `a`–`z`, `0`–`9`, `_`
|
||||
and `-`), is a built-in or OpenCE gametype (`base`) and rules over it:
|
||||
|
||||
```toml
|
||||
base = "team_king" # the gametype it starts from
|
||||
name = "Moving Hill" # the name the game shows: 11 characters of printable ASCII
|
||||
|
||||
[universal]
|
||||
score_to_win = 3
|
||||
|
||||
[options]
|
||||
time_limit = 15
|
||||
friendly_fire = "off"
|
||||
|
||||
[king]
|
||||
moving_hill = true
|
||||
```
|
||||
|
||||
Each rule goes in its table (the schema's `table`): `[universal]`,
|
||||
`[options]`, and one game engine's, `[ctf]`, `[slayer]`, `[oddball]`,
|
||||
`[king]` or `[race]`. A file gives each rule its full name
|
||||
(`vehicle_set`, `team_vehicles`, `score_to_win`): the short names
|
||||
(`vehicles`, `score`) are the rotation's alone. A file is 64 KB at most.
|
||||
`deploy/gametypes` has examples. The server reads the `gametypes` folder
|
||||
beside `config.toml` if there is one, else the data root's, and writes the
|
||||
web page's files to it.
|
||||
|
||||
A gametype a player's game saved is played with `file=<name>`: copy the
|
||||
saved gametype, as `<name>.gametype`, into the same `gametypes` folder
|
||||
(beside `config.toml` if there is one, else the data root's).
|
||||
|
||||
## The listing
|
||||
|
||||
A public server (`server.public`, with `network.online` and
|
||||
`network.public_lobby`) is published to each master server of
|
||||
`masters.txt` (`docs/master_protocol.md`). A change that a list shows (the
|
||||
listing made public or private, a player joining or leaving, the name, the
|
||||
map) is published within 5 seconds. Made private, the server makes a new
|
||||
invite and sends the masters a closed publish, which takes it off their
|
||||
lists;
|
||||
`network.public_lobby = false` stops the publishing too. A master's
|
||||
`Retry-After` is kept (a day at most). `key_revoked` and
|
||||
`publisher_revoked` stop the publishing to that master for the run;
|
||||
`unknown_key`, `publisher_pending`, `application_denied` and
|
||||
`listing_taken` are logged once a minute while they last.
|
||||
|
||||
## Files
|
||||
|
||||
| File | What |
|
||||
| --- | --- |
|
||||
| `config.toml` | Every setting (beside the executable; `HALO_CONFIG_FILE`, else `--config`, names another) |
|
||||
| `init.txt` (`server.init_file`) | Commands run at the start, in the data root unless a full path |
|
||||
| `gametypes/<name>.toml` | Gametype files: the `gametypes` folder beside `config.toml` if there is one, else the data root's |
|
||||
| `gametypes/<name>.gametype` | Gametypes saved by a player's game (`file=<name>` in the rotation): the same `gametypes` folder |
|
||||
| `publisher.key` | The publisher key for the master servers (beside `config.toml`). On Windows, a server's `config.toml` and `publisher.key` are given an access list of their owner alone (the entries inherited for Administrators and SYSTEM taken out) |
|
||||
| `masters.txt` | The master servers (`server.masters_file`: beside `config.toml`, else beside the executable); one that names none leaves the official master, built in |
|
||||
| `bans.txt`, `cheaters.txt`, `debug.txt` | In `paths.logs`, else the data root |
|
||||
| `status.json` (`server.status_file`) | The status, written every 2 seconds |
|
||||
| A password's file (`HALO_SERVER_WEB_PASSWORD_FILE`, `HALO_SERVER_WEB_OWNER_PASSWORD_FILE`, `HALO_SERVER_WEB_MODERATOR_PASSWORD_FILE`, `HALO_SERVER_WEB_VIEWER_PASSWORD_FILE`, `HALO_SERVER_PASSWORD_FILE`) | A container's secret: when the plain variable is not set, the file's first line (its CR and LF off) is the setting's value, which is then pinned as the plain variable's would be (`sv_set` and `PUT /api/settings` refuse it, `409 pinned`). Read once, at the start; a file that cannot be read is logged, and the setting is `config.toml`'s |
|
||||
|
||||
## Releases
|
||||
|
||||
Each release has `SHA256SUMS` (the SHA-256 of each of its files, as
|
||||
`sha256sum` writes them: `<hex> <name>`, written by `tools/ci_build.py
|
||||
sums`) and `SHA256SUMS.sig`: the Ed25519 signature of that file's exact
|
||||
bytes by the project's release key, in 128 lowercase hex digits and a
|
||||
newline (the form `opence-master-server`'s `cmd/release-sign` writes). The
|
||||
public key is `deploy/release-key.pub` (64 hex digits:
|
||||
`d04e8b101007d1641cace8b95fcca76f7f44709f6885c3d031b52394dbdf9376`).
|
||||
`tools/release_sign.sh verify SHA256SUMS` checks the signature (OpenSSL 3),
|
||||
and `sha256sum -c --ignore-missing SHA256SUMS` the files downloaded. The
|
||||
build workflow signs with the `RELEASE_SIGNING_KEY` secret (the key's seed,
|
||||
64 hex digits) and checks the signature against `deploy/release-key.pub`
|
||||
before it publishes the release.
|
||||
@@ -0,0 +1,650 @@
|
||||
# The master servers' protocol, version 1
|
||||
|
||||
A master server lists dedicated servers and vouches for who publishes them.
|
||||
An operator applies to a master once with the public half of an Ed25519
|
||||
key, the *publisher key*, through the master's Discord bot; once an
|
||||
approver approves the application, the
|
||||
operator's servers publish to the master with requests signed by that key,
|
||||
and the master lists them after probing their UDP port. The game's server
|
||||
browser fetches each master's list, checks the master's signature with the
|
||||
key pinned in `masters.txt`, and joins a listed game by the invite in its
|
||||
listing, as it joins a game heard on the brokers.
|
||||
|
||||
A master carries no game traffic: each list entry holds the host-signed
|
||||
listing the game publishes to the signalling brokers (`p2p_lobby.c`), so
|
||||
the join path is unchanged and nobody needs the master to be honest about a
|
||||
game's details.
|
||||
|
||||
This document is the contract between the game (the publisher in
|
||||
`port/linux/src/server_master.c`, the probe's answer, the list client in
|
||||
`port/linux/src/master_list.c`) and the masters' implementations. The
|
||||
project's implementation is `opence-master`
|
||||
(github.com/OpenCommunityEdition/opence-master-server, Go, AGPL-3.0-or-later),
|
||||
whose `testdata/vectors.json` holds fixed keys and every value this
|
||||
document derives from them, and whose `tests/conformance` is the test a
|
||||
master must pass to be an official one. `docs/dedicated_server.md` is the
|
||||
server's side: its settings, `--keygen` and `--sign`.
|
||||
|
||||
## Conventions
|
||||
|
||||
| Thing | Form |
|
||||
| --- | --- |
|
||||
| Hexadecimal | Lowercase, two digits a byte, no prefix |
|
||||
| Base64 | The standard alphabet (RFC 4648 section 4) with `=` padding |
|
||||
| Times | Unix seconds, decimal, UTC |
|
||||
| JSON | UTF-8; every string the protocol defines is printable ASCII (0x20 to 0x7E) |
|
||||
| Signatures | Ed25519 as RFC 8032 defines it (with SHA-512): Monocypher's `crypto_ed25519_sign` and `crypto_ed25519_check`, Go's `crypto/ed25519` |
|
||||
| Transport | HTTPS. A master refuses publishes, key changes and peers' requests over plain HTTP except from loopback |
|
||||
| Unknown JSON fields | Ignored by both sides, so later versions can add fields |
|
||||
|
||||
## Keys and identifiers
|
||||
|
||||
| Thing | Definition |
|
||||
| --- | --- |
|
||||
| Key file (`publisher.key`, `master.key`) | One line of 64 hexadecimal digits: the Ed25519 seed (32 bytes). Anything after `#` is a comment; blank lines are skipped. Mode 0600 |
|
||||
| Public key, as text | `ed25519:` and the 32-byte public key in hexadecimal (64 digits) |
|
||||
| Key id | The first 8 bytes of SHA-256 of the 32-byte public key. Written as 16 hexadecimal digits (`keyid=`, `key_id`, `Signature-Key`); in the probe's packets it is the 8 raw bytes |
|
||||
| Instance | A name the operator gives each server process (`server.instance`): 1 to 32 characters of `a-z`, `0-9`, `-` and `_`, the first a letter or a digit |
|
||||
| Server id | The first 16 hexadecimal digits (8 bytes) of SHA-256 of the ASCII text of the key id's 16 hexadecimal digits followed by the instance's text, with nothing between them |
|
||||
|
||||
The server id hashes the key id **as its 16 characters of text**, not its 8
|
||||
bytes. With the vectors' publisher key (RFC 8032's first test seed):
|
||||
|
||||
```
|
||||
seed 9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60
|
||||
public key ed25519:d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
|
||||
key id 21fe31dfa154a261 (SHA-256 of the 32 key bytes: 21fe31dfa154a261...)
|
||||
instance main
|
||||
hashed "21fe31dfa154a261main" (20 ASCII bytes)
|
||||
server id 4c5f15237c866f6f (SHA-256 of those 20 bytes: 4c5f15237c866f6f...)
|
||||
```
|
||||
|
||||
The same instance under another key is another server id, so a server
|
||||
keeps its id across restarts as long as it keeps its key and its instance.
|
||||
A master refuses a public key whose point has a small order (its X25519
|
||||
form multiplied by a clamped scalar is zero, as `p2p_ed25519_verify`
|
||||
checks), since anyone can make signatures that verify under one.
|
||||
|
||||
`masters.txt` (the one beside `config.toml`, else the one beside the
|
||||
executable) lists the masters, one per line:
|
||||
`https://master1.example.org ed25519:<64 hex>`; `#` starts a comment; the
|
||||
first 4 are used. A file that names none (missing, empty, or comments alone,
|
||||
as the release's) leaves the official master, built into the game
|
||||
(`master_list_read_defaults` in `port/linux/src/master_list.c`) and the web
|
||||
page (`servers.js`):
|
||||
`https://master.opencommunityedition.com ed25519:89f4eda71229f11f3538679f49ef7fb0c2b407b380093f7f4fe02105b92225aa`.
|
||||
The web build reads its site's `masters.json` before the official master. The URL is an origin with no path, or a path
|
||||
the master is served under as it is (a proxy must not rewrite paths, since
|
||||
the path is signed).
|
||||
|
||||
## Signed requests
|
||||
|
||||
A publisher's requests carry a detached signature in one header:
|
||||
|
||||
```
|
||||
Authorization: OpenCE-Ed25519 keyid=<16 hex>, ts=<unix seconds>, nonce=<32 hex>, sig=<base64 of 64 bytes>
|
||||
```
|
||||
|
||||
The signature is the key's over the bytes of this string, its parts joined
|
||||
by single line feeds (0x0A) and no line feed at the end:
|
||||
|
||||
```
|
||||
OpenCE-Master-v1
|
||||
<the receiving master's key id>
|
||||
<METHOD>
|
||||
<PATH>
|
||||
<ts>
|
||||
<nonce>
|
||||
<SHA-256 of the body, in hexadecimal>
|
||||
```
|
||||
|
||||
| Part | Rule |
|
||||
| --- | --- |
|
||||
| Master key id | The key id of the master the request is sent to: the first 8 bytes of SHA-256 of the master's list-signing public key (the key pinned for it in `masters.txt`), as 16 lowercase hexadecimal digits. It binds the request to that master: a request signed for one master does not verify at another, even within the replay window. A master checks the signature with its own key id |
|
||||
| `METHOD` | The request's method in capitals: `PUT`, `DELETE`, `GET`, `POST` |
|
||||
| `PATH` | The path exactly as the request line sends it, without the query string: `/v1/servers/4c5f15237c866f6f`, `/v1/me`, `/v1/publishers` |
|
||||
| `ts` | The same decimal text as in the header: no sign, no leading zeros |
|
||||
| `nonce` | 16 random bytes in hexadecimal (32 digits), new for each request |
|
||||
| Body hash | Of the exact body bytes sent; an empty body's is SHA-256 of no bytes, `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` |
|
||||
|
||||
The four parameters come once each, in any order, separated by commas with
|
||||
optional spaces; a publisher sends them in the order above. The master
|
||||
checks, in this order, and answers the first failure:
|
||||
|
||||
| Check | Failure |
|
||||
| --- | --- |
|
||||
| The header parses (scheme, the four parameters and their forms) | `401 bad_signature` |
|
||||
| `ts` is within 300 seconds of the master's clock | `401 clock` (the body's `master_time` is the master's clock, for the server to log) |
|
||||
| The key id is a publisher's, or an application's | `403 unknown_key` |
|
||||
| The signature verifies, for this master's key id | `401 bad_signature` |
|
||||
| The nonce was not seen with this key in the last 600 seconds | `401 replay` |
|
||||
|
||||
Since `unknown_key` is answered before the signature is checked, anyone can
|
||||
learn whether a key id is known to a master (a publisher's or an
|
||||
application's) by sending it with any signature. This is a known property
|
||||
of version 1: key ids are not secret (each is a hash of a public key, which
|
||||
an operator hands out when applying), and the answer says nothing more of
|
||||
the key than that the master has seen it.
|
||||
|
||||
The vectors' `GET /v1/me` to the vectors' master (key id
|
||||
`39f713d0a644253f`) at 1760900001 with the nonce
|
||||
`f0e0d0c0b0a090807060504030201000` signs
|
||||
|
||||
```
|
||||
OpenCE-Master-v1\n39f713d0a644253f\nGET\n/v1/me\n1760900001\nf0e0d0c0b0a090807060504030201000\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
```
|
||||
|
||||
and sends
|
||||
|
||||
```
|
||||
Authorization: OpenCE-Ed25519 keyid=21fe31dfa154a261, ts=1760900001, nonce=f0e0d0c0b0a090807060504030201000, sig=duRZ+WKAI8hbvidtC63U1XHxOSoeRN5mcrZvw4qihhlilhZjbVBCLYjsQLr4+F2C1gy6lN9/ixqevFX7dfNGDA==
|
||||
```
|
||||
|
||||
## Publishing
|
||||
|
||||
`PUT /v1/servers/{server_id}`, signed, with a JSON body of 16 KB at most.
|
||||
A server publishes to every master in `masters.txt` every 30 seconds, and
|
||||
within 5 seconds of a change (the lobby opened, a game started or ended, a
|
||||
player joined or left, the name or map changed). On shutdown it publishes
|
||||
`closed: true` (or `DELETE`s) and waits up to 2 seconds.
|
||||
|
||||
```json
|
||||
{"protocol":1,"instance":"main","name":"OpenCE Dedicated","map":"bloodgulch","gametype":"CTF","variant":"CTF",
|
||||
"players":5,"max_players":16,"teams":true,"in_progress":false,"password":false,"dedicated":true,
|
||||
"network_version":38,"build":"build-206","region":"eu","tunnel_port":2302,
|
||||
"listing":"<base64 of the host-signed listing>","closed":false,"serial":412}
|
||||
```
|
||||
|
||||
(The vectors' publish, made at network version 38: "The listing" says
|
||||
why the examples keep it.) The game's publisher sends `protocol`,
|
||||
`instance`, `listing` (but in a tombstone), `tunnel_port`, `dedicated`,
|
||||
`build`, `region` and `variant` when they are set, `address` with
|
||||
`server.master_publish_address`, `serial` and `closed`; the listing holds
|
||||
the rest. A server that goes private, or off the internet, sends one more
|
||||
publish, `closed: true`, to each master that listed it.
|
||||
|
||||
| Field | Type | Required | Meaning |
|
||||
| --- | --- | --- | --- |
|
||||
| `protocol` | number | yes | 1 |
|
||||
| `instance` | string | yes | The instance; the path's server id must be the server id of the signing key's id and this instance, else `400 server_id` |
|
||||
| `listing` | string | yes, but with `closed: true` | Base64 of the exact bytes `listing_make` makes, the bytes the game publishes to the brokers |
|
||||
| `tunnel_port` | number | yes, unless `address` is given | The UDP port the game's tunnel socket is bound to (`network.tunnel_port`), 1 to 65535 |
|
||||
| `address` | string | no | `"203.0.113.5:2302"`: an IP address (IPv4, or IPv6 in brackets) and a port to probe instead of the request's source address. Sent only with `server.master_publish_address`; a master serves it in its list only if its own policy allows (`MASTER_SERVE_ADDRESSES`). It must be globally routable (below); a private or loopback address is taken only from a private or loopback source |
|
||||
| `dedicated` | boolean | no | A dedicated server. Also read from the listing's flag 32, which a dedicated server sets; either makes the entry dedicated. A player's public game, published with the player's publisher key, sends `false` |
|
||||
| `variant` | string | no | The gametype's name as the server shows it; printable ASCII, cut to 24 |
|
||||
| `build` | string | no | The game's build (`build-206`); cut to 32 |
|
||||
| `region` | string | no | Up to 16 of `a-z`, `0-9` and `-` (`server.region`) |
|
||||
| `serial` | number | no | A whole number the server raises at each change; kept and shown to admins |
|
||||
| `closed` | boolean | no | `true`: unlist the server now |
|
||||
| `name`, `map`, `gametype`, `players`, `max_players`, `teams`, `in_progress`, `password`, `network_version` | | no | Informational only: the listing is authoritative. A value that differs from the listing's is ignored, and the answer's `warnings` says so |
|
||||
|
||||
The master parses the listing and checks the host's signature (below), and
|
||||
takes from it the name, the map, the gametype, the players and most
|
||||
players, the gametype's engine, the game's kind, the open, in-progress,
|
||||
teams and password flags, and the network version, so a publish cannot
|
||||
claim more than the host signed. A listing that does not parse or verify
|
||||
is `400 listing`. So is one whose own time is more than 3600 seconds from
|
||||
the master's clock. A listing with the same host key and a lower sequence
|
||||
than the one the master holds is not taken (the newer stays; a warning
|
||||
says so). A listing with the closed flag unlists the server, as
|
||||
`closed: true` does.
|
||||
|
||||
The master records the request's source address (behind a reverse proxy,
|
||||
the address its trusted proxy forwards) to probe the server. It keeps the
|
||||
addresses 7 days at most after a server's last publish, for probes and
|
||||
abuse handling, and never serves them.
|
||||
|
||||
The addresses a master probes and serves are an allowlist of globally
|
||||
routable unicast addresses: an IPv4 address outside IANA's special-purpose
|
||||
ranges (`0/8`, `10/8`, `100.64/10`, `127/8`, `169.254/16`, `172.16/12`,
|
||||
`192.0.0/24`, `192.0.2/24`, `192.88.99/24`, `192.168/16`, `198.18/15`,
|
||||
`198.51.100/24`, `203.0.113/24`, `224/4`, `240/4`); an IPv6 address in
|
||||
`2000::/3` outside `2001::/23`, `2001:db8::/32`, `3fff::/20` and
|
||||
`5f00::/16`; a 6to4 (`2002::/16`) or well-known NAT64 (`64:ff9b::/96`)
|
||||
address whose embedded IPv4 address is global. An IPv4-mapped address is
|
||||
judged as its IPv4 address. Everything else (link-local, site-local
|
||||
`fec0::/10`, unique local, multicast, `64:ff9b:1::/48`, zones) is refused
|
||||
(`400 schema`, `field: address`), except a private or loopback address
|
||||
from a private or loopback source (a master on the same network). A
|
||||
publish from a source address outside the allowlist without `address` is
|
||||
refused the same way when the master probes.
|
||||
|
||||
A listing's host key is published by one publisher at a time: a listing
|
||||
whose host key is that of a live server of another publisher is refused,
|
||||
`403 listing_taken`, so a listing's bytes copied from a list cannot be
|
||||
published by someone else. The same publisher may carry it under another
|
||||
server id (another key or instance). A host makes a new listing (a higher
|
||||
sequence) at each of its publishes, so a live server that has taken no newer
|
||||
listing of its host key for 90 seconds (3 intervals) is replaying a copy:
|
||||
a publish of a newer listing of that host key takes the host key from it,
|
||||
and its server is unlisted. A server an admin hid, or whose publisher or key
|
||||
is not approved, holds no host key. A master shows its admins the publishes
|
||||
it refused with `listing_taken`, to settle (see "Known limitations").
|
||||
|
||||
### The answer
|
||||
|
||||
`200` once the publish is taken and the master's decision for now is made;
|
||||
`202` while the first probe of the server's address is unanswered:
|
||||
|
||||
```json
|
||||
{"ok":true,"server_id":"4c5f15237c866f6f","listed":true,"interval":30,"ttl":90,"probe":"ok","reachable":true,
|
||||
"observed_address":"203.0.113.5","master_time":1760900000}
|
||||
{"ok":true,"server_id":"4c5f15237c866f6f","listed":false,"interval":30,"ttl":90,"probe":"pending","reachable":false,
|
||||
"observed_address":"203.0.113.5","probe_address":"203.0.113.5:2302","master_time":1760900000}
|
||||
```
|
||||
|
||||
| Field | Meaning |
|
||||
| --- | --- |
|
||||
| `listed` | Whether the list shows the server now |
|
||||
| `interval` | Seconds between publishes the master expects (30) |
|
||||
| `ttl` | Seconds after its last publish that a server is unlisted (90): one lost publish does not unlist it, three do |
|
||||
| `probe` | `pending` (no answer yet at this address), `ok`, `failed` (three attempts unanswered), `skipped` (an admin marked the server trusted), `off` (the master does not probe) |
|
||||
| `reachable` | The probe was answered |
|
||||
| `observed_address` | The address the master saw the request come from |
|
||||
| `probe_address` | With `pending` and `failed`: the address and port the master probes |
|
||||
| `hidden`, `reason` | An admin hid the server: it is listed to nobody, and `reason` says why. With `probe: failed`, `reason` is the hint to log: `let UDP port <n> through your firewall or NAT, or set network.public_address` |
|
||||
| `closed` | `true` after `closed: true`, a tombstone or `DELETE` |
|
||||
| `warnings` | Body fields the listing contradicts, which were ignored |
|
||||
| `master_time` | The master's clock |
|
||||
|
||||
A server with a failed probe is unlisted unless the master's policy lists
|
||||
unreachable servers (`MASTER_LIST_UNREACHABLE`), as `reachable: false`.
|
||||
The server logs each change of outcome once (not every 30 seconds), and
|
||||
the failed probe's hint once a minute until the probe passes.
|
||||
|
||||
`DELETE /v1/servers/{server_id}`, signed by any key of the server's
|
||||
publisher with an empty body, unlists the server at once and answers
|
||||
`200 {"ok":true,"server_id":…,"listed":false,"closed":true,…}`; `404
|
||||
not_found` for a server that is not the publisher's.
|
||||
|
||||
### Limits
|
||||
|
||||
| Limit | Answer |
|
||||
| --- | --- |
|
||||
| A server publishes at most once each 5 seconds, with a burst of 2 | `429 rate_limited` with `Retry-After` |
|
||||
| 120 publishes a minute per source address, and per key | `429 rate_limited` |
|
||||
| A body is 16 KB at most | `413 too_large` |
|
||||
| A publisher has at most its quota of live servers at once (default 4; live: published within `ttl` and not closed) | `403 quota_exceeded` |
|
||||
| An instance is published by one key of a publisher at a time | `403 instance_taken` (another key's server of that instance is live) |
|
||||
| A publisher holds at most its quota and 16 server records (one per server id); for a new server id past that, its oldest records that are not live are dropped, and if none can be | `403 too_many_instances` |
|
||||
|
||||
## The listing
|
||||
|
||||
The listing is `p2p_lobby.c`'s (`listing_make`, `listing_read`), in network
|
||||
byte order. The master reads it as `listing_read` does and checks its
|
||||
signature as `listing_signed` does.
|
||||
|
||||
| Offset | Size | Field |
|
||||
| --- | --- | --- |
|
||||
| 0 | 2 | `"HL"` |
|
||||
| 2 | 1 | Format: 1 |
|
||||
| 3 | 2 | Network version (`HALO_PORT_NETWORK_VERSION`, 39 now) |
|
||||
| 5 | 1 | Flags (below) |
|
||||
| 6 | 4 | Sequence: the host's count of its listings (the newest wins) |
|
||||
| 10 | 4 | The host's Unix time when it made the listing |
|
||||
| 14 | 32 | The host's Ed25519 public key (one per run of the game) |
|
||||
| 46 | 16, or 56 with the password flag | The invite's token (zero in a tombstone); with the password flag the token sealed with the password's key: nonce (24), MAC (16), the token encrypted (16), XChaCha20-Poly1305 with the host's key as additional data (`p2p_seal_token`) |
|
||||
| then | 1 | Players (at most 255) |
|
||||
| | 1 | Most players |
|
||||
| | 1 | The gametype's engine: 0 none (co-op), 1 CTF, 2 Slayer, 3 Oddball, 4 King of the Hill, 5 Race |
|
||||
| | 1 + up to 32 | The game's name: a length byte, then that many bytes |
|
||||
| | 1 + up to 32 | The map's name |
|
||||
| | 1 + up to 24 | The gametype's name |
|
||||
| | 8 | The stamp: the game's kind (`game_modes_kind`: the OpenCE mode, 1 SWAT, 2 Infection, 3 Gun Game, or 0; with 0x80 for Hardcore), then 7 reserved bytes, zero |
|
||||
| | 64 | The Ed25519 signature, by the listing's key, of the 12 ASCII bytes `hceu-lobby-1` followed by every byte before the signature |
|
||||
|
||||
| Flag | Meaning |
|
||||
| --- | --- |
|
||||
| 1 | Open: it takes players now |
|
||||
| 2 | In progress: a game is under way (or loading) |
|
||||
| 4 | Teams |
|
||||
| 8 | Closed: a tombstone, the host stopped |
|
||||
| 16 | Password: the token is sealed |
|
||||
| 32 | Dedicated: a dedicated server (`halo --server` sets it, since network version 39) |
|
||||
|
||||
A listing is 140 bytes at least (all names empty) and 268 at most (a
|
||||
password and every name at its length). A reader refuses one outside those
|
||||
sizes, without `"HL"` and format 1, with a name's length byte past its
|
||||
field's maximum or past the end, or whose stamp and signature do not end it
|
||||
exactly. The names are sanitised as the game's `sanitize` does: a byte
|
||||
outside 0x20 to 0x7E becomes `?`, and a zero ends the name. A master also
|
||||
refuses a listing whose key has a small order.
|
||||
|
||||
The vectors' first listing (an open team game of a dedicated server,
|
||||
sequence 412, 5 of 16 players, CTF on bloodgulch, named `OpenCE Dedicated`)
|
||||
is these 169 bytes, of which the first 105 are signed. The vectors were made
|
||||
at network version 38 and are kept as they are (the bytes and signatures
|
||||
are fixed): their listings carry version 38 with flag 32, which the game
|
||||
sets from version 39 on, so a game of version 39 reads them, checks their
|
||||
signatures and hides them from its browser as another version's games, as
|
||||
it does any. The examples' `network_version` of 38 in this document are the
|
||||
vectors' too.
|
||||
|
||||
| Field | Bytes |
|
||||
| --- | --- |
|
||||
| Magic, format | `484c` `01` |
|
||||
| Network version 38, flags 37 (open, teams, dedicated) | `0026` `25` |
|
||||
| Sequence 412, time 1760900000 | `0000019c` `68f533a0` |
|
||||
| Host key | `fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025` |
|
||||
| Token | `a0a1a2a3a4a5a6a7a8a9aaabacadaeaf` |
|
||||
| Players 5, most 16, engine 1 (CTF) | `05` `10` `01` |
|
||||
| Name, map, gametype | `10` `4f70656e434520446564696361746564`, `0a` `626c6f6f6467756c6368`, `03` `435446` |
|
||||
| Stamp (kind 0) | `0000000000000000` |
|
||||
| Signature | `633dc63eb27828d6e589e34dc4336dbb2d514b2018e4bf4a3adf5aeb774b6a523fe662c3d29241c6f91c8714a8ca2b5e493aacb32bcaeb9bce715f15b76d230f` |
|
||||
|
||||
(`testdata/vectors.json` has it whole, with a password game's, a
|
||||
tombstone's and an altered one that must be refused.)
|
||||
|
||||
## The probe
|
||||
|
||||
Before it lists a server, the master proves that the server's UDP port is
|
||||
reachable from the internet and that the publisher key's holder answers on
|
||||
it. It sends a datagram to the probe address (the published `address`, or
|
||||
the request's source address with `tunnel_port`) from its probe socket:
|
||||
|
||||
| Offset | Size | Probe (35 bytes) |
|
||||
| --- | --- | --- |
|
||||
| 0 | 10 | `"OPCE-PROBE"` |
|
||||
| 10 | 1 | 1 |
|
||||
| 11 | 8 | The master's key id, raw |
|
||||
| 19 | 16 | A nonce |
|
||||
|
||||
The game's tunnel socket, which dispatches what it receives by its first
|
||||
bytes, recognises the magic and answers from the same socket to the
|
||||
address the probe came from:
|
||||
|
||||
| Offset | Size | Answer (103 bytes) |
|
||||
| --- | --- | --- |
|
||||
| 0 | 14 | `"OPCE-PROBE-ACK"` |
|
||||
| 14 | 1 | 1 |
|
||||
| 15 | 8 | The master's key id, as the probe had it |
|
||||
| 23 | 16 | The nonce, as the probe had it |
|
||||
| 39 | 64 | The publisher key's Ed25519 signature of the 29 bytes `"probe"`, the master's key id, the nonce |
|
||||
|
||||
The server answers only a probe of exactly 35 bytes whose key id is that of
|
||||
a master in its `masters.txt`, only to the probe's source, a given nonce at
|
||||
most once per second, at most 2 answers a second to one source address and
|
||||
at most 10 answers a second in all, so the probe cannot be used to reflect
|
||||
traffic (a 103-byte answer to a 35-byte probe is the whole amplification),
|
||||
and probes forged from one address cannot use up the answers a master's
|
||||
probe needs. A probe whose nonce was answered in the same second counts
|
||||
against neither limit.
|
||||
The master takes only an answer from the probed address and port, with its
|
||||
own key id, a nonce it made for that address and key, and a signature that
|
||||
verifies with the key that signed the publish.
|
||||
|
||||
| Rule | Value |
|
||||
| --- | --- |
|
||||
| Attempts | 3, 2 seconds apart; failed 2 seconds after the third |
|
||||
| Again | Every 5 minutes while the server is reachable (it stays listed meanwhile); a failed server at its first publish a minute or more after the failure; at once when its probe address or key changes |
|
||||
| Nonce | Opaque to the server. A master uses a fresh nonce for each probe round (the round's attempts share it), and never the same one for two rounds of one address and key. `opence-master`'s is stateless: the first 16 bytes of HMAC-SHA-256(seed, `"opence-probe-1"` 0x00 address 0x00 key id 0x00 step), the step the decimal Unix time of the round's start divided by 30; it accepts the current and the previous hour's random seed and the current and the previous step, and starts rounds of one address and key at least a step apart |
|
||||
| Duplicates | A server answers a given nonce at most once per second: it remembers the nonces it answered (the last 64) with the Unix second they came in, and ignores a probe whose nonce it answered in the same second, whatever came between (A, B, A in one second: the second A is ignored). A master's retries, 2 seconds apart, are answered again; a nonce resent within the second is not |
|
||||
|
||||
With the vectors' master key (id `39f713d0a644253f`) and the nonce
|
||||
`101112131415161718191a1b1c1d1e1f`, the probe is
|
||||
`4f5043452d50524f42450139f713d0a644253f101112131415161718191a1b1c1d1e1f`, the
|
||||
signed message `70726f626539f713d0a644253f101112131415161718191a1b1c1d1e1f`,
|
||||
and the publisher's answer
|
||||
`4f5043452d50524f42452d41434b0139f713d0a644253f101112131415161718191a1b1c1d1e1f`
|
||||
followed by the signature
|
||||
`a63af355db038dff90e6c82abc0e252eddbd1ed3562580d7becaf3e4edbdd39cef7ef3163b91849ba57f6e83240b92df1efbce15dfa42f4a12981590a0234109`.
|
||||
|
||||
## The list
|
||||
|
||||
`GET /v1/servers`, with the optional query `network_version=<n>`,
|
||||
`dedicated=1` (or `0`), `region=<region>`, `q=<text>` (a case-insensitive
|
||||
substring of the name, map, gametype or variant; 32 characters at most).
|
||||
No signature is needed and plain HTTP is allowed: the body is signed.
|
||||
|
||||
```json
|
||||
{"protocol":1,"master":{"name":"OpenCE Master 1","key_id":"39f713d0a644253f","time":1760900000},
|
||||
"servers":[{"id":"4c5f15237c866f6f","publisher":{"id":"p_kz3c5lb2xvq7mdpa","name":"Milenko's servers","since":"2026-10"},
|
||||
"name":"OpenCE Dedicated","map":"bloodgulch","gametype":"CTF","variant":"CTF","players":5,"max_players":16,
|
||||
"teams":true,"in_progress":false,"password":false,"open":true,"dedicated":true,"kind":0,"engine":1,
|
||||
"network_version":38,"build":"build-206","region":"eu","reachable":true,"updated":1760899990,
|
||||
"listing":"<base64>"}]}
|
||||
```
|
||||
|
||||
| Entry field | Meaning |
|
||||
| --- | --- |
|
||||
| `id` | The server id |
|
||||
| `publisher` | The publisher's id (`p_` and up to 32 of `a-z0-9`), display name, and the year and month it was approved |
|
||||
| `name`, `map`, `gametype`, `players`, `max_players`, `teams`, `in_progress`, `password`, `open`, `kind`, `engine`, `network_version` | From the listing |
|
||||
| `variant`, `build`, `region` | From the publish |
|
||||
| `dedicated` | The listing's flag 32 or the publish's `dedicated` |
|
||||
| `reachable` | The last probe was answered (`false` for a trusted server or under `MASTER_LIST_UNREACHABLE`) |
|
||||
| `updated` | The time of the server's last publish |
|
||||
| `address` | Only with the operator's and the master's consent (above); absent otherwise |
|
||||
| `listing` | Base64 of the listing's exact bytes, as the server published them |
|
||||
|
||||
The list holds at most 512 entries: dedicated servers first, then by
|
||||
players. Its headers:
|
||||
|
||||
| Header | Value |
|
||||
| --- | --- |
|
||||
| `Signature` | `ed25519=` and the base64 of the master key's signature of the body's exact bytes (before any `Content-Encoding`) |
|
||||
| `Signature-Key` | The master's key id, 16 hexadecimal digits |
|
||||
| `Signature-Time` | The body's `master.time` |
|
||||
| `ETag` | `"` and the first 16 hexadecimal digits of SHA-256 of the body, and `"`; `If-None-Match` with it answers `304` |
|
||||
| `Cache-Control` | `public, max-age=5` (the master serves the same body for 5 seconds) |
|
||||
| `Content-Encoding` | `gzip` when the request's `Accept-Encoding` asks for it |
|
||||
| `Access-Control-Allow-Origin` | `*` (and `Access-Control-Expose-Headers` names the four above), for the web build |
|
||||
|
||||
A client:
|
||||
|
||||
1. checks `Signature` over the decompressed body bytes with the key in
|
||||
`masters.txt`, and that `Signature-Key` is that key's id, and refuses
|
||||
the whole body otherwise (a missing `Signature-Key` too; a client that
|
||||
cannot check Ed25519, such as an old browser, refuses every list rather
|
||||
than show one unchecked);
|
||||
2. parses the body, and refuses it unless `protocol` is 1, `master.key_id`
|
||||
is the key's id, and `master.time` is no older than 300 seconds and no
|
||||
more than 300 seconds ahead of the client's clock (a list dated ahead
|
||||
would be taken for longer when it is replayed later, and a clock that
|
||||
far off is wrong). The time is in the signed body: `Signature-Time` only
|
||||
repeats it, since a header is not signed, and a client need not read
|
||||
it;
|
||||
3. type-checks each entry, decodes its `listing`, runs `listing_read` and
|
||||
the host signature's check on it, and skips an entry that fails rather
|
||||
than the list; it shows the name, map, gametype and players of the
|
||||
signed listing (an entry's own fields are the master's word, and may
|
||||
differ); it filters control characters from every name, and takes at
|
||||
most 512 entries (a 512-entry list is some 26,000 JSON tokens: the game
|
||||
reads a list of 65,536 tokens at most);
|
||||
4. merges the masters' lists: entries with the same `id` are one game (the
|
||||
newest `updated` wins), and an entry whose listing key is also heard on
|
||||
the brokers is one game, shown as master-listed;
|
||||
5. never pings listed servers (that would tell every server the player's
|
||||
address): it shows the `region`, and the ping once a game is joined.
|
||||
|
||||
The vectors' signed body is
|
||||
`{"protocol":1,"master":{"name":"OpenCE Master 1","key_id":"39f713d0a644253f","time":1760900000},"servers":[]}`
|
||||
with `Signature: ed25519=18dmQnIfmRnC+wUwRJ/loxAH1VfASRBVnZgCfRuHrAw/2uo4thTibWnNQFScgRju+5lQtt709blK86BLT0fYCw==`
|
||||
and `ETag: "cd755a50c5cfc457"`.
|
||||
|
||||
`GET /v1/servers/{server_id}` answers one listed server the same way:
|
||||
`{"protocol":1,"master":{…},"server":{<entry>}}` with the same headers, or
|
||||
`404 not_found`.
|
||||
|
||||
## Other endpoints
|
||||
|
||||
| Request | Who | Answer |
|
||||
| --- | --- | --- |
|
||||
| `GET /v1/publishers/{id}` | anyone (the list's limit) | `{"ok":true,"id","name","since":"2026-10","status","servers":<listed now>}`, or `404` |
|
||||
| `POST /v1/applications`, `/v1/applications/…` | anyone | `410 applications_by_discord`: applications are made with the master's Discord bot (below), not over HTTP |
|
||||
| `POST /v1/keys` | signed, an approved publisher's active key | Body `{"public_key":"ed25519:…"}`: adds a key (8 active at most). `201 {"ok":true,"key_id","status":"active"}`; `409 key_exists`; `403 too_many_keys` |
|
||||
| `GET /v1/me` | signed, any key the master knows | The publisher's record: `{"ok":true,"key_id","status","publisher":{"id","name","since","status","quota","origin","keys":[{"key_id","public_key","status","updated","last_used"}],"servers":[{"id","instance","key_id","listed","probe","reachable","hidden","trusted","updated","name","players","max_players"}]}}`; for a key still in an application, `"publisher":null` and `"application":{"id","status","reason","created"}`; `403 key_revoked` |
|
||||
| `GET /v1/master` | anyone | The master's name, key id, public key, contact, data policy and limits (informational: clients use the key in `masters.txt`) |
|
||||
| `GET /healthz` | anyone | `200 {"ok":true,…}` while the database answers |
|
||||
| `GET /metrics` | anyone (the list's limit) | Prometheus text, read at most once each 5 seconds: `master_servers{reachable}`, `master_publishers{status}`, `master_publishes_total{result}`, `master_probes_total{result}`, `master_list_requests_total`, `master_peer_requests_total`, `master_build_info{version,protocol}` |
|
||||
| `GET /`, `GET /apply`, `/admin/*` | people | The list page (the list's limit), how to apply (the Discord bot, and an invite to its server), the admin pages |
|
||||
|
||||
## Applications
|
||||
|
||||
An operator applies with the master's Discord bot, in the master's
|
||||
Discord server (the `/apply` page links to it): the bot's `/apply` command
|
||||
takes the region (a menu of the master's choices) and the number of servers
|
||||
at once as its options, and answers the applicant alone with a nonce for
|
||||
the proof of key,
|
||||
`opence-apply-<unix>-<16 hex>`, good for 24 hours and bound to that Discord
|
||||
user (a nonce given to another user, or to none, does not prove this one's
|
||||
key), and a button that opens the application's form: a display name, the
|
||||
public key, the proof, and a note. The application's name is 3 to 32 printable ASCII characters,
|
||||
`servers` is 1 to 64, and the region up to 16 of `a-z`, `0-9` and `-`. The
|
||||
proof of key is required unless the master's policy says otherwise
|
||||
(`MASTER_REQUIRE_PROOF`, true by default): it is the publisher key's
|
||||
Ed25519 signature of the nonce's ASCII text, in hexadecimal (128 digits,
|
||||
what `halo --server --sign <nonce>` prints) or base64. An application
|
||||
without one is shown to the approvers as unproven. A key already a
|
||||
publisher's is refused, and so is a key with an application pending. The
|
||||
applicant is answered on Discord, and told of the decision by a direct
|
||||
message; the applicant's identity is their Discord user id and username.
|
||||
|
||||
Each application is posted to the master's log channel with Approve and
|
||||
Deny buttons, which only the members of the master's approver roles may
|
||||
press; the admin pages decide too. Once decided, anywhere, the message
|
||||
shows the outcome and who decided. The master's operator can also add an
|
||||
application on its command line (`opence-master challenge` for the nonce,
|
||||
then `add-application`), as the conformance test does.
|
||||
|
||||
A master limits applications, since each one is posted to its approvers:
|
||||
`opence-master` takes one pending application at a time and 3 a day per
|
||||
Discord user, 3 a day per key, and, of applications without a proof of key,
|
||||
100 an hour in all; one with a proof is not refused for the hour's number,
|
||||
but past 100 applications in an hour the approvers are alerted once and the
|
||||
next ones are not posted one by one (its settings change these numbers). It
|
||||
deletes a denied application 30 days after its denial.
|
||||
|
||||
The earlier HTTP application (`POST /v1/applications` with an e-mail
|
||||
address verified by a mailed link, `GET /v1/applications/challenge`, and
|
||||
the application's status by its mailed token) is gone: its endpoints
|
||||
answer `410 applications_by_discord`. A master keeps the applications made
|
||||
that way readable to its admins.
|
||||
|
||||
## Approval sharing between masters
|
||||
|
||||
The official masters share approvals, so an operator applies once. Each
|
||||
master fetches each peer's `GET /v1/publishers?since=<unix>` (every minute
|
||||
in `opence-master`), signed with its own master key in the request scheme
|
||||
above (`keyid` is its master key id, and the signed string's master key id
|
||||
is the peer's, the one it fetches from; a master answers only the peers it
|
||||
is configured with, else `403 not_a_peer`). The answer is signed as the list
|
||||
is (`Signature`, `Signature-Key`, `Signature-Time`, the body's
|
||||
`master.time`):
|
||||
|
||||
```json
|
||||
{"protocol":1,"master":{"name","key_id","time"},
|
||||
"publishers":[{"id","name","status","since","updated","origin","quota",
|
||||
"keys":[{"key_id","public_key","status","updated"}]}]}
|
||||
```
|
||||
|
||||
A master shares only what it holds a word of its own on: the publishers it
|
||||
approved or moderated (`status` is its own word: `approved`, `suspended` or
|
||||
`revoked`; `null` when it only vouches for keys), and the keys it added or
|
||||
revoked (`active` or `revoked`). `origin` is the key id of the master that
|
||||
approved the publisher, as the sharing master knows it (a master records a
|
||||
publisher new to it as come from the peer it fetched the record from,
|
||||
whatever origin the record claims, and only that peer's records rename
|
||||
it); `since` its approval time; `updated` the time of
|
||||
the newest word in the record; `since=` returns the records updated after
|
||||
it. The next fetch's `since` is the answer's `master.time` less 120 seconds,
|
||||
on the peer's own clock.
|
||||
|
||||
The importing master keeps each master's word apart and takes the most
|
||||
restrictive of the trusted masters' words as the publisher's status
|
||||
(`revoked` over `suspended` over `approved`) and the smallest quota given;
|
||||
a newer word from a master replaces that master's older one. So a
|
||||
suspension or revocation anywhere wins everywhere, and only the master that
|
||||
suspended a publisher can lift its suspension. A key revoked by any trusted
|
||||
master is revoked, for good; a key two publishers claim is refused. A
|
||||
master may refuse a peer's words (`MASTER_PEERS_TRUST`); they then count
|
||||
for nothing.
|
||||
|
||||
## Errors
|
||||
|
||||
Every error is `{"ok":false,"error":{"code":"…","message":"…","field":"…"?},"master_time":<unix>}`.
|
||||
The message is for people and may change; programs read the code.
|
||||
|
||||
| Status | Code | Meaning | A server's publisher should |
|
||||
| --- | --- | --- | --- |
|
||||
| 400 | `schema` | A field is missing, of the wrong type or out of range (`field` names it), or the body is not one JSON object | Log it once; it is a bug |
|
||||
| 400 | `server_id` | The path's id is not the key's and the instance's | Log it once |
|
||||
| 400 | `listing` | The listing does not parse, its signature fails, its key has a small order, or its time is an hour off | Log it once |
|
||||
| 401 | `bad_signature` | The Authorization header is malformed or its signature fails | Log it once |
|
||||
| 401 | `clock` | `ts` is more than 300 seconds from `master_time` | Log the difference (from the answer's `master_time`): the machine's clock is wrong |
|
||||
| 401 | `replay` | The nonce was used in the last 600 seconds | Send a new nonce |
|
||||
| 403 | `unknown_key` | No publisher or application has the key | Log `master: apply with key <id>` once a minute |
|
||||
| 403 | `publisher_pending` | The key's application waits for review | Log `master: publisher pending` once a minute; keep publishing every 30 s |
|
||||
| 403 | `application_denied` | The key's application was denied (`message` says why) | Log it once a minute |
|
||||
| 403 | `publisher_suspended` | The publisher is suspended | Log it; keep publishing slowly |
|
||||
| 403 | `publisher_revoked`, `key_revoked` | Revoked for good | Log it; stop publishing to that master |
|
||||
| 403 | `quota_exceeded` | The publisher has its quota of servers live | Log it |
|
||||
| 403 | `instance_taken` | Another key of the publisher has a live server of this instance | Log it; the old server expires after `ttl` |
|
||||
| 403 | `listing_taken` | The listing's host key is that of another publisher's live server, which has renewed it within 90 seconds | Log it once a minute; it is someone else's listing, or the host key is shared; keep publishing |
|
||||
| 403 | `too_many_instances` | The publisher holds its quota and 16 server records, none of which can be dropped | Log it; use fewer instance names |
|
||||
| 403 | `tls_required` | Plain HTTP from beyond loopback | Use the `https://` URL |
|
||||
| 403 | `not_a_peer` | A peer's request from a master not configured as a peer | |
|
||||
| 404 | `not_found` | No such server, publisher or endpoint | |
|
||||
| 409 | `key_exists` | The key added (`POST /v1/keys`) is known already | |
|
||||
| 410 | `applications_by_discord` | An application sent over HTTP: applications are made with the master's Discord bot | Log it: apply with the bot's `/apply` |
|
||||
| 413 | `too_large` | The body is over 16 KB | |
|
||||
| 429 | `rate_limited` | Too many requests; `Retry-After` gives the seconds to wait | Wait that long (the header's name read in any case; the game waits a day at most, and 30 seconds without one) |
|
||||
| 500 | `internal` | The master failed | Try again at the next interval |
|
||||
|
||||
## Privacy and limits
|
||||
|
||||
| What | Rule |
|
||||
| --- | --- |
|
||||
| Servers' addresses | Kept 7 days after the server's last publish, for probes and abuse handling; never served unless the operator and the master both chose to; not in the master's log unless its operator asks (`MASTER_LOG_ADDRESSES`) |
|
||||
| Applicants | Their Discord user id and username, seen by the master's admins and approvers (the log channel) only; no address is kept |
|
||||
| Applications | A denied one: deleted 30 days after the denial |
|
||||
| Servers' records | A closed server's: deleted an hour after it closed; one not published again: after 24 hours (unless an admin flagged it) |
|
||||
| Contacts | Discord names (and the earlier HTTP applications' e-mail addresses) are seen by the master's admins and approvers only, and are not shared with peers |
|
||||
| Strings | Printable ASCII, cut to the listing's lengths: name 32, map 32, gametype and variant 24, build 32 |
|
||||
| Requests | 60 list requests a minute per address (the list, one server, a publisher's page, the list page and the metrics together); the application limits above; bodies 16 KB at most; the publish limits above. Every limit by address counts an IPv6 address by its /64 |
|
||||
|
||||
## Known limitations
|
||||
|
||||
A listing's host key is bound to the first publisher whose live server
|
||||
publishes it, not to the host's own publisher: the listing does not say
|
||||
which publisher key the host chose. A publisher that copies a listing from a
|
||||
list while the host's publisher is not publishing (more than `ttl`) holds
|
||||
the host key, and the host's publisher is refused `listing_taken`, until the
|
||||
copy goes 90 seconds without a newer listing; one that keeps copying the
|
||||
host's newest listings from other lists keeps it until an admin hides its
|
||||
server or suspends it. The planned fix is in the listing: the host signs the
|
||||
key id of the publisher key it publishes with into the listing (a new
|
||||
listing format, with a new network version), and a master takes a listing
|
||||
only from that key.
|
||||
|
||||
## Versions
|
||||
|
||||
This is protocol 1: `protocol` in bodies, `/v1/` in paths and
|
||||
`OpenCE-Master-v1` in signed strings (followed by the receiving master's
|
||||
key id). A change that an older client or
|
||||
server would misread is a new version, with new paths; fields may be added
|
||||
to version 1, and both sides ignore what they do not know. The listing's
|
||||
own format follows the game's network version: a client hides entries
|
||||
whose `network_version` is not its own, as it does for the brokers'
|
||||
listings.
|
||||
|
||||
## Testing an implementation
|
||||
|
||||
`testdata/vectors.json` in the master's repository has, from fixed seeds:
|
||||
three key pairs with their key ids (the publisher's, the master's, a
|
||||
host's), a server id, a signed publish and a signed `GET /v1/me` to the
|
||||
vectors' master (its key id, the canonical strings, the signatures, the
|
||||
headers), a probe and its answer,
|
||||
four listings (a dedicated team game, a password game in progress with its
|
||||
sealed token, a tombstone, and an altered listing that must be refused), a
|
||||
signed list body with its headers and ETag, a small-order key that must be
|
||||
refused, and a proof of key. Monocypher's `crypto_ed25519_sign`,
|
||||
`crypto_ed25519_check` and `crypto_aead_lock` give the same bytes.
|
||||
`tests/conformance/opence_publisher.py` is a reference publisher in Python
|
||||
(keys, signatures, listings, publishing, the probe's answer), and
|
||||
`tests/conformance/test_master_protocol.py` runs a master through the whole
|
||||
flow: an application (on the master's command line, since the Discord bot
|
||||
is beyond a test's reach), the HTTP application's `410`, a pending
|
||||
publish, approval, the probe, the listed
|
||||
server's exact bytes in a signed list, closing, every refusal, and two
|
||||
masters sharing an approval, a suspension and a revocation.
|
||||
+22
-5
@@ -233,7 +233,7 @@ These settings are only for Android:
|
||||
| `display.shader_cache` | `true` (the default): the linked shader programs are kept in `shader_cache` in the data folder (their binaries, the driver that made them and their sources), and each map's list of the programs it drew with; as a map loads, the programs on its list are made ready, so that its first frames do not wait for the driver to compile them. A driver update compiles them again from the kept sources. `false`: each program is compiled the first time it is drawn. The folder may be deleted at any time. |
|
||||
| `display.shader_worker` | `true` (the default): the shader programs are made on a thread of their own, whose GL context shares the game's (loaded from the shader cache, or compiled), and drawn with once there (`debug.shader_warm_up`: `"worker"`, `"load"` on the game's thread as a map loads, or `"off"`); a draw whose program is not made yet is left out for the frames it takes, and the frame does not wait. As a map loads, its own programs and then every map's (`shader_cache/all.txt`) are asked for. `false`: each is made on the game's thread when first drawn with. |
|
||||
| `debug.sample_seconds` | Refer to "Find problems". |
|
||||
| `debug.memory_watch` | `true` (the default): the app notices the game's writes to textures and vertices by page protection. `false`: it compares page contents once a frame instead, which is slower. Refer to "Limits". |
|
||||
| `debug.memory_watch` | `true` (the default): the app notices the game's writes to cached textures by page protection. `false`: it compares page contents once a frame instead, which is slower. Geometry uses the streaming path in either mode. Refer to "Limits". |
|
||||
|
||||
## Internet play
|
||||
|
||||
@@ -543,6 +543,23 @@ assembly of the port is necessary:
|
||||
- The symbol aliases in `guest/libc/src_include/features.h`. The Darwin
|
||||
target does not accept alias attributes.
|
||||
|
||||
## Geometry uploads
|
||||
|
||||
Android streams vertex and index data from the current CPU bytes instead
|
||||
of reusing the persistent geometry mirror or its cached index extents.
|
||||
This is automatic; no console command or configuration change is needed.
|
||||
Affected players reported that bypassing the cache resolved stretched or
|
||||
missing geometry, with some also reporting better performance. The exact
|
||||
cache failure mechanism remains unconfirmed.
|
||||
|
||||
The Android-only guard in `mirror_range` uses the existing streaming
|
||||
fallback. Streamed upload methods, frame fences, shaders, texture caching
|
||||
and CPU write tracking are unchanged. Desktop and web retain their cache.
|
||||
Xbox and Custom Edition maps keep their existing loaders and resource
|
||||
paths. `tools/test_android_mirror_uploads.py` checks the bypass with large
|
||||
and reused ranges, frame-counter rollover and desktop/web cache controls;
|
||||
it does not substitute for device gameplay validation.
|
||||
|
||||
## Find problems
|
||||
|
||||
- Enter `adb logcat -s halo` to see the log of the port and the errors of
|
||||
@@ -572,11 +589,11 @@ assembly of the port is necessary:
|
||||
operate. The Xbox memory uses 4 KB pages.
|
||||
- The x86 Android emulator runs the app through its ARM translation. The
|
||||
translation cannot deliver the page faults that the renderer uses to
|
||||
notice changed textures and vertices. On the emulator the app compares
|
||||
notice changed textures. On the emulator the app compares
|
||||
page contents once a frame instead ("write tracking: page hashes" in the
|
||||
log). This is slower, and a write shows one frame later, so moving
|
||||
geometry can glitch briefly. `debug.memory_watch = false` does the same
|
||||
on a device. The translation also has no scalar conversion from floating
|
||||
log). This is slower, and texture changes may appear one frame later.
|
||||
`debug.memory_watch = false` does the same on a device. The translation
|
||||
also has no scalar conversion from floating
|
||||
point to an integer in a SIMD register (`fcvtzs s0, s1`, an illegal
|
||||
instruction there), so `tools/android_asm_convert.py` writes each as the
|
||||
vector form, which leaves the register and the exception flags the same.
|
||||
@@ -198,4 +198,12 @@ void host_touch_scene(int scene);
|
||||
for the overlay's labels */
|
||||
void host_touch_bindings(const int *controls);
|
||||
|
||||
/* ---------- the server browser's master servers (host_https.c) */
|
||||
|
||||
/* a GET of an https:// url (port/linux/src/master_list.c): 1 with the
|
||||
status, the headers ("Name: value" lines) and up to body_capacity bytes of
|
||||
the body (its size in body_size), else 0 and why in error */
|
||||
int host_https_get(const char *url, int *status, char *headers, int headers_size, char *body, int body_capacity,
|
||||
int *body_size, char *error, int error_size);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
HOST_HTTPS.C
|
||||
|
||||
The server browser's requests to the master servers (host_https_get,
|
||||
port/android/guest/runtime/guest_host.h; port/linux/src/master_list.c), made
|
||||
in the host with the desktop's HTTPS client (port/linux/src/posix_update.c's
|
||||
update_https_request, Mbed TLS, the system's certificate authorities): the
|
||||
guest has no TLS of its own, and its memory is the host's to read and write.
|
||||
*/
|
||||
|
||||
#include "host.h"
|
||||
#include "../../linux/src/update.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int host_https_get(const char *url, int *status, char *headers, int headers_size, char *body, int body_capacity,
|
||||
int *body_size, char *error, int error_size)
|
||||
{
|
||||
struct update_response response;
|
||||
|
||||
*status = 0;
|
||||
*body_size = 0;
|
||||
if (!update_https_request("GET", url, NULL, NULL, 0, (unsigned long)body_capacity, &response, error, error_size))
|
||||
return 0;
|
||||
*status = response.status;
|
||||
snprintf(headers, (size_t)headers_size, "%s", response.headers);
|
||||
if (response.body_size > (unsigned long)body_capacity)
|
||||
response.body_size = (unsigned long)body_capacity;
|
||||
memcpy(body, response.body, response.body_size);
|
||||
*body_size = (int)response.body_size;
|
||||
free(response.body);
|
||||
return 1;
|
||||
}
|
||||
@@ -85,5 +85,6 @@ host_touch_look_read
|
||||
host_touch_rumble
|
||||
host_touch_scene
|
||||
host_touch_bindings
|
||||
host_https_get
|
||||
|
||||
host_errno
|
||||
@@ -0,0 +1,223 @@
|
||||
/* Real mirror decisions with a delayed, renaming GPU. No API failures. */
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef int BOOL;
|
||||
typedef unsigned GLuint, GLenum;
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#ifndef TEST_DESKTOP
|
||||
#define HALO_GLES 1
|
||||
#endif
|
||||
#define STREAM_BUFFER_RING 3
|
||||
#define GL_COPY_WRITE_BUFFER 1
|
||||
#define GL_DYNAMIC_DRAW 2
|
||||
#define SEGMENT_SIZE 0x400000u
|
||||
#define PLATFORM_CONTIGUOUS_SIZE (2 * SEGMENT_SIZE)
|
||||
static unsigned char cpu[PLATFORM_CONTIGUOUS_SIZE];
|
||||
#define PLATFORM_CONTIGUOUS_BASE ((unsigned long)cpu)
|
||||
#define CHECK(x) do { if (!(x)) { fprintf(stderr, "line %d: %s\n", __LINE__, #x); exit(1); } } while (0)
|
||||
static struct { unsigned long frame, buffer_ring; } device;
|
||||
static struct { unsigned long mirrored_bytes; } stats;
|
||||
static unsigned long generations[PLATFORM_CONTIGUOUS_SIZE / 4096], serial;
|
||||
static unsigned mapped, subdata, overlaps, draws, mismatches, uploads;
|
||||
static unsigned watch_reads, protections;
|
||||
|
||||
/* A subdata update may rename storage immediately and queue preservation
|
||||
of the old store plus its changed bytes. A later unsynchronized write to
|
||||
the new store can then be overwritten, even at a disjoint offset. */
|
||||
static unsigned char *stores[2];
|
||||
static GLuint bound, next_buffer;
|
||||
struct command
|
||||
{
|
||||
struct command *next;
|
||||
unsigned char *source, *destination, *expected;
|
||||
unsigned long offset, size, sequence;
|
||||
};
|
||||
static struct command *head, *tail;
|
||||
static unsigned long submitted, fences[STREAM_BUFFER_RING];
|
||||
|
||||
static void enqueue(unsigned char *source, unsigned char *destination,
|
||||
unsigned char *expected, unsigned long offset, unsigned long size)
|
||||
{
|
||||
struct command *command = calloc(1, sizeof(*command));
|
||||
CHECK(command);
|
||||
command->source = source;
|
||||
command->destination = destination;
|
||||
command->expected = expected;
|
||||
command->offset = offset;
|
||||
command->size = size;
|
||||
command->sequence = ++submitted;
|
||||
if (tail) tail->next = command;
|
||||
else head = command;
|
||||
tail = command;
|
||||
}
|
||||
|
||||
static void complete(unsigned long sequence)
|
||||
{
|
||||
while (head && head->sequence <= sequence)
|
||||
{
|
||||
struct command *command = head;
|
||||
if (command->expected)
|
||||
{
|
||||
draws++;
|
||||
if (memcmp(command->source + command->offset, command->expected, command->size)) mismatches++;
|
||||
free(command->expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(command->destination + command->offset, command->source, command->size);
|
||||
free(command->source);
|
||||
}
|
||||
head = command->next;
|
||||
free(command);
|
||||
}
|
||||
if (!head) tail = NULL;
|
||||
}
|
||||
|
||||
static void host_gl_fence_frame(unsigned slot) { fences[slot] = submitted; }
|
||||
static void host_gl_wait_frame(unsigned slot) { complete(fences[slot]); }
|
||||
|
||||
static void next_frame(void)
|
||||
{
|
||||
/* The actual fence/rotation/wait statements from Present. */
|
||||
#include "rotation.inc"
|
||||
device.frame++;
|
||||
}
|
||||
|
||||
static unsigned long memory_watch_generation(unsigned long address, unsigned long size)
|
||||
{
|
||||
unsigned long page = (address - PLATFORM_CONTIGUOUS_BASE) / 4096;
|
||||
unsigned long last = (address - PLATFORM_CONTIGUOUS_BASE + size - 1) / 4096, newest = 0;
|
||||
watch_reads++;
|
||||
for (; page <= last; page++) if (generations[page] > newest) newest = generations[page];
|
||||
return newest;
|
||||
}
|
||||
static void memory_watch_protect(unsigned long address, unsigned long size) { (void)address; (void)size; protections++; }
|
||||
static void write_pages(unsigned first, unsigned count, unsigned char value)
|
||||
{
|
||||
unsigned page;
|
||||
for (page = first; page < first + count; page++) generations[page] = ++serial;
|
||||
memset(cpu + first * 4096, value, count * 4096);
|
||||
}
|
||||
static void glGenBuffers(int count, GLuint *buffer) { CHECK(count == 1 && next_buffer < 2); *buffer = ++next_buffer; }
|
||||
static void glBindBuffer(GLenum target, GLuint buffer) { CHECK(target == GL_COPY_WRITE_BUFFER && buffer && buffer <= 2); bound = buffer - 1; }
|
||||
static void glBufferData(GLenum target, unsigned long size, const void *data, GLenum usage)
|
||||
{
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && size == SEGMENT_SIZE && !data && usage == GL_DYNAMIC_DRAW);
|
||||
stores[bound] = calloc(1, size);
|
||||
CHECK(stores[bound]);
|
||||
}
|
||||
static void buffer_upload(GLenum target, unsigned long offset, unsigned long size, const void *data)
|
||||
{
|
||||
unsigned char *old = stores[bound], *copy = malloc(size);
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && offset + size <= SEGMENT_SIZE && copy);
|
||||
stores[bound] = calloc(1, SEGMENT_SIZE);
|
||||
CHECK(stores[bound]);
|
||||
memcpy(copy, data, size);
|
||||
enqueue(old, stores[bound], NULL, 0, SEGMENT_SIZE);
|
||||
enqueue(copy, stores[bound], NULL, offset, size);
|
||||
subdata++;
|
||||
uploads++;
|
||||
}
|
||||
static void host_gl_buffer_write(GLenum target, unsigned offset, unsigned size, const void *data)
|
||||
{
|
||||
struct command *command;
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && offset + size <= SEGMENT_SIZE);
|
||||
for (command = head; command; command = command->next)
|
||||
{
|
||||
if (command->destination == stores[bound] && offset < command->offset + command->size &&
|
||||
command->offset < offset + size) overlaps++;
|
||||
if (command->expected && command->source == stores[bound] && offset < command->offset + command->size &&
|
||||
command->offset < offset + size) overlaps++;
|
||||
}
|
||||
memcpy(stores[bound] + offset, data, size);
|
||||
mapped++;
|
||||
uploads++;
|
||||
}
|
||||
|
||||
#include "mirror.inc"
|
||||
|
||||
static int draw_pages(unsigned first, unsigned count)
|
||||
{
|
||||
GLuint buffer;
|
||||
unsigned long offset;
|
||||
unsigned char *expected;
|
||||
if (!mirror_range(PLATFORM_CONTIGUOUS_BASE + first * 4096, count * 4096, &buffer, &offset, NULL)) return 0;
|
||||
expected = malloc(count * 4096);
|
||||
CHECK(expected);
|
||||
memcpy(expected, cpu + first * 4096, count * 4096);
|
||||
enqueue(stores[buffer - 1], NULL, expected, offset, count * 4096);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned index, old_uploads;
|
||||
int rollover = argc > 1 && !strcmp(argv[1], "rollover");
|
||||
device.frame = rollover ? ~0UL - 1 : 100;
|
||||
#ifdef HALO_ANDROID
|
||||
/* First-use and reused ranges must always go to the caller's existing
|
||||
streaming path, without creating GPU storage or consulting tracking. */
|
||||
for (index = 0; index < 1200; index++)
|
||||
{
|
||||
GLuint buffer = 99;
|
||||
unsigned long offset = 77, generation = 55;
|
||||
write_pages(0, 300, (unsigned char)index);
|
||||
CHECK(!mirror_range(PLATFORM_CONTIGUOUS_BASE, 300 * 4096, &buffer, &offset, &generation));
|
||||
CHECK(buffer == 99 && offset == 77 && generation == 55);
|
||||
CHECK(!draw_pages(0, 1));
|
||||
CHECK(!draw_pages(1023, 2));
|
||||
CHECK(!draw_pages(1024, 1));
|
||||
next_frame();
|
||||
}
|
||||
CHECK(!next_buffer && !uploads && !watch_reads && !protections && !stats.mirrored_bytes);
|
||||
fprintf(stderr, "bypassed=4800 allocations=0 uploads=0 watch_reads=0 protections=0\n");
|
||||
return 0;
|
||||
#endif
|
||||
write_pages(0, 1, 1);
|
||||
CHECK(draw_pages(0, 1));
|
||||
CHECK(watch_reads && protections);
|
||||
next_frame();
|
||||
/* An ordinary reused allocation: some previously mirrored pages and
|
||||
some first-time pages. 300 pages also crosses the 256-page refresh chunk. */
|
||||
write_pages(0, 300, 2);
|
||||
CHECK(draw_pages(0, 300));
|
||||
CHECK(draw_pages(0, 1));
|
||||
next_frame();
|
||||
write_pages(300, 1, 3);
|
||||
CHECK(draw_pages(300, 1));
|
||||
next_frame();
|
||||
write_pages(301, 1, 4);
|
||||
CHECK(draw_pages(301, 1));
|
||||
/* A different segment has no pending preservation copy. */
|
||||
write_pages(1024, 1, 5);
|
||||
CHECK(draw_pages(1024, 1));
|
||||
CHECK(!draw_pages(1023, 2)); /* segment boundary streams instead */
|
||||
for (index = 0; index < STREAM_BUFFER_RING; index++) next_frame();
|
||||
index = mapped;
|
||||
write_pages(302, 1, 6);
|
||||
CHECK(draw_pages(302, 1));
|
||||
#if defined(HALO_ANDROID) || defined(TEST_DESKTOP)
|
||||
CHECK(mapped == 0); /* every persistent-cache upload is ordered */
|
||||
#else
|
||||
CHECK(mapped == index + 1); /* fast path returns after the fence */
|
||||
#endif
|
||||
complete(submitted);
|
||||
old_uploads = uploads;
|
||||
/* CPU generations are unchanged: any GPU damage is retained. */
|
||||
for (index = 0; index < 1200; index++)
|
||||
{
|
||||
CHECK(draw_pages(256, 1));
|
||||
next_frame();
|
||||
}
|
||||
complete(submitted);
|
||||
CHECK(uploads == old_uploads);
|
||||
fprintf(stderr, "mapped=%u subdata=%u overlaps=%u bad_draws=%u draws=%u repair_uploads=%u\n",
|
||||
mapped, subdata, overlaps, mismatches, draws, uploads - old_uploads);
|
||||
for (index = 0; index < 2; index++) free(stores[index]);
|
||||
CHECK(overlaps == 0 && mismatches == 0);
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 272 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
@@ -0,0 +1,317 @@
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"name": "ce_hud_unit_meters",
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters",
|
||||
"bitmap": 0,
|
||||
"scale": 4,
|
||||
"format": "a8r8g8b8",
|
||||
"ce_only": true,
|
||||
"cells": [
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
20,
|
||||
288,
|
||||
958,
|
||||
505
|
||||
],
|
||||
"to": [
|
||||
23.0,
|
||||
136.0,
|
||||
257.5,
|
||||
190.25
|
||||
],
|
||||
"alignment": {
|
||||
"anchor": "top_right",
|
||||
"xbox_sprite": [
|
||||
122,
|
||||
34
|
||||
],
|
||||
"ce_sprite": [
|
||||
262,
|
||||
132
|
||||
],
|
||||
"pixels_per_xbox_texel": 8,
|
||||
"ce_resolution": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
1141,
|
||||
16,
|
||||
1904,
|
||||
129
|
||||
],
|
||||
"to": [
|
||||
271.0,
|
||||
2.0,
|
||||
366.0,
|
||||
16.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
714,
|
||||
527,
|
||||
1403,
|
||||
625
|
||||
],
|
||||
"to": [
|
||||
84.5,
|
||||
199.75,
|
||||
256.75,
|
||||
224.25
|
||||
],
|
||||
"alignment": {
|
||||
"anchor": "top_right",
|
||||
"xbox_sprite": [
|
||||
176,
|
||||
65
|
||||
],
|
||||
"ce_sprite": [
|
||||
258,
|
||||
198
|
||||
],
|
||||
"pixels_per_xbox_texel": 8,
|
||||
"ce_resolution": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
68,
|
||||
527,
|
||||
684,
|
||||
577
|
||||
],
|
||||
"to": [
|
||||
389.0,
|
||||
1.0,
|
||||
466.0,
|
||||
7.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
132,
|
||||
648,
|
||||
923,
|
||||
688
|
||||
],
|
||||
"to": [
|
||||
33.0,
|
||||
251.0,
|
||||
237.0,
|
||||
262.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
1085,
|
||||
400,
|
||||
1803,
|
||||
416
|
||||
],
|
||||
"to": [
|
||||
271.0,
|
||||
67.0,
|
||||
364.0,
|
||||
71.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
5,
|
||||
95,
|
||||
799,
|
||||
193
|
||||
],
|
||||
"to": [
|
||||
15.0,
|
||||
84.0,
|
||||
169.0,
|
||||
103.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
981,
|
||||
279,
|
||||
1670,
|
||||
377
|
||||
],
|
||||
"to": [
|
||||
14.0,
|
||||
3.0,
|
||||
153.0,
|
||||
22.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"size": 262144,
|
||||
"crc": 3491893663,
|
||||
"coverage": true,
|
||||
"point_threshold": true
|
||||
},
|
||||
{
|
||||
"name": "ce_hud_ammo_meters",
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters",
|
||||
"bitmap": 0,
|
||||
"scale": 4,
|
||||
"format": "a8r8g8b8",
|
||||
"ce_only": true,
|
||||
"cells": [
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
0,
|
||||
504,
|
||||
830,
|
||||
616
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
122.0,
|
||||
208.0,
|
||||
151.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
7,
|
||||
11,
|
||||
898,
|
||||
208
|
||||
],
|
||||
"to": [
|
||||
1.0,
|
||||
2.0,
|
||||
225.0,
|
||||
51.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
1048,
|
||||
224,
|
||||
1903,
|
||||
352
|
||||
],
|
||||
"to": [
|
||||
268.0,
|
||||
54.0,
|
||||
469.0,
|
||||
86.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
848,
|
||||
504,
|
||||
1672,
|
||||
592
|
||||
],
|
||||
"to": [
|
||||
211.0,
|
||||
122.0,
|
||||
417.0,
|
||||
145.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
872,
|
||||
368,
|
||||
1740,
|
||||
488
|
||||
],
|
||||
"to": [
|
||||
216.0,
|
||||
89.0,
|
||||
434.0,
|
||||
120.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
4,
|
||||
368,
|
||||
855,
|
||||
484
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
89.0,
|
||||
214.0,
|
||||
119.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
920,
|
||||
8,
|
||||
1756,
|
||||
168
|
||||
],
|
||||
"to": [
|
||||
245.0,
|
||||
2.0,
|
||||
431.0,
|
||||
41.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
14,
|
||||
224,
|
||||
887,
|
||||
352
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
54.0,
|
||||
219.0,
|
||||
87.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
18,
|
||||
632,
|
||||
835,
|
||||
664
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
153.0,
|
||||
187.0,
|
||||
162.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"size": 1048576,
|
||||
"crc": 1316117604,
|
||||
"coverage": true,
|
||||
"point_threshold": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"resource_sha256": "317658e0ebd4aa189bac68e994fe0b515928f44d17b62ba676d8850aa329dd3d",
|
||||
"bitmaps": [
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 0, "width": 128, "height": 32, "size": 16384, "crc": 2336761448},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 1382921092},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 2, "width": 128, "height": 32, "size": 16384, "crc": 2368424546},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 2101251412},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 1083921210},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 0, "width": 128, "height": 32, "size": 4096, "crc": 2685300349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 1, "width": 128, "height": 8, "size": 1024, "crc": 2768572645},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 2, "width": 128, "height": 32, "size": 4096, "crc": 4194268279},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 3, "width": 128, "height": 32, "size": 4096, "crc": 1151077783},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 0, "width": 32, "height": 16, "size": 2048, "crc": 3757329756},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 1, "width": 64, "height": 16, "size": 4096, "crc": 1699380589},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 2, "width": 32, "height": 16, "size": 2048, "crc": 1250297732},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 3, "width": 32, "height": 16, "size": 2048, "crc": 1096370127},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 4, "width": 32, "height": 16, "size": 2048, "crc": 1461299380},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 634647465},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 1, "width": 128, "height": 128, "size": 65536, "crc": 2663295025},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 2, "width": 128, "height": 128, "size": 65536, "crc": 4013307535},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 1215291247},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 4, "width": 128, "height": 128, "size": 65536, "crc": 4173016642},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_waypoints", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 1547299393},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2514937598},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 1, "width": 64, "height": 64, "size": 16384, "crc": 1934334840},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 2, "width": 64, "height": 64, "size": 16384, "crc": 2036152485},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 3, "width": 64, "height": 64, "size": 16384, "crc": 1222075981},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 3524091297},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 5, "width": 64, "height": 64, "size": 16384, "crc": 1478490245},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 6, "width": 64, "height": 64, "size": 16384, "crc": 2425719365},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 2841977525},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 8, "width": 64, "height": 64, "size": 16384, "crc": 1789610607},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 9, "width": 64, "height": 64, "size": 16384, "crc": 10769595},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 10, "width": 64, "height": 64, "size": 16384, "crc": 112721360},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 11, "width": 64, "height": 64, "size": 16384, "crc": 1500905970},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 12, "width": 64, "height": 64, "size": 16384, "crc": 2831607766},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 13, "width": 64, "height": 64, "size": 16384, "crc": 3213345147},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticle_warnings", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 598528602},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_damage_arrows", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 4014689458},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 1530348706},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper_mask", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 3264958306},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_multiplayer", "bitmap": 0, "width": 64, "height": 32, "size": 2048, "crc": 279669690},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_counter_numbers", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 22576901},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip", "bitmap": 0, "width": 32, "height": 32, "size": 1024, "crc": 2905414509},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip_custom", "bitmap": 0, "width": 32, "height": 32, "size": 512, "crc": 2318551224},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_msg_icons_sm", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2829841605},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_msg_icons_sm", "bitmap": 1, "width": 128, "height": 128, "size": 65536, "crc": 2261388858},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_health_base", "bitmap": 0, "width": 128, "height": 32, "size": 8192, "crc": 2334111445},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_alphas", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 2672369332},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 1316117604},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\hud_reticles_scope", "bitmap": 0, "width": 64, "height": 64, "size": 16384, "crc": 3359213591},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 0, "width": 64, "height": 256, "size": 65536, "crc": 2440566533},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 1, "width": 64, "height": 256, "size": 65536, "crc": 1451459225},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 2, "width": 128, "height": 8, "size": 4096, "crc": 2199832653},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 3, "width": 128, "height": 8, "size": 4096, "crc": 1036536086},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 4, "width": 8, "height": 128, "size": 4096, "crc": 3263269116},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 0, "width": 32, "height": 128, "size": 16384, "crc": 703763697},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 1, "width": 32, "height": 128, "size": 16384, "crc": 183991369},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 2, "width": 128, "height": 4, "size": 2048, "crc": 2030486740},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 3, "width": 128, "height": 4, "size": 2048, "crc": 1345205876},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 4, "width": 4, "height": 64, "size": 1024, "crc": 1676080439},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\caption", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 120126724},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask2", "bitmap": 0, "width": 512, "height": 256, "size": 524288, "crc": 2575239539},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask_sm", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 2593381205},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 1764629049},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask split", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 343664195},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 0, "width": 256, "height": 64, "size": 65536, "crc": 3748199011},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 550837563},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 2, "width": 256, "height": 32, "size": 32768, "crc": 2456043857},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 3, "width": 256, "height": 32, "size": 32768, "crc": 1948057961},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 4, "width": 256, "height": 16, "size": 16384, "crc": 2860676839},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 5, "width": 128, "height": 8, "size": 4096, "crc": 3272812517},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 6, "width": 128, "height": 128, "size": 65536, "crc": 1984211349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 1269964274},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 8, "width": 256, "height": 64, "size": 65536, "crc": 526077822},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 9, "width": 256, "height": 64, "size": 65536, "crc": 2003746041},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 10, "width": 256, "height": 64, "size": 65536, "crc": 3746007716},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 11, "width": 128, "height": 32, "size": 16384, "crc": 3375336138},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 12, "width": 256, "height": 64, "size": 65536, "crc": 4225542721},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters", "bitmap": 0, "width": 512, "height": 512, "size": 262144, "crc": 3491893663}
|
||||
]
|
||||
}
|
||||
@@ -1,197 +1,68 @@
|
||||
{
|
||||
"note": "High-res HUD textures whose bitmap has the same layout in Halo Custom Edition (the same sprites, the same size or twice it), compared against the stock bitmaps.map and bloodgulch.map; hud_hires.c draws them for a Custom Edition map's stock bitmap of that name as well.",
|
||||
"assets": [
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons",
|
||||
"bitmap": 4
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_counter_numbers",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_damage_arrows",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 4
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 5
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 6
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds",
|
||||
"bitmap": 7
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_waypoints",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds",
|
||||
"bitmap": 4
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_health_base",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_multiplayer",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_sensor_blip",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_sensor_blip_custom",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_sweeper",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\hud_sweeper_mask",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask split",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2",
|
||||
"bitmap": 4
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm",
|
||||
"bitmap": 1
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm",
|
||||
"bitmap": 2
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm",
|
||||
"bitmap": 3
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm",
|
||||
"bitmap": 4
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask2",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask_sm",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks2",
|
||||
"bitmap": 0
|
||||
},
|
||||
{
|
||||
"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks_mask",
|
||||
"bitmap": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 0, "width": 128, "height": 32, "size": 4096, "crc": 2685300349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 1, "width": 128, "height": 8, "size": 1024, "crc": 2768572645},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 2, "width": 128, "height": 32, "size": 4096, "crc": 4194268279},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 3, "width": 128, "height": 32, "size": 4096, "crc": 1151077783},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 0, "width": 32, "height": 16, "size": 2048, "crc": 3757329756},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 1, "width": 64, "height": 16, "size": 4096, "crc": 1699380589},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 2, "width": 32, "height": 16, "size": 2048, "crc": 1250297732},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 3, "width": 32, "height": 16, "size": 2048, "crc": 1096370127},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 4, "width": 32, "height": 16, "size": 2048, "crc": 1461299380},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_counter_numbers", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 22576901},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_damage_arrows", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 4014689458},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 0, "width": 256, "height": 64, "size": 65536, "crc": 3748199011},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 550837563},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 2, "width": 256, "height": 32, "size": 32768, "crc": 2456043857},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 3, "width": 256, "height": 32, "size": 32768, "crc": 1948057961},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 4, "width": 256, "height": 16, "size": 16384, "crc": 2860676839},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 5, "width": 128, "height": 8, "size": 4096, "crc": 3272812517},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 6, "width": 128, "height": 128, "size": 65536, "crc": 1984211349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 1269964274},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_waypoints", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 1547299393},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 0, "width": 128, "height": 32, "size": 16384, "crc": 2336761448},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 1382921092},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 2, "width": 128, "height": 32, "size": 16384, "crc": 2368424546},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 2101251412},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 1083921210},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_health_base", "bitmap": 0, "width": 128, "height": 32, "size": 8192, "crc": 2334111445},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_multiplayer", "bitmap": 0, "width": 64, "height": 32, "size": 2048, "crc": 279669690},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip", "bitmap": 0, "width": 32, "height": 32, "size": 1024, "crc": 2905414509},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip_custom", "bitmap": 0, "width": 32, "height": 32, "size": 512, "crc": 2318551224},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 1530348706},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper_mask", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 3264958306},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 1764629049},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask split", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 343664195},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 0, "width": 64, "height": 256, "size": 65536, "crc": 2440566533},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 1, "width": 64, "height": 256, "size": 65536, "crc": 1451459225},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 2, "width": 128, "height": 8, "size": 4096, "crc": 2199832653},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 3, "width": 128, "height": 8, "size": 4096, "crc": 1036536086},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 4, "width": 8, "height": 128, "size": 4096, "crc": 3263269116},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 0, "width": 32, "height": 128, "size": 16384, "crc": 703763697},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 1, "width": 32, "height": 128, "size": 16384, "crc": 183991369},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 2, "width": 128, "height": 4, "size": 2048, "crc": 2030486740},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 3, "width": 128, "height": 4, "size": 2048, "crc": 1345205876},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 4, "width": 4, "height": 64, "size": 1024, "crc": 1676080439},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask2", "bitmap": 0, "width": 512, "height": 256, "size": 524288, "crc": 2575239539},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask_sm", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 2593381205},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks", "bitmap": 0, "width": 8, "height": 512, "size": 4096, "crc": 2262136367},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks2", "bitmap": 0, "width": 8, "height": 512, "size": 4096, "crc": 2208884634},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks_mask", "bitmap": 0, "width": 8, "height": 256, "size": 2048, "crc": 283547923},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters", "bitmap": 0, "width": 512, "height": 512, "size": 262144, "crc": 3491893663, "replacement": "ce_hud_unit_meters"},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 1316117604, "replacement": "ce_hud_ammo_meters"},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2514937598},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 1, "width": 64, "height": 64, "size": 16384, "crc": 1934334840},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 2, "width": 64, "height": 64, "size": 16384, "crc": 2036152485},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 3, "width": 64, "height": 64, "size": 16384, "crc": 1222075981},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 3524091297},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 5, "width": 64, "height": 64, "size": 16384, "crc": 1478490245},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 6, "width": 64, "height": 64, "size": 16384, "crc": 2425719365},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 2841977525},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 8, "width": 64, "height": 64, "size": 16384, "crc": 1789610607},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 9, "width": 64, "height": 64, "size": 16384, "crc": 10769595},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 10, "width": 64, "height": 64, "size": 16384, "crc": 112721360},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 11, "width": 64, "height": 64, "size": 16384, "crc": 1500905970}
|
||||
],
|
||||
"resource_sha256": "317658e0ebd4aa189bac68e994fe0b515928f44d17b62ba676d8850aa329dd3d"
|
||||
}
|
||||
@@ -10,18 +10,13 @@ do (save a setting, join a game) does not happen; the screens open and close as
|
||||
|
||||
| Function | Uses | |
|
||||
| --- | --- | --- |
|
||||
| `common button bar update` | 28 | PC function |
|
||||
| `common button bar update` | 29 | PC function |
|
||||
| `direct ip connect init` | 1 | PC function |
|
||||
| `direct ip connect update` | 1 | PC function |
|
||||
| `direct ip edit field` | 4 | PC function |
|
||||
| `gamespy screen update` | 1 | PC function |
|
||||
| `gamespy select button` | 8 | PC function |
|
||||
| `gamespy select header` | 22 | PC function |
|
||||
| `gamespy select item` | 49 | PC function |
|
||||
| `gamespy update filter settings` | 2 | PC function |
|
||||
| `gt edit list update` | 1 | PC function |
|
||||
| `gt select list update` | 1 | PC function |
|
||||
| `mouse spinner 1wide click` | 84 | PC function |
|
||||
| `mouse spinner 1wide click` | 99 | PC function |
|
||||
| `mp map list update` | 1 | PC function |
|
||||
| `mp prof init teamplay options` | 1 | PC function |
|
||||
| `mp prof init vehicle options` | 1 | PC function |
|
||||
@@ -33,4 +28,4 @@ do (save a setting, join a game) does not happen; the screens open and close as
|
||||
| `ss edit server name` | 2 | PC function |
|
||||
| `ss start game` | 2 | PC function |
|
||||
|
||||
Wired: `campaign menu continue`, `campaign menu init`, `controls back handler`, `controls begin binding`, `controls screen change set`, `controls screen defaults`, `controls screen init`, `controls update menu`, `difficulty item select`, `direct ip connect go`, `emit custom activation event`, `gamespy back handler`, `gamespy dismiss error`, `gamespy dismiss filters`, `gamespy screen dispose`, `gamespy screen init`, `load game list update`, `load game menu activated`, `load game menu delete finish`, `load game menu delete request`, `load game menu dispose`, `load game menu init`, `main menu quit game`, `mouse emit accept event`, `mouse emit back event`, `mouse emit x event`, `mp type set mode`, `profile manager select`, `profile set edit begin`, `single prev cl item activated`, `solo map list update`, `ss edit server password`.
|
||||
Wired: `campaign menu continue`, `campaign menu init`, `controls back handler`, `controls begin binding`, `controls screen change set`, `controls screen defaults`, `controls screen init`, `controls update menu`, `difficulty item select`, `direct ip connect go`, `emit custom activation event`, `gamespy back handler`, `gamespy dismiss error`, `gamespy dismiss filters`, `gamespy screen dispose`, `gamespy screen init`, `gamespy screen update`, `gamespy select button`, `gamespy select header`, `gamespy select item`, `gamespy update filter settings`, `load game list update`, `load game menu activated`, `load game menu delete finish`, `load game menu delete request`, `load game menu dispose`, `load game menu init`, `main menu quit game`, `mouse emit accept event`, `mouse emit back event`, `mouse emit x event`, `mp type set mode`, `profile manager select`, `profile set edit begin`, `single prev cl item activated`, `solo map list update`, `ss edit server password`.
|
||||
@@ -3,7 +3,7 @@
|
||||
<menus>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/empty_servers_label" type="text" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/empty_servers_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="strings/var_boolean" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/empty_servers_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196" strings="NO|YES" setting="network.browser_show_empty" values="false|true">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/filters_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -22,10 +22,8 @@
|
||||
<data input="game settings lists text update"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_empty_servers" x="54" y="73"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_full_servers" x="54" y="103"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_ping" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_game_type" x="54" y="163"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_game_options" x="54" y="193"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_installed_maps" x="54" y="223"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_game_type" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/op_installed_maps" x="54" y="163"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/filters_button_bar" y="449"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/filters_screen" width="640" height="480" flags="pass_unhandled_to_focused_child force_handle_mouse" bitmap="bitmaps/gradient_big">
|
||||
@@ -34,24 +32,19 @@
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/full_servers_label" type="text" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/full_servers_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="strings/var_boolean" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/game_options_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/game_options_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/join_game/filters/var_filter_game_options" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/full_servers_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196" strings="NO|YES" setting="network.browser_show_full" values="false|true">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/game_type_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/game_type_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/join_game/filters/var_filter_gametype" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings one_tooltip" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/game_type_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings one_tooltip" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196" strings="ANY|CTF|SLAYER|ODDBALL|KING|RACE" setting="network.browser_gametype" values="any|ctf|slayer|oddball|king|race">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/header_filters" controller="1" left="35" top="11" width="395" height="59" bitmap="main_menu/multiplayer_type_select/join_game/filters/header_filters">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/installed_maps_label" type="text" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/installed_maps_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="strings/var_boolean" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/installed_maps_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196" strings="NO|YES|IF DOWNLOADABLE" setting="network.browser_maps" values="no|yes|downloadable">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/op_empty_servers" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
@@ -62,10 +55,6 @@
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/full_servers_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/full_servers_spinner" x="300" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/op_game_options" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/game_options_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/game_options_spinner" x="300" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/op_game_type" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/game_type_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/game_type_spinner" x="300" y="1"/>
|
||||
@@ -74,13 +63,4 @@
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/installed_maps_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/installed_maps_spinner" x="300" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/op_ping" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/ping_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/ping_spinner" x="300" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/ping_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/join_game/filters/filter_options" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/filters/ping_spinner" type="spinner" left="3" top="2" width="187" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/join_game/filters/var_filter_ping" font="ui\large_ui" color="#FF2896FF" align="center" list_flags="items_from_strings one_tooltip" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 190 19 196">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
</menus>
|
||||
@@ -52,6 +52,53 @@
|
||||
<string text="That is not the game's password. Try again."/>
|
||||
<string text="Could not join the game."/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/browser_words">
|
||||
<string text="of"/>
|
||||
<string text="players"/>
|
||||
<string text="player"/>
|
||||
<string text="under way"/>
|
||||
<string text="full or starting"/>
|
||||
<string text="Dedicated server by"/>
|
||||
<string text="listed on"/>
|
||||
<string text="master server"/>
|
||||
<string text="master servers"/>
|
||||
<string text="Dedicated server"/>
|
||||
<string text="Hosted by a player (anonymous listing)"/>
|
||||
<string text="Password required"/>
|
||||
<string text="Needs the newer build: Settings > Network Setup > Check for updates"/>
|
||||
<string text="Runs an older build: it can be joined once it updates"/>
|
||||
<string text="Asking the brokers for the host..."/>
|
||||
<string text="The host answered: connecting (UDP hole punching)..."/>
|
||||
<string text="Connected: joining the game..."/>
|
||||
<string text="The host did not answer (offline, or its listing is stale)"/>
|
||||
<string text="No route to the host: a forwarded port on either side helps"/>
|
||||
<string text="The host refused: full"/>
|
||||
<string text="The host refused: closed"/>
|
||||
<string text="The host refused: banned"/>
|
||||
<string text="The host refused: wrong password"/>
|
||||
<string text="The host refused: another version"/>
|
||||
<string text="The host refused: its invite changed"/>
|
||||
<string text="Strict NAT: turn on UPnP, or forward a port"/>
|
||||
<string text="Internet play is off (Settings)"/>
|
||||
<string text="The server browser is off (network.public_lobby)"/>
|
||||
<string text="Looking for public games..."/>
|
||||
<string text="Games on a newer version (update the game to join them):"/>
|
||||
<string text="No public games found"/>
|
||||
<string text="No games match the filters"/>
|
||||
<string text="No master server answered: showing player-hosted games only"/>
|
||||
<string text="dedicated"/>
|
||||
<string text="JOINING"/>
|
||||
<string text="NEWER"/>
|
||||
<string text="OLDER"/>
|
||||
<string text="FAILED"/>
|
||||
<string text="LIVE"/>
|
||||
<string text="CLOSED"/>
|
||||
<string text="Internet play is off:\nSettings > Network Setup"/>
|
||||
<string text="Neither the master servers\nnor the brokers answer:\ncheck the connection"/>
|
||||
<string text="The host refused: your player name"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/error_words" type="text" controller="1" width="280" height="159" bitmap="bitmaps/alert_bkd" font="ui\large_ui" color="#FF2896FF" text_x="9" text_y="35" text_flags="no_focus_test">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/header_server_browser" controller="1" left="35" top="11" width="363" height="59" bitmap="main_menu/multiplayer_type_select/join_game/header_server_browser">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/header_direct_link" controller="1" left="35" top="11" width="363" height="59" bitmap="main_menu/multiplayer_type_select/join_game/header_direct_link">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The PC version's menus: ui\shell\main_menu\multiplayer_type_select\join_game (tools/ce_menus.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/browser_mode_spinner" type="spinner" left="3" top="2" width="97" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/join_game/join_game_mode" font="ui\large_ui" color="#FFCCCCCC" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 100 19 106">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/browser_mode_spinner" type="spinner" left="3" top="2" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" color="#FFCCCCCC" align="center" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" strings="ALL GAMES|DEDICATED|P2P GAMES" setting="network.browser_source" values="all|dedicated|players" width="117" footer_bounds="7 120 19 126" font="ui\small_ui" text_y="3">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/gamespy_error_fullscreen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/black">
|
||||
@@ -9,6 +9,7 @@
|
||||
<on event="start" run="gamespy dismiss error"/>
|
||||
<on event="b" run="gamespy dismiss error"/>
|
||||
<on event="back" run="gamespy dismiss error"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/error_words" x="192" y="176"/>
|
||||
<child widget="error/error_modal"/>
|
||||
<child widget="error/error_modal_button_bar" x="194" y="309"/>
|
||||
</widget>
|
||||
@@ -110,8 +111,8 @@
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/gamespy_error_fullscreen"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/filters/filters_screen"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/op_browser_mode" width="150" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds_sm2" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/browser_mode_spinner" x="25" y="1"/>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/op_browser_mode" width="150" height="28" flags="pass_unhandled_to_focused_child" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/browser_mode_spinner" x="16" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/op_sort_header_classic" width="20" height="18" bitmap="bitmaps/server_header_background_0" string_list="main_menu/multiplayer_type_select/join_game/join_game_column_headers" string_index="1" font="ui\small_ui" color="#FFFFFFFF" text_y="1">
|
||||
<on event="a" run="gamespy select header"/>
|
||||
@@ -166,12 +167,12 @@
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/header_sort_arrows" x="24" y="4"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/sort_header_type"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/page_count_label" type="text" controller="1" width="170" height="30" font="ui\small_ui" color="#FFFFFFFF" text_flags="no_focus_test">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/page_count_label" type="text" controller="1" width="170" height="30" font="ui\small_ui" color="#FFFFFFFF" text_flags="no_focus_test" align="center">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/player_count_label" type="text" controller="1" width="170" height="30" font="ui\small_ui" color="#FFFFFFFF" text_flags="no_focus_test">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/screen_stats_container" controller="1" width="640" height="480" color="#FFFFFFFF" align="right">
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/server_count_label" x="450" y="60"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/server_count_label" x="410" y="60"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/player_count_label" x="15" y="60"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/page_count_label" x="310" y="60"/>
|
||||
</widget>
|
||||
@@ -191,7 +192,7 @@
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/multiplayer_type_select/join_game/scroll_up_arrow" x="268" y="3"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/server_count_label" type="text" controller="1" width="170" height="30" font="ui\small_ui" color="#FFFFFFFF" align="right" text_flags="no_focus_test">
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/server_count_label" type="text" controller="1" height="30" font="ui\small_ui" color="#FFFFFFFF" align="right" text_flags="no_focus_test" width="210">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/join_game/server_item_1" width="620" height="18" bitmap="bitmaps/server_item_bkds">
|
||||
<on event="a" run="gamespy select item"/>
|
||||
|
||||
@@ -105,6 +105,9 @@
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/lobby/lobby_game_data" type="text" controller="1" left="417" top="250" width="146" height="144" font="ui\small_ui" color="#FF2896FF">
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/lobby/lobby_words">
|
||||
<string text="dedicated"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/lobby/lobby_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/multiplayer_type_select/lobby/lobby_button_team" x="120" y="1"/>
|
||||
<child widget="main_menu/multiplayer_type_select/lobby/lobby_button_start" x="250" y="1"/>
|
||||
|
||||
@@ -216,12 +216,13 @@
|
||||
<string text="Each team's vehicles and their respawn time, for\nthis game."/>
|
||||
<string text="The motion tracker and nav points, for this game."/>
|
||||
<string text="Friendly fire and team balance, for this game."/>
|
||||
<string text="Anyone can see and join your game: it is listed\nin everyone's Server Browser."/>
|
||||
<string text="Anyone can see and join your game: it is listed\nfor everyone through the brokers."/>
|
||||
<string text="Only players with your invite link can join."/>
|
||||
<string text="Friendly fire, the enemies and player collisions,\nfor this game."/>
|
||||
<string text="Voice chat, text chat and votes to kick a player,\nfor this game."/>
|
||||
<string text="Players from the Server Browser must type it to\njoin (an invite link needs none). Enter sets it."/>
|
||||
<string text="Sending players who join without the game's\nCustom Edition map the map, and how fast."/>
|
||||
<string text="Listed for everyone through the brokers, and on\nthe master servers with your publisher key."/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/header_coop_options"/>
|
||||
@@ -241,6 +242,7 @@
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_multiplier" x="54" y="193"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_per_player" x="54" y="223"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_player_collisions" x="54" y="253"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_ally_friendly_fire" x="54" y="283"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -355,6 +357,19 @@
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_ally_friendly_fire" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_ally_friendly_fire" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_ally_friendly_fire">
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels">
|
||||
<string text="FRIENDLY FIRE:"/>
|
||||
<string text="EXTRA ENEMIES:"/>
|
||||
@@ -363,6 +378,7 @@
|
||||
<string text="MULTIPLIER:"/>
|
||||
<string text="PER PLAYER:"/>
|
||||
<string text="PLAYER COLLISIONS:"/>
|
||||
<string text="ALLY FRIENDLY FIRE:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/cap_coop_options">
|
||||
<string text="Players can not be hurt by weapons and explosives\nfired by the other players."/>
|
||||
@@ -390,6 +406,8 @@
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="Players bump into each other, as in the campaign."/>
|
||||
<string text="Players walk through each other, so that no one\nblocks a doorway. The AI's characters still block."/>
|
||||
<string text="Players can hurt and kill their AI allies, as in\nthe campaign."/>
|
||||
<string text="Players can not hurt their AI allies, so that no\none can kill Keyes or the Marines a level needs."/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/header_voice_options"/>
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's multiplayer screens, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/header_opence"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/header_opence" controller="1" left="35" top="11" width="363" height="59" type="text" text="OPENCE OPTIONS" font="ui\large_ui" color="#FFFFFFFF" text_x="13" text_y="16">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_help" type="text" controller="1" left="68" top="341" width="482" height="79" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/cap_opence" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_help">
|
||||
<data input="game settings lists text update"/>
|
||||
<on event="created" run="mp profile init opence options"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_mode" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_hardcore" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_zombies" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_speed" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_damage" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_respawn" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_countdown" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_shields" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_order" x="54" y="313"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_melee" x="54" y="343"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<data input="common button bar update"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="mp profile set opence options" back="true"/>
|
||||
<on event="start" run="mp profile set opence options" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_mode" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_mode" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_mode">
|
||||
<string text="NONE"/>
|
||||
<string text="SWAT"/>
|
||||
<string text="INFECTION"/>
|
||||
<string text="GUN GAME"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_hardcore" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_hardcore" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_hardcore">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_zombies" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_zombies" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_zombies">
|
||||
<string text="1"/>
|
||||
<string text="2"/>
|
||||
<string text="3"/>
|
||||
<string text="4"/>
|
||||
<string text="8"/>
|
||||
<string text="16"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_speed" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_speed" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_speed">
|
||||
<string text="100%"/>
|
||||
<string text="110%"/>
|
||||
<string text="125%"/>
|
||||
<string text="150%"/>
|
||||
<string text="175%"/>
|
||||
<string text="200%"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_damage" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_damage" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_damage">
|
||||
<string text="100%"/>
|
||||
<string text="150%"/>
|
||||
<string text="200%"/>
|
||||
<string text="250%"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_respawn" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_respawn" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_respawn">
|
||||
<string text="1 SECOND"/>
|
||||
<string text="3 SECONDS"/>
|
||||
<string text="5 SECONDS"/>
|
||||
<string text="10 SECONDS"/>
|
||||
<string text="15 SECONDS"/>
|
||||
<string text="30 SECONDS"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_countdown" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_countdown" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_countdown">
|
||||
<string text="NONE"/>
|
||||
<string text="5 SECONDS"/>
|
||||
<string text="10 SECONDS"/>
|
||||
<string text="15 SECONDS"/>
|
||||
<string text="30 SECONDS"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_shields" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_shields" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_shields">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_order" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_order" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_order">
|
||||
<string text="STRONGEST FIRST"/>
|
||||
<string text="WEAKEST FIRST"/>
|
||||
<string text="RANDOM"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_melee" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_melee" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_melee">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels">
|
||||
<string text="MODE:"/>
|
||||
<string text="HARDCORE:"/>
|
||||
<string text="FIRST ZOMBIES:"/>
|
||||
<string text="ZOMBIE SPEED:"/>
|
||||
<string text="SKULL DAMAGE:"/>
|
||||
<string text="ZOMBIE RESPAWN:"/>
|
||||
<string text="COUNTDOWN:"/>
|
||||
<string text="ZOMBIE SHIELDS:"/>
|
||||
<string text="WEAPON ORDER:"/>
|
||||
<string text="MELEE DEMOTES:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/cap_opence">
|
||||
<string text="The game type's own rules."/>
|
||||
<string text="No shields, and a shot to the head kills. Slayer only."/>
|
||||
<string text="Humans killed join the zombies, who win when\nno human is left. Team Slayer only."/>
|
||||
<string text="Each kill gives the next weapon; a kill with the\nlast wins. Free for all Slayer only."/>
|
||||
<string text="The motion sensor and aim assist as the game\ntype has them."/>
|
||||
<string text="No motion sensor, no aim assist, and a kill\nrestores the killer's health and shields."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="Zombies have no shields."/>
|
||||
<string text="Zombies have shields, as humans do."/>
|
||||
<string text="From the rocket launcher to the pistol."/>
|
||||
<string text="From the pistol to the rocket launcher."/>
|
||||
<string text="In an order the host draws for each game."/>
|
||||
<string text="A melee kill takes nothing from the victim."/>
|
||||
<string text="A melee kill takes the victim back a weapon."/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_opence_item" type="text" left="51" top="309" width="232" height="32" bitmap="bitmaps/list_item_bkd" text="OPENCE OPTIONS" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="5">
|
||||
<on event="a" open="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
</menus>
|
||||
+18
@@ -10,8 +10,26 @@
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/aim_assist_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/var_aim_assist" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shield_effects" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_label" type="text" controller="1" width="280" height="22" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/var_shield_effects" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/var_aim_assist">
|
||||
<string text="ALLOWED"/>
|
||||
<string text="BLOCK M+KB"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/var_shield_effects">
|
||||
<string text="STOCK"/>
|
||||
<string text="GLOW"/>
|
||||
<string text="LIGHT SHOW"/>
|
||||
<string text="OVERSHIELD"/>
|
||||
<string text="GLOW+OVERSHIELD"/>
|
||||
<string text="SHOW+OVERSHIELD"/>
|
||||
<string text="PLAYERS' OWN"/>
|
||||
</strings>
|
||||
</menus>
|
||||
+9
-8
@@ -71,14 +71,15 @@
|
||||
<data input="game settings lists text update"/>
|
||||
<on event="created" run="mp profile init player opts"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_number_of_lives" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_maximum_health" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shields" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time_growth" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_odd_man_out" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_invisible_players" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_suicide_penalty" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_aim_assist" x="54" y="313"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_maximum_health" x="54" y="100"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shields" x="54" y="127"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time" x="54" y="154"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time_growth" x="54" y="181"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_odd_man_out" x="54" y="208"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_invisible_players" x="54" y="235"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_suicide_penalty" x="54" y="262"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_aim_assist" x="54" y="289"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shield_effects" x="54" y="316"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/player_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/edit_playlist_select_list" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_list_extended_desc">
|
||||
<data input="playlist settings menu update desc"/>
|
||||
<data input="port playlist edit desc"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_name_list_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_game_type_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_player_opts_item"/>
|
||||
@@ -10,6 +11,7 @@
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_vehicles_list_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_indicators_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_team_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_opence_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/gametype_edit_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|SWAP TRIGGERS|SWAP A, L TRIGGER|SWAP B, L TRIGGER|SWAP B, R STICK|BUMPER JUMPER" setting="profile.button_preset" values="0|1|2|3|4|5" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|SWAP TRIGGERS|SWAP A, L TRIGGER|SWAP B, L TRIGGER|SWAP B, R STICK|BUMPER JUMPER|FISHSTICKS|RECON" setting="profile.button_preset" values="0|1|2|3|4|5|6|7" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/op_joystick_preset" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's settings screen, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/server_browser_settings_screen" width="640" height="480" flags="pass_unhandled_to_focused_child pause_game" bitmap="bitmaps/gradient">
|
||||
<on event="b" back="true"/>
|
||||
<on event="back" back="true"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/header_profile_network_settings"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/options_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/header_profile_network_settings" controller="1" left="35" top="11" width="605" height="59" bitmap="main_menu/settings_select/player_setup/player_profile_edit/network_setup/header_profile_network_settings">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/help" type="text" controller="1" left="68" top="350" width="482" height="60" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/help_strings" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/help">
|
||||
<data input="port settings help"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_listings" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_show_empty" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_show_full" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_maps" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_sort" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_master_servers" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_defaults" y="1"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_listings" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/listings_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/listings_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/listings_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/listings_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ALL GAMES|DEDICATED|P2P GAMES" setting="network.listings" values="both|masters|brokers" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_show_empty" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_empty_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_empty_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_empty_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_empty_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="YES|NO" setting="network.browser_show_empty" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_show_full" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_full_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_full_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_full_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_show_full_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="YES|NO" setting="network.browser_show_full" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_maps" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_maps_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_maps_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_maps_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_maps_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="NO|YES|IF DOWNLOADABLE" setting="network.browser_maps" values="no|yes|downloadable" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_browser_sort" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_sort_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_sort_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_sort_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/browser_sort_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEDICATED FIRST|PLAYERS|NAME|MAP|GAME TYPE|LOCKED FIRST" setting="network.browser_sort" values="servers|players|name|map|type|locked" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/op_master_servers" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/master_servers_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/master_servers_value" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/master_servers_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/master_servers_value" type="text" controller="1" width="212" height="22" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" text_flags="no_focus_test">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings save" back="true"/>
|
||||
<on event="start" run="port settings save" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/labels">
|
||||
<string text="LISTS:"/>
|
||||
<string text="SHOW EMPTY SERVERS:"/>
|
||||
<string text="SHOW FULL SERVERS:"/>
|
||||
<string text="SHOW MISSING MAPS:"/>
|
||||
<string text="SORT BY:"/>
|
||||
<string text="MASTER SERVERS:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/words">
|
||||
<string text="OF"/>
|
||||
<string text="NONE LISTED"/>
|
||||
<string text="NOT ASKED YET"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/help_strings">
|
||||
<string text=""/>
|
||||
<string text="The master servers' dedicated servers, the games\nplayers host (through the brokers), or all of them."/>
|
||||
<string text="List games no one is playing yet."/>
|
||||
<string text="List games with no room left."/>
|
||||
<string text="List games on maps you do not have: IF\nDOWNLOADABLE, those Map Sharing can download."/>
|
||||
<string text="The list's order. Its column titles sort it too;\nchoosing one again reverses it."/>
|
||||
<string text="The master servers (masters.txt) that answered\nwhen the Server Browser last asked."/>
|
||||
</strings>
|
||||
</menus>
|
||||
+12
@@ -22,6 +22,8 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_multiplayer_hud" x="54" y="103" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_streamer_mode" x="54" y="253" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_streamer_mode" x="54" y="133" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_server_browser" x="54" y="283" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_server_browser" x="54" y="163" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -89,6 +91,14 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_server_browser" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/server_browser_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser/server_browser_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/server_browser_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
@@ -107,6 +117,7 @@
|
||||
<string text="MAP SHARING:"/>
|
||||
<string text="MULTIPLAYER HUD:"/>
|
||||
<string text="STREAMER MODE:"/>
|
||||
<string text="SERVER BROWSER:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/help_strings">
|
||||
<string text=""/>
|
||||
@@ -117,5 +128,6 @@
|
||||
<string text="Downloading Custom Edition maps you do not have,\nand helping send them to other players."/>
|
||||
<string text="Players' names above their heads, the\nscoreboard, and the text chat."/>
|
||||
<string text="Hide offensive words in names and text from\nother players, maps and mods, as stars."/>
|
||||
<string text="What the Server Browser lists and its order: the\nsame settings as its Filters screen."/>
|
||||
</strings>
|
||||
</menus>
|
||||
+3
-3
@@ -89,9 +89,9 @@
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/help_strings">
|
||||
<string text=""/>
|
||||
<string text="The overshield rises up the body as it charges\nand stays lit, in its own color. Off: stock."/>
|
||||
<string text="Shields light their surroundings as they flare,\nin the shield's own color."/>
|
||||
<string text="Light Show: the shield glow three times as far,\nat full from a third of the flare."/>
|
||||
<string text="The overshield rises up the body and stays lit,\nin its own color. Online: the host's choice."/>
|
||||
<string text="Shields light their surroundings as they flare.\nOnline: the host's choice."/>
|
||||
<string text="Light Show: three times as far, at full from a\nthird of the flare. Online: the host's choice."/>
|
||||
<string text="Keep the light of explosions, plasma and the sun\npast white, and roll it off instead of clipping."/>
|
||||
<string text="With HDR, on an HDR display, show that light\nbrighter than white. From the next start."/>
|
||||
</strings>
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
</strings>
|
||||
<strings name="main_menu/gametype_select/var_gametype_banks" map="ui\shell\main_menu\gametype_select\var_gametype_banks">
|
||||
<string text="STANDARD" map="0"/>
|
||||
<string text="OPENCE"/>
|
||||
<string text="CUSTOM" map="2"/>
|
||||
</strings>
|
||||
<strings name="main_menu/main_menu_options" map="ui\shell\main_menu\main_menu_options">
|
||||
@@ -286,6 +287,7 @@
|
||||
<string text="Show only servers running teamplay modes." map="8"/>
|
||||
<string text="Show only servers with custom maps that are\ncurrently installed." map="9"/>
|
||||
<string text="Show servers with custom maps that are not\ncurrently installed." map="10"/>
|
||||
<string text="Show servers on maps you do not have if their\nhost shares them: they download as you join."/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/filters/filter_options" map="ui\shell\main_menu\multiplayer_type_select\join_game\filters\filter_options">
|
||||
<string text="SHOW EMPTY SERVERS" map="0"/>
|
||||
@@ -295,11 +297,6 @@
|
||||
<string text="TEAMPLAY OPTIONS" map="4"/>
|
||||
<string text="SHOW MISSING MAPS" map="5"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/filters/var_filter_game_options" map="ui\shell\main_menu\multiplayer_type_select\join_game\filters\var_filter_game_options">
|
||||
<string text="ANY" map="0"/>
|
||||
<string text="FREE-FOR-ALL" map="1"/>
|
||||
<string text="TEAMPLAY" map="2"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/filters/var_filter_gametype" map="ui\shell\main_menu\multiplayer_type_select\join_game\filters\var_filter_gametype">
|
||||
<string text="ANY" map="0"/>
|
||||
<string text="CTF" map="1"/>
|
||||
@@ -308,14 +305,6 @@
|
||||
<string text="KING" map="4"/>
|
||||
<string text="RACE" map="5"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/filters/var_filter_ping" map="ui\shell\main_menu\multiplayer_type_select\join_game\filters\var_filter_ping">
|
||||
<string text="ANY" map="0"/>
|
||||
<string text="< 50" map="1"/>
|
||||
<string text="< 100" map="2"/>
|
||||
<string text="< 150" map="3"/>
|
||||
<string text="< 200" map="4"/>
|
||||
<string text="< 300" map="5"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/join_game/join_game_buttons" map="ui\shell\main_menu\multiplayer_type_select\join_game\join_game_buttons">
|
||||
<string text="GET LIST" map="0"/>
|
||||
<string text="REFRESH" map="1"/>
|
||||
@@ -591,6 +580,13 @@
|
||||
<string text="When you suicide, you must wait fifteen seconds \nbefore you can respawn. This will give you an idea of \nwhat eternity is like." map="27"/>
|
||||
<string text="Players keep their current mouse aim assist setting."/>
|
||||
<string text="Disable mouse aim assist for mouse/keyboard players.\nController and touch aim assist are unchanged."/>
|
||||
<string text="Everyone sees the stock game's shields and\novershield, whatever their own settings."/>
|
||||
<string text="Everyone's shields light their surroundings as\nthey flare."/>
|
||||
<string text="Everyone's shields light their surroundings as\nthey flare, three times as far (Light Show)."/>
|
||||
<string text="For everyone, the overshield rises up the body\nand stays lit, in its own color."/>
|
||||
<string text="For everyone, shields light their surroundings,\nand the overshield rises and stays lit."/>
|
||||
<string text="For everyone, Light Show's shield glow, and the\novershield rising and staying lit."/>
|
||||
<string text="Not synced: each player sees the shield effects\nof their own Video Setup settings."/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_labels" map="ui\shell\main_menu\settings_select\multiplayer_setup\player_options_edit\player_options_labels">
|
||||
<string text="NUMBER OF LIVES:" map="0"/>
|
||||
@@ -602,6 +598,7 @@
|
||||
<string text="INVISIBLE PLAYERS:" map="6"/>
|
||||
<string text="SUICIDE PENALTY:" map="7"/>
|
||||
<string text="AIM ASSIST:"/>
|
||||
<string text="SHIELD EFFECTS:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/var_invisible_players" map="ui\shell\main_menu\settings_select\multiplayer_setup\player_options_edit\var_invisible_players">
|
||||
<string text="YES" map="0"/>
|
||||
@@ -893,6 +890,7 @@
|
||||
<string text="Choose which interface indica-\ntors are available while playing \nthis gametype.\nThis gametype:" map="5"/>
|
||||
<string text="Modify gameplay options and\nrules used by teamplay game\nmodes.\nThis gametype:" map="6"/>
|
||||
<string text="Save changes you've made to\nthis gametype and return to\nthe previous screen.\nThis gametype:" map="7"/>
|
||||
<string text="Choose the rules of OpenCE's\ngametypes: SWAT, Infection,\nGun Game and Hardcore.\nThis gametype:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_options" map="ui\shell\main_menu\settings_select\multiplayer_setup\playlist_edit\playlist_edit_options">
|
||||
<string text="CHANGE NAME" map="0"/>
|
||||
@@ -1093,6 +1091,7 @@
|
||||
<string text="You'll traverse the map in the Rocket Warthog, a\nhardy jeep with a rocket launcher mounted in the back." map="14"/>
|
||||
<string text="Command the skies in the Banshee." map="15"/>
|
||||
<string text="Defend the lands with the powerful Covenant Gun\nTurret." map="16"/>
|
||||
<string text="Every vehicle the map places will spawn, as in\nHalo PC."/>
|
||||
<string text="Customize the set of vehicles which will spawn\nin the map." map="17"/>
|
||||
<string text="No Warthogs will spawn in the map." map="18"/>
|
||||
<string text="Up to one Warthog will spawn in the map." map="19"/>
|
||||
@@ -1145,6 +1144,7 @@
|
||||
<string text="ROCKET WARTHOGS" map="5"/>
|
||||
<string text="BANSHEES" map="6"/>
|
||||
<string text="GUN TURRETS" map="7"/>
|
||||
<string text="PC"/>
|
||||
<string text="CUSTOM" map="8"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/vehicle_options_edit/var_vehicles_respawn" map="ui\shell\main_menu\settings_select\multiplayer_setup\vehicle_options_edit\var_vehicles_respawn">
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
"ce/main_menu.settings_select.multiplayer_setup.item_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.item_options_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.name_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.opence_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.player_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.player_options_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.playlist_edit.ctf_edit.xml",
|
||||
@@ -51,6 +52,7 @@
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.in_game.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.map_sharing.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.multiplayer_hud.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.server_browser.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.streamer_mode.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.extra_effects.xml",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# The master servers that list dedicated servers (docs/master_protocol.md):
|
||||
# the server browser asks each for its signed list, and a dedicated server
|
||||
# publishes its game to each. One master on each line: its https:// URL and
|
||||
# its list-signing key, "ed25519:" and 64 hex digits; up to 4; "#" starts a
|
||||
# comment. A list whose signature does not check with the key is refused.
|
||||
# (The game reads this file beside config.toml: network.masters_file, and a
|
||||
# dedicated server's server.masters_file. An update replaces it; keep a list
|
||||
# of your own under another name.)
|
||||
#
|
||||
# A file that names no master, as this one, leaves the game the official
|
||||
# master, built in: https://master.opencommunityedition.com. A file that
|
||||
# names one or more is asked instead of it.
|
||||
@@ -0,0 +1,261 @@
|
||||
/* The admin page (index.html), in the look of the web site's launcher
|
||||
(port/web/site/style.css): navy panels between a bright rule and a blue
|
||||
edge, blue labels, the system's fonts. Tables become cards on a phone. */
|
||||
|
||||
:root {
|
||||
color-scheme: dark; --ground: #02060c; --head: linear-gradient(180deg, #0b3466 0%, #072852 45%, #041a35 100%);
|
||||
--stage: linear-gradient(180deg, #072852 0px, #062247 320px, #031122 960px, #02060c 1500px);
|
||||
--panel: rgba(0, 10, 24, 0.55); --navy: #002244; --navy-deep: #000e23; --row: rgba(0, 17, 34, 0.6);
|
||||
--edge: #2299ff; --edge-bright: #36afff; --edge-dim: #1d4f86; --label: #2896ff; --text: #ffffff; --soft: #c9daf0;
|
||||
--glow: rgba(54, 175, 255, 0.45); --bad: #ff9b42; --bad-text: #ffd2a8; --bad-ground: #2a1404; --red: #ff6b5e;
|
||||
--blue: #4aa8ff; --log: #00070f; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
|
||||
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
color-scheme: light; --ground: #eef3f9; --head: linear-gradient(180deg, #0b3466 0%, #0a3a73 100%);
|
||||
--stage: linear-gradient(180deg, #dce8f6 0px, #eef3f9 400px); --panel: #ffffff; --navy: #e4eefa;
|
||||
--navy-deep: #f4f8fd; --row: #f1f5fb; --edge: #1673d1; --edge-bright: #1f86e8; --edge-dim: #a9c4e4;
|
||||
--label: #0d5fb3; --text: #0b1726; --soft: #43577a; --glow: rgba(31, 134, 232, 0.25); --bad: #c25a00;
|
||||
--bad-text: #8a3d00; --bad-ground: #fff1e4; --red: #c8322a; --blue: #1663c7; --log: #f7f9fc;
|
||||
}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body { margin: 0; background: var(--ground); color: var(--text); font: 500 15px/1.5 var(--font); }
|
||||
body { min-height: 100vh; background: var(--stage); background-repeat: no-repeat; }
|
||||
|
||||
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label); }
|
||||
h2 { font-size: 17px; margin: 18px 0 10px; }
|
||||
h2:first-child { margin-top: 0; }
|
||||
h3 { font-size: 13px; margin: 14px 0 4px; }
|
||||
.note { margin: 6px 0 0; color: var(--soft); font-size: 13px; }
|
||||
.note:empty, .error:empty { display: none; }
|
||||
.error { margin: 8px 0 0; color: var(--bad-text); font-size: 14px; }
|
||||
.mono, code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
|
||||
|
||||
/* ---------- buttons and fields: the site's */
|
||||
|
||||
button {
|
||||
display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
|
||||
border: 2px solid var(--edge); border-radius: 10px; background: var(--navy); color: var(--text);
|
||||
font: 700 13px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
|
||||
}
|
||||
button:hover:not(:disabled) { border-color: var(--edge-bright); box-shadow: 0 0 12px var(--glow); }
|
||||
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .log:focus-visible {
|
||||
outline: 2px solid var(--edge-bright); outline-offset: 2px;
|
||||
}
|
||||
button:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
button.primary { border-color: var(--edge-bright); box-shadow: 0 0 14px var(--glow); }
|
||||
button.danger { border-color: var(--bad); background: var(--bad-ground); color: var(--bad-text); }
|
||||
button.small { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
|
||||
|
||||
input, select, textarea {
|
||||
min-height: 40px; padding: 6px 10px; border: 2px solid var(--edge-dim); border-radius: 10px;
|
||||
background: var(--navy-deep); color: var(--text); font: 16px var(--font); max-width: 100%;
|
||||
}
|
||||
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--edge); }
|
||||
input:disabled, select:disabled, textarea:read-only { opacity: 0.6; }
|
||||
textarea { font: 13px/1.5 var(--mono); width: 100%; resize: vertical; }
|
||||
label { color: var(--soft); font-size: 13px; }
|
||||
.check { display: inline-flex; align-items: center; gap: 6px; }
|
||||
|
||||
.badge {
|
||||
display: inline-block; padding: 2px 10px; border: 1px solid var(--edge-dim); border-radius: 999px;
|
||||
color: var(--soft); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
|
||||
}
|
||||
.badge:empty { display: none; }
|
||||
.state-playing, .link-live { border-color: var(--edge-bright); color: var(--text); }
|
||||
.state-loading, .state-stopping, .link-polling { border-color: var(--bad); color: var(--bad-text); }
|
||||
|
||||
/* ---------- the sign-in */
|
||||
|
||||
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
|
||||
.login-panel { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; }
|
||||
.login-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
|
||||
.login-head h1 { font-size: 24px; }
|
||||
|
||||
/* ---------- the header and the tabs */
|
||||
|
||||
.top {
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
|
||||
padding: 12px max(16px, env(safe-area-inset-left)); background: var(--head);
|
||||
border-bottom: 1px solid var(--edge-bright); color: #ffffff;
|
||||
}
|
||||
.top h1 { font-size: 20px; color: #4fb4ff; overflow-wrap: anywhere; }
|
||||
.top .badge { color: #c9daf0; }
|
||||
.top-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
||||
.tabs {
|
||||
display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px 0; border-bottom: 1px solid var(--edge-dim);
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
.tabs button {
|
||||
flex: none; border-width: 2px 2px 0; border-color: transparent; border-radius: 12px 12px 0 0;
|
||||
background: transparent; color: var(--label); font-size: 14px;
|
||||
}
|
||||
.tabs button.current { border-color: var(--edge); background: var(--navy-deep); color: var(--text); }
|
||||
|
||||
main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 48px; }
|
||||
|
||||
/* ---------- panels */
|
||||
|
||||
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; }
|
||||
.grid .wide { grid-column: 1 / -1; }
|
||||
.panel {
|
||||
min-width: 0; padding: 18px 20px; background: var(--panel); border-top: 1px solid var(--edge-bright);
|
||||
border-bottom: 1px solid var(--label);
|
||||
}
|
||||
.bar, .inline, .fields { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
|
||||
.inline input { flex: 1 1 200px; min-width: 0; }
|
||||
.fields label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; }
|
||||
.fields button { align-self: flex-end; }
|
||||
|
||||
.facts { margin: 0; display: grid; gap: 4px; }
|
||||
.facts > div {
|
||||
display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 6px 12px;
|
||||
border-radius: 10px; background: var(--row);
|
||||
}
|
||||
.facts dt { color: var(--label); text-transform: uppercase; letter-spacing: 0.03em; font-size: 13px; }
|
||||
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
|
||||
.facts .notice { border: 1px solid var(--bad); }
|
||||
|
||||
.count { margin: 0; font-size: 40px; font-weight: 800; line-height: 1.1; }
|
||||
.count .of { font-size: 18px; color: var(--soft); font-weight: 600; }
|
||||
.spark { display: block; width: 100%; height: 64px; margin-top: 8px; border-radius: 8px; background: var(--row); }
|
||||
.spark-line { fill: none; stroke: var(--edge-bright); stroke-width: 2; vector-effect: non-scaling-stroke; }
|
||||
.spark-fill { fill: var(--glow); stroke: none; opacity: 0.5; }
|
||||
|
||||
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 420px;
|
||||
overflow-y: auto; font-size: 14px; }
|
||||
.feed li { padding: 3px 8px; border-left: 3px solid var(--edge-dim); }
|
||||
.feed time { color: var(--soft); font: 12px var(--mono); }
|
||||
.feed .feed-bad { border-left-color: var(--bad); color: var(--bad-text); }
|
||||
.feed .feed-moderation { border-left-color: var(--label); }
|
||||
.feed .feed-chat { border-left-color: transparent; color: var(--soft); }
|
||||
|
||||
/* ---------- tables, cards on a phone */
|
||||
|
||||
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
|
||||
th { padding: 4px 10px; color: var(--label); text-align: left; font-size: 12px; letter-spacing: 0.05em;
|
||||
text-transform: uppercase; }
|
||||
td { padding: 6px 10px; background: var(--row); vertical-align: middle; overflow-wrap: anywhere; }
|
||||
td:first-child { border-radius: 10px 0 0 10px; }
|
||||
td:last-child { border-radius: 0 10px 10px 0; }
|
||||
tr.bad td, tr.muted td { color: var(--bad-text); }
|
||||
.actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
|
||||
.row-actions { text-align: right; }
|
||||
.dossier td { background: var(--navy-deep); border: 1px solid var(--edge-dim); }
|
||||
.team { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--soft); }
|
||||
.team-0 { background: var(--red); }
|
||||
.team-1 { background: var(--blue); }
|
||||
td .badge { margin-left: 8px; }
|
||||
|
||||
@media (max-width: 700px) {
|
||||
table.cards thead { display: none; }
|
||||
table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
|
||||
table.cards tr { margin-bottom: 10px; padding: 8px 12px; border: 2px solid var(--edge-dim); border-radius: 12px;
|
||||
background: var(--row); }
|
||||
table.cards td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; background: none;
|
||||
border-radius: 0; text-align: right; overflow-wrap: anywhere; }
|
||||
table.cards td::before { content: attr(data-label); color: var(--label); font-size: 12px; text-transform: uppercase;
|
||||
letter-spacing: 0.04em; text-align: left; }
|
||||
table.cards td.row-actions { justify-content: flex-end; padding-top: 8px; }
|
||||
table.cards td.row-actions::before { content: none; }
|
||||
.dossier td { border: none; }
|
||||
.top h1 { font-size: 17px; }
|
||||
.top-end { margin-left: 0; }
|
||||
.panel { padding: 14px; }
|
||||
main { padding: 12px 10px 40px; }
|
||||
}
|
||||
|
||||
/* ---------- the rotation */
|
||||
|
||||
.rotation { margin: 0; padding: 0 0 0 28px; display: flex; flex-direction: column; gap: 6px; }
|
||||
.rotation li { padding: 6px 10px; border: 2px solid transparent; border-radius: 10px; background: var(--row); }
|
||||
.rotation li::marker { color: var(--label); font-weight: 700; }
|
||||
.rotation li { display: list-item; }
|
||||
.rotation li > span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
|
||||
.rotation li .actions { margin-top: 6px; }
|
||||
.rotation .current { border-color: var(--edge); background: var(--navy); }
|
||||
.entry-text { font-family: var(--mono); overflow-wrap: anywhere; }
|
||||
.rejected .entry-text { text-decoration: line-through; color: var(--soft); }
|
||||
.reason { color: var(--bad-text); font-size: 13px; }
|
||||
|
||||
/* ---------- gametypes */
|
||||
|
||||
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
|
||||
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px;
|
||||
border-radius: 10px; background: var(--row); }
|
||||
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
|
||||
.schema-form fieldset, #settings-fields fieldset { margin: 0 0 12px; padding: 8px 12px 12px; border: 1px solid var(--edge-dim);
|
||||
border-radius: 12px; }
|
||||
legend { padding: 0 6px; color: var(--label); font: 700 13px var(--mono); }
|
||||
.schema-form label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
|
||||
.schema-form input, .schema-form select { width: 12em; }
|
||||
.raw { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); }
|
||||
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
|
||||
|
||||
/* ---------- the console */
|
||||
|
||||
.console { display: flex; flex-direction: column; gap: 10px; }
|
||||
.console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
|
||||
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
|
||||
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border: 1px solid var(--edge-dim);
|
||||
border-radius: 999px; font-size: 12px; }
|
||||
.chip input { width: 14px; height: 14px; }
|
||||
.log {
|
||||
height: min(62vh, 640px); overflow-y: auto; padding: 8px 10px; border: 2px solid var(--edge-dim);
|
||||
border-radius: 10px; background: var(--log); color: var(--soft); font: 12.5px/1.5 var(--mono);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.line { white-space: pre-wrap; }
|
||||
.line time { color: var(--edge-dim); }
|
||||
.line .cat { color: var(--label); }
|
||||
.level-warn { color: var(--bad-text); }
|
||||
.level-error { color: var(--bad); font-weight: 700; }
|
||||
.mine { color: var(--text); }
|
||||
.command-line { color: var(--edge-bright); margin-top: 4px; }
|
||||
.line.bad { color: var(--bad-text); }
|
||||
.line.note { color: var(--edge-dim); font-style: italic; }
|
||||
.hide-server .cat-server, .hide-lobby .cat-lobby, .hide-game .cat-game, .hide-player .cat-player,
|
||||
.hide-chat .cat-chat, .hide-moderation .cat-moderation, .hide-net .cat-net, .hide-master .cat-master,
|
||||
.hide-console .cat-console, .hide-health .cat-health { display: none; }
|
||||
.command { display: flex; gap: 8px; }
|
||||
.command input { flex: 1; min-width: 0; font-family: var(--mono); }
|
||||
@media (max-width: 700px) {
|
||||
.log { height: 55vh; font-size: 12px; }
|
||||
.command { position: sticky; bottom: 0; padding: 8px 0 env(safe-area-inset-bottom); background: var(--ground); }
|
||||
}
|
||||
|
||||
/* ---------- settings */
|
||||
|
||||
.setting { display: grid; grid-template-columns: minmax(0, 16em) minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
|
||||
padding: 8px 0; border-bottom: 1px solid var(--row); }
|
||||
.setting .note, .setting .error { grid-column: 1 / -1; margin: 0; }
|
||||
.setting-name { font: 13px var(--mono); color: var(--text); overflow-wrap: anywhere; }
|
||||
.setting input[type="text"], .setting input[type="number"], .setting select, .secret input[type="password"] { width: 100%; }
|
||||
.secret { display: flex; gap: 10px; align-items: center; }
|
||||
.pinned .setting-name { color: var(--soft); }
|
||||
@media (max-width: 700px) { .setting { grid-template-columns: 1fr; } }
|
||||
|
||||
/* ---------- the dialog and the notice */
|
||||
|
||||
.sheet { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
|
||||
background: rgba(0, 4, 10, 0.78); z-index: 10; }
|
||||
.sheet-body { width: min(560px, 100%); max-height: 100%; overflow: auto; border: 2px solid var(--edge); border-radius: 16px;
|
||||
background: var(--navy-deep); box-shadow: 0 0 32px var(--glow); }
|
||||
.sheet h2 { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--edge-bright); background: var(--head); color: #4fb4ff; }
|
||||
#dialog-body { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 10px; }
|
||||
#dialog-body p { margin: 0; }
|
||||
#dialog-body label { display: flex; flex-direction: column; gap: 4px; }
|
||||
.sheet .error { padding: 0 20px; }
|
||||
.sheet .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding: 12px 20px;
|
||||
border-top: 1px solid var(--label); }
|
||||
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
|
||||
max-width: calc(100% - 32px); padding: 10px 18px; border: 2px solid var(--edge); border-radius: 12px;
|
||||
background: var(--navy-deep); box-shadow: 0 0 24px var(--glow); z-index: 20; overflow-wrap: anywhere; }
|
||||
.toast.bad { border-color: var(--bad); color: var(--bad-text); }
|
||||
|
||||
[hidden] { display: none !important; }
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect x="2" y="2" width="60" height="60" rx="14" fill="#002244" stroke="#2299ff" stroke-width="3"/>
|
||||
<rect x="14" y="16" width="36" height="10" rx="3" fill="none" stroke="#36afff" stroke-width="3"/>
|
||||
<rect x="14" y="30" width="36" height="10" rx="3" fill="none" stroke="#36afff" stroke-width="3"/>
|
||||
<circle cx="20" cy="21" r="2" fill="#ffffff"/>
|
||||
<circle cx="20" cy="35" r="2" fill="#ffffff"/>
|
||||
<path d="M32 44v6M22 50h20" fill="none" stroke="#2896ff" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 569 B |
@@ -0,0 +1,241 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="referrer" content="same-origin">
|
||||
<meta name="color-scheme" content="dark light">
|
||||
<title>OpenCE server</title>
|
||||
<link rel="icon" href="icon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="app.css">
|
||||
<script src="app.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="login" class="login" hidden>
|
||||
<form id="login-form" class="panel login-panel">
|
||||
<div class="login-head"><img src="icon.svg" alt="" width="52" height="52"><h1>OpenCE server</h1></div>
|
||||
<label for="login-password">Password</label>
|
||||
<input id="login-password" type="password" autocomplete="current-password" required>
|
||||
<p id="login-error" class="error" role="alert"></p>
|
||||
<button type="submit" class="primary" id="login-button">Sign in</button>
|
||||
<p class="note">server.web_password (admin) or server.web_moderator_password (moderator). The page keeps no
|
||||
password: the session is a cookie for 12 hours, or 30 minutes unused.</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="app" hidden>
|
||||
<header class="top">
|
||||
<img src="icon.svg" alt="" width="34" height="34">
|
||||
<h1 id="server-name">OpenCE server</h1>
|
||||
<span id="server-state" class="badge"></span>
|
||||
<span class="top-end">
|
||||
<span id="link-state" class="badge" title="How the page hears from the server"></span>
|
||||
<span id="role" class="badge"></span>
|
||||
<button id="logout" class="small">Sign out</button>
|
||||
</span>
|
||||
</header>
|
||||
<nav class="tabs" role="tablist" aria-label="Sections">
|
||||
<button role="tab" data-tab="status">Status</button>
|
||||
<button role="tab" data-tab="players">Players</button>
|
||||
<button role="tab" data-tab="rotation">Rotation</button>
|
||||
<button role="tab" data-tab="gametypes">Gametypes</button>
|
||||
<button role="tab" data-tab="bans" data-needs="admin">Bans</button>
|
||||
<button role="tab" data-tab="console">Console</button>
|
||||
<button role="tab" data-tab="settings" data-needs="admin">Settings</button>
|
||||
<button role="tab" data-tab="about">About</button>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<section id="tab-status" class="tab" role="tabpanel" hidden>
|
||||
<div class="grid">
|
||||
<div class="panel">
|
||||
<h2>Game</h2>
|
||||
<dl id="status-facts" class="facts"></dl>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h2>Players</h2>
|
||||
<p class="count"><span id="status-count">0</span><span class="of"> of <span id="status-max">0</span></span></p>
|
||||
<svg id="spark" class="spark" viewBox="0 0 300 64" preserveAspectRatio="none" role="img"
|
||||
aria-label="Players over the last 10 minutes"><polyline id="spark-fill" class="spark-fill" points=""/><polyline id="spark-line" class="spark-line" points=""/></svg>
|
||||
<p class="note" id="spark-note">The last 10 minutes, as this page saw them.</p>
|
||||
<h2>Actions</h2>
|
||||
<div class="bar">
|
||||
<button id="next-map" data-needs="moderator">Next map</button>
|
||||
<button id="end-game" data-needs="moderator">End game</button>
|
||||
</div>
|
||||
<form id="say-form" class="inline">
|
||||
<input id="say-text" maxlength="127" placeholder="A notice on every screen" aria-label="Notice"
|
||||
data-needs="moderator">
|
||||
<button data-needs="moderator">Say</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h2>Invite</h2>
|
||||
<div class="inline">
|
||||
<input id="invite" readonly aria-label="The invite link">
|
||||
<button id="invite-copy" data-needs="admin">Copy</button>
|
||||
</div>
|
||||
<p class="note">Anyone with the link joins: the game's Join Game, or ?join= on the web page.</p>
|
||||
<h2>Master servers</h2>
|
||||
<table id="masters" class="cards">
|
||||
<thead><tr><th>Master</th><th>Listed</th><th>Probe</th><th>Answer</th><th>When</th></tr></thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<p id="masters-empty" class="note">No master servers.</p>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h2>Recent events</h2>
|
||||
<ol id="feed" class="feed"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-players" class="tab" role="tabpanel" hidden>
|
||||
<div class="panel">
|
||||
<h2>Players</h2>
|
||||
<table id="players" class="cards">
|
||||
<thead><tr><th>Slot</th><th>Name</th><th>Team</th><th>Score</th><th>K/D/A</th><th>Ping</th><th>Played</th>
|
||||
<th>Actions</th></tr></thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<p id="players-empty" class="note">No players.</p>
|
||||
<p class="note">Every action names the slot and the player: the server checks the slot is still theirs.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-rotation" class="tab" role="tabpanel" hidden>
|
||||
<div class="panel">
|
||||
<h2>Rotation</h2>
|
||||
<ol id="rotation" class="rotation"></ol>
|
||||
<form id="rotation-add" class="fields">
|
||||
<label>Map <select id="add-map" data-needs="admin"></select></label>
|
||||
<label>Gametype <select id="add-gametype" data-needs="admin"></select></label>
|
||||
<label>Rules <input id="add-rules" placeholder="score=50+time=15" data-needs="admin"></label>
|
||||
<button data-needs="admin">Add</button>
|
||||
</form>
|
||||
<p id="rotation-note" class="note"></p>
|
||||
<div class="bar">
|
||||
<button id="rotation-save" class="primary" data-needs="admin">Save</button>
|
||||
<button id="rotation-revert">Revert</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-gametypes" class="tab" role="tabpanel" hidden>
|
||||
<div class="grid">
|
||||
<div class="panel">
|
||||
<h2>Gametypes</h2>
|
||||
<ul id="gametype-files" class="list"></ul>
|
||||
<h3>Built-in</h3>
|
||||
<p id="gametype-builtins" class="note"></p>
|
||||
<form id="gametype-new" class="fields">
|
||||
<label>Name <input id="new-name" pattern="[a-z0-9_\-]{1,32}" placeholder="btb_ctf" required
|
||||
data-needs="admin"></label>
|
||||
<label>Base <select id="new-base" data-needs="admin"></select></label>
|
||||
<button data-needs="admin">New</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel wide" id="gametype-editor" hidden>
|
||||
<h2 id="editor-title"></h2>
|
||||
<div class="editor">
|
||||
<div id="gametype-form" class="schema-form"></div>
|
||||
<label class="raw"><span>gametypes/<span id="editor-file"></span>.toml</span>
|
||||
<textarea id="gametype-text" spellcheck="false" autocapitalize="off" rows="22"></textarea></label>
|
||||
</div>
|
||||
<p id="gametype-error" class="error" role="alert"></p>
|
||||
<div class="bar">
|
||||
<button id="gametype-save" class="primary" data-needs="admin">Save</button>
|
||||
<button id="gametype-delete" class="danger" data-needs="admin">Delete</button>
|
||||
<button id="gametype-close">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-bans" class="tab" role="tabpanel" hidden>
|
||||
<div class="panel">
|
||||
<h2>Bans</h2>
|
||||
<table id="bans" class="cards">
|
||||
<thead><tr><th>#</th><th>When</th><th>Players</th><th>Address</th><th>Hardware id</th><th>Reason</th>
|
||||
<th>Until</th><th></th></tr></thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<p id="bans-empty" class="note">No bans.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-console" class="tab" role="tabpanel" hidden>
|
||||
<div class="panel console">
|
||||
<div class="console-bar">
|
||||
<label class="check"><input type="checkbox" id="follow" checked> Follow</label>
|
||||
<span id="categories" class="chips"></span>
|
||||
<button id="log-clear" class="small">Clear</button>
|
||||
</div>
|
||||
<div id="log" class="log" role="log" tabindex="0"></div>
|
||||
<form id="command-form" class="command">
|
||||
<input id="command" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="send"
|
||||
placeholder="A command: help lists them" aria-label="Command">
|
||||
<button>Run</button>
|
||||
</form>
|
||||
<p id="command-hint" class="note">Tab completes, Up and Down go through what was run.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-settings" class="tab" role="tabpanel" hidden>
|
||||
<form id="settings-form" class="panel">
|
||||
<h2>Settings</h2>
|
||||
<p class="note">Written to config.toml and applied now where they can be. A setting its environment
|
||||
variable sets cannot be changed here.</p>
|
||||
<div id="settings-fields"></div>
|
||||
<p id="settings-note" class="note" role="status"></p>
|
||||
<div class="bar"><button class="primary" data-needs="admin">Save</button>
|
||||
<button type="button" id="settings-revert">Revert</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section id="tab-about" class="tab" role="tabpanel" hidden>
|
||||
<div class="grid">
|
||||
<div class="panel">
|
||||
<h2>Ports to open</h2>
|
||||
<dl class="facts" id="about-ports"></dl>
|
||||
<p class="note">Only the tunnel's port needs to reach the internet. Keep the web port on loopback, or
|
||||
behind a proxy that adds TLS (Caddy: reverse_proxy 127.0.0.1:8080), or reach it with
|
||||
ssh -L 8080:127.0.0.1:8080.</p>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h2>Where files are</h2>
|
||||
<dl class="facts">
|
||||
<div><dt>config.toml</dt><dd>Every setting: beside the executable, or --config</dd></div>
|
||||
<div><dt>init.txt</dt><dd>Commands run at the start (server.init_file), in the data root</dd></div>
|
||||
<div><dt>gametypes/</dt><dd>The operator's gametypes (.toml) and saved ones (.gametype), in the data
|
||||
root</dd></div>
|
||||
<div><dt>bans.txt, debug.txt</dt><dd>In paths.logs, else the data root</dd></div>
|
||||
<div><dt>masters.txt</dt><dd>The master servers, beside the executable</dd></div>
|
||||
<div><dt>publisher.key</dt><dd>The publisher key for the master servers, beside config.toml</dd></div>
|
||||
<div><dt>status.json</dt><dd>The status every 2 seconds (server.status_file)</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h2>This server</h2>
|
||||
<dl class="facts" id="about-facts"></dl>
|
||||
<p class="note">docs/dedicated_server.md is the reference of the commands, the API and the RCON.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div id="dialog" class="sheet" hidden>
|
||||
<form id="dialog-form" class="sheet-body" role="dialog" aria-modal="true" aria-labelledby="dialog-title">
|
||||
<h2 id="dialog-title"></h2>
|
||||
<div id="dialog-body"></div>
|
||||
<p id="dialog-error" class="error" role="alert"></p>
|
||||
<div class="actions">
|
||||
<button type="button" id="dialog-cancel">Cancel</button>
|
||||
<button type="submit" id="dialog-ok" class="primary">OK</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="toast" class="toast" role="status" hidden></div>
|
||||
</body>
|
||||
</html>
|
||||
+113
-7
@@ -47,6 +47,11 @@ with ideas from VALORANT's netcode articles, keeping the 30 Hz tick:
|
||||
host's is once that stops, or if they drift apart while it moves;
|
||||
- which named objects exist, so scripted creates and deletes match.
|
||||
|
||||
Script actions naming player0 also reach the players beyond player1.
|
||||
They use the same reverse datum order as the script's `(players)` list,
|
||||
skipping players without units, so a scripted BSP transition does not
|
||||
leave the extra players in the unloaded part of the level.
|
||||
|
||||
Every machine follows the host's structure BSP: a switch is sent at once
|
||||
and reliably, and each client's input says which BSP it has loaded.
|
||||
Until a client has the host's, the host takes none of its players'
|
||||
@@ -233,7 +238,52 @@ from, so that a second copy of the game on one computer, on a port of its
|
||||
own, plays too; version 32 sends the host's mouse aim assist policy
|
||||
(distributed message 90, `network_aim_assist.c`), which a client must not
|
||||
ignore, and has a client's input say whether its player plays co-op with
|
||||
friendly fire.
|
||||
friendly fire; version 33 sends with the game's settings whether co-op's
|
||||
players hurt their AI allies (Server Setup's ALLY FRIENDLY FIRE: the host
|
||||
then deals the players' hits of them no damage); version 34 takes clients'
|
||||
hits on, and sends the host's damage to, the map's scenery and devices
|
||||
whose shield is all damage can break (Rat Race's energy shields, a Custom
|
||||
Edition map's tripmines), which version 17 left out as having no body to
|
||||
destroy, and has every machine run those shields' stun and recharge itself;
|
||||
and the host deals what such an object deals itself (its shield or body
|
||||
breaking: a tripmine a client's player threw going off under the host's
|
||||
vehicle), which a client no longer reports and the host took from no one.
|
||||
One made in the game, a tripmine, is at an index of its own on each machine:
|
||||
the host takes a client's hit on its copy as one on the host's nearest where
|
||||
the client had it, and a client the host's damage to one as damage to its own
|
||||
copy nearest the damage. Then version 35 sends with the game's settings the
|
||||
options of OpenCE's gametypes (SWAT, Infection, Gun Game and Hardcore:
|
||||
`port/linux/game/game_modes.c`), which make the gametype's PC options 0x2C
|
||||
bytes where they were 0x1C, and the game settings record 16 bytes longer; and
|
||||
in an Infection game the host sends its round in the game type's state
|
||||
(`struct distributed_infection_state`: each player's role and score, the
|
||||
round's phase and winner) in place of Slayer's, which each client checks whole
|
||||
before taking it. Then version 36 sends the host's shield effects (distributed
|
||||
message 91, `network_shield_effects.c`: the shield glow, its Light Show reach
|
||||
and the overshield effect, Server Setup's SHIELD EFFECTS), which every client
|
||||
draws in place of its player's own, so that a build that would draw its own
|
||||
cannot join. Then version 37 sends with a game's LAN advertisement (the fourth
|
||||
of its reserved bytes) and internet listing (the first byte of its stamp) the
|
||||
game's kind: an OpenCE gametype's mode and Hardcore
|
||||
(`port/linux/game/game_modes.h`'s `game_modes_kind`), which the server
|
||||
browser names in its gametype column ("SWAT", "HC CTF"); a browser takes a
|
||||
mode for a Slayer game only, and one it does not know as none. Then version 38
|
||||
lets the host's shield effects be `players` (SHIELD EFFECTS' PLAYERS' OWN), a
|
||||
value of distributed message 91 that tells each client to draw its own
|
||||
settings', not synced. Then version 39 marks a dedicated server's game (a
|
||||
host with no player of its own, `halo --server`: "Dedicated servers"
|
||||
below) with a flag of its LAN advertisement (`HALO_PORT_ADVERTISED_DEDICATED_FLAG`,
|
||||
0x04 of the third reserved byte) and of its internet listing (32), which
|
||||
the server browser shows. With no new version, each client then tells the
|
||||
host its build (distributed message 92, `_distributed_message_client_build`,
|
||||
reliably once a game after its ready, over its connection alone): its
|
||||
number, configuration, the label it shows ("OpenCE Linux | build 282
|
||||
(release)"), the GitHub repository it is made from (owner/name, which the
|
||||
build scripts take from CI's `GITHUB_REPOSITORY` or the checkout's origin
|
||||
remote) and the mods it plays, a line each ("folder version", in the load
|
||||
order); the host keeps it printable and logs it once, and a dedicated
|
||||
server shows it in `/api/players` (`client`). A host without the message
|
||||
drops it as a kind it does not know.
|
||||
|
||||
`port/linux/network_format.txt` records the wire format of the current
|
||||
version (`tools/network_format.py`): `test_linux_port.py` fails when the
|
||||
@@ -292,7 +342,13 @@ hardware id is in it (a line taken out unbans). Both are as the player's
|
||||
machine tells them: anyone with administrator or root access can change
|
||||
them, and players behind one address share it. The console's `kick <player
|
||||
name>` drops a player as `ban` does (every machine told), but adds no line
|
||||
and keeps no address out: the player may join again at once.
|
||||
and keeps no address out: the player may join again at once. Besides
|
||||
`bans.txt`, the host keeps out a machine dropped for cheating or banned for
|
||||
ever while it runs, by its address as it joined (an internet play peer's
|
||||
stand-in), its real address and its hardware id, any of them; a dedicated
|
||||
server's ban for a while (`ban <player> 30m`) is left to its `bans.txt`
|
||||
line, whose `until=` ends it, and its `unban` lets the machine in again by
|
||||
the line's address or hardware id (`network_game_server_port_forget_kicked_address`).
|
||||
|
||||
The players' votes to kick a player (`network_votekick.c`): a client sends
|
||||
`_distributed_message_votekick` (the player's absolute index) reliably, and
|
||||
@@ -347,8 +403,9 @@ names of the network game's players, which the lobby has too). A
|
||||
machine's own scoreboard mute stays its own: it plays none of that
|
||||
machine's voice and shows none of its players' lines, and tells no one.
|
||||
The host's chat settings (`network.text_chat`: on, links allowed, or off;
|
||||
always off while its game is listed in the server browser,
|
||||
`p2p_hosting_listed`) go to every client in
|
||||
always off while a player's game is listed in the server browser,
|
||||
`p2p_hosting_listed`, but a dedicated server's own, `chat_listing_allows`)
|
||||
go to every client in
|
||||
`_distributed_message_chat_config` (one byte of flags), reliably, as they
|
||||
change and every 3 seconds. A client without them (from a host without the
|
||||
chat, or before they come) has the chat off, and so does a client in a
|
||||
@@ -356,7 +413,10 @@ public game it joined from the server browser, whatever its host sends (a
|
||||
changed host could turn the chat on): while the tunnel reaches the host of
|
||||
the listing it joined (`p2p_join_listing`, `p2p_joined_listed_host`; any
|
||||
other invite joined since forgets it), it takes no chat line or notice and
|
||||
sends none. A client refuses a line the
|
||||
sends none, unless the listing was a dedicated server's that a master
|
||||
server lists (`p2p_joined_listed_dedicated`: the master's word, from an
|
||||
approved operator's key; a listing's own dedicated flag, which any host can
|
||||
set, does not count), whose settings it follows. A client refuses a line the
|
||||
settings refuse before sending it, and the host refuses it again whatever
|
||||
the client knew, telling its machine why: a changed build gets no further.
|
||||
Links are found in the line's text (`chat_text_has_link`): a scheme, `www.`,
|
||||
@@ -429,7 +489,8 @@ do (in free for all, a team of its own).
|
||||
|
||||
The game is closed to joins while its machines load and after it ends.
|
||||
A machine must join within 10 seconds of connecting; in a game, the host
|
||||
drops a machine it has heard nothing from for 15 seconds, and one that
|
||||
drops a machine it has heard nothing from for 15 seconds
|
||||
(`network.client_timeout_seconds`), and one that
|
||||
joined the game in progress and has not loaded in two minutes.
|
||||
|
||||
Until it has loaded, the machine hears none of the game's messages (which a
|
||||
@@ -437,6 +498,48 @@ machine in the pregame refuses, and which the others no longer need), only
|
||||
a pregame keep-alive every five seconds from the host
|
||||
(`network_server_manager.c`, `network_server_message_handler.c`).
|
||||
|
||||
## Dedicated servers
|
||||
|
||||
A dedicated server (`halo --server`: `docs/dedicated_server.md`) is a host
|
||||
as any other, with these differences, all on the host's side:
|
||||
|
||||
- **No player of its own.** The host machine is in the game as machine 0
|
||||
but has no player, so its lobby counts the joined machines' players only
|
||||
(`network_server_manager.c`'s `server_ok_to_countdown`, which asks
|
||||
`server_director_ok_to_countdown` for `server.min_players` and
|
||||
`server.team_start`), and a game with one team's players may start (the
|
||||
next players to join balance the teams). The host waits for no player of
|
||||
its own to precache, and a client's player that quits the game does not
|
||||
end the host's (`network_client_manager.c`: only a local player's quit
|
||||
leaves).
|
||||
- **No ticks of its own player.** The host's own action queue may hold no
|
||||
action (`player_queues_new.c`), as a game with no local player has none.
|
||||
- **The director.** `port/linux/game/server_director.c` drives the lobby as
|
||||
a player at the pregame screen would: it sets the map and gametype of the
|
||||
rotation's entry, starts the countdown once the server's own rule allows
|
||||
it (`network_game_server_port_ok_to_countdown`, the rule the server checks
|
||||
each tick, then `network_game_server_port_countdown_begin`), and after the postgame
|
||||
goes back to the lobby with the next entry. The clients see a lobby, a
|
||||
game and a postgame as with any host.
|
||||
- **Shutdown.** On SIGTERM, a game in progress goes to its postgame, and
|
||||
the host tells every machine it goes (`network_game_server_graceful_shutdown`)
|
||||
before it exits, so that the clients show the scores rather than a lost
|
||||
connection.
|
||||
- **The flags.** Since version 39 a dedicated server's LAN advertisement
|
||||
carries `HALO_PORT_ADVERTISED_DEDICATED_FLAG` and its internet listing the
|
||||
dedicated flag (32); a listing published to the master servers is the
|
||||
same signed listing (`docs/master_protocol.md`), and the master's probe
|
||||
is answered on the tunnel's socket (`p2p.c`, `server_master_probe`).
|
||||
- **The timeout.** `network.client_timeout_seconds` (15 seconds by
|
||||
default) sets how long a host waits for a silent machine, and two more
|
||||
waits with it: how long a stream's writes may stall before its connection
|
||||
is dropped (`network_connection.c`), on every machine, clients too; and
|
||||
how long a host in a game rides out its network going (an address
|
||||
renewed, a wifi drop: `network_game_server_network_lost`). So it is not
|
||||
the host's alone, and not a dedicated server's only: each machine reads
|
||||
its own setting, and nothing on the wire changes (the machines need not
|
||||
agree on it).
|
||||
|
||||
## Map sharing
|
||||
|
||||
A client may join a game on a Custom Edition map it does not have
|
||||
@@ -610,7 +713,10 @@ its name alone beside it, has its name given back as the map lists find it.
|
||||
players' ammunition and grenade counts from the host only once a
|
||||
round trip has passed since it last fired, reloaded or threw (what
|
||||
the host says before then is from before). How old what a unit
|
||||
carries is travels in 16 bits.
|
||||
carries is travels in 16 bits. A client keeps an inventory whose
|
||||
unit or weapons have not come yet (the stream can trail the datagram)
|
||||
and applies it in full once they have, the newest of a unit's winning;
|
||||
one is dropped `EMPTY_INVENTORY_TICKS` after the newest came.
|
||||
- Players take the units the host spawns them with, seats are the
|
||||
host's (a client's own player's once it has ridden otherwise for
|
||||
longer than a round trip), and the CTF flags and oddballs are the same
|
||||
|
||||
+287
-15
@@ -226,6 +226,12 @@ is held. The profile's button layout (Settings > Gamepads) is the
|
||||
gamepads' only. Besides the Xbox's five, it has the Master Chief
|
||||
Collection's Bumper Jumper: jump on the left bumper, melee on the right,
|
||||
switching grenades on A, action and reload on B and the flashlight on X.
|
||||
Fishsticks has zoom on the left trigger and melee on the right stick's
|
||||
button, the grenade thrown with the right bumper, crouch on B and grenades
|
||||
switched with the pad's left direction (which then does not strafe or turn).
|
||||
|
||||
Recon is the standard layout with action and reload on the right bumper and
|
||||
grenades switched with the left bumper (the flashlight moves to X).
|
||||
|
||||
| Action | Keys and buttons (default) |
|
||||
| --- | --- |
|
||||
@@ -263,7 +269,9 @@ second get a numeric suffix so previous screenshots are preserved.
|
||||
One movement of the mouse wheel changes the weapon one time. A second
|
||||
movement after a short pause changes it again.
|
||||
|
||||
In the menus, the mouse moves a pointer:
|
||||
In the menus, the mouse moves a pointer, a blue arrow
|
||||
(`port/assets/cursor/menu_cursor.png`) in place of the system's, sized to
|
||||
the window as Halo PC's was (32 of the menus' 480 lines tall):
|
||||
|
||||
- The item below the pointer gets the focus.
|
||||
- A left click selects the item. On a setting with values, a click on the
|
||||
@@ -375,8 +383,38 @@ follow the teams' changes in the lobby. They look for enemies, aim, fire,
|
||||
throw grenades and pick up better weapons, as well as `bots.skill` lets
|
||||
them, and walk the paths that the campaign's AI finds on the maps' walkable
|
||||
surfaces (`game/bots.c`). They are never in system link or internet games,
|
||||
nor in other gametypes, and nothing that the machines send each other
|
||||
changes.
|
||||
nor in other gametypes (but SWAT, Infection and Gun Game, which are
|
||||
Slayer's: below), and nothing that the machines send each other changes.
|
||||
|
||||
## OpenCE gametypes
|
||||
|
||||
Create Game's Select Gametype screen has a bank between STANDARD and
|
||||
CUSTOM: OPENCE, the port's own gametypes (`game/game_modes.c`).
|
||||
|
||||
| Gametype | Rules |
|
||||
| --- | --- |
|
||||
| SWAT | Team Slayer with no shields, in which a shot to the head of any weapon kills (a bullet's, a plasma bolt's, a needle's or a shotgun pellet's, not a melee's or an explosion's). Everyone starts with a pistol and an assault rifle; no weapons are on the map, no one has grenades, and there is no motion sensor. |
|
||||
| Infection | Team Slayer. Humans are red and keep the map's weapons; zombies are blue, carry the Oddball skull and nothing else, move faster, hit harder with the skull, and cannot drive, pick up grenades or powerups. Once two players are alive the round counts down, then the host chooses the first zombies (a human is always left). A human killed by a zombie, by themselves or by a fall becomes a zombie, one killed by a teammate does not; a zombie respawns a zombie, and a player who joins late is one. The zombies win when no human is left, the humans when the round's time runs out (5 minutes). Each player scores a kill of the other side. The rules follow pull request #420's (`game/infection.c`). |
|
||||
| Gun Game | Free for all Slayer. Everyone starts with the first weapon of a list (the rocket launcher, the shotgun, the sniper rifle, the plasma rifle, the assault rifle, the needler, the plasma pistol, the pistol, of those the map has); each kill gives the killer the next, and a kill with the last wins. No one picks up a weapon, a weapon emptied is refilled, and a melee kill takes the victim back a weapon (`game/gun_game.c`). |
|
||||
| Hardcore Slayer, Hardcore CTF, Hardcore Oddball, Hardcore King | The team gametypes with Hardcore's rules: no motion sensor (the flag, the ball and the hill keep their nav points), no aim assist (no autoaim nor magnetism, for controllers and the mouse alike), friendly fire on, and a kill restores the killer's health, and their shields unless an overshield has them past full. |
|
||||
|
||||
Edit Gametypes edits them as any gametype, and its OPENCE OPTIONS screen
|
||||
(after TEAMPLAY OPTIONS) gives any gametype these rules: its MODE (NONE,
|
||||
SWAT, INFECTION or GUN GAME: Slayer only; Infection is played on teams and
|
||||
Gun Game free for all, which the screen's OK sets), HARDCORE (any game
|
||||
type), and the mode's own options: Infection's first zombies, zombie speed,
|
||||
skull damage, zombie respawn time, countdown and zombie shields, and Gun
|
||||
Game's weapon order (strongest first, weakest first, or random, drawn by
|
||||
the host for each game) and whether a melee kill demotes. A saved gametype
|
||||
keeps them with its PC options (`saved games/playlist_profile.c`, version 2
|
||||
of their block; a gametype saved before them has none), and the network
|
||||
game carries them to every machine (network version 35, `NETCODE.md`).
|
||||
Only the host decides each mode's events (Infection's zombies, Gun Game's
|
||||
weapons, Hardcore's restores); the clients take them from it as they take
|
||||
the rest of the game. The lobby and Server Setup name the gametype's mode.
|
||||
`debug.network_test` hosts them by name: `swat`, `infection`, `gun_game`,
|
||||
`hardcore`, `hardcore_ctf`, `hardcore_oddball` and `hardcore_king`
|
||||
(`host:bloodgulch:infection`).
|
||||
|
||||
## Settings
|
||||
|
||||
@@ -435,9 +473,9 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `display.latency_meter` | `false` | `HALO_LATENCY_METER` | `true`: in a network game, your round trip to the host in milliseconds at the top right of the screen, "Ping 45 ms" with four bars: green below 80 ms, yellow below 150, red from 150. The host shows "Max ping", its slowest player's. A player's machine that has heard nothing from the host for two seconds shows "Connection problem". The round trip includes each machine's wait for its next tick, so a LAN reads 15 to 35 ms. Not shown in the menus, after the game, in a co-op cutscene or when the host plays alone. The scoreboard's pings take the same colours, and show the round trips this machine times itself (the host: each player's; a player: their own), so they agree with the meter. Nothing more is sent. Only in config.toml, not in the menus. |
|
||||
| `display.per_pixel_lighting` | `false` | `HALO_PER_PIXEL_LIGHTING` | `false`: the models (characters, weapons, vehicles, scenery) are lit at each vertex and the light is blended between them, as on the Xbox. The light across a curved surface then shows facets, and a point light that passes close lights only the vertices it reaches. `true`: the models are lit at each pixel by the same lights (the ambient light, two distant lights and two point lights), which changes their look. |
|
||||
| `display.structure_culling` | `31` | `HALO_STRUCTURE_CULLING` | Which tests skip the triangles of the level (its walls, floors and terrain) that the camera cannot see before they are drawn, as bits added together: `1`, triangles outside the view; `2`, groups of triangles that all face away from the camera; `4`, single triangles that face away; `8`, smaller groups, so that more of them are skipped whole; `16`, the rooms nearest the camera first. Each test is conservative: the picture is the same, with fewer triangles drawn. `0`: the original walk, which draws every triangle of each visible room. The console's `structure_culling <bits>` changes it until the game quits, and `debug_structure_culling true` shows what was skipped (red: outside the view, blue: facing away). |
|
||||
| `display.shield_glow` | `false` | `HALO_SHIELD_GLOW` | `true`: as a unit's energy shield flares (hit, charging, falling), it lights what is around it and itself, as a plasma bolt does, in the shield shader's own color (a Spartan's gold, an Elite's blue), rising and falling with the flare seen on the body. An ordinary dynamic light of the game's, drawn with a light definition the map has (`shield_glow.c`). Up to 8 units near the camera. Video Setup's Extra Effects screen sets it. |
|
||||
| `display.shield_glow_intensity` | `default` | `HALO_SHIELD_GLOW_INTENSITY` | The shield glow's reach and brightness: `default`, or `light_show` (three times as far, and at full strength from a third of the flare: a light is no brighter than full). The units glowing are those near any local player's camera, so each of a split screen's views has the same. Video Setup's Extra Effects screen sets it. |
|
||||
| `display.overshield_effect` | `false` | `HALO_OVERSHIELD_EFFECT` | `true`: the overshield's flare rises up the body from the feet as it charges, with a soft edge (2 seconds, the charge's time from a full shield; 3 from a shield that was down; 2 from any other), then stays lit, whole, for as long as the overshield lasts, its energy moving at 30% of its speed, in its own color (the powerup's, 253, 78, 116), whatever shield color its player chose; the shield's own flares are not drawn over it, and its glow (`display.shield_glow`) rises and stays with it. With `display.viewmodel_shield` it comes up on the first-person arms as the rise reaches them. A hit on it plays what the projectile plays on an Elite's shield (its sound, sparks and light), when the map has that effect and it only shows and sounds. `false`: the overshield as the stock game draws it. Only this machine's drawing and sounds change (`overshield_effect.c`; the rise is a fade in the vertex shader, `d3d8_gl_set_height_fade`). Video Setup's Extra Effects screen sets it. |
|
||||
| `display.shield_glow` | `false` | `HALO_SHIELD_GLOW` | `true`: as a unit's energy shield flares (hit, charging, falling), it lights what is around it and itself, as a plasma bolt does, in the shield shader's own color (a Spartan's gold, an Elite's blue), rising and falling with the flare seen on the body. An ordinary dynamic light of the game's, drawn with a light definition the map has (`shield_glow.c`). Up to 8 units near the camera. Video Setup's Extra Effects screen sets it. In a network game, the host's `network.shield_effects` decides, unless it is `players` (each player's own). |
|
||||
| `display.shield_glow_intensity` | `default` | `HALO_SHIELD_GLOW_INTENSITY` | The shield glow's reach and brightness: `default`, or `light_show` (three times as far, and at full strength from a third of the flare: a light is no brighter than full). The units glowing are those near any local player's camera, so each of a split screen's views has the same. Video Setup's Extra Effects screen sets it. In a network game, the host's `network.shield_effects` decides, unless it is `players` (each player's own). |
|
||||
| `display.overshield_effect` | `false` | `HALO_OVERSHIELD_EFFECT` | `true`: the overshield's flare rises up the body from the feet as it charges, with a soft edge (2 seconds, the charge's time from a full shield; 3 from a shield that was down; 2 from any other), then stays lit, whole, for as long as the overshield lasts, its energy moving at 30% of its speed, in its own color (the powerup's, 253, 78, 116), whatever shield color its player chose; the shield's own flares are not drawn over it, and its glow (`display.shield_glow`) rises and stays with it. With `display.viewmodel_shield` it comes up on the first-person arms as the rise reaches them. A hit on it plays what the projectile plays on an Elite's shield (its sound, sparks and light), when the map has that effect and it only shows and sounds. `false`: the overshield as the stock game draws it. Only this machine's drawing and sounds change (`overshield_effect.c`; the rise is a fade in the vertex shader, `d3d8_gl_set_height_fade`). Video Setup's Extra Effects screen sets it. In a network game, the host's `network.shield_effects` decides, unless it is `players` (each player's own). |
|
||||
| `display.model_detail` | `"stock"` | `HALO_MODEL_DETAIL` | Which level of detail (of up to five) each model is drawn at. The game measures a model by its size in the lines of its 480-line screen, at any resolution, so at 1440 lines a model three times larger than the levels were made for is drawn as the Xbox drew it. `"stock"`: as on the Xbox. `"native"`: measured in the lines of the display (not supersampling's), so more detail is kept at a distance at high resolutions, and small far models that the Xbox left out are drawn. `"highest"`: measured as `"native"` for which models are drawn, and those drawn at their most detailed level. With either, a part that has no geometry at the level chosen draws its most detailed level below that has some, and a level made for a model's inside (one for a size over 1000 pixels, as the top level of a10's cryotubes) is drawn only while the camera is inside the model. Models whose map gives one level (the trees and rocks of b30) do not change. On Android, which draws 480 lines, `"native"` is `"stock"`. |
|
||||
| `display.hdr` | `false` | `HALO_HDR` | `true`: the back buffer that the 3D view is drawn into holds half floats (`GL_RGBA16F`) in place of 8 bits a channel, so that the light the game adds up (blended lights, glows, fog, particles) is kept past white in place of being clipped. Before the HUD and the menus, a tone mapping pass brings it back into the display's range (`display.hdr_tone_mapping`). The HUD and the menus do not change. On Android, only with a GPU that draws into half floats (OpenGL ES 3.2, `GL_EXT_color_buffer_half_float` or `GL_EXT_color_buffer_float`); otherwise off, with a line in the log. A change applies from the next frame. Video Setup's GRAPHICS screen sets it (HDR) and `display.hdr_output` (HDR DISPLAY). Refer to "HDR" in "What operates". |
|
||||
| `display.hdr_exposure` | `1.0` | `HALO_HDR_EXPOSURE` | With `display.hdr`, the light of the 3D view is multiplied by this before the tone mapping, from `0.25` to `4.0`. |
|
||||
@@ -470,6 +508,8 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `bots.teams` | `"even"` | `HALO_BOT_TEAMS` | In a team game: `"even"` puts the bots on both teams, evening them with the players; `"against"` puts them all on the team the players are not on. |
|
||||
| `paths.data` | `""` | `HALO_DATA_ROOT` | The data root. Refer to "Start the game". |
|
||||
| `paths.saves` | `""` | `HALO_SAVE_ROOT` | The save root. Refer to "Files and folders". |
|
||||
| `paths.logs` | `""` | `HALO_LOG_ROOT` | The folder of `debug.txt`, `bans.txt` and `cheaters.txt`. Empty: the data root. With it, the data root can be read-only (a dedicated server's maps mounted so). |
|
||||
| `paths.custom_maps` | `""` | `HALO_CUSTOM_MAPS_ROOT` | The `custom_maps` folder (Custom Edition maps, with their `bitmaps.map`, `sounds.map` and `loc.map`). Empty: the one in the data root. |
|
||||
| `network.address` | `""` | `HALO_NET_ADDRESS` | The IPv4 address of this machine for system link. Refer to "Play on one computer". |
|
||||
| `network.broadcast` | `""` | `HALO_NET_BROADCAST` | IPv4 addresses, with commas between them, that get the broadcasts of the game. Empty: 255.255.255.255. |
|
||||
| `network.online` | `true` | `HALO_NET_ONLINE` | `true`: internet play. `false`: system link on the local network only. |
|
||||
@@ -478,7 +518,8 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.allow_upnp` | `true` | `HALO_NET_ALLOW_UPNP` | `true`: internet play can ask the router to forward its port (UPnP). `false`: the game does not ask. Refer to "Internet play". |
|
||||
| `network.public_lobby` | `true` | `HALO_NET_PUBLIC_LOBBY` | `true`: the server browser. Public games are listed, and Join Game > Server Browser shows them. `false`: no games are listed or shown. Refer to "Server browser". |
|
||||
| `network.host_public` | `true` | `HALO_NET_HOST_PUBLIC` | `true`: a new game of Create Game > Internet starts as PUBLIC. `false`: it starts as PRIVATE. LISTING in Server Setup changes it for each game. Refer to "Server browser". |
|
||||
| `network.coop_friendly_fire` | `"on"` | `HALO_NET_COOP_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt each other: `"off"`, `"on"`, `"shields_only"` or `"explosives_only"`. FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here. Their AI allies they always can, as in the campaign. |
|
||||
| `network.coop_friendly_fire` | `"on"` | `HALO_NET_COOP_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt each other: `"off"`, `"on"`, `"shields_only"` or `"explosives_only"`. FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here. Their AI allies they hurt as `network.coop_ally_friendly_fire` says. |
|
||||
| `network.coop_ally_friendly_fire` | `true` | `HALO_NET_COOP_ALLY_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt their AI allies (the Marines, Captain Keyes, the Sentinels while they are allies), as in the campaign. `false`: the players' weapons, grenades, melee and vehicles do them no harm, so that no player can kill the allies a level needs. The allies' and enemies' own damage is unchanged. ALLY FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here; the host sends it with the game's settings. |
|
||||
| `network.coop_own_friendly_fire` | `true` | `HALO_NET_COOP_OWN_FRIENDLY_FIRE` | Whether this machine's players hurt, and are hurt by, the other players of an online co-op game. Two players hurt each other only if both have it `true`, and then as the host's `network.coop_friendly_fire` says. FRIENDLY FIRE in that game's pause menu writes its choice here. A player away from the controls for over 70 seconds is hurt by every player, whatever either chose. |
|
||||
| `network.coop_player_collisions` | `true` | `HALO_NET_COOP_PLAYER_COLLISIONS` | Whether the players of an online co-op game bump into each other. `false`: they walk through each other, so that one cannot block a doorway or stand on another; they still bump into the AI's characters. PLAYER COLLISIONS in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.coop_enemies_mode` | `"per_player"` | `HALO_NET_COOP_ENEMIES_MODE` | Online co-op's extra enemies: `"none"`; `"per_player"`, each squad of enemies that a level places grows by `network.coop_enemies` for each player past the first; or `"multiplier"`, each squad is `network.coop_enemies_multiplier` times as large, for any number of players. The extra enemies stand around the squad's places, and those that a dropship has no seats for drop out of it after its passengers. EXTRA ENEMIES in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
@@ -490,10 +531,11 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.voice_mode` | `"team_global_enemy_proximity"` | `HALO_NET_VOICE_MODE` | When you host: who hears whom during a game. `"off"`; `"team_proximity"` (teammates who are near); `"team_enemy_proximity"` (all players who are near); `"team_global"` (all teammates); `"team_global_enemy_proximity"` (all teammates, and enemies who are near). Refer to "Voice chat". |
|
||||
| `network.voice_kbps` | `24` | `HALO_NET_VOICE_KBPS` | When you host: the voice quality in the lobby and in a game, in kilobits per second, `8` to `64`. |
|
||||
| `network.voice_proximity` | `15.0` | `HALO_NET_VOICE_PROXIMITY` | When you host: the distance in world units (1 unit is approximately 3 metres) at which players are near, for voice chat. `5` to `100`. |
|
||||
| `network.text_chat` | `"on"` | `HALO_NET_TEXT_CHAT` | When you host: the text chat. `"on"`, lines with links refused; `"links"`, links allowed; `"off"`, no chat (in either case). Always off in a game listed in the server browser. TEXT CHAT in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. Refer to "Text chat". |
|
||||
| `network.text_chat` | `"on"` | `HALO_NET_TEXT_CHAT` | When you host: the text chat. `"on"`, lines with links refused; `"links"`, links allowed; `"off"`, no chat (in either case). Always off in a game a player hosts that is listed in the server browser; a dedicated server's follows it, listed or not. TEXT CHAT in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. Refer to "Text chat". |
|
||||
| `network.votekick` | `true` | `HALO_NET_VOTEKICK` | When you host: `true`, the players can vote to kick a player. Refer to "Security". `false`: no votes. VOTE KICK in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. |
|
||||
| `network.votekick_minutes` | `5` | `HALO_NET_VOTEKICK_MINUTES` | When you host: the minutes that a player must play on the server before the player can start a vote to kick (`0` to `60`). To vote, a player must play for 2 minutes, or for this time if it is less. |
|
||||
| `network.votekick_ban_minutes` | `30` | `HALO_NET_VOTEKICK_BAN_MINUTES` | When you host: the minutes that a player who is kicked by a vote cannot join again (`1` to `1440`). |
|
||||
| `network.shield_effects` | `stock` | `HALO_NET_SHIELD_EFFECTS` | Host: the shield effects every player of a network game sees, whatever their own settings, so that none sees what another does not: `stock`, `glow` (`display.shield_glow`), `light_show` (its Light Show intensity), `overshield` (`display.overshield_effect`), `glow_overshield` or `light_show_overshield`; or `players`, not synced: each player sees their own settings' (PLAYERS' OWN). Sent to each client when it is ready and when it changes (`network_shield_effects.c`); a client draws stock until it has it. SHIELD EFFECTS in Server Setup > Player Options writes its choice here. |
|
||||
| `network.block_mouse_aim_assist` | `false` | `HALO_NET_BLOCK_MOUSE_AIM_ASSIST` | Host: Player Options > Aim Assist, Allowed or Block M+KB. Block overrides optional mouse magnetism while mouse/keyboard aims, including on the host, without changing the saved preference. Controllers and touch retain their existing behavior; bullet autoaim is unchanged. |
|
||||
| `network.map_share` | `true` | `HALO_NET_MAP_SHARE` | When you host: send a player who joins without the game's Custom Edition map the map, and the resource maps that it needs and that the player does not have. SHARE MAPS in Server Setup > Map Sharing writes its choice here. Refer to "Map sharing". |
|
||||
| `network.map_share_upload` | `1024` | `HALO_NET_MAP_SHARE_UPLOAD` | When you host: the most kilobytes per second that the game sends of maps (`16` to `20480`, 20 MB/s). UPLOAD LIMIT in Server Setup > Map Sharing writes its choice here. |
|
||||
@@ -503,6 +545,55 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.coop_public` | `false` | `HALO_NET_COOP_PUBLIC` | `true`: an online co-op game (Create Game > Internet, a SINGLEPLAYER map) starts as PUBLIC. `false`: it starts as PRIVATE. LISTING in co-op's Server Setup writes its choice here. Refer to "Server browser". |
|
||||
| `network.brokers_file` | `"brokers.txt"` | `HALO_NET_BROKERS_FILE` | The file of the public MQTT brokers that let the machines of an invite find each other, and that carry the listings of the server browser: next to `config.toml`, unless a full path. One `host:port` on each line, up to 4; `#` starts a comment. |
|
||||
| `network.stun_servers` | Google and Cloudflare | `HALO_NET_STUN` | The public STUN servers (`host:port`, with commas between them) that give the internet address of a machine. |
|
||||
| `network.client_timeout_seconds` | `15` | `HALO_NET_CLIENT_TIMEOUT_SECONDS` | Hosting: the seconds the host waits for a machine it hears nothing from before it drops it (5 to 300; the stock game waits 15). The same seconds are how long each machine's reliable stream waits for its peer to read before it gives up, and how long a host in a game waits for its own network to come back (an address renewed, a wifi drop) before it ends the game; each machine reads its own setting. A longer wait keeps players whose connection stalls (a browser tab in the background), but a machine that is really gone leaves its players frozen for longer. |
|
||||
| `network.public_address` | `""` | `HALO_NET_PUBLIC_ADDRESS` | Hosting: the internet address the joiners reach this machine at, `host[:port]` (the port forwarded to `network.tunnel_port`), for a server behind a NAT with one forwarded port. It is offered first, and its name is looked up again every 5 minutes. Empty: what STUN and UPnP find. |
|
||||
| `network.listings` | `"both"` | `HALO_NET_LISTINGS` | What the server browser lists. `"both"`: the dedicated servers of the master servers first, then the games players host (from the brokers). `"masters"`: the master servers' only. `"brokers"`: the brokers' only. Refer to "Server browser". |
|
||||
| `network.masters_file` | `"masters.txt"` | `HALO_NET_MASTERS_FILE` | The file of the master servers the server browser asks for dedicated servers, next to `config.toml` unless a full path: on each line an `https://` URL and the master's key (`ed25519:<hex>`), 4 at most. A file that names none (missing, or comments alone, as the release's) leaves the official master, built in (`https://master.opencommunityedition.com`). Refer to "Dedicated server". |
|
||||
| `network.browser_source` | `"all"` | `HALO_NET_BROWSER_SOURCE` | The server browser's games. `"all"` (ALL GAMES): the dedicated servers first, then the games players host; `"dedicated"`: the dedicated servers of the master servers; `"players"` (P2P GAMES): the games players host. The tab at the top left of the server browser changes it. |
|
||||
| `network.browser_show_empty`, `network.browser_show_full` | `true` | `HALO_NET_BROWSER_SHOW_EMPTY`, `HALO_NET_BROWSER_SHOW_FULL` | `false`: the server browser does not list the games with no player, the full games. The server browser's Filters screen sets them. |
|
||||
| `network.browser_maps` | `"yes"` | `HALO_NET_BROWSER_MAPS` | `"yes"`: the server browser lists the games on maps this computer does not have. `"no"`: it does not. `"downloadable"`: only those of a Custom Edition map that the host shares. |
|
||||
| `network.browser_gametype` | `"any"` | `HALO_NET_BROWSER_GAMETYPE` | The server browser lists the games of one kind only: `"any"`, `"ctf"`, `"slayer"`, `"oddball"`, `"king"` or `"race"` (the Filters screen). |
|
||||
| `network.browser_sort` | `"servers"` | `HALO_NET_BROWSER_SORT` | The server browser's order. `"servers"`: dedicated servers first, then by players. `"players"`, `"name"`, `"map"`, `"type"` or `"locked"` (games with a password first). A `-` before one reverses it (`"-players"`). A column's title sorts by it, and again the other way. |
|
||||
| `server.enabled` | `false` | `HALO_SERVER` | `true`: run as a dedicated server, as `halo --server` does. Refer to "Dedicated server". The `server.*` settings are written to `config.toml` only by a dedicated server. |
|
||||
| `server.name` | `"OpenCE Server"` | `HALO_SERVER_NAME` | The game's name in the lobby and the server browser: 15 characters of printable ASCII. |
|
||||
| `server.max_players` | `16` | `HALO_SERVER_MAX_PLAYERS` | The most players (2 to 127). |
|
||||
| `server.min_players` | `1` | `HALO_SERVER_MIN_PLAYERS` | The players in the lobby before it counts down to a game (1 to 16). |
|
||||
| `server.password` | `""` | `HALO_SERVER_PASSWORD` | The password the server browser asks for (an invite link joins without it). Empty: none. It is never logged. `HALO_SERVER_PASSWORD_FILE` names a file whose first line is it instead (a container's secret; pinned, as the variable would be). |
|
||||
| `server.public` | `true` | `HALO_SERVER_PUBLIC` | `true`: the server is in everyone's server browser (on the master servers, with `network.online`). `false`: players join with its invite link, or on the LAN. |
|
||||
| `server.rotation` | `"bloodgulch:ctf, sidewinder:team_slayer, prisoner:slayer"` | `HALO_SERVER_ROTATION` | The games, played one after another: `map[:gametype[+rule=value...]]`, separated by commas, semicolons or new lines, 64 at most (an entry 255 characters, the whole 4096); a line that begins with `#` is a comment. A map is a multiplayer map's name (`bloodgulch`), `custom_maps\<name>` or a level's path; a gametype is a built-in gametype's name (`slayer`, `team_slayer`, `ctf`...), an OpenCE gametype's (`swat`...), a gametype file's (`gametypes/<name>.toml`) or `file=<saved gametype>`. An entry that cannot be played is left out with a warning. A change of the rotation (a command, the web page, `sv_reload`) keeps its place: the next game is the entry after the one played last. Refer to `docs/dedicated_server.md`, "The rotation". |
|
||||
| `server.rotation_fallback` | `false` | `HALO_SERVER_ROTATION_FALLBACK` | `true`: with no entry of `server.rotation` that can be played, play `bloodgulch:slayer`. `false`: stop (exit code 3). |
|
||||
| `server.lobby_seconds` | `15` | `HALO_SERVER_LOBBY_SECONDS` | The seconds the lobby counts down once `server.min_players` are in (0 to 300; `0`: the game starts at once). |
|
||||
| `server.postgame_seconds` | `12` | `HALO_SERVER_POSTGAME_SECONDS` | The seconds the scores show after a game (0 to 300). |
|
||||
| `server.empty_seconds` | `30` | `HALO_SERVER_EMPTY_SECONDS` | The seconds a game with nobody in it goes on before it ends. `0`: it does not end. A game whose last player leaves ends at once, as the game ends it. |
|
||||
| `server.idle_minutes` | `0` | `HALO_SERVER_IDLE_MINUTES` | The minutes a game goes on with no score before it ends. `0`: it does not end. |
|
||||
| `server.team_start` | `"one"` | `HALO_SERVER_TEAM_START` | A team game. `"one"`: it starts with the players of one team (the next players to join balance the teams). `"both"`: it waits, saying nothing, for a player on each team. `"skip"`: while one player waits, a team game (not one `sv_map` asked for) gives way to the rotation's next entry without teams, if it has one; checked when the lobby opens and again when its countdown would begin. |
|
||||
| `server.motd` | `""` | `HALO_SERVER_MOTD` | A notice each machine sees when it joins (127 characters). Empty: none. |
|
||||
| `server.frame_rate` | `60` | `HALO_SERVER_FRAME_RATE` | The frames a second (30 to 120); the game's ticks stay at 30 a second. A server with no other machine runs 10 frames a second. |
|
||||
| `server.console`, `server.console_exit_on_eof` | `true`, `false` | `HALO_SERVER_CONSOLE`, `HALO_SERVER_CONSOLE_EXIT_ON_EOF` | `true`: the server takes commands from the standard input; it stops when the standard input ends if `server.console_exit_on_eof` is `true` (a panel can close it), after running the last line, whether or not a line's end ended it. |
|
||||
| `server.init_file` | `"init.txt"` | `HALO_SERVER_INIT_FILE` | The commands run once at the start, one on each line: in the data root unless a full path. Empty: none. |
|
||||
| `server.web_port`, `server.web_bind` | `8080`, `"127.0.0.1"` | `HALO_SERVER_WEB_PORT`, `HALO_SERVER_WEB_BIND` | The TCP port and IPv4 address of the web page, its API and the remote console (RCON). `0`: none. With an address beyond loopback, each web password that is set must have 8 characters or more, else the server stops (exit code 3, as for a port it may not bind or an address the machine does not have; a port in use: exit code 4); put a reverse proxy with TLS in front of it. Each server on a machine needs its own port. Read at the start only. |
|
||||
| `server.web_password` | `""` | `HALO_SERVER_WEB_PASSWORD` | The admin password of the web page (8 characters or more). Empty: the server makes one at the first start, shows it once and writes it here. |
|
||||
| `server.web_owner_password` | `""` | `HALO_SERVER_WEB_OWNER_PASSWORD` | A password with the owner role, for a supervisor on the server's own machine (a fleet's agent, a panel): over the API and the RCON it does what the standard input does (`quit`, `sv_stop`, `sv_restart`, the owner's settings, the game's console commands, the players' addresses). It signs in from `127.0.0.0/8` alone, never through `server.web_trusted_proxy`; from another address it is refused (`403 forbidden`) and counted as a wrong password. 8 characters or more (else the server exits with code 3). Empty: none. `sv_set` does not change it (`config.toml` and `sv_reload`). |
|
||||
| `server.web_moderator_password`, `server.web_viewer_password` | `""` | `HALO_SERVER_WEB_MODERATOR_PASSWORD`, `HALO_SERVER_WEB_VIEWER_PASSWORD` | Other passwords: the moderator role (kick, mute, say, the next map, bans of one day at most) and the viewer role (the status, the players and the log; no changes). 8 characters or more when the web port is bound beyond loopback (else the server exits with code 3; on loopback, a warning). Empty: none. `sv_set` changes the moderator password, not the viewer password (`config.toml` and `sv_reload`). Each web password's variable has a `_FILE` form (`HALO_SERVER_WEB_PASSWORD_FILE`, `HALO_SERVER_WEB_OWNER_PASSWORD_FILE`...): when the variable is not set, the file's first line is the password, pinned as the variable would be; read at the start. |
|
||||
| `server.web_ui` | `true` | `HALO_SERVER_WEB_UI` | `false`: the web port serves the API and RCON, but not the admin page. |
|
||||
| `server.web_trusted_proxy` | `""` | `HALO_SERVER_WEB_TRUSTED_PROXY` | The address of a reverse proxy in front of the web port: its `X-Forwarded-For` (the last entry, the one the proxy added, an IPv4 or IPv6 address with or without a port), `-Host` and `-Proto` headers are believed, and a sign-in through it with `X-Forwarded-Proto: https` gets a `Secure` cookie. Empty: none. |
|
||||
| `server.metrics` | `true` | `HALO_SERVER_METRICS` | `true`: the web port serves `/metrics` (Prometheus) without a password. |
|
||||
| `server.log_format` | `"text"` | `HALO_SERVER_LOG_FORMAT` | The standard output's lines: `"text"` or `"json"`. |
|
||||
| `server.log_addresses` | `false` | `HALO_SERVER_LOG_ADDRESSES` | `true`: the players' internet addresses and hardware IDs are in the log, the events and the API for every role (the owner's console always has them). |
|
||||
| `server.log_debug_echo` | `false` | `HALO_SERVER_LOG_DEBUG_ECHO` | `true`: the lines of `debug.txt` are also written to the standard error. |
|
||||
| `server.status_file` | `""` | `HALO_SERVER_STATUS_FILE` | A file the status (as `/api/status` gives it) is written to every 2 seconds, for a panel without HTTP. Empty: none. |
|
||||
| `server.auto_update` | `"off"` | `HALO_SERVER_AUTO_UPDATE` | `"check"`: every 6 hours, the server looks for a newer release and logs it. `"install"`: it also installs it once the server has been empty for 10 minutes (on a thread of its own, the server playing on meanwhile), and stops with exit code 5, once it is empty, to be started again; an install that fails is tried again at the next check. `"off"`: neither. |
|
||||
| `server.upnp` | `false` | `HALO_SERVER_UPNP` | `true`: ask the router (UPnP) to forward the tunnel's port (as `network.allow_upnp`, for a server at home). |
|
||||
| `server.coop_difficulty` | `"normal"` | `HALO_SERVER_COOP_DIFFICULTY` | The difficulty of co-op entries of the rotation (`<level>:coop`): `"easy"`, `"normal"`, `"hard"` or `"impossible"`. |
|
||||
| `server.list_on_brokers` | `false` | `HALO_SERVER_LIST_ON_BROKERS` | `true`: the server is also listed with the games players host (through the brokers), for server browsers without master servers. |
|
||||
| `server.master_publish` | `true` | `HALO_SERVER_MASTER_PUBLISH` | `true`: a public server is published to the master servers, signed with the publisher key. |
|
||||
| `server.masters_file` | `"masters.txt"` | `HALO_SERVER_MASTERS_FILE` | The master servers the server is published to, next to `config.toml` unless a full path: on each line an `https://` URL and the master's key (`ed25519:<hex>`). None named: the official master, built in. |
|
||||
| `server.publisher_key_file` | `"publisher.key"` | `HALO_SERVER_PUBLISHER_KEY_FILE` | The operator's Ed25519 key for the master servers (`halo --server --keygen` makes it), next to `config.toml` unless a full path. In a container, `HALO_SERVER_PUBLISHER_KEY` can hold the key itself. |
|
||||
| `server.instance` | `""` | `HALO_SERVER_INSTANCE` | A short name that tells this server from the operator's other servers on the master servers (letters, digits, `-` and `_`). Empty: made from `server.name`. |
|
||||
| `server.region` | `""` | `HALO_SERVER_REGION` | A region the server browser shows (`eu`, `na-east`...): 16 characters. Empty: none. |
|
||||
| `server.chat_filter` | `"off"` | `HALO_SERVER_CHAT_FILTER` | The words the server keeps out of its chat and its players' names (streamer mode's list): `"off"`; `"censor"`, a line's words shown as stars; `"block"`, a line with them refused (its sender told why) and a player whose name has them refused at the door. Links are `network.text_chat`'s. |
|
||||
| `server.chat_filter_slurs`, `server.chat_filter_swearing`, `server.chat_filter_insults` | `"mild"`, `"off"`, `"off"` | `HALO_SERVER_CHAT_FILTER_SLURS`, `_SWEARING`, `_INSULTS` | With `server.chat_filter`, each group's words kept out: `"off"`, `"severe"` (the worst), `"strong"` or `"mild"` (all). |
|
||||
| `server.master_publish_address` | `false` | `HALO_SERVER_MASTER_PUBLISH_ADDRESS` | `true`: the master servers can give this server's address to players. `false`: only their probe uses it. |
|
||||
| `discord.application_id` | the application of the project | `HALO_DISCORD_APPLICATION` | The Discord application for invites. Empty: no Discord. |
|
||||
| `update.auto` | `true` | `HALO_UPDATE_AUTO` | `true`: at start-up, the game looks for a new version. Refer to "Updates". `false`: the game does not look. |
|
||||
| `streamer.enabled` | `false` | `HALO_STREAMER_MODE` | `true`: streamer mode hides offensive words, as stars, in the names and text of other players, maps and mods, at the levels below. Refer to "Streamer mode". STREAMER MODE in Settings > Network Setup > Streamer Mode. |
|
||||
@@ -512,7 +603,7 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `crash_reports.upload` | `"ask"` | `HALO_CRASH_REPORTS` | Windows only. `"yes"`: the game sends a report of each crash to the developers. `"no"`: the game sends no reports. `"ask"`: the game asks at the next crash and writes the answer here. Refer to "Crash reports" in [port/windows/README.md](../windows/README.md#crash-reports). |
|
||||
| `debug.update_answer` | `""` | `HALO_UPDATE_ANSWER` | The answer to the update question, for automatic tests: `yes`, `no` or `never`. Empty: the game asks. |
|
||||
| `debug.fixed_step` | `false` | `HALO_FIXED_STEP` | `true`: a game of this computer alone runs one tick a frame, whatever time has passed, so that it plays the same every time (tests). |
|
||||
| `debug.exit_after` | `0.0` | `HALO_EXIT_AFTER` | The game stops after this number of seconds (from when its window opens; with `debug.null_renderer`, or no display, from its first frame). `0`: never. |
|
||||
| `debug.exit_after` | `0.0` | `HALO_EXIT_AFTER` | The game stops after this number of seconds (from when its window opens; with `debug.null_renderer`, or no display, from its first frame; a dedicated server stops as `quit` stops it). `0`: never. |
|
||||
| `debug.screenshot_directory`, `debug.screenshot_every` | `""`, `0` | `HALO_SCREENSHOT_DIR`, `HALO_SCREENSHOT_EVERY` | The game writes each Nth frame to this folder as a BMP file. |
|
||||
| `debug.hidden_window`, `debug.null_renderer` | `false` | `HALO_HIDDEN_WINDOW`, `HALO_NULL_RENDERER` | `true`: no visible window, or no graphics. |
|
||||
| `debug.gpu_stats`, `debug.gpu_trace_frame`, `debug.gpu_trace_constants`, `debug.gpu_dump_shaders`, `debug.texture_dump_directory`, `debug.texture_log`, `debug.gl_debug`, `debug.texture_no_cache` | off | `HALO_GPU_STATS`, `HALO_GPU_TRACE`, `HALO_GPU_TRACE_CONSTANTS`, `HALO_GPU_DUMP_SHADERS`, `HALO_TEXTURE_DUMP`, `HALO_TEXTURE_LOG`, `HALO_GL_DEBUG`, `HALO_TEXTURE_NO_CACHE` | Tools to find problems in the graphics: counts for each frame, all the GL state of one frame, the GLSL code, the textures. |
|
||||
@@ -834,14 +925,18 @@ ON (the default: a line with a link, such as `discord.gg/...`,
|
||||
`example.com`, `www.`, an address, or `example [dot] com`, is refused),
|
||||
WITH LINKS, or OFF. A domain that is a word as well (`.me`, `.to`, `.is`)
|
||||
counts only with a path after it (`youtu.be/...`), so that `go.to` and
|
||||
`he.is` are not refused. A game listed in
|
||||
`he.is` are not refused. A game a player hosts that is listed in
|
||||
the server browser (a public internet game) never has the text chat,
|
||||
whatever it says (TEXT CHAT shows OFF there, and cannot be changed, while
|
||||
LISTING is PUBLIC); a private game, joined by its invite, and a LAN game have
|
||||
it as chosen. A player who joins a game from the server browser has no text
|
||||
chat in it even if its host turns it on: their game takes no line from that
|
||||
host and sends none. Pressing T where the chat is off says so, and a refused line
|
||||
tells its sender why.
|
||||
it as chosen. A player who joins such a game from the server browser has no
|
||||
text chat in it even if its host turns it on: their game takes no line from
|
||||
that host and sends none. A dedicated server is the exception: its own
|
||||
`network.text_chat` decides (on by default, and its operator can turn it
|
||||
off, or allow links), listed or not, and a player who joins it from the
|
||||
server browser's dedicated servers (a master server's list, which names
|
||||
approved operators alone) has the chat as it says. Pressing T where the chat
|
||||
is off says so, and a refused line tells its sender why.
|
||||
|
||||
On the scoreboard (right-click, then click the player), Mute voice and chat
|
||||
mutes a player for you alone: you no longer see their lines or hear their
|
||||
@@ -943,6 +1038,80 @@ game with a password, whose invite the listing hides, shows no ping, nor
|
||||
does a host not reached; a game that is full or starting shows CLOSED.
|
||||
REFRESH also asks the hosts for their listings again.
|
||||
|
||||
The gametype column names an OpenCE gametype's kind (SWAT, INFECTION, GUN
|
||||
GAME, or HC and the game engine for Hardcore: HC CTF, HC SLAYER), which the
|
||||
host sends with the game (network version 37), and otherwise the game
|
||||
engine's (SLAYER, CTF, KING OF THE HILL). The browser of LAN games, and the
|
||||
preview of a game before joining it, name it the same way.
|
||||
|
||||
The browser lists two kinds of games: the dedicated servers that the
|
||||
master servers list (`masters.txt`, `network.masters_file`; the official
|
||||
master, `https://master.opencommunityedition.com`, built in, when the file
|
||||
names none), and the games
|
||||
that players host, which come through the brokers. `network.listings`
|
||||
chooses the kinds that the browser asks for: both (the default), only the
|
||||
master servers, or only the brokers.
|
||||
|
||||
- The top-left tab chooses the games that the list shows: ALL GAMES (at
|
||||
first), DEDICATED or P2P GAMES (left and right, `network.browser_source`).
|
||||
When `network.listings` is `"masters"`, the tab shows DEDICATED only;
|
||||
when it is `"brokers"`, P2P GAMES only.
|
||||
PLAYERS, the sum of the players in the games shown, is in the middle tab.
|
||||
- The column titles sort the list (A or Enter on a title, or a click).
|
||||
The titles are: server name, map, game, players, the lock (the games
|
||||
with a password first) and the dedicated icon (dedicated servers first).
|
||||
A second choice of the same title reverses the order, and an arrow on
|
||||
the title shows the direction. The default order is dedicated servers
|
||||
first, then the games with the most players, then by name. The browser
|
||||
keeps the order in `network.browser_sort`.
|
||||
- FILTERS opens the Filters screen of Custom Edition. It has SHOW EMPTY
|
||||
SERVERS, SHOW FULL SERVERS, GAME TYPE (ANY or one game engine) and SHOW
|
||||
MISSING MAPS (NO, YES, or IF DOWNLOADABLE, for a Custom Edition map that
|
||||
Map Sharing can download when you join). OK writes the
|
||||
`network.browser_*` settings. Settings > Network Setup > SERVER BROWSER
|
||||
writes the same settings, and also shows LISTS, SORT BY (DEDICATED FIRST,
|
||||
PLAYERS, NAME, MAP, GAME TYPE or LOCKED FIRST; an order that a title reversed
|
||||
shows as the same choice) and MASTER SERVERS
|
||||
(the number of master servers that answered the last request of the
|
||||
browser, for example `2 OF 2`). The PING and TEAMPLAY OPTIONS rows of
|
||||
Custom Edition are not on the Filters screen.
|
||||
- A dedicated server's row shows the dedicated icon of Custom Edition.
|
||||
Instead of a ping, a dedicated server shows its region (EU, NA-E),
|
||||
because the browser does not ping the servers that the master servers
|
||||
list. The row shows JOINING while a join runs. A game of another network
|
||||
version stays in the list in grey, after the other games, with NEWER or
|
||||
OLDER. Its row does not join the game: it shows the message about the
|
||||
version. The server count above the list adds the number of dedicated
|
||||
servers (`SERVERS: 8 (5 dedicated)`) when the list shows all the games on
|
||||
one page. PAGE shows only when the list has more than one page.
|
||||
- The two lines below the list describe the selected game. The first line
|
||||
shows its players, map, game and region. The second line shows where the
|
||||
game comes from: "Dedicated server by <publisher>, listed on N master
|
||||
servers" (the operator's name comes from the master server, and only this
|
||||
line shows it), "Hosted by a player (anonymous listing)", "Password
|
||||
required", or, for a game of another version, the update that it needs.
|
||||
During a join, the second line shows the steps of the join, and how many
|
||||
seconds it has taken. The steps are: the request to the brokers for the
|
||||
host, the answer of the host and the connection attempt (UDP hole
|
||||
punching), and the connection to the host. If the join fails, the line
|
||||
shows the reason:
|
||||
- the host did not answer;
|
||||
- no route to the host (the line says strict NAT when that is the cause);
|
||||
- the host refused the join: the game is full or closed, this machine is
|
||||
banned, the password is wrong, the version is different, or the invite
|
||||
changed.
|
||||
The browser shows a refusal when it opens again after the main menu
|
||||
error.
|
||||
- If no master server answers but the brokers do, the second line shows "No
|
||||
master server answered: showing player-hosted games only", and the list
|
||||
shows the games from the brokers. An error panel covers the list in two
|
||||
cases: internet play is off, or nothing answers (no master server and no
|
||||
broker) after 15 seconds. OK, Enter or B closes the panel.
|
||||
- In the lobby of a dedicated server, the panel at the right shows the
|
||||
name of the server and "dedicated" on its first line. It shows "Waiting
|
||||
for players" while the server waits for enough players
|
||||
(`server.min_players`) to start its countdown.
|
||||
|
||||
How it operates (`src/p2p_lobby.c`):
|
||||
|
||||
- The host of a public game publishes a listing: the invite, and the name,
|
||||
@@ -1194,6 +1363,108 @@ the invite with the invite button of Discord. When a person accepts it, that
|
||||
person joins the game. If the game does not operate, Discord starts it.
|
||||
The game sends the activity only to a Discord client of the same user.
|
||||
|
||||
## Dedicated server
|
||||
|
||||
`halo --server` (or `server.enabled = true`) runs the game as a host with no
|
||||
window, sound or player of its own, for a VPS, a container or a game panel.
|
||||
It hosts the games of `server.rotation` one after another: the lobby counts
|
||||
down when `server.min_players` are in, the game is played, its scores show,
|
||||
and the lobby opens with the next entry. Players join it as they join any
|
||||
host: on the LAN, with its invite link, or from the server browser.
|
||||
`docs/dedicated_server.md` is the reference: the command line, the exit
|
||||
codes, the commands, the HTTP API, the remote console, the events and the
|
||||
files.
|
||||
|
||||
```sh
|
||||
./halo --server # the settings of config.toml
|
||||
HALO_SERVER_ROTATION="bloodgulch:ctf, prisoner:slayer+score=25" ./halo --server
|
||||
./halo --server --config /srv/opence/config.toml
|
||||
```
|
||||
|
||||
The server needs the game data (`maps/`, as for the game); without
|
||||
`maps/ui.map` it stops at once with exit code 2. At the first start it
|
||||
writes the `server.*` settings to `config.toml` (they are written only by a
|
||||
server) and a web password if there is none. It writes one line for each
|
||||
event to the standard output (`server.log_format = "json"` for JSON
|
||||
lines), and the game's own log to `debug.txt` as the game does
|
||||
(`paths.logs` moves it, so that the data root can be read-only).
|
||||
|
||||
- **Commands.** The standard input, `init.txt` (`server.init_file`) and the
|
||||
web page take the same commands: `sv_status`, `sv_players`, `say`, `tell`,
|
||||
`kick`, `ban <player> 2h <reason>`, `unban`, `mute`, `sv_map`,
|
||||
`sv_map_next`, `sv_end_game`, `sv_rotation_set`, `sv_set <setting>
|
||||
<value>`, `sv_reload`, `sv_ban_address <address|hardware id>`,
|
||||
`sv_stop [now|game|empty] [notice]`, `sv_restart`, `quit`. `help` lists
|
||||
them. `sv_stop game` (or `empty`) withdraws the listings, refuses new
|
||||
players and stops once the game is over (or nobody plays), without
|
||||
cutting a game short; `sv_stop cancel` undoes it. The game's own console
|
||||
commands need the owner role: the standard input and `init.txt` take
|
||||
them, and the web page and the remote console with
|
||||
`server.web_owner_password` from the machine itself; with another
|
||||
password they do not (and `kick` and `ban` are always the server's).
|
||||
- **Web page.** `server.web_port` (8080, on `127.0.0.1`) serves an admin
|
||||
page, a JSON API, a remote console over WebSocket, `/healthz` and
|
||||
`/metrics`. Sign in with `server.web_password` (the admin); the moderator
|
||||
and viewer passwords give fewer rights, and `server.web_owner_password`,
|
||||
from the machine itself alone, the owner's. To reach it from another
|
||||
computer, use an SSH tunnel, or a reverse proxy with TLS,
|
||||
`server.web_bind` and `server.web_trusted_proxy`; bound beyond loopback,
|
||||
every web password must have 8 characters or more.
|
||||
- **Signals.** SIGTERM and SIGINT stop the server cleanly (a game in
|
||||
progress shows its scores, every machine is told, the listings are
|
||||
withdrawn); SIGHUP reads the settings and the rotation again.
|
||||
- **Listing.** A public server (`server.public`) with `network.online` is
|
||||
published to the master servers of `masters.txt`, signed with the
|
||||
operator's key: `halo --server --keygen` makes `publisher.key` and prints
|
||||
the public key, which the operator gives to a master server's Discord
|
||||
bot: `/apply` in the master's Discord server (the master's `/apply` page
|
||||
links to it), with `halo --server --sign <nonce>`'s proof of key. Until a
|
||||
master approves it, the server is not listed
|
||||
there (its log says so), but players can join it with its invite link
|
||||
and on the LAN. A change the lists show (public or private, the
|
||||
players, the name, the map) is published within 5 seconds; made
|
||||
private, the server makes a new invite and takes itself off the
|
||||
masters' lists, as `network.public_lobby = false` does
|
||||
(`docs/dedicated_server.md`, "The listing"). `server.list_on_brokers`
|
||||
also lists it with the games players host. A player's public game is published to the masters too
|
||||
when `publisher.key` is next to `config.toml` (not as a dedicated
|
||||
server), and withdrawn when it ends. `docs/master_protocol.md` is the
|
||||
protocol.
|
||||
- **Ports.** The tunnel's UDP port (`network.tunnel_port`, 2302 for a
|
||||
server) must be reachable from the internet; `network.public_address`
|
||||
names the address and forwarded port behind a NAT. The web port is TCP
|
||||
and best kept private.
|
||||
- **Updates.** `server.auto_update = "install"` installs a new release once
|
||||
the server has been empty for 10 minutes (on a thread of its own: the
|
||||
server goes on meanwhile), and stops with exit code 5, once it is empty,
|
||||
so that what runs it (systemd, Docker, a panel) starts the new build. An
|
||||
install that fails is tried again at the next check, 6 hours later.
|
||||
- **Probe.** `halo --probe <invite>` prints the state of the invite's game
|
||||
(a server's name, map, gametype and players) as one line of JSON, for a
|
||||
list site, and exits: the game of the invite's host alone. It never
|
||||
starts a server, whatever the settings say, and writes nothing to
|
||||
`config.toml`.
|
||||
|
||||
`deploy/` has a systemd unit (`deploy/systemd`), a Docker image and compose
|
||||
file (`deploy/docker`), a Pterodactyl and Pelican egg (`deploy/pterodactyl`),
|
||||
a Helm chart (`deploy/helm/opence-server`), PufferPanel and MCSManager
|
||||
templates (`deploy/pufferpanel`, `deploy/mcsmanager`), example gametype
|
||||
files (`deploy/gametypes`, described in `docs/dedicated_server.md`,
|
||||
"Gametype files": their rules have their full names, `team_vehicles`, not
|
||||
the rotation's short names) and an example `init.txt`
|
||||
(`deploy/init.txt.example`). The README of each of the first six folders
|
||||
says how to use it. `deploy/release-key.pub` is the public key of the
|
||||
releases' signed `SHA256SUMS` (`docs/dedicated_server.md`, "Releases").
|
||||
|
||||
**Fleets.** For many servers on many machines, beside the panels,
|
||||
`opence-fleet`
|
||||
([github.com/OpenCommunityEdition/opence-fleet](https://github.com/OpenCommunityEdition/opence-fleet))
|
||||
is one control plane over them all: an agent on each machine runs its
|
||||
servers and drives each through the API as the owner, from the machine
|
||||
itself (`server.web_owner_password`), drains a server before an update
|
||||
(`sv_stop game`, `POST /api/stop`) and bans an address on every server at
|
||||
once (`POST /api/bans`); `docs/dedicated_server.md`, "Panels and fleets".
|
||||
|
||||
## Mods
|
||||
|
||||
A mod is a folder in `mods/` in the data root with a `mod.toml` and a
|
||||
@@ -1428,9 +1699,10 @@ Other changes:
|
||||
| `hs/hs.c` | The console's `mods_reload`, `mods_enable` and `mods_list`, which a client may run too. |
|
||||
| `interface/ui_widget.c`, `interface/ui_widget_event_handler_functions.c`, `interface/ui_widget_game_data_input_functions.c` | The main menu is the PC version's from `port/assets/menus` (`display.menus`); the menus' widgets can call the port's functions (`game/menu_functions.c`) and send the PC version's custom activation event; the widgets' memory is 256 KB, not 16 KB; the main menu and Multiplayer clear co-op's controllers, so that a gamepad going back to controller 1 is not a controller unplugged; the lobby's split screen players leave alone, and one who quits in game is not joined to the next game (`interface/player_ui.c`). |
|
||||
| `interface/player_ui.c` | Fast setup opens the pregame screen through the port's menus (the lobby), as `interface/ui_widget.c` does. |
|
||||
| `game/game_engine.c`, `game/game_engine.h`, `game/game_engine_slayer.c`, `game/game.c`, `game/aim_assist.c`, `game/players.c`, `objects/damage.c`, `objects/objects.c`, `units/units.c`, `items/weapons.c`, `saved games/playlist_profile.c`, `saved games/saved_game_files.c` | OpenCE's gametypes (`game/game_modes.c`, "OpenCE gametypes"): the gametype's PC options carry a mode and Hardcore with their options; the built-in ones are written after the Xbox's default gametypes; Infection's and Gun Game's game engines are Slayer's with their rules; SWAT's headshots, Hardcore's motion sensor, aim assist and restore of the killer; Infection's zombies' skulls, grenades, powerups, seats and melee. |
|
||||
| `game/game_time.c`, `main/main.c` | With `debug.fixed_step`, a game of one machine runs a tick a frame, each frame taking a tick's time, so that it plays the same every time (`tools/stagekit`). |
|
||||
| `input/input_abstraction.c`, `game/player_control.c`, `game/players.c`, `game/player_queues_new.c`, `units/units.h` | The keyboard and mouse's actions (`src/xinput_sdl.c`, `include/halo_keyboard.h`) join controller 1's game controls; their reload key reloads on its own, and their action key only acts (a control flag of the port's, sent with the player's action, stops the reload the controller's X falls back to). |
|
||||
| `saved games/player_profile.h`, `interface/player_ui.c` | A sixth button layout, the Master Chief Collection's Bumper Jumper (`profile.button_preset` 5). A layout the build does not know (a later build's) gets the standard buttons, not none, which moved start and back and stopped the game. |
|
||||
| `saved games/player_profile.h`, `interface/player_ui.c` | A sixth button layout, the Master Chief Collection's Bumper Jumper (`profile.button_preset` 5), and a seventh, Fishsticks (6: zoom on the left trigger, melee on the right stick's button, grenade throw on the right bumper, crouch on B, grenade switch on the pad's left, which then does not move you), and an eighth, Recon (7: the standard buttons with action and reload on the right bumper, grenade switch on the left bumper, flashlight on X). A layout the build does not know (a later build's) gets the standard buttons, not none, which moved start and back and stopped the game. |
|
||||
| `sound/sound_manager.c`, `interface/hud.c`, `game/game_engine.c` | The music's and the other sounds' volumes; the HUD's and the scoreboard's settings are read again when Settings changes them. |
|
||||
| `rasterizer/xbox/rasterizer_xbox_shadows.c` | With larger shadow maps (`display.shadow_resolution`), the blur's taps stay half a texel apart, and more passes widen it to cover the same part of the map as on the Xbox. |
|
||||
| `rasterizer/rasterizer.c` | The 128 KB of vertices of the debug display of a model's vertices are static, not on the stack: the compiler inlines the function in `render_model`, and the Windows build probed the stack a page at a time for every model drawn. |
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/* CE textures can exceed the Android Xbox window's current-frame capacity.
|
||||
* Keep individual allocations stable rather than repeatedly moving/reloading
|
||||
* a packed arena. This cache owns only synchronous, cached CE map pixels;
|
||||
* dynamic textures and other map storage keep their established paths. */
|
||||
#ifdef HALO_ANDROID
|
||||
#include "cseries.h"
|
||||
#include "bitmaps/bitmaps.h"
|
||||
#include "bitmaps/bitmap_group.h"
|
||||
#include "android_ce_texture_cache.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* cseries redirects free to debug_free, but calloc is the runtime allocator.
|
||||
* These cache-owned allocations must return to the matching runtime heap. */
|
||||
#undef free
|
||||
|
||||
#define ANDROID_CE_TEXTURE_BYTES (128UL * 1024UL * 1024UL)
|
||||
#define ANDROID_CE_TEXTURE_ENTRIES 8192
|
||||
#define ANDROID_CE_TEXTURE_BUCKETS 1024
|
||||
|
||||
struct android_ce_texture
|
||||
{
|
||||
struct android_ce_texture *bitmap_next, *resource_next;
|
||||
struct android_ce_texture *older, *newer;
|
||||
struct bitmap_data *bitmap;
|
||||
unsigned long header[5];
|
||||
void *pixels;
|
||||
unsigned long bytes, frame;
|
||||
};
|
||||
|
||||
static struct android_ce_texture *bitmap_buckets[ANDROID_CE_TEXTURE_BUCKETS];
|
||||
static struct android_ce_texture *resource_buckets[ANDROID_CE_TEXTURE_BUCKETS];
|
||||
static struct android_ce_texture *oldest, *newest;
|
||||
static unsigned long cache_bytes, cache_count, cache_frame;
|
||||
static unsigned long cache_loads, cache_evictions, cache_failed;
|
||||
static unsigned long cache_peak;
|
||||
extern void platform_log(const char *format, ...);
|
||||
extern void halo_custom_edition_texels_channels(const void *pixels, unsigned char order);
|
||||
|
||||
static unsigned long android_ce_texture_bucket(const void *pointer)
|
||||
{
|
||||
return (((unsigned long)pointer >> 4) * 2654435761UL) % ANDROID_CE_TEXTURE_BUCKETS;
|
||||
}
|
||||
|
||||
static void android_ce_texture_report(void)
|
||||
{
|
||||
/* One summary per unload/flush; no per-frame logging or pixel readback. */
|
||||
platform_log("textures: Android CE cache peak=%lu limit=%lu loads=%lu evictions=%lu failures=%lu",
|
||||
cache_peak, ANDROID_CE_TEXTURE_BYTES, cache_loads, cache_evictions, cache_failed);
|
||||
}
|
||||
|
||||
static void android_ce_texture_failed(void)
|
||||
{
|
||||
if (!cache_failed++)
|
||||
platform_log("textures: Android CE cache allocation failed (used=%lu limit=%lu entries=%lu)",
|
||||
cache_bytes, ANDROID_CE_TEXTURE_BYTES, cache_count);
|
||||
}
|
||||
|
||||
static void android_ce_texture_unlink(struct android_ce_texture *entry)
|
||||
{
|
||||
if (entry->older)
|
||||
entry->older->newer = entry->newer;
|
||||
else
|
||||
oldest = entry->newer;
|
||||
if (entry->newer)
|
||||
entry->newer->older = entry->older;
|
||||
else
|
||||
newest = entry->older;
|
||||
}
|
||||
|
||||
static void android_ce_texture_touch(struct android_ce_texture *entry)
|
||||
{
|
||||
if (entry != newest)
|
||||
{
|
||||
android_ce_texture_unlink(entry);
|
||||
entry->older = newest;
|
||||
entry->newer = NULL;
|
||||
if (newest)
|
||||
newest->newer = entry;
|
||||
else
|
||||
oldest = entry;
|
||||
newest = entry;
|
||||
}
|
||||
entry->frame = cache_frame;
|
||||
}
|
||||
|
||||
static void android_ce_texture_release(struct android_ce_texture *entry)
|
||||
{
|
||||
struct android_ce_texture **link;
|
||||
|
||||
/* Remove bindings and GPU copies before either address can be reused. */
|
||||
android_ce_texture_unbind(entry->header);
|
||||
android_ce_texture_gpu_forget(entry->header);
|
||||
halo_custom_edition_texels_channels(entry->pixels, 0);
|
||||
link = &bitmap_buckets[android_ce_texture_bucket(entry->bitmap)];
|
||||
while (*link != entry)
|
||||
link = &(*link)->bitmap_next;
|
||||
*link = entry->bitmap_next;
|
||||
link = &resource_buckets[android_ce_texture_bucket(entry->header)];
|
||||
while (*link != entry)
|
||||
link = &(*link)->resource_next;
|
||||
*link = entry->resource_next;
|
||||
android_ce_texture_unlink(entry);
|
||||
if (entry->bitmap->base_address == entry->pixels)
|
||||
entry->bitmap->base_address = NULL;
|
||||
cache_bytes -= entry->bytes;
|
||||
cache_count--;
|
||||
free(entry->pixels);
|
||||
free(entry);
|
||||
}
|
||||
|
||||
void android_ce_texture_delete(struct bitmap_data *bitmap)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
|
||||
for (entry = bitmap_buckets[android_ce_texture_bucket(bitmap)]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
{
|
||||
android_ce_texture_release(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int android_ce_texture_resident(const struct bitmap_data *bitmap)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
for (entry = bitmap_buckets[android_ce_texture_bucket(bitmap)]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void android_ce_texture_reset(void)
|
||||
{
|
||||
if (cache_count || cache_failed)
|
||||
android_ce_texture_report();
|
||||
while (oldest)
|
||||
android_ce_texture_release(oldest);
|
||||
cache_frame = cache_loads = cache_evictions = cache_failed = 0;
|
||||
cache_peak = 0;
|
||||
}
|
||||
|
||||
void android_ce_texture_idle(void)
|
||||
{
|
||||
/* Equality alone defines current-frame ownership. Avoid wrap aliasing. */
|
||||
if (++cache_frame == 0)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
for (entry = oldest; entry; entry = entry->newer)
|
||||
entry->frame = 0;
|
||||
cache_frame = 1;
|
||||
}
|
||||
}
|
||||
|
||||
const void *android_ce_texture_pixels(const void *resource, unsigned long *bytes)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
|
||||
for (entry = resource_buckets[android_ce_texture_bucket(resource)]; entry; entry = entry->resource_next)
|
||||
if (entry->header == resource)
|
||||
{
|
||||
*bytes = entry->bytes;
|
||||
return entry->pixels;
|
||||
}
|
||||
*bytes = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *android_ce_texture_get(struct bitmap_data *bitmap, unsigned long bytes,
|
||||
int load, android_ce_texture_load_proc read)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
unsigned long bucket;
|
||||
|
||||
if (!bitmap)
|
||||
return NULL;
|
||||
bucket = android_ce_texture_bucket(bitmap);
|
||||
for (entry = bitmap_buckets[bucket]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
{
|
||||
android_ce_texture_touch(entry);
|
||||
return entry->header;
|
||||
}
|
||||
if (!load)
|
||||
return NULL;
|
||||
if (!bytes || bytes > ANDROID_CE_TEXTURE_BYTES || !read)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
/* LRU order makes room without moving survivors. Preserve every entry
|
||||
* touched this frame, including headers already bound by earlier stages. */
|
||||
while (oldest && oldest->frame != cache_frame &&
|
||||
(cache_bytes > ANDROID_CE_TEXTURE_BYTES - bytes || cache_count == ANDROID_CE_TEXTURE_ENTRIES))
|
||||
{
|
||||
android_ce_texture_release(oldest);
|
||||
cache_evictions++;
|
||||
}
|
||||
if (cache_bytes > ANDROID_CE_TEXTURE_BYTES - bytes || cache_count == ANDROID_CE_TEXTURE_ENTRIES)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry = calloc(1, sizeof(*entry));
|
||||
if (!entry)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry->pixels = calloc(1, bytes);
|
||||
if (!entry->pixels)
|
||||
{
|
||||
free(entry);
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry->bitmap = bitmap;
|
||||
entry->bytes = bytes;
|
||||
bitmap->base_address = entry->pixels;
|
||||
read(bitmap, entry->header);
|
||||
/* A heap pointer is not an Xbox physical address. The renderer resolves
|
||||
* this header through the registry, with an allocation-length check. */
|
||||
entry->header[1] = (unsigned long)entry->pixels;
|
||||
entry->bitmap_next = bitmap_buckets[bucket];
|
||||
bitmap_buckets[bucket] = entry;
|
||||
bucket = android_ce_texture_bucket(entry->header);
|
||||
entry->resource_next = resource_buckets[bucket];
|
||||
resource_buckets[bucket] = entry;
|
||||
entry->older = newest;
|
||||
if (newest)
|
||||
newest->newer = entry;
|
||||
else
|
||||
oldest = entry;
|
||||
newest = entry;
|
||||
entry->frame = cache_frame;
|
||||
cache_bytes += bytes;
|
||||
cache_count++;
|
||||
cache_loads++;
|
||||
if (cache_bytes > cache_peak)
|
||||
cache_peak = cache_bytes;
|
||||
return entry->header;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Android CE's bounded, stable pixel storage, outside the Xbox window. */
|
||||
#ifndef ANDROID_CE_TEXTURE_CACHE_H
|
||||
#define ANDROID_CE_TEXTURE_CACHE_H
|
||||
|
||||
struct bitmap_data;
|
||||
typedef void (*android_ce_texture_load_proc)(struct bitmap_data *, void *);
|
||||
void *android_ce_texture_get(struct bitmap_data *bitmap, unsigned long bytes,
|
||||
int load, android_ce_texture_load_proc read);
|
||||
void android_ce_texture_delete(struct bitmap_data *bitmap);
|
||||
void android_ce_texture_reset(void);
|
||||
void android_ce_texture_idle(void);
|
||||
int android_ce_texture_resident(const struct bitmap_data *bitmap);
|
||||
|
||||
/* Only an exact registered header grants the renderer access to heap pixels.
|
||||
* Cached map pixels are filled synchronously before this header is published. */
|
||||
const void *android_ce_texture_pixels(const void *resource, unsigned long *bytes);
|
||||
void android_ce_texture_gpu_forget(const void *resource);
|
||||
void android_ce_texture_unbind(const void *resource);
|
||||
|
||||
#endif
|
||||
@@ -3572,6 +3572,8 @@ static struct custom_edition_behaviour_map
|
||||
} const custom_edition_behaviour_maps[] =
|
||||
{
|
||||
#include "custom_edition_behaviours.inc"
|
||||
/* Locally verified HUD data; not part of Chimera's generated list. */
|
||||
{ "bigass_open_v1.1", 0xD2BC19F7, BEHAVIOUR(hud_number_scale) | BEHAVIOUR(xbox_ammo_meter_channels) },
|
||||
};
|
||||
|
||||
#undef BEHAVIOUR
|
||||
@@ -3590,6 +3592,7 @@ static char const *const custom_edition_behaviour_names[NUMBER_OF_CUSTOM_EDITION
|
||||
"old_widescreen_fix",
|
||||
"gearbox_shader_environment_types",
|
||||
"block_multitexture_overlays",
|
||||
"xbox_ammo_meter_channels",
|
||||
};
|
||||
|
||||
/* the behaviours the map named `map_name` relies on, found as Chimera finds
|
||||
|
||||
@@ -252,6 +252,8 @@ enum custom_edition_channel_order
|
||||
where this build's meters take the fill order from color and discard
|
||||
what has no alpha */
|
||||
_custom_edition_channels_hud_meter,
|
||||
/* Authored Xbox-order meters, including sheets also used as artwork. */
|
||||
_custom_edition_channels_hud_meter_xbox,
|
||||
|
||||
NUMBER_OF_CUSTOM_EDITION_CHANNEL_ORDERS
|
||||
};
|
||||
@@ -281,6 +283,8 @@ enum custom_edition_behaviour
|
||||
_custom_edition_behaviour_gearbox_shader_environment_types,
|
||||
/* HUD multitexture overlays are not drawn (hud_draw.c) */
|
||||
_custom_edition_behaviour_block_multitexture_overlays,
|
||||
/* Bigass Open's ammo sheet has fill in color and shape in alpha. */
|
||||
_custom_edition_behaviour_xbox_ammo_meter_channels,
|
||||
|
||||
NUMBER_OF_CUSTOM_EDITION_BEHAVIOURS
|
||||
};
|
||||
|
||||
@@ -103,33 +103,11 @@ boolean coop_scripts_any_player_will_do(
|
||||
return any;
|
||||
}
|
||||
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
boolean coop_scripts_empty_player_list(
|
||||
long object_list_index)
|
||||
{
|
||||
long reference_index;
|
||||
long object_index;
|
||||
long inside_index = NONE;
|
||||
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE && inside_index == NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
inside_index = object_index;
|
||||
}
|
||||
if (inside_index == NONE)
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (!scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
{
|
||||
player_teleport(player_index_from_unit_index(object_index), inside_index,
|
||||
&object_get(inside_index)->object.bounding_sphere_center);
|
||||
}
|
||||
}
|
||||
return coop_scripts_host() && (object_list_index == NONE ||
|
||||
(object_list_is_players(object_list_index) && object_list_count(object_list_index) == 0));
|
||||
}
|
||||
|
||||
/* the units of the players following player0, if `unit_index` is
|
||||
@@ -141,22 +119,29 @@ static short players_following(
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
short position = 0;
|
||||
long players[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
short player_count = 0;
|
||||
short position;
|
||||
short count = 0;
|
||||
|
||||
if (unit_index == NONE || !coop_scripts_host())
|
||||
return 0;
|
||||
/* (in the order (players) lists them: player0 is the first with a unit) */
|
||||
/* hs_players adds each unit to the head of a reference list. Its
|
||||
player0 is the LAST live unit in datum order, not the first. Keep that
|
||||
same order here, including gaps left by dead or disconnected players. */
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
if (player->unit_index == NONE)
|
||||
continue;
|
||||
if (position == 0 && player->unit_index != unit_index)
|
||||
return 0;
|
||||
if (position >= NAMED_PLAYERS && count < maximum_count)
|
||||
unit_indices[count++] = player->unit_index;
|
||||
position++;
|
||||
if (player->unit_index != NONE && player_count < NUMBEROF(players))
|
||||
players[player_count++] = player->unit_index;
|
||||
}
|
||||
if (player_count == 0 || players[player_count - 1] != unit_index)
|
||||
return 0;
|
||||
for (position = player_count - NAMED_PLAYERS - 1;
|
||||
position >= 0 && count < maximum_count;
|
||||
position--)
|
||||
{
|
||||
unit_indices[count++] = players[position];
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@@ -221,6 +206,70 @@ static boolean teleport_to(
|
||||
return arrived;
|
||||
}
|
||||
|
||||
/* A placement may fail after moving the unit, or find free ground outside
|
||||
this volume. Restore that unit before retrying; never move the loaded BSP.
|
||||
The second attempt uses the same crowd fallback as scripted teleports. */
|
||||
static void gather_player_in_volume(
|
||||
short trigger_volume_index,
|
||||
long unit_index,
|
||||
long anchor_index,
|
||||
real_point3d const *destination)
|
||||
{
|
||||
long player_index = player_index_from_unit_index(unit_index);
|
||||
real_point3d original;
|
||||
real_point3d placed;
|
||||
short attempt;
|
||||
|
||||
if (player_index == NONE)
|
||||
return;
|
||||
object_get_origin(unit_index, &original);
|
||||
for (attempt = 0; attempt < 2; attempt++)
|
||||
{
|
||||
boolean arrived = teleport_to(player_index, anchor_index, destination, attempt != 0);
|
||||
|
||||
if (arrived && scenario_trigger_volume_test_object(trigger_volume_index, unit_index) &&
|
||||
!player_position_switches_bsp(object_get_origin(unit_index, &placed)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* This was the unit's valid position at entry, on the same tick. */
|
||||
object_set_position(unit_index, &original, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
long object_list_index)
|
||||
{
|
||||
long reference_index;
|
||||
long object_index;
|
||||
long inside_index = NONE;
|
||||
real_point3d destination;
|
||||
|
||||
if (!coop_scripts_host())
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (scenario_trigger_volume_test_object(trigger_volume_index, object_index) &&
|
||||
!player_position_switches_bsp(object_get_origin(object_index, &destination)))
|
||||
{
|
||||
inside_index = object_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (inside_index == NONE)
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (!scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
gather_player_in_volume(trigger_volume_index, object_index, inside_index, &destination);
|
||||
}
|
||||
}
|
||||
|
||||
boolean coop_scripts_unit_near(
|
||||
long unit_index,
|
||||
real_point3d const *destination)
|
||||
|
||||
@@ -16,9 +16,14 @@ Campaign scripts made to work for every player in network co-op
|
||||
list as inside once any of it is, because every object in it is a player */
|
||||
boolean coop_scripts_any_player_will_do(
|
||||
long object_list_index);
|
||||
/* An empty (players) result or failed list allocation cannot advance a
|
||||
co-op gate. Does not change valid empty AI lists or non-host behavior. */
|
||||
boolean coop_scripts_empty_player_list(
|
||||
long object_list_index);
|
||||
/* and when a script waits on it and one player is inside, the players of
|
||||
the list outside come beside that one, so a gate (the Maw's lift, the run
|
||||
to its bridge, a30's Pelicans) leaves no one behind */
|
||||
to its bridge, a30's Pelicans) leaves no one behind. The caller must test
|
||||
the volume again: a failed placement leaves the script waiting. */
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
long object_list_index);
|
||||
|
||||
@@ -197,6 +197,7 @@ struct reordered_bitmap
|
||||
struct custom_edition_bitmaps_globals
|
||||
{
|
||||
struct reordered_bitmap *reordered_bitmaps;
|
||||
unsigned long behaviours;
|
||||
long reordered_bitmap_count;
|
||||
long reordered_bitmap_capacity;
|
||||
};
|
||||
@@ -394,7 +395,9 @@ static boolean reordered_bitmap_mark(
|
||||
|
||||
if (index != NONE)
|
||||
{
|
||||
if (globals->reordered_bitmaps[index].channel_order != channel_order)
|
||||
if (globals->reordered_bitmaps[index].channel_order != channel_order &&
|
||||
!(globals->reordered_bitmaps[index].channel_order == _custom_edition_channels_hud_meter_xbox &&
|
||||
channel_order == NONE))
|
||||
{
|
||||
globals->reordered_bitmaps[index].drawn_otherwise = TRUE;
|
||||
}
|
||||
@@ -477,8 +480,16 @@ static boolean meter_bitmaps_mark(
|
||||
struct tag_view const *view,
|
||||
struct meter_hud_element_definition const *meter)
|
||||
{
|
||||
short order = _custom_edition_channels_hud_meter;
|
||||
|
||||
/* Open v1.1 changed this shared weapon sheet to Xbox channel order.
|
||||
Keep the explicit identity even when static elements use it too. */
|
||||
if ((custom_edition_bitmaps_globals.behaviours & (1UL << _custom_edition_behaviour_xbox_ammo_meter_channels)) &&
|
||||
!strcmp(view_tag_name(view, DATUM_INDEX_TO_ABSOLUTE_INDEX(meter->meter_bitmap.index)),
|
||||
"bourrin\\hud\\v3\\bitmaps\\all icons wips"))
|
||||
order = _custom_edition_channels_hud_meter_xbox;
|
||||
return reordered_bitmaps_mark(view, meter->meter_bitmap.index, meter->sequence_index,
|
||||
_custom_edition_channels_hud_meter);
|
||||
order);
|
||||
}
|
||||
|
||||
/* the bitmaps a HUD static element draws as they are */
|
||||
@@ -776,10 +787,12 @@ boolean custom_edition_bitmaps_verify(
|
||||
|
||||
boolean custom_edition_reordered_bitmaps_find(
|
||||
byte *tag_cache,
|
||||
unsigned long loaded_bytes)
|
||||
unsigned long loaded_bytes,
|
||||
unsigned long behaviours)
|
||||
{
|
||||
struct tag_view view;
|
||||
|
||||
custom_edition_bitmaps_globals.behaviours = behaviours;
|
||||
view.tag_cache = tag_cache;
|
||||
view.loaded_bytes = loaded_bytes;
|
||||
|
||||
@@ -824,6 +837,7 @@ void custom_edition_bitmaps_dispose(
|
||||
globals->reordered_bitmaps = NULL;
|
||||
globals->reordered_bitmap_count = 0;
|
||||
globals->reordered_bitmap_capacity = 0;
|
||||
globals->behaviours = 0;
|
||||
/* the pixels it was told of are the texture cache's to reuse */
|
||||
halo_custom_edition_texels_forget();
|
||||
|
||||
|
||||
@@ -596,6 +596,14 @@ static void custom_edition_behaviours_log(
|
||||
{
|
||||
if (!((behaviours >> behaviour) & 1))
|
||||
continue;
|
||||
if (behaviour == _custom_edition_behaviour_gearbox_meters ||
|
||||
behaviour == _custom_edition_behaviour_old_widescreen_fix)
|
||||
{
|
||||
error(_error_silent,
|
||||
"custom edition: relies on Halo PC's %s (Chimera's map list), partially supported (HUD tint/warning placement)",
|
||||
custom_edition_behaviour_name(behaviour));
|
||||
continue;
|
||||
}
|
||||
error(
|
||||
_error_silent,
|
||||
(FOLLOWED_BEHAVIOURS >> behaviour) & 1 ?
|
||||
@@ -742,7 +750,7 @@ static boolean custom_edition_cache_tags_convert(
|
||||
|
||||
return custom_edition_cache_tags_validate(tag_cache, report) &&
|
||||
custom_edition_bitmaps_verify(tag_cache, loaded_bytes) &&
|
||||
custom_edition_reordered_bitmaps_find(tag_cache, loaded_bytes) &&
|
||||
custom_edition_reordered_bitmaps_find(tag_cache, loaded_bytes, custom_edition_cache_globals.behaviours) &&
|
||||
custom_edition_scripts_convert(tag_cache, loaded_bytes) &&
|
||||
custom_edition_cache_models_convert(tag_cache, report);
|
||||
}
|
||||
@@ -1273,6 +1281,12 @@ void custom_edition_cache_tags_unload(
|
||||
return;
|
||||
}
|
||||
|
||||
struct resource_map const *custom_edition_cache_bitmap_resources(void)
|
||||
{
|
||||
return custom_edition_cache_tags_loaded() ?
|
||||
custom_edition_cache_globals.resource_maps[_resource_map_bitmaps] : NULL;
|
||||
}
|
||||
|
||||
void custom_edition_cache_read(
|
||||
long tag_index,
|
||||
long offset,
|
||||
|
||||
@@ -57,6 +57,9 @@ Custom Edition map is loaded. */
|
||||
boolean custom_edition_cache_stock_tag(
|
||||
long tag_index);
|
||||
|
||||
/* Borrowed until map unload; reads remain bounds checked by the source. */
|
||||
struct resource_map const *custom_edition_cache_bitmap_resources(void);
|
||||
|
||||
/* When `header` (CACHE_FILE_HEADER_BYTES bytes, with `build` its build
|
||||
string field) is a Custom Edition cache header that reached the Xbox loader,
|
||||
logs why the file at `path` cannot run and returns TRUE: the map is refused,
|
||||
@@ -221,7 +224,8 @@ FALSE after logging why it cannot. custom_edition_bitmaps_dispose forgets
|
||||
them either way. */
|
||||
boolean custom_edition_reordered_bitmaps_find(
|
||||
byte *tag_cache,
|
||||
unsigned long loaded_bytes);
|
||||
unsigned long loaded_bytes,
|
||||
unsigned long behaviours);
|
||||
/* As custom_edition_reordered_bitmaps_find, in the loaded map's tags, which
|
||||
the validator has checked: for the bitmaps of mods (mod_bitmaps.c), Halo
|
||||
PC's on any map. FALSE after logging why it cannot. */
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* CE warning graphics use crosshair states but are not aiming reticles. */
|
||||
#ifndef CUSTOM_EDITION_HUD_H
|
||||
#define CUSTOM_EDITION_HUD_H
|
||||
#include "cache_file_formats.h"
|
||||
#include "custom_edition_cache.h"
|
||||
|
||||
static boolean custom_edition_hud_warning(short state)
|
||||
{
|
||||
return custom_edition_cache_tags_loaded() &&
|
||||
((state >= 3 && state <= 15) || state == 18);
|
||||
}
|
||||
|
||||
/* Legacy HUDs placed warnings beside corner panels using offsets from a
|
||||
* 640x480 canvas center with PC's 8-pixel HUD margins (Chimera's
|
||||
* hud_bitmap_scale.hpp). Translate to the current title-safe frame, just
|
||||
* as the corner panels do. Centered warnings remain centered. */
|
||||
static void custom_edition_hud_warning_placement(short state, short width, short height,
|
||||
struct hud_placement_definition *placement)
|
||||
{
|
||||
long extra;
|
||||
if (!custom_edition_hud_warning(state) ||
|
||||
!custom_edition_cache_relies_on(_custom_edition_behaviour_old_widescreen_fix))
|
||||
return;
|
||||
extra = (width - 624) / 2;
|
||||
if (placement->offset.x > 0)
|
||||
placement->offset.x = (short)PIN(placement->offset.x + extra, SHORT_MIN, SHORT_MAX);
|
||||
else if (placement->offset.x < 0)
|
||||
placement->offset.x = (short)PIN(placement->offset.x - extra, SHORT_MIN, SHORT_MAX);
|
||||
extra = (height - 464) / 2;
|
||||
if (placement->offset.y > 0)
|
||||
placement->offset.y = (short)PIN(placement->offset.y + extra, SHORT_MIN, SHORT_MAX);
|
||||
else if (placement->offset.y < 0)
|
||||
placement->offset.y = (short)PIN(placement->offset.y - extra, SHORT_MIN, SHORT_MAX);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,118 @@
|
||||
/* Original controller sprites for CE maps whose messaging sheet holds weapons.
|
||||
* Resource tag addresses are offsets into that item, not engine pointers. */
|
||||
#ifndef CUSTOM_EDITION_HUD_BUTTONS_H
|
||||
#define CUSTOM_EDITION_HUD_BUTTONS_H
|
||||
#include "cache_file_formats.h"
|
||||
#include "custom_edition_cache.h"
|
||||
#include "interface/hud_draw.h"
|
||||
|
||||
static struct
|
||||
{
|
||||
byte tag[8192];
|
||||
unsigned long size;
|
||||
struct bitmap_data *bitmaps[2];
|
||||
boolean attempted;
|
||||
} ce_hud_buttons;
|
||||
|
||||
static unsigned long ce_hud_button_u32(byte const *p)
|
||||
{
|
||||
return (unsigned long)p[0] | ((unsigned long)p[1] << 8) |
|
||||
((unsigned long)p[2] << 16) | ((unsigned long)p[3] << 24);
|
||||
}
|
||||
|
||||
static byte const *ce_hud_button_range(unsigned long offset, unsigned long count, unsigned long stride)
|
||||
{
|
||||
if (offset > ce_hud_buttons.size || count > (ce_hud_buttons.size - offset) / stride)
|
||||
return NULL;
|
||||
return ce_hud_buttons.tag + offset;
|
||||
}
|
||||
|
||||
static void ce_hud_buttons_forget(void)
|
||||
{
|
||||
short i;
|
||||
for (i = 0; i < 2; i++)
|
||||
if (ce_hud_buttons.bitmaps[i]) bitmap_delete(ce_hud_buttons.bitmaps[i]);
|
||||
csmemset(&ce_hud_buttons, 0, sizeof(ce_hud_buttons));
|
||||
}
|
||||
|
||||
static boolean ce_hud_button_draw(struct icon_hud_element_definition const *icon,
|
||||
rectangle2d *cursor, pixel32 color)
|
||||
{
|
||||
struct resource_map const *resources = custom_edition_cache_bitmap_resources();
|
||||
byte const *sequences, *sequence, *sprites, *data;
|
||||
struct bitmap_group_sprite sprite;
|
||||
struct bitmap_data *bitmap;
|
||||
unsigned long count, frame, bitmap_index, offset, bytes;
|
||||
long i;
|
||||
real viewport, scale, width, height;
|
||||
point2d point;
|
||||
if (!resources) return FALSE;
|
||||
if (!ce_hud_buttons.attempted)
|
||||
{
|
||||
ce_hud_buttons.attempted = TRUE;
|
||||
for (i = 0; i < resources->item_count; i++)
|
||||
{
|
||||
struct resource_map_item const *item = &resources->items[i];
|
||||
if (strcmp(item->name, "ui\\hud\\bitmaps\\hud_msg_icons_sm")) continue;
|
||||
if (item->size >= 108 && item->size <= sizeof(ce_hud_buttons.tag) &&
|
||||
resources->source->read(resources->source->context, item->data_offset,
|
||||
item->size, ce_hud_buttons.tag)) ce_hud_buttons.size = item->size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ce_hud_buttons.size || icon->sequence_index < 0) return FALSE;
|
||||
count = ce_hud_button_u32(ce_hud_buttons.tag + 84);
|
||||
sequences = ce_hud_button_range(ce_hud_button_u32(ce_hud_buttons.tag + 88), count, 64);
|
||||
if (!sequences || (unsigned long)icon->sequence_index >= count) return FALSE;
|
||||
sequence = sequences + icon->sequence_index * 64;
|
||||
count = ce_hud_button_u32(sequence + 52);
|
||||
sprites = ce_hud_button_range(ce_hud_button_u32(sequence + 56), count, 32);
|
||||
if (!sprites || !count) return FALSE;
|
||||
frame = icon->frame_rate > 0 ? (unsigned long)(game_time_get() / icon->frame_rate) % count : 0;
|
||||
csmemcpy(&sprite, sprites + frame * 32, sizeof(sprite));
|
||||
if (!(sprite.bounds.x0 >= 0 && sprite.bounds.x1 <= 1 && sprite.bounds.x1 > sprite.bounds.x0 &&
|
||||
sprite.bounds.y0 >= 0 && sprite.bounds.y1 <= 1 && sprite.bounds.y1 > sprite.bounds.y0)) return FALSE;
|
||||
bitmap_index = (unsigned long)sprite.bitmap_index;
|
||||
count = ce_hud_button_u32(ce_hud_buttons.tag + 96);
|
||||
data = ce_hud_button_range(ce_hud_button_u32(ce_hud_buttons.tag + 100), count, 48);
|
||||
if (!data || bitmap_index >= count || bitmap_index >= 2) return FALSE;
|
||||
data += bitmap_index * 48;
|
||||
/* The stock controller sheet is two 128-square, linear ARGB images.
|
||||
* Refuse other layouts rather than interpreting custom resource data. */
|
||||
if (ce_hud_button_u32(data + 4) != 0x00800080 ||
|
||||
ce_hud_button_u32(data + 8) != 1 || (data[12] != 11 || data[13]) ||
|
||||
(data[14] & (2 | 4 | 8 | 16))) return FALSE;
|
||||
bitmap = ce_hud_buttons.bitmaps[bitmap_index];
|
||||
if (!bitmap)
|
||||
{
|
||||
offset = ce_hud_button_u32(data + 24);
|
||||
bytes = ce_hud_button_u32(data + 28);
|
||||
if (bytes < 65536 || offset > resources->source->size ||
|
||||
65536 > resources->source->size - offset) return FALSE;
|
||||
bitmap = bitmap_2d_new(128, 128, 0, 11);
|
||||
if (!bitmap) return FALSE;
|
||||
if (!bitmap->base_address || !resources->source->read(resources->source->context,
|
||||
offset, 65536, bitmap->base_address) || !rasterizer_bitmap_new(bitmap))
|
||||
{
|
||||
bitmap_delete(bitmap);
|
||||
return FALSE;
|
||||
}
|
||||
rasterizer_bitmap_changed(bitmap);
|
||||
ce_hud_buttons.bitmaps[bitmap_index] = bitmap;
|
||||
}
|
||||
/* Match the native gameplay face's 26-pixel height: the CE resource
|
||||
* uses 20-pixel faces. Align to the active font's capitals, not the
|
||||
* stock font's baseline offsets. Keep all sprite proportions/frames. */
|
||||
viewport = local_player_count() > 1 ? 0.75f : 1.0f;
|
||||
scale = viewport * (26.0f / 20.0f);
|
||||
width = (sprite.bounds.x1 - sprite.bounds.x0) * bitmap->width * scale;
|
||||
height = (sprite.bounds.y1 - sprite.bounds.y0) * bitmap->height * scale;
|
||||
point.x = (short)(cursor->x0 + 4.0f * viewport);
|
||||
point.y = (short)(draw_unicode_string_capital_middle(cursor, L"") + height * 0.5f);
|
||||
hud_draw_bitmap_direct(bitmap, _hud_anchor_bottom_left, &point, &sprite.bounds,
|
||||
scale, 0.0f, icon->flags & 2 ? icon->color : color, FALSE);
|
||||
/* The following text run supplies its own three-pixel leading inset. */
|
||||
cursor->x0 = (short)(point.x + width - 3.0f * viewport);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,449 @@
|
||||
/*
|
||||
GAME_MODES.C
|
||||
|
||||
OpenCE's gametypes: SWAT, Infection and Gun Game, modes of Slayer, and
|
||||
Hardcore, rules over any game engine's. Which a gametype plays is in its PC
|
||||
options (game_engine.h's struct game_variant_options, from mode on), which a
|
||||
saved gametype keeps (playlist_profile.c), the network game carries to every
|
||||
machine (network_game_manager.h) and the game plays by
|
||||
(game_variant_options_get).
|
||||
|
||||
- SWAT: no shields, and a shot to the head of any weapon kills (damage.c).
|
||||
Its built-in gametype starts everyone with a pistol and an assault rifle,
|
||||
with no weapons on the map, no grenades and no motion sensor.
|
||||
- Infection (infection.c): on teams. Humans are red, zombies blue; the host
|
||||
chooses the first zombies after a countdown, a human killed joins them, and
|
||||
the zombies win when no human is left, the humans when the time runs out.
|
||||
- Gun Game (gun_game.c): free for all. Each kill gives the killer the next
|
||||
weapon of a list; a kill with the last wins.
|
||||
- Hardcore: no motion sensor, no aim assist, and a kill restores the
|
||||
killer's health and shields.
|
||||
|
||||
The built-in gametypes (game_modes_gametype) are written with the Xbox's
|
||||
default ones, after them, and the Select Gametype screen lists them in a bank
|
||||
of their own (menu_functions.c's OPENCE).
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/game_engine_playlist.h"
|
||||
#include "game/players.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "objects/objects.h"
|
||||
#include "units/units.h"
|
||||
#include "game_modes.h"
|
||||
#include "gun_game.h"
|
||||
#include "infection.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* game_engine.c's values of the variant's (its enums goal_radar,
|
||||
game_engine_weapons and game_engine_vehicles) */
|
||||
enum
|
||||
{
|
||||
GOAL_RADAR_NAV_POINT = 1,
|
||||
WEAPON_SET_NO_GRENADES = 10,
|
||||
VEHICLE_SET_NONE = 1
|
||||
};
|
||||
|
||||
/* Infection's options when a gametype has none (game_modes_options_sanitize) */
|
||||
enum
|
||||
{
|
||||
INFECTION_DEFAULT_INITIAL_ZOMBIES = 1,
|
||||
INFECTION_DEFAULT_ZOMBIE_SPEED = 150,
|
||||
INFECTION_DEFAULT_SKULL_DAMAGE = 200,
|
||||
INFECTION_DEFAULT_RESPAWN_TIME = 5,
|
||||
INFECTION_DEFAULT_COUNTDOWN = 10
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
_gametype_swat = 0,
|
||||
_gametype_infection,
|
||||
_gametype_gun_game,
|
||||
_gametype_hardcore_slayer,
|
||||
_gametype_hardcore_ctf,
|
||||
_gametype_hardcore_oddball,
|
||||
_gametype_hardcore_king,
|
||||
NUMBER_OF_GAMETYPES
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
/* debug.network_test's */
|
||||
char const *name;
|
||||
/* the gametype lists' */
|
||||
wchar_t const *display_name;
|
||||
/* the variant's own (11 characters at most: the lobby's and the server
|
||||
browser's) */
|
||||
wchar_t const *variant_name;
|
||||
} const game_modes_gametypes[NUMBER_OF_GAMETYPES] =
|
||||
{
|
||||
{ "swat", L"SWAT", L"SWAT" },
|
||||
{ "infection", L"Infection", L"Infection" },
|
||||
{ "gun_game", L"Gun Game", L"Gun Game" },
|
||||
{ "hardcore", L"Hardcore Slayer", L"Hardcore" },
|
||||
{ "hardcore_ctf", L"Hardcore CTF", L"HC CTF" },
|
||||
{ "hardcore_oddball", L"Hardcore Oddball", L"HC Oddball" },
|
||||
{ "hardcore_king", L"Hardcore King", L"HC King" },
|
||||
};
|
||||
|
||||
/* the kill being recorded is a melee's (game_modes_kill_by_melee) */
|
||||
static boolean game_modes_melee_kill;
|
||||
|
||||
/* ---- the built-in gametypes */
|
||||
|
||||
short game_modes_gametype_count(
|
||||
void)
|
||||
{
|
||||
return NUMBER_OF_GAMETYPES;
|
||||
}
|
||||
|
||||
wchar_t const *game_modes_gametype_name(
|
||||
short index)
|
||||
{
|
||||
return VALID_INDEX(index, NUMBER_OF_GAMETYPES) ? game_modes_gametypes[index].display_name : L"";
|
||||
}
|
||||
|
||||
/* a variant without a motion sensor: no players on it, and a goal (a flag,
|
||||
the ball, the hill) shown by its nav point instead */
|
||||
static void game_modes_no_motion_sensor(
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_draw_object_in_motion_sensor_bit, FALSE);
|
||||
variant->universal_variant.goal_radar = GOAL_RADAR_NAV_POINT;
|
||||
options->radar_players = _radar_players_none;
|
||||
}
|
||||
|
||||
void game_modes_gametype(
|
||||
short index,
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
struct game_variant temporary;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case _gametype_hardcore_ctf:
|
||||
*variant = *build_game_variant_ctf(&temporary);
|
||||
break;
|
||||
case _gametype_hardcore_oddball:
|
||||
*variant = *build_game_variant_team_oddball(&temporary);
|
||||
break;
|
||||
case _gametype_hardcore_king:
|
||||
*variant = *build_game_variant_team_king(&temporary);
|
||||
break;
|
||||
case _gametype_gun_game:
|
||||
*variant = *build_game_variant_slayer(&temporary);
|
||||
break;
|
||||
default:
|
||||
*variant = *build_game_variant_team_slayer(&temporary);
|
||||
break;
|
||||
}
|
||||
game_variant_options_default(variant, options);
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case _gametype_swat:
|
||||
options->mode = _game_mode_swat;
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_no_shields_bit, TRUE);
|
||||
variant->universal_variant.weapon_set = WEAPON_SET_NO_GRENADES;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = 150;
|
||||
game_modes_no_motion_sensor(variant, options);
|
||||
options->loadout = _loadout_custom;
|
||||
options->primary_weapon = _loadout_weapon_pistol;
|
||||
options->secondary_weapon = _loadout_weapon_assault_rifle;
|
||||
options->no_map_weapons = TRUE;
|
||||
break;
|
||||
case _gametype_infection:
|
||||
options->mode = _game_mode_infection;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = INFECTION_DEFAULT_RESPAWN_TIME * TICKS_PER_SECOND;
|
||||
variant->universal_variant.suicide_penalty = 0;
|
||||
options->time_limit = 5;
|
||||
options->friendly_fire = _friendly_fire_off;
|
||||
break;
|
||||
case _gametype_gun_game:
|
||||
options->mode = _game_mode_gun_game;
|
||||
variant->universal_variant.weapon_set = WEAPON_SET_NO_GRENADES;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = 90;
|
||||
variant->universal_variant.suicide_penalty = 0;
|
||||
options->no_map_weapons = TRUE;
|
||||
break;
|
||||
default:
|
||||
options->hardcore = TRUE;
|
||||
options->friendly_fire = _friendly_fire_on;
|
||||
game_modes_no_motion_sensor(variant, options);
|
||||
break;
|
||||
}
|
||||
/* (each team's vehicles the variant's, as game_variant_options_default
|
||||
gives them) */
|
||||
options->vehicle_set[0] = options->vehicle_set[1] = (byte)variant->universal_variant.vehicle_set;
|
||||
game_modes_options_sanitize(options);
|
||||
csmemset(variant->human_readable_game_description, 0, sizeof(variant->human_readable_game_description));
|
||||
if (VALID_INDEX(index, NUMBER_OF_GAMETYPES))
|
||||
{
|
||||
ustrncpy(variant->human_readable_game_description, game_modes_gametypes[index].variant_name,
|
||||
NUMBEROF(variant->human_readable_game_description) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
boolean game_modes_gametype_by_name(
|
||||
char const *name,
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
short index;
|
||||
|
||||
for (index = 0; index < NUMBER_OF_GAMETYPES; index++)
|
||||
{
|
||||
if (!strcmp(name, game_modes_gametypes[index].name))
|
||||
{
|
||||
game_modes_gametype(index, variant, options);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ---- a gametype's options */
|
||||
|
||||
void game_modes_options_default(
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
options->mode = _game_mode_none;
|
||||
options->hardcore = FALSE;
|
||||
options->infection_initial_zombies = INFECTION_DEFAULT_INITIAL_ZOMBIES;
|
||||
options->infection_zombie_speed = INFECTION_DEFAULT_ZOMBIE_SPEED;
|
||||
options->infection_skull_damage = INFECTION_DEFAULT_SKULL_DAMAGE;
|
||||
options->infection_respawn_time = INFECTION_DEFAULT_RESPAWN_TIME;
|
||||
options->infection_countdown = INFECTION_DEFAULT_COUNTDOWN;
|
||||
options->infection_zombie_shields = TRUE;
|
||||
options->gun_game_order = _gun_game_order_strongest_first;
|
||||
options->gun_game_melee_demotes = TRUE;
|
||||
csmemset(options->reserved, 0, sizeof(options->reserved));
|
||||
}
|
||||
|
||||
/* a byte option within its range, else its default */
|
||||
static byte game_modes_option(
|
||||
byte value,
|
||||
byte minimum,
|
||||
byte maximum,
|
||||
byte default_value)
|
||||
{
|
||||
return value >= minimum && value <= maximum ? value : default_value;
|
||||
}
|
||||
|
||||
void game_modes_options_sanitize(
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
if (options->mode >= NUMBER_OF_GAME_MODES)
|
||||
options->mode = _game_mode_none;
|
||||
options->hardcore = options->hardcore != FALSE;
|
||||
options->infection_initial_zombies = game_modes_option(options->infection_initial_zombies, 1, 16,
|
||||
INFECTION_DEFAULT_INITIAL_ZOMBIES);
|
||||
options->infection_zombie_speed = game_modes_option(options->infection_zombie_speed, 100, 200,
|
||||
INFECTION_DEFAULT_ZOMBIE_SPEED);
|
||||
options->infection_skull_damage = game_modes_option(options->infection_skull_damage, 100, 250,
|
||||
INFECTION_DEFAULT_SKULL_DAMAGE);
|
||||
options->infection_respawn_time = game_modes_option(options->infection_respawn_time, 1, 30,
|
||||
INFECTION_DEFAULT_RESPAWN_TIME);
|
||||
options->infection_countdown = game_modes_option(options->infection_countdown, 0, 30,
|
||||
INFECTION_DEFAULT_COUNTDOWN);
|
||||
options->infection_zombie_shields = options->infection_zombie_shields != FALSE;
|
||||
if (options->gun_game_order >= NUMBER_OF_GUN_GAME_ORDERS)
|
||||
options->gun_game_order = _gun_game_order_strongest_first;
|
||||
options->gun_game_melee_demotes = options->gun_game_melee_demotes != FALSE;
|
||||
csmemset(options->reserved, 0, sizeof(options->reserved));
|
||||
}
|
||||
|
||||
short game_modes_variant_mode(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
if (!variant || !options || variant->game_engine_index != game_engine_slayer)
|
||||
return _game_mode_none;
|
||||
switch (options->mode)
|
||||
{
|
||||
case _game_mode_swat:
|
||||
return _game_mode_swat;
|
||||
case _game_mode_infection:
|
||||
return variant->universal_variant.teams ? _game_mode_infection : _game_mode_none;
|
||||
case _game_mode_gun_game:
|
||||
return !variant->universal_variant.teams ? _game_mode_gun_game : _game_mode_none;
|
||||
}
|
||||
return _game_mode_none;
|
||||
}
|
||||
|
||||
byte game_modes_kind(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
return (byte)(game_modes_variant_mode(variant, options) |
|
||||
(options && options->hardcore ? GAME_MODES_KIND_HARDCORE : 0));
|
||||
}
|
||||
|
||||
wchar_t const *game_modes_kind_name(
|
||||
long game_engine_index,
|
||||
byte kind,
|
||||
boolean abbreviated)
|
||||
{
|
||||
/* (each kind's name, and its name with Hardcore's, in full and short) */
|
||||
static wchar_t const *const mode_names[NUMBER_OF_GAME_MODES][2][2] =
|
||||
{
|
||||
{ { NULL, NULL }, { NULL, NULL } },
|
||||
{ { L"SWAT", L"SWAT" }, { L"HARDCORE SWAT", L"HC SWAT" } },
|
||||
{ { L"INFECTION", L"INFECTION" }, { L"HARDCORE INFECTION", L"HC INFECTION" } },
|
||||
{ { L"GUN GAME", L"GUN GAME" }, { L"HARDCORE GUN GAME", L"HC GUN GAME" } },
|
||||
};
|
||||
static wchar_t const *const hardcore_names[][2] =
|
||||
{
|
||||
{ NULL, NULL },
|
||||
{ L"HARDCORE CTF", L"HC CTF" },
|
||||
{ L"HARDCORE SLAYER", L"HC SLAYER" },
|
||||
{ L"HARDCORE ODDBALL", L"HC ODDBALL" },
|
||||
{ L"HARDCORE KING", L"HC KING" },
|
||||
{ L"HARDCORE RACE", L"HC RACE" },
|
||||
};
|
||||
boolean hardcore = (kind & GAME_MODES_KIND_HARDCORE) != 0;
|
||||
short mode = (short)(kind & ~GAME_MODES_KIND_HARDCORE);
|
||||
|
||||
/* (another machine's: a mode of Slayer only, and one this build knows) */
|
||||
if (game_engine_index == game_engine_slayer && mode > _game_mode_none && mode < NUMBER_OF_GAME_MODES)
|
||||
return mode_names[mode][hardcore][abbreviated != FALSE];
|
||||
if (!hardcore || game_engine_index <= game_engine_none || game_engine_index >= (long)NUMBEROF(hardcore_names))
|
||||
return NULL;
|
||||
return hardcore_names[game_engine_index][abbreviated != FALSE];
|
||||
}
|
||||
|
||||
wchar_t const *game_modes_variant_kind_name(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
return variant && options ?
|
||||
game_modes_kind_name(variant->game_engine_index, game_modes_kind(variant, options), FALSE) : NULL;
|
||||
}
|
||||
|
||||
boolean game_modes_variant_is_opence(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
return options && (options->hardcore || game_modes_variant_mode(variant, options) != _game_mode_none);
|
||||
}
|
||||
|
||||
/* ---- the game being played */
|
||||
|
||||
short game_modes_mode(
|
||||
void)
|
||||
{
|
||||
if (!game_engine_running())
|
||||
return _game_mode_none;
|
||||
return game_modes_variant_mode(game_engine_get_variant(), game_variant_options_get());
|
||||
}
|
||||
|
||||
boolean game_modes_hardcore(
|
||||
void)
|
||||
{
|
||||
return game_engine_running() && game_variant_options_get()->hardcore;
|
||||
}
|
||||
|
||||
struct game_engine *game_modes_engine(
|
||||
struct game_engine *engine)
|
||||
{
|
||||
switch (game_modes_mode())
|
||||
{
|
||||
case _game_mode_swat:
|
||||
/* (SWAT is played without shields, whatever its variant's) */
|
||||
SET_FLAG(game_engine_get_variant()->universal_variant.flags, _game_variant_no_shields_bit, TRUE);
|
||||
break;
|
||||
case _game_mode_infection:
|
||||
return infection_engine_get(engine);
|
||||
case _game_mode_gun_game:
|
||||
return gun_game_engine_get(engine);
|
||||
}
|
||||
return engine;
|
||||
}
|
||||
|
||||
void game_modes_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
switch (game_modes_mode())
|
||||
{
|
||||
case _game_mode_infection:
|
||||
infection_postspawn(player_index);
|
||||
break;
|
||||
case _game_mode_gun_game:
|
||||
gun_game_postspawn(player_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void game_modes_player_killed(
|
||||
long killing_player_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
struct player_datum *killer;
|
||||
struct unit_datum *unit;
|
||||
|
||||
/* Hardcore: the host restores the killer's health, and their shields
|
||||
unless an overshield has them past full */
|
||||
if (!game_modes_hardcore() || network_game_distributed_client() || friendly_fire ||
|
||||
killing_player_index == NONE || killing_player_index == dead_player_index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
killer = player_try_and_get(killing_player_index);
|
||||
if (!killer || killer->unit_index == NONE)
|
||||
return;
|
||||
unit = unit_try_and_get(killer->unit_index);
|
||||
if (!unit || TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
unit->object.body_vitality = 1.0f;
|
||||
if (unit->object.maximum_shield_vitality > 0.0f && unit->object.shield_vitality < 1.0f)
|
||||
{
|
||||
unit->object.shield_vitality = 1.0f;
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_depleted_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_charging_bit, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void game_modes_kill_by_melee(
|
||||
boolean melee)
|
||||
{
|
||||
game_modes_melee_kill = melee;
|
||||
}
|
||||
|
||||
boolean game_modes_killed_by_melee(
|
||||
void)
|
||||
{
|
||||
return game_modes_melee_kill;
|
||||
}
|
||||
|
||||
boolean game_modes_headshot_kills(
|
||||
long object_index,
|
||||
boolean shot)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
|
||||
if (!shot || game_modes_mode() != _game_mode_swat)
|
||||
return FALSE;
|
||||
unit = (struct unit_datum *)object_try_and_get_and_verify_type(object_index, _object_mask_biped);
|
||||
return unit && unit->unit.player_index != NONE;
|
||||
}
|
||||
|
||||
boolean game_modes_motion_sensor_hidden(
|
||||
void)
|
||||
{
|
||||
return game_modes_hardcore();
|
||||
}
|
||||
|
||||
boolean game_modes_aim_assist_off(
|
||||
void)
|
||||
{
|
||||
return game_modes_hardcore();
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/* game_modes.h: OpenCE's gametypes (port/linux/game/game_modes.c)
|
||||
|
||||
SWAT, Infection and Gun Game are modes of Slayer, and Hardcore is a set of
|
||||
rules over any game engine's: a gametype's PC options (game_engine.h's struct
|
||||
game_variant_options, from mode on) say which, so a saved gametype, the
|
||||
network game and the game all carry them. The built-in ones are written with
|
||||
the Xbox's default gametypes (playlist_profile.c), after them, and the
|
||||
Select Gametype screen lists them in a bank of their own, OPENCE. */
|
||||
#ifndef HALO_GAME_MODES_H
|
||||
#define HALO_GAME_MODES_H
|
||||
|
||||
struct game_engine;
|
||||
struct game_variant;
|
||||
struct game_variant_options;
|
||||
|
||||
/* the built-in gametypes' place among the default ones (the Xbox's 26 come
|
||||
first: playlist_profile.c checks it) */
|
||||
#define GAME_MODES_FIRST_DEFAULT_PLAYLIST_PROFILE 26
|
||||
|
||||
/* ---- the built-in gametypes */
|
||||
|
||||
short game_modes_gametype_count(void);
|
||||
/* its name in the gametype lists */
|
||||
wchar_t const *game_modes_gametype_name(short index);
|
||||
/* its variant and options */
|
||||
void game_modes_gametype(short index, struct game_variant *variant, struct game_variant_options *options);
|
||||
/* the one of that name (debug.network_test's: "swat", "infection",
|
||||
"gun_game", "hardcore", "hardcore_ctf" ...), FALSE if none is */
|
||||
boolean game_modes_gametype_by_name(char const *name, struct game_variant *variant,
|
||||
struct game_variant_options *options);
|
||||
|
||||
/* ---- a gametype's options */
|
||||
|
||||
/* OpenCE's options at their defaults, with no mode (a gametype's that has
|
||||
none of its own: game_variant_options_default, and one saved before them) */
|
||||
void game_modes_options_default(struct game_variant_options *options);
|
||||
/* each of OpenCE's options in range (a file's or another machine's), its
|
||||
mode's own set to their defaults where none were given */
|
||||
void game_modes_options_sanitize(struct game_variant_options *options);
|
||||
/* the mode a gametype plays: its options' if its game engine and teams
|
||||
allow it (SWAT and Infection on teams, Gun Game free for all, all of them
|
||||
Slayer), else none */
|
||||
short game_modes_variant_mode(struct game_variant const *variant, struct game_variant_options const *options);
|
||||
/* the name the menus show for its kind of game ("INFECTION", "HARDCORE
|
||||
CTF"), NULL for a game engine's own ("SLAYER") */
|
||||
wchar_t const *game_modes_variant_kind_name(struct game_variant const *variant,
|
||||
struct game_variant_options const *options);
|
||||
/* a game's kind in a byte, as its LAN advertisement and internet listing
|
||||
carry it to the server browser: the mode it plays (game_modes_variant_mode),
|
||||
and GAME_MODES_KIND_HARDCORE */
|
||||
#define GAME_MODES_KIND_HARDCORE 0x80
|
||||
byte game_modes_kind(struct game_variant const *variant, struct game_variant_options const *options);
|
||||
/* the name of a game engine's game of that kind, in full or abbreviated
|
||||
("HC CTF": the server browser's column), NULL for the game engine's own
|
||||
(another machine's kind: a mode of any game engine but Slayer, or one this
|
||||
build does not know, is none) */
|
||||
wchar_t const *game_modes_kind_name(long game_engine_index, byte kind, boolean abbreviated);
|
||||
/* whether a gametype is one of OpenCE's (a mode, or Hardcore) */
|
||||
boolean game_modes_variant_is_opence(struct game_variant const *variant, struct game_variant_options const *options);
|
||||
|
||||
/* ---- the game being played */
|
||||
|
||||
/* its mode (_game_mode_none with no game engine) */
|
||||
short game_modes_mode(void);
|
||||
/* whether it plays by Hardcore's rules */
|
||||
boolean game_modes_hardcore(void);
|
||||
/* the game engine a mode plays with: Infection's and Gun Game's are
|
||||
Slayer's with their own rules; SWAT's variant has no shields
|
||||
(game_engine_initialize) */
|
||||
struct game_engine *game_modes_engine(struct game_engine *engine);
|
||||
/* a player's spawn, after its starting equipment (game_engine_postspawn_player_update) */
|
||||
void game_modes_postspawn(long player_index);
|
||||
/* a player killed (game_engine_player_killed, after the game engine's):
|
||||
Hardcore's restore of the killer */
|
||||
void game_modes_player_killed(long killing_player_index, long dead_player_index, boolean friendly_fire);
|
||||
/* the kill being recorded is a melee's (damage.c, around
|
||||
game_statistics_record_kill) */
|
||||
void game_modes_kill_by_melee(boolean melee);
|
||||
boolean game_modes_killed_by_melee(void);
|
||||
/* a shot's hit on a player's head (a bullet's, a plasma bolt's, a needle's,
|
||||
not a melee's or an explosion's) kills at once (SWAT) */
|
||||
boolean game_modes_headshot_kills(long object_index, boolean shot);
|
||||
/* the motion sensor is not drawn (Hardcore) */
|
||||
boolean game_modes_motion_sensor_hidden(void);
|
||||
/* no aim assist: neither autoaim nor magnetism (Hardcore) */
|
||||
boolean game_modes_aim_assist_off(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,308 @@
|
||||
/*
|
||||
GUN_GAME.C
|
||||
|
||||
Gun Game, a mode of free for all Slayer (game_modes.c). Everyone starts with
|
||||
the first weapon of a list and nothing else; each kill gives the killer the
|
||||
next, and a kill with the last wins. A player's level is their Slayer score
|
||||
(the kills less the suicides), so the scores the host sends its clients
|
||||
(game_engine_slayer_write_network_state) carry it, and the game ends as
|
||||
Slayer's does, at the score to win, which is the list's length.
|
||||
|
||||
The list is those of the loadout weapons (game_engine.h's _loadout_weapon_*)
|
||||
the map has, the strongest first (the rocket launcher, the shotgun, the
|
||||
sniper rifle, the plasma rifle, the assault rifle, the needler, the plasma
|
||||
pistol, the pistol), the weakest first, or in an order the host draws for
|
||||
each game. Only the host gives weapons: a player's weapons go to every
|
||||
machine with their inventory (network_objects.c). No one picks up a
|
||||
weapon; a weapon emptied is replaced with a full one; and a melee kill can
|
||||
take the victim back a weapon (gun_game_melee_demotes).
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/game_engine_slayer.h"
|
||||
#include "game/players.h"
|
||||
#include "items/weapons.h"
|
||||
#include "items/weapon_definitions.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "objects/objects.h"
|
||||
#include "units/units.h"
|
||||
#include "game_modes.h"
|
||||
#include "gun_game.h"
|
||||
|
||||
static byte const gun_game_strongest_first[] =
|
||||
{
|
||||
_loadout_weapon_rocket_launcher,
|
||||
_loadout_weapon_shotgun,
|
||||
_loadout_weapon_sniper_rifle,
|
||||
_loadout_weapon_plasma_rifle,
|
||||
_loadout_weapon_assault_rifle,
|
||||
_loadout_weapon_needler,
|
||||
_loadout_weapon_plasma_pistol,
|
||||
_loadout_weapon_pistol,
|
||||
};
|
||||
|
||||
#define GUN_GAME_MAXIMUM_LEVELS NUMBEROF(gun_game_strongest_first)
|
||||
|
||||
static struct
|
||||
{
|
||||
struct game_engine engine;
|
||||
struct game_engine slayer;
|
||||
/* the map's list, its weapons as _loadout_weapon_* */
|
||||
byte levels[GUN_GAME_MAXIMUM_LEVELS];
|
||||
short level_count;
|
||||
/* the host's: each player's unit given a level's weapon, and that level
|
||||
(by absolute player index) */
|
||||
long equipped_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
short equipped_level[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
/* a weapon being given (gun_game_allow_pick_up allows it) */
|
||||
boolean equipping;
|
||||
} gun_game;
|
||||
|
||||
short gun_game_level_count(
|
||||
void)
|
||||
{
|
||||
return gun_game.level_count;
|
||||
}
|
||||
|
||||
byte gun_game_level_weapon(
|
||||
short level)
|
||||
{
|
||||
return VALID_INDEX(level, gun_game.level_count) ? gun_game.levels[level] : _loadout_weapon_none;
|
||||
}
|
||||
|
||||
/* a player's level: their score, within the list */
|
||||
static short gun_game_player_level(
|
||||
long player_index)
|
||||
{
|
||||
long score = gun_game.slayer.get_player_score(player_index, _get_score_individual);
|
||||
|
||||
return (short)PIN(score, 0, MAX(gun_game.level_count - 1, 0));
|
||||
}
|
||||
|
||||
/* a weapon with no rounds left (none loaded nor carried), or a battery
|
||||
spent */
|
||||
static boolean gun_game_weapon_empty(
|
||||
long weapon_index)
|
||||
{
|
||||
struct weapon_datum *weapon = weapon_try_and_get(weapon_index);
|
||||
struct weapon_definition *definition;
|
||||
short magazine;
|
||||
boolean holds_rounds = FALSE;
|
||||
|
||||
if (!weapon)
|
||||
return FALSE;
|
||||
definition = weapon_definition_get(weapon->definition_index);
|
||||
if (definition->weapon.magazines.count <= 0)
|
||||
return weapon->weapon.age >= 1.0f;
|
||||
for (magazine = 0; magazine < MIN(definition->weapon.magazines.count, NUMBEROF(weapon->weapon.magazines));
|
||||
magazine++)
|
||||
{
|
||||
struct weapon_magazine_definition const *magazine_definition =
|
||||
TAG_BLOCK_GET_ELEMENT(&definition->weapon.magazines, magazine, struct weapon_magazine_definition);
|
||||
|
||||
/* (a battery weapon's magazine holds no rounds: the plasma rifle's and plasma pistol's) */
|
||||
if (magazine_definition->rounds_loaded_maximum <= 0 && magazine_definition->rounds_total_maximum <= 0)
|
||||
continue;
|
||||
holds_rounds = TRUE;
|
||||
if (weapon->weapon.magazines[magazine].rounds_loaded > 0 || weapon->weapon.magazines[magazine].rounds_total > 0)
|
||||
return FALSE;
|
||||
}
|
||||
return holds_rounds ? TRUE : weapon->weapon.age >= 1.0f;
|
||||
}
|
||||
|
||||
/* every weapon of a unit gone, the one in its hand too (which
|
||||
unit_delete_all_weapons keeps) */
|
||||
static void gun_game_delete_weapons(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
short slot;
|
||||
short other;
|
||||
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
long weapon_index = unit->unit.weapon_object_indices[slot];
|
||||
|
||||
if (weapon_index == NONE)
|
||||
continue;
|
||||
/* (each deleted once, should two slots hold it) */
|
||||
for (other = slot; other < MAXIMUM_WEAPONS_PER_UNIT; other++)
|
||||
{
|
||||
if (unit->unit.weapon_object_indices[other] == weapon_index)
|
||||
{
|
||||
unit->unit.weapon_object_indices[other] = NONE;
|
||||
if (unit->unit.current_weapon_index == other)
|
||||
unit->unit.current_weapon_index = NONE;
|
||||
if (unit->unit.desired_weapon_index == other)
|
||||
unit->unit.desired_weapon_index = NONE;
|
||||
}
|
||||
}
|
||||
if (object_try_and_get(weapon_index))
|
||||
object_delete(weapon_index);
|
||||
}
|
||||
}
|
||||
|
||||
/* the host gives a living player their level's weapon (their others gone),
|
||||
again when it is spent */
|
||||
static void gun_game_equip(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct unit_datum *unit;
|
||||
short level;
|
||||
long definition_index;
|
||||
long weapon_index;
|
||||
struct object_placement_data placement;
|
||||
|
||||
if (network_game_distributed_client() || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) ||
|
||||
player->quit_out_of_game || player->unit_index == NONE || !gun_game.level_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
unit = unit_try_and_get(player->unit_index);
|
||||
if (!unit || TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
level = gun_game_player_level(player_index);
|
||||
if (gun_game.equipped_unit[slot] == player->unit_index && gun_game.equipped_level[slot] == level)
|
||||
{
|
||||
long current = VALID_INDEX(unit->unit.current_weapon_index, MAXIMUM_WEAPONS_PER_UNIT) ?
|
||||
unit->unit.weapon_object_indices[unit->unit.current_weapon_index] : NONE;
|
||||
|
||||
if (current != NONE && !gun_game_weapon_empty(current))
|
||||
return;
|
||||
}
|
||||
/* (no weapon in the hand: a grenade being thrown has it, so wait) */
|
||||
if (unit->unit.grenade_throw_state != _unit_grenade_throw_idle)
|
||||
return;
|
||||
definition_index = game_engine_loadout_weapon_definition(gun_game.levels[level]);
|
||||
if (definition_index == NONE)
|
||||
return;
|
||||
gun_game.equipping = TRUE;
|
||||
gun_game_delete_weapons(player->unit_index);
|
||||
object_placement_data_new(&placement, definition_index, NONE);
|
||||
weapon_index = object_new(&placement);
|
||||
if (weapon_index != NONE && !unit_add_weapon_to_inventory(player->unit_index, weapon_index, 2))
|
||||
{
|
||||
object_delete(weapon_index);
|
||||
weapon_index = NONE;
|
||||
}
|
||||
gun_game.equipping = FALSE;
|
||||
gun_game.equipped_unit[slot] = player->unit_index;
|
||||
gun_game.equipped_level[slot] = level;
|
||||
}
|
||||
|
||||
void gun_game_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
gun_game.equipped_unit[slot] = NONE;
|
||||
gun_game_equip(player_index);
|
||||
}
|
||||
|
||||
/* the map's list, in the gametype's order */
|
||||
static void gun_game_levels_build(
|
||||
void)
|
||||
{
|
||||
short order = game_variant_options_get()->gun_game_order;
|
||||
short index;
|
||||
|
||||
gun_game.level_count = 0;
|
||||
for (index = 0; index < (short)GUN_GAME_MAXIMUM_LEVELS; index++)
|
||||
{
|
||||
byte weapon = gun_game_strongest_first[order == _gun_game_order_weakest_first ?
|
||||
GUN_GAME_MAXIMUM_LEVELS - 1 - index : index];
|
||||
|
||||
if (game_engine_loadout_weapon_definition(weapon) != NONE)
|
||||
gun_game.levels[gun_game.level_count++] = weapon;
|
||||
}
|
||||
/* (the host's draw: only the host gives weapons) */
|
||||
if (order == _gun_game_order_random && !network_game_distributed_client())
|
||||
{
|
||||
for (index = gun_game.level_count - 1; index > 0; index--)
|
||||
{
|
||||
short other = (short)local_random_range(0, index + 1);
|
||||
byte weapon = gun_game.levels[index];
|
||||
|
||||
gun_game.levels[index] = gun_game.levels[other];
|
||||
gun_game.levels[other] = weapon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static boolean gun_game_initialize_for_new_map(
|
||||
void)
|
||||
{
|
||||
gun_game_levels_build();
|
||||
csmemset(gun_game.equipped_unit, 0xFF, sizeof(gun_game.equipped_unit));
|
||||
csmemset(gun_game.equipped_level, 0xFF, sizeof(gun_game.equipped_level));
|
||||
gun_game.equipping = FALSE;
|
||||
/* (the game is won with a kill with the last weapon: every machine's
|
||||
list is as long) */
|
||||
if (gun_game.level_count)
|
||||
game_engine_get_variant()->universal_variant.score_to_win = gun_game.level_count;
|
||||
return gun_game.slayer.initialize_for_new_map ? gun_game.slayer.initialize_for_new_map() : TRUE;
|
||||
}
|
||||
|
||||
static void gun_game_player_update_each_tick(
|
||||
long player_index)
|
||||
{
|
||||
if (gun_game.slayer.player_update_each_tick)
|
||||
gun_game.slayer.player_update_each_tick(player_index);
|
||||
gun_game_equip(player_index);
|
||||
}
|
||||
|
||||
/* only the weapons given (and a weapon held, which readying it asks of) */
|
||||
static boolean gun_game_allow_pick_up(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_try_and_get(unit_index);
|
||||
short slot;
|
||||
|
||||
if (gun_game.equipping)
|
||||
return TRUE;
|
||||
for (slot = 0; unit && slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
if (unit->unit.weapon_object_indices[slot] == weapon_index)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void gun_game_player_killed_player(
|
||||
long killing_player_index,
|
||||
long killing_object_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
gun_game.slayer.player_killed_player(killing_player_index, killing_object_index, dead_player_index, friendly_fire);
|
||||
if (network_game_distributed_client() || player_get(dead_player_index)->quit_out_of_game)
|
||||
return;
|
||||
/* a melee kill takes the victim back a weapon */
|
||||
if (game_variant_options_get()->gun_game_melee_demotes && game_modes_killed_by_melee() && !friendly_fire &&
|
||||
killing_player_index != NONE && killing_player_index != dead_player_index &&
|
||||
gun_game.slayer.get_player_score(dead_player_index, _get_score_individual) > 0)
|
||||
{
|
||||
game_engine_slayer_adjust_score(dead_player_index, -1);
|
||||
}
|
||||
/* (a suicide at the first weapon leaves the score at 0) */
|
||||
if (gun_game.slayer.get_player_score(dead_player_index, _get_score_individual) < 0)
|
||||
game_engine_slayer_adjust_score(dead_player_index, 1);
|
||||
}
|
||||
|
||||
struct game_engine *gun_game_engine_get(
|
||||
struct game_engine const *slayer)
|
||||
{
|
||||
gun_game.slayer = *slayer;
|
||||
gun_game.engine = *slayer;
|
||||
gun_game.engine.initialize_for_new_map = gun_game_initialize_for_new_map;
|
||||
gun_game.engine.player_update_each_tick = gun_game_player_update_each_tick;
|
||||
gun_game.engine.allow_pick_up = gun_game_allow_pick_up;
|
||||
gun_game.engine.player_killed_player = gun_game_player_killed_player;
|
||||
return &gun_game.engine;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* gun_game.h: Gun Game, a mode of free for all Slayer (port/linux/game/gun_game.c) */
|
||||
#ifndef HALO_GUN_GAME_H
|
||||
#define HALO_GUN_GAME_H
|
||||
|
||||
struct game_engine;
|
||||
|
||||
/* Slayer's engine with Gun Game's rules (game_modes_engine) */
|
||||
struct game_engine *gun_game_engine_get(struct game_engine const *slayer);
|
||||
/* a player spawned: their weapon (game_modes_postspawn) */
|
||||
void gun_game_postspawn(long player_index);
|
||||
/* the weapons of the map's list (each machine's alike), and a level's (a
|
||||
_loadout_weapon_*) */
|
||||
short gun_game_level_count(void);
|
||||
byte gun_game_level_weapon(short level);
|
||||
|
||||
#endif
|
||||
@@ -34,6 +34,20 @@ When the texture cannot be drawn, the sprites are drawn from their bitmap.
|
||||
#include "text/draw_string.h"
|
||||
#include "hud_button_layout.h"
|
||||
#include "scenario/scenario_definitions.h"
|
||||
#include "cache/texture_cache.h"
|
||||
#ifdef HALO_ANDROID
|
||||
#include "android_ce_texture_cache.h"
|
||||
#endif
|
||||
|
||||
static boolean hud_hires_bitmap_resident(struct bitmap_data const *bitmap)
|
||||
{
|
||||
#ifdef HALO_ANDROID
|
||||
/* CE heap pixels have no Xbox LRU block. Query without touching their age. */
|
||||
if (android_ce_texture_resident(bitmap))
|
||||
return TRUE;
|
||||
#endif
|
||||
return bitmap->cache_block_index != NONE;
|
||||
}
|
||||
|
||||
/* the platform layer's (port/linux/src) */
|
||||
void platform_log(char const *format, ...);
|
||||
@@ -48,8 +62,15 @@ unsigned long hud_hires_asset_sprites(long asset);
|
||||
int hud_hires_sprites_drawable(long asset, unsigned long address, unsigned long level0_size);
|
||||
void hud_hires_register_placeholder(long asset, unsigned long const *texture);
|
||||
int hud_hires_asset_custom_edition(long asset);
|
||||
int hud_hires_asset_ce_only(long asset);
|
||||
long hud_hires_ce_stock_count_get(void);
|
||||
long hud_hires_ce_stock_find(char const *tag, long bitmap);
|
||||
char const *hud_hires_ce_stock_tag(long index);
|
||||
long hud_hires_ce_stock_bitmap(long index);
|
||||
int hud_hires_ce_stock_matches(long index, unsigned long address, long width, long height, unsigned long size);
|
||||
/* (custom_edition_cache.c) */
|
||||
boolean custom_edition_cache_stock_tag(long tag_index);
|
||||
boolean custom_edition_cache_tags_loaded(void);
|
||||
|
||||
void hud_hires_map_loaded(const long *assets, long count);
|
||||
void hud_hires_map_unloaded(void);
|
||||
@@ -58,6 +79,8 @@ void hud_hires_tags_unloaded(void);
|
||||
long hud_hires_asset_at(unsigned long address, long width, long height);
|
||||
struct bitmap_data const *hud_hires_sprite_bitmap(struct bitmap_data const *bitmap, short sequence_index);
|
||||
|
||||
#include "custom_edition_hud_buttons.h"
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
enum
|
||||
@@ -72,8 +95,8 @@ static struct
|
||||
{
|
||||
struct bitmap_data *bitmap;
|
||||
long asset;
|
||||
/* a Custom Edition map's stock bitmap of a layout the texture was made
|
||||
for, whose pixels are its own: drawn without the pixels' check */
|
||||
/* A compatible CE resource sheet: checked against CE's pixel signature
|
||||
in the platform layer, rather than the Xbox signature. */
|
||||
boolean stock_custom_edition;
|
||||
} hires_bitmaps[MAXIMUM_HIRES_BITMAPS];
|
||||
static long hires_bitmap_count = 0;
|
||||
@@ -81,6 +104,8 @@ static long hires_bitmap_count = 0;
|
||||
/* Sheets without redraws: retain their original lettering and sprite layout. */
|
||||
static struct { struct bitmap_data *bitmap; long kind; } upscale_bitmaps[16];
|
||||
static long upscale_bitmap_count;
|
||||
static struct { struct bitmap_data *bitmap; long signature; } ce_stock_bitmaps[128];
|
||||
static long ce_stock_bitmap_count;
|
||||
|
||||
/* the bitmaps some of whose sprites have a texture, with their placeholder,
|
||||
and whether the texture can be drawn for the pixels at checked_address
|
||||
@@ -110,6 +135,7 @@ static short hud_buttons_style;
|
||||
static void hud_buttons_forget(void)
|
||||
{
|
||||
long index;
|
||||
ce_hud_buttons_forget();
|
||||
for (index = 0; index < 14; index++)
|
||||
{
|
||||
if (hud_buttons[index].bitmap)
|
||||
@@ -154,6 +180,22 @@ void hud_hires_tags_loaded(
|
||||
hires_bitmap_count = 0;
|
||||
hud_hires_sprite_bitmaps_forget();
|
||||
upscale_bitmap_count = 0;
|
||||
ce_stock_bitmap_count = 0;
|
||||
if (custom_edition_cache_tags_loaded())
|
||||
{
|
||||
long index;
|
||||
for (index = 0; index < hud_hires_ce_stock_count_get() && ce_stock_bitmap_count < NUMBEROF(ce_stock_bitmaps); index++)
|
||||
{
|
||||
long group = tag_loaded(BITMAP_GROUP_TAG, hud_hires_ce_stock_tag(index));
|
||||
struct bitmap_data *bitmap = group == NONE ? NULL :
|
||||
bitmap_group_try_and_get_bitmap(group, (short)hud_hires_ce_stock_bitmap(index));
|
||||
if (bitmap && custom_edition_cache_stock_tag(group))
|
||||
{
|
||||
ce_stock_bitmaps[ce_stock_bitmap_count].bitmap = bitmap;
|
||||
ce_stock_bitmaps[ce_stock_bitmap_count++].signature = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
static struct { char const *tag; short first, last; } const sheets[] = {
|
||||
{ "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", 8, 12 },
|
||||
@@ -168,7 +210,8 @@ void hud_hires_tags_loaded(
|
||||
{
|
||||
long group = tag_loaded(BITMAP_GROUP_TAG, sheets[sheet].tag);
|
||||
|
||||
if (group == NONE)
|
||||
/* CE's custom sheets must not enter the Xbox-only upscaler. */
|
||||
if (group == NONE || custom_edition_cache_tags_loaded())
|
||||
continue;
|
||||
for (index = sheets[sheet].first; index <= sheets[sheet].last; index++)
|
||||
{
|
||||
@@ -189,6 +232,14 @@ void hud_hires_tags_loaded(
|
||||
struct bitmap_data *bitmap = group_index == NONE ? NULL :
|
||||
bitmap_group_try_and_get_bitmap(group_index, (short)hud_hires_asset_bitmap(asset));
|
||||
|
||||
/* Only the verified compatible resource sheets have CE redraws.
|
||||
Embedded custom art keeps its own pixels, even under a stock name. */
|
||||
if (custom_edition_cache_tags_loaded() &&
|
||||
(!hud_hires_asset_custom_edition(asset) || !custom_edition_cache_stock_tag(group_index)))
|
||||
continue;
|
||||
if (!custom_edition_cache_tags_loaded() && hud_hires_asset_ce_only(asset))
|
||||
continue;
|
||||
|
||||
if (!bitmap)
|
||||
{
|
||||
/* (the main menu's map has only some of the HUD) */
|
||||
@@ -243,6 +294,7 @@ void hud_hires_tags_unloaded(
|
||||
{
|
||||
hires_bitmap_count = 0;
|
||||
upscale_bitmap_count = 0;
|
||||
ce_stock_bitmap_count = 0;
|
||||
hud_hires_sprite_bitmaps_forget();
|
||||
hud_hires_map_unloaded();
|
||||
|
||||
@@ -267,7 +319,7 @@ struct bitmap_data const *hud_hires_sprite_bitmap(
|
||||
continue;
|
||||
}
|
||||
/* (checked on its pixels in the texture cache, once they are loaded) */
|
||||
if (sprite_bitmap->cache_block_index == NONE || !sprite_bitmap->base_address)
|
||||
if (!hud_hires_bitmap_resident(sprite_bitmap) || !sprite_bitmap->base_address)
|
||||
break;
|
||||
if (hires_sprite_bitmaps[index].checked_address != sprite_bitmap->base_address ||
|
||||
hires_sprite_bitmaps[index].checked_at != config_changes())
|
||||
@@ -330,7 +382,7 @@ long hud_hires_asset_stock_custom_edition(
|
||||
{
|
||||
struct bitmap_data *bitmap = hires_bitmaps[index].bitmap;
|
||||
|
||||
if (hires_bitmaps[index].asset == asset && bitmap->cache_block_index != NONE &&
|
||||
if (hires_bitmaps[index].asset == asset && hud_hires_bitmap_resident(bitmap) &&
|
||||
(unsigned long)bitmap->base_address == address && bitmap->width == width && bitmap->height == height)
|
||||
{
|
||||
return hires_bitmaps[index].stock_custom_edition;
|
||||
@@ -351,7 +403,7 @@ long hud_hires_asset_at(
|
||||
{
|
||||
struct bitmap_data *bitmap = hires_bitmaps[index].bitmap;
|
||||
|
||||
if (bitmap->cache_block_index != NONE &&
|
||||
if (hud_hires_bitmap_resident(bitmap) &&
|
||||
(unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width &&
|
||||
bitmap->height == height)
|
||||
@@ -367,20 +419,56 @@ long hud_hires_upscale_at(unsigned long address, long width, long height)
|
||||
{
|
||||
long index;
|
||||
|
||||
for (index = 0; index < ce_stock_bitmap_count; index++)
|
||||
{
|
||||
struct bitmap_data const *bitmap = ce_stock_bitmaps[index].bitmap;
|
||||
if (hud_hires_bitmap_resident(bitmap) && (unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width && bitmap->height == height &&
|
||||
hud_hires_ce_stock_matches(ce_stock_bitmaps[index].signature, address, width, height,
|
||||
(unsigned long)bitmap_mipmap_get_pixel_data_size(bitmap, 0)))
|
||||
return 4;
|
||||
}
|
||||
|
||||
for (index = 0; index < upscale_bitmap_count; index++)
|
||||
{
|
||||
struct bitmap_data const *bitmap = upscale_bitmaps[index].bitmap;
|
||||
|
||||
if (bitmap->cache_block_index != NONE && (unsigned long)bitmap->base_address == address &&
|
||||
if (hud_hires_bitmap_resident(bitmap) && (unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width && bitmap->height == height)
|
||||
return upscale_bitmaps[index].kind;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean ce_hud_buttons_stock(struct icon_hud_element_definition const *icon, long button)
|
||||
{
|
||||
/* CE keeps these Xbox controller definitions even when its messaging
|
||||
sheet contains only weapon pictures. Identify the controller entry, not
|
||||
the sheet: weapon icons are separate records and keep their own art. */
|
||||
static const short stock[18][7] = {
|
||||
{0,-6,-2,-5,0,2,0}, {1,-6,-2,-5,0,2,0},
|
||||
{2,-6,-2,-5,0,2,0}, {3,-6,-2,-5,0,2,0},
|
||||
{13,-6,-2,-5,0,2,1}, {13,-6,-2,-5,0,2,2},
|
||||
{21,-6,-2,-5,0,0,3}, {22,-6,-2,-5,0,0,4},
|
||||
{0,0,0,0,0,1,5}, {0,0,0,0,0,1,6},
|
||||
{0,0,0,0,0,1,7}, {0,0,0,0,0,1,8},
|
||||
{18,-6,-2,-5,0,0,9}, {17,-6,-2,-5,0,0,10},
|
||||
{19,28,-2,-5,10,4,11}, {20,28,-2,-5,10,4,12},
|
||||
{15,-6,-2,-5,0,0,11}, {16,-6,-2,-5,0,0,12}
|
||||
};
|
||||
if (!custom_edition_cache_tags_loaded()) return TRUE;
|
||||
if (button < 0 || button >= NUMBEROF(stock) ||
|
||||
icon->sequence_index != stock[button][0] || icon->width_offset != stock[button][1] ||
|
||||
icon->offset.x != stock[button][2] || icon->offset.y != stock[button][3] ||
|
||||
icon->frame_rate != stock[button][4] || icon->flags != stock[button][5] ||
|
||||
icon->text_index != stock[button][6]) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Match the controller entry itself: weapon icons may reuse its sequence.
|
||||
* Draw the existing Xbox menu faces with straight alpha, independently of
|
||||
* the messaging sheet and its tint. Disabling the HUD keeps the map's art. */
|
||||
* the messaging sheet and its tint. CE custom sheets also need this fallback
|
||||
* with High-Res HUD off: their stock button entries can name weapon art. */
|
||||
boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
rectangle2d *cursor, pixel32 color)
|
||||
{
|
||||
@@ -406,7 +494,9 @@ boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
short i;
|
||||
short style, slot;
|
||||
|
||||
if (!config_boolean("display.high_res_hud") || !hud_globals)
|
||||
if (!hud_globals || (!config_boolean("display.high_res_hud") &&
|
||||
(!custom_edition_cache_tags_loaded() ||
|
||||
custom_edition_cache_stock_tag(hud_globals->messaging.messaging_icons.index))))
|
||||
return FALSE;
|
||||
buttons = hud_globals->messaging.button_icons.address;
|
||||
if (!buttons) return FALSE;
|
||||
@@ -414,6 +504,9 @@ boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
if (icon == buttons + index) break;
|
||||
if (index >= 18 || index >= hud_globals->messaging.button_icons.count)
|
||||
return FALSE;
|
||||
if (!ce_hud_buttons_stock(icon, index)) return FALSE;
|
||||
if (!config_boolean("display.high_res_hud"))
|
||||
return ce_hud_button_draw(icon, cursor, color);
|
||||
slot = index < 6 ? (short)index : hud_button_control_slot((short)index,
|
||||
icon->frame_rate > 0 ? game_time_get() / icon->frame_rate : 0);
|
||||
if (slot < 0) return FALSE;
|
||||
|
||||
@@ -0,0 +1,972 @@
|
||||
/*
|
||||
INFECTION.C
|
||||
|
||||
Infection, a mode of team Slayer (game_modes.c). Humans are red and keep the
|
||||
gametype's equipment; zombies are blue, carry the Oddball skull and nothing
|
||||
else, and fight on foot, faster than humans, their skull's melee stronger.
|
||||
The round waits for two living players, counts down, and then the host
|
||||
chooses the first zombies (leaving at least one human). A human killed by a
|
||||
zombie, by themselves or by the world becomes a zombie (one killed by a
|
||||
teammate does not); a zombie respawns a zombie, and a player who joins late
|
||||
joins the zombies. The zombies win when no human is left, the humans when the
|
||||
round's time runs out. Each player scores a kill of the other side.
|
||||
|
||||
Only the host decides: it chooses the zombies, turns the dead, gives the
|
||||
skulls and ends the round, and sends every client its state
|
||||
(struct distributed_infection_state, with the game type's:
|
||||
game_engine_write_network_state), which a client checks whole before taking.
|
||||
Each machine then sets each player's team, speed and shields by their role.
|
||||
|
||||
Its options are the gametype's (game_engine.h's struct game_variant_options,
|
||||
infection_*). The rules and much of the code follow the Infection of pull
|
||||
request #420 by arisson2001rojas-design.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/players.h"
|
||||
#include "math/real_math.h"
|
||||
#include "memory/data.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "networking/network_game_manager.h"
|
||||
#include "networking/network_server_manager.h"
|
||||
#include "objects/objects.h"
|
||||
#include "objects/object_definitions.h"
|
||||
#include "physics/collisions.h"
|
||||
#include "text/unicode.h"
|
||||
#include "units/units.h"
|
||||
#include "units/unit_definitions.h"
|
||||
#include "game_modes.h"
|
||||
#include "infection.h"
|
||||
#include "network_infection.h"
|
||||
|
||||
void platform_log(char const *format, ...);
|
||||
|
||||
/* a score past this is not a client's to take */
|
||||
#define INFECTION_MAXIMUM_SCORE 1000000
|
||||
|
||||
static struct
|
||||
{
|
||||
struct game_engine engine;
|
||||
struct game_engine slayer;
|
||||
struct distributed_infection_state state;
|
||||
/* the host's, by absolute player index: the player of the slot, the unit
|
||||
given its role's equipment, the unit counted dead, the skull given, and
|
||||
the unit whose shields a zombie's role took (and their maximum) */
|
||||
long participant[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long equipped_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long killed_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long skull[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long shield_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
real shield_maximum[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
/* a skull being given (the pickup checks allow it) */
|
||||
boolean equipping;
|
||||
/* the map has no skull, or one could not be given: the round ends */
|
||||
boolean missing_skull;
|
||||
} infection;
|
||||
|
||||
/* ---- the players' roles */
|
||||
|
||||
boolean infection_enabled(
|
||||
void)
|
||||
{
|
||||
return game_modes_mode() == _game_mode_infection;
|
||||
}
|
||||
|
||||
/* a player's identity on every machine: their name and place in the game */
|
||||
static unsigned long infection_player_identity(
|
||||
long player_index)
|
||||
{
|
||||
struct network_player const *network_player = &player_get(player_index)->network_player_data;
|
||||
unsigned long hash = 2166136261UL;
|
||||
short index;
|
||||
|
||||
for (index = 0; index < NUMBEROF(network_player->name); index++)
|
||||
hash = (hash ^ (word)network_player->name[index]) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->machine_index) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->controller_index) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->player_list_index) * 16777619UL;
|
||||
return hash ? hash : 1;
|
||||
}
|
||||
|
||||
/* a player's role, if the state has it for them (not one who left, whose
|
||||
slot another took) */
|
||||
static struct distributed_infection_player *infection_player(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (player_index == NONE || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) ||
|
||||
!player_try_and_get(player_index) ||
|
||||
infection.state.players[slot].identity != infection_player_identity(player_index))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return &infection.state.players[slot];
|
||||
}
|
||||
|
||||
static boolean infection_weapon_is_skull(
|
||||
long weapon_index)
|
||||
{
|
||||
struct object_datum *object = object_try_and_get_and_verify_type(weapon_index, _object_mask_weapon);
|
||||
|
||||
return object && object->definition_index == get_ball_definition_index();
|
||||
}
|
||||
|
||||
boolean infection_can_delete_skull(
|
||||
long object_index)
|
||||
{
|
||||
return infection_enabled() && infection_weapon_is_skull(object_index);
|
||||
}
|
||||
|
||||
boolean infection_unit_is_zombie(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
struct distributed_infection_player *role;
|
||||
|
||||
if (unit_index == NONE || !infection_enabled() || (unit = unit_try_and_get(unit_index)) == NULL)
|
||||
return FALSE;
|
||||
role = infection_player(unit->unit.player_index);
|
||||
return role && role->role == _distributed_infection_role_zombie;
|
||||
}
|
||||
|
||||
/* asked of a player's own drops only: a death, and the inventories the host
|
||||
sends, still take a skull away */
|
||||
boolean infection_allow_weapon_drop(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
struct player_datum *player;
|
||||
|
||||
if (!infection_enabled() || infection.state.phase != _distributed_infection_active || infection.equipping ||
|
||||
!infection_unit_is_zombie(unit_index))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
unit = unit_get(unit_index);
|
||||
player = player_try_and_get(unit->unit.player_index);
|
||||
if (!player || player->quit_out_of_game || player->unit_index != unit_index ||
|
||||
TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return !infection_weapon_is_skull(weapon_index);
|
||||
}
|
||||
|
||||
/* a zombie's skull in the hand */
|
||||
static boolean infection_unit_holds_skull(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
|
||||
return VALID_INDEX(unit->unit.current_weapon_index, MAXIMUM_WEAPONS_PER_UNIT) &&
|
||||
infection_weapon_is_skull(unit->unit.weapon_object_indices[unit->unit.current_weapon_index]);
|
||||
}
|
||||
|
||||
real infection_melee_multiplier(
|
||||
long unit_index)
|
||||
{
|
||||
if (!infection_unit_is_zombie(unit_index) || infection.state.phase != _distributed_infection_active ||
|
||||
!infection_unit_holds_skull(unit_index))
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
return game_variant_options_get()->infection_skull_damage / 100.0f;
|
||||
}
|
||||
|
||||
/* a living human in a seat of a vehicle that is not hidden, whom a zombie
|
||||
holding its skull struck itself (not the vehicle: Slayer's melee hits the
|
||||
vehicle a rider is in) */
|
||||
boolean infection_melee_rider_target(
|
||||
long attacker_index,
|
||||
long target_index)
|
||||
{
|
||||
struct unit_datum *target;
|
||||
struct unit_datum *vehicle;
|
||||
struct distributed_infection_player *role;
|
||||
struct unit_definition *definition;
|
||||
short seat;
|
||||
|
||||
if (!infection_unit_is_zombie(attacker_index) || infection.state.phase != _distributed_infection_active ||
|
||||
!infection_unit_holds_skull(attacker_index))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
target = unit_try_and_get(target_index);
|
||||
if (!target || target->object.type != _object_type_biped || TEST_FLAG(target->object.damage_flags, _object_dead_bit))
|
||||
return FALSE;
|
||||
role = infection_player(target->unit.player_index);
|
||||
if (!role || role->role != _distributed_infection_role_human)
|
||||
return FALSE;
|
||||
vehicle = (struct unit_datum *)object_try_and_get_and_verify_type(target->object.parent_object_index,
|
||||
_object_mask_vehicle);
|
||||
if (!vehicle)
|
||||
return FALSE;
|
||||
definition = unit_definition_get(vehicle->definition_index);
|
||||
seat = target->unit.parent_seat_index;
|
||||
return VALID_INDEX(seat, definition->unit.seats.count) &&
|
||||
!TEST_FLAG(TAG_BLOCK_GET_ELEMENT(&definition->unit.seats, seat, struct unit_seat)->flags,
|
||||
_unit_seat_invisible_bit);
|
||||
}
|
||||
|
||||
/* the host's check of a client's melee report on a rider: one of its own
|
||||
lines through the melee's cone (0.8 world units from the attacker's head,
|
||||
as the game's melee) reaches the rider, through the host's own world, not
|
||||
from a place the client says */
|
||||
boolean infection_melee_rider_visible(
|
||||
long attacker_index,
|
||||
long target_index,
|
||||
real_vector3d const *direction)
|
||||
{
|
||||
struct object_marker head;
|
||||
real_vector3d facing = *direction;
|
||||
real_vector3d perpendicular;
|
||||
real_vector3d cross;
|
||||
real_vector3d ray;
|
||||
struct collision_result hit;
|
||||
long outer;
|
||||
long inner;
|
||||
|
||||
if (!infection_melee_rider_target(attacker_index, target_index) || normalize3d(&facing) <= 0.0f)
|
||||
return FALSE;
|
||||
object_get_marker_by_name(attacker_index, "head", &head, 1);
|
||||
normalize3d(perpendicular3d(&facing, &perpendicular));
|
||||
cross_product3d(&facing, &perpendicular, &cross);
|
||||
for (outer = -2; outer <= 2; outer++)
|
||||
{
|
||||
for (inner = -2; inner <= 2; inner++)
|
||||
{
|
||||
ray.i = facing.i * 0.8f + (cross.i * inner + perpendicular.i * outer) * 0.1f;
|
||||
ray.j = facing.j * 0.8f + (cross.j * inner + perpendicular.j * outer) * 0.1f;
|
||||
ray.k = facing.k * 0.8f + (cross.k * inner + perpendicular.k * outer) * 0.1f;
|
||||
if (collision_test_vector(_collision_test_for_projectiles_flags, &head.matrix.position, &ray,
|
||||
attacker_index, &hit) && hit.type == _collision_result_object && hit.object_index == target_index)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ---- the host's round */
|
||||
|
||||
static void infection_finish(
|
||||
long winner)
|
||||
{
|
||||
if (infection.state.phase == _distributed_infection_finished)
|
||||
return;
|
||||
infection.state.winner = winner;
|
||||
infection.state.phase = _distributed_infection_finished;
|
||||
infection.state.revision++;
|
||||
platform_log("infection: finished, winner %ld", winner);
|
||||
game_engine_end_game();
|
||||
}
|
||||
|
||||
/* a unit's armour in its team's colour (a human turned while alive), as a
|
||||
spawn colours it; the colour channels a function drives (the shield's glow)
|
||||
are left to it */
|
||||
static void infection_color_unit(
|
||||
struct unit_datum *unit,
|
||||
long player_index)
|
||||
{
|
||||
struct object_definition *definition = object_definition_get(unit->definition_index);
|
||||
real_rgb_color color;
|
||||
short channel;
|
||||
|
||||
game_engine_player_get_change_color(&color, player_index);
|
||||
for (channel = 0; channel < NUMBER_OF_OBJECT_CHANGE_COLORS; channel++)
|
||||
{
|
||||
unit->object.base_change_colors[channel] = color;
|
||||
if (channel < definition->object.change_colors.count)
|
||||
{
|
||||
struct object_change_color_definition *change_color = TAG_BLOCK_GET_ELEMENT(
|
||||
&definition->object.change_colors, channel, struct object_change_color_definition);
|
||||
|
||||
if (change_color->scaled_by || change_color->darken_by)
|
||||
continue;
|
||||
}
|
||||
unit->object.outgoing_change_colors[channel] = color;
|
||||
}
|
||||
}
|
||||
|
||||
/* a zombie without shields (the gametype's infection_zombie_shields): a
|
||||
shield capacity of 0, the game's own unshielded unit, which neither takes
|
||||
shield damage nor recharges; a human again (or the option on) gets the
|
||||
unit's capacity back, without healing its body */
|
||||
static void infection_apply_shields(
|
||||
long slot,
|
||||
long unit_index,
|
||||
struct unit_datum *unit,
|
||||
boolean disabled)
|
||||
{
|
||||
if (infection.shield_unit[slot] != unit_index)
|
||||
infection.shield_unit[slot] = NONE;
|
||||
if (disabled)
|
||||
{
|
||||
if (infection.shield_unit[slot] == NONE)
|
||||
{
|
||||
infection.shield_unit[slot] = unit_index;
|
||||
infection.shield_maximum[slot] = unit->object.maximum_shield_vitality;
|
||||
}
|
||||
unit->object.maximum_shield_vitality = 0.0f;
|
||||
unit->object.shield_vitality = 0.0f;
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_charging_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_over_charging_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_depleted_bit, TRUE);
|
||||
}
|
||||
else if (infection.shield_unit[slot] == unit_index)
|
||||
{
|
||||
unit->object.maximum_shield_vitality = infection.shield_maximum[slot];
|
||||
infection.shield_unit[slot] = NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void infection_reconcile_player(
|
||||
long player_index)
|
||||
{
|
||||
struct game_variant_options const *options = game_variant_options_get();
|
||||
struct distributed_infection_player *role;
|
||||
struct player_datum *player;
|
||||
struct unit_datum *unit;
|
||||
long team;
|
||||
|
||||
if (!infection_enabled() || (role = infection_player(player_index)) == NULL ||
|
||||
role->role == _distributed_infection_role_none)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player = player_get(player_index);
|
||||
team = role->role == _distributed_infection_role_zombie ? 1 : 0;
|
||||
player->team_index = team;
|
||||
player->network_player_data.team_index = (char)team;
|
||||
player->speed_multiplier = team ? options->infection_zombie_speed / 100.0f : 1.0f;
|
||||
if (player->unit_index != NONE && (unit = unit_try_and_get(player->unit_index)) != NULL)
|
||||
{
|
||||
infection_apply_shields(DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index), player->unit_index, unit,
|
||||
team && !options->infection_zombie_shields);
|
||||
unit->object.owner_team_index = (short)team;
|
||||
infection_color_unit(unit, player_index);
|
||||
/* (a living zombie's grenades and powerups gone; a dead one's are its
|
||||
body's, which drops them) */
|
||||
if (team && !TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
/* (a grenade being wound up when its thrower turned is not thrown:
|
||||
the throw would find no grenade left) */
|
||||
if (unit->unit.grenade_throw_state == _unit_grenade_throw_wind_up)
|
||||
unit->unit.grenade_throw_state = _unit_grenade_throw_ending;
|
||||
csmemset(unit->unit.grenade_counts, 0, sizeof(unit->unit.grenade_counts));
|
||||
csmemset(player->powerup_durations, 0, sizeof(player->powerup_durations));
|
||||
}
|
||||
}
|
||||
/* (and the host's game record, which the lobby and late joins read) */
|
||||
if (!network_game_distributed_client())
|
||||
{
|
||||
struct network_game_server *server = global_network_game_server_get();
|
||||
struct network_game *game = server ? network_game_server_get_game(server) : NULL;
|
||||
long list_index = player->network_player_data.player_list_index;
|
||||
|
||||
if (game && VALID_INDEX(list_index, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
game->players[list_index].team_index = (char)team;
|
||||
}
|
||||
}
|
||||
|
||||
static void infection_delete_weapon(
|
||||
long weapon_index)
|
||||
{
|
||||
long slot;
|
||||
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.skull[slot] == weapon_index)
|
||||
infection.skull[slot] = NONE;
|
||||
}
|
||||
if (weapon_index != NONE && object_try_and_get(weapon_index))
|
||||
object_delete(weapon_index);
|
||||
}
|
||||
|
||||
static void infection_delete_skull(
|
||||
long slot)
|
||||
{
|
||||
infection_delete_weapon(infection.skull[slot]);
|
||||
infection.skull[slot] = NONE;
|
||||
}
|
||||
|
||||
/* a unit's weapons gone but the one kept (skulls only: a human's skull
|
||||
picked up), each deleted once */
|
||||
static void infection_strip_weapons(
|
||||
long unit_index,
|
||||
long keep,
|
||||
boolean skulls_only)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
long removed[MAXIMUM_WEAPONS_PER_UNIT];
|
||||
long count = 0;
|
||||
long slot;
|
||||
long previous;
|
||||
long kept = NONE;
|
||||
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
long weapon_index = unit->unit.weapon_object_indices[slot];
|
||||
|
||||
if (weapon_index == NONE)
|
||||
continue;
|
||||
if (weapon_index == keep && kept == NONE)
|
||||
{
|
||||
kept = slot;
|
||||
continue;
|
||||
}
|
||||
if (skulls_only && !infection_weapon_is_skull(weapon_index))
|
||||
continue;
|
||||
unit->unit.weapon_object_indices[slot] = NONE;
|
||||
if (unit->unit.current_weapon_index == slot)
|
||||
unit->unit.current_weapon_index = NONE;
|
||||
if (unit->unit.desired_weapon_index == slot)
|
||||
unit->unit.desired_weapon_index = NONE;
|
||||
if (weapon_index == keep)
|
||||
continue;
|
||||
for (previous = 0; previous < count && removed[previous] != weapon_index; previous++)
|
||||
{
|
||||
}
|
||||
if (previous == count)
|
||||
removed[count++] = weapon_index;
|
||||
}
|
||||
for (slot = 0; slot < count; slot++)
|
||||
infection_delete_weapon(removed[slot]);
|
||||
if (kept != NONE)
|
||||
unit->unit.desired_weapon_index = (short)kept;
|
||||
else if (unit->unit.desired_weapon_index == NONE)
|
||||
unit->unit.desired_weapon_index = unit_inventory_next_weapon(unit_index, NONE, 0);
|
||||
}
|
||||
|
||||
/* the host gives a living player their role's equipment: a zombie its skull
|
||||
alone (out of any vehicle, without grenades or powerups), a human what they
|
||||
spawned with, without a skull */
|
||||
static void infection_equip(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
struct unit_datum *unit;
|
||||
long weapon_index;
|
||||
short inventory_slot;
|
||||
|
||||
if (network_game_distributed_client() || !role || player->quit_out_of_game || player->unit_index == NONE ||
|
||||
infection.missing_skull)
|
||||
{
|
||||
return;
|
||||
}
|
||||
unit = unit_get(player->unit_index);
|
||||
if (TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
if (infection.equipped_unit[slot] == player->unit_index)
|
||||
{
|
||||
if (role->role == _distributed_infection_role_human)
|
||||
{
|
||||
infection_strip_weapons(player->unit_index, NONE, TRUE);
|
||||
return;
|
||||
}
|
||||
/* (a zombie still holding its skull keeps it; any other weapon goes) */
|
||||
for (inventory_slot = 0; inventory_slot < MAXIMUM_WEAPONS_PER_UNIT; inventory_slot++)
|
||||
{
|
||||
weapon_index = unit->unit.weapon_object_indices[inventory_slot];
|
||||
if (infection_weapon_is_skull(weapon_index))
|
||||
{
|
||||
if (infection.skull[slot] != weapon_index)
|
||||
infection_delete_skull(slot);
|
||||
infection.skull[slot] = weapon_index;
|
||||
infection_strip_weapons(player->unit_index, weapon_index, FALSE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
infection.equipping = TRUE;
|
||||
infection_strip_weapons(player->unit_index, NONE, role->role == _distributed_infection_role_human);
|
||||
infection_delete_skull(slot);
|
||||
if (role->role == _distributed_infection_role_zombie)
|
||||
{
|
||||
if (unit->object.parent_object_index != NONE)
|
||||
unit_exit_seat_end(player->unit_index);
|
||||
csmemset(unit->unit.grenade_counts, 0, sizeof(unit->unit.grenade_counts));
|
||||
if (unit->unit.equipment_object_index != NONE)
|
||||
{
|
||||
object_delete(unit->unit.equipment_object_index);
|
||||
unit->unit.equipment_object_index = NONE;
|
||||
}
|
||||
weapon_index = NONE;
|
||||
if (get_ball_definition_index() != NONE)
|
||||
{
|
||||
struct object_placement_data placement;
|
||||
|
||||
object_placement_data_new(&placement, get_ball_definition_index(), NONE);
|
||||
placement.owner_team_index = 1;
|
||||
weapon_index = object_new(&placement);
|
||||
}
|
||||
if (weapon_index == NONE || !unit_add_weapon_to_inventory(player->unit_index, weapon_index, 2))
|
||||
{
|
||||
if (weapon_index != NONE)
|
||||
object_delete(weapon_index);
|
||||
infection.missing_skull = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
infection.skull[slot] = weapon_index;
|
||||
}
|
||||
}
|
||||
infection.equipping = FALSE;
|
||||
infection.equipped_unit[slot] = player->unit_index;
|
||||
infection.killed_unit[slot] = NONE;
|
||||
}
|
||||
|
||||
/* a player new to the round: a human before the zombies are chosen, a
|
||||
zombie after */
|
||||
static void infection_player_added(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct distributed_infection_player *role;
|
||||
|
||||
if (infection.slayer.player_added)
|
||||
infection.slayer.player_added(player_index);
|
||||
if (!VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
return;
|
||||
role = &infection.state.players[slot];
|
||||
if (!network_game_distributed_client())
|
||||
{
|
||||
infection_delete_skull(slot);
|
||||
csmemset(role, 0, sizeof(*role));
|
||||
role->identity = infection_player_identity(player_index);
|
||||
role->role = infection.state.phase >= _distributed_infection_active ? _distributed_infection_role_zombie :
|
||||
_distributed_infection_role_human;
|
||||
infection.participant[slot] = player_index;
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection.killed_unit[slot] = NONE;
|
||||
infection.state.revision++;
|
||||
}
|
||||
infection_reconcile_player(player_index);
|
||||
}
|
||||
|
||||
void infection_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (!VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
return;
|
||||
if (!network_game_distributed_client() && infection.participant[slot] != player_index)
|
||||
infection_player_added(player_index);
|
||||
infection_reconcile_player(player_index);
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection_equip(player_index);
|
||||
}
|
||||
|
||||
static void infection_player_killed_player(
|
||||
long killing_player_index,
|
||||
long killing_object_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
struct distributed_infection_player *dead = infection_player(dead_player_index);
|
||||
struct distributed_infection_player *killer = infection_player(killing_player_index);
|
||||
struct player_datum *player = player_get(dead_player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(dead_player_index);
|
||||
long unit_index = player->unit_index != NONE ? player->unit_index : player->dead_unit_index;
|
||||
|
||||
(void)killing_object_index;
|
||||
if (network_game_distributed_client() || infection.state.phase != _distributed_infection_active || !dead ||
|
||||
player->quit_out_of_game || infection.killed_unit[slot] != NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
infection.killed_unit[slot] = unit_index == NONE ? 0 : unit_index;
|
||||
if (killer && killer != dead && killer->role != dead->role && killer->score < INFECTION_MAXIMUM_SCORE)
|
||||
killer->score++;
|
||||
/* (a human killed by a zombie, themselves or the world turns; one killed
|
||||
by a human teammate does not) */
|
||||
if (dead->role == _distributed_infection_role_human &&
|
||||
!(friendly_fire && killer && killer != dead && killer->role == dead->role))
|
||||
{
|
||||
dead->role = _distributed_infection_role_zombie;
|
||||
platform_log("infection: player %ld infected", slot);
|
||||
}
|
||||
infection_reconcile_player(dead_player_index);
|
||||
/* (the body's skull is deleted on the player's next tick, once the
|
||||
unit's death has dropped what it held) */
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection.state.revision++;
|
||||
}
|
||||
|
||||
/* the round's result: 0 the humans won, 1 the zombies, 2 no one (everyone
|
||||
left), NONE still on. Turning the last human wins over the time running
|
||||
out on the same tick. */
|
||||
static long infection_round_result(
|
||||
long humans,
|
||||
long zombies,
|
||||
long elapsed,
|
||||
long limit)
|
||||
{
|
||||
if (!humans && !zombies)
|
||||
return 2;
|
||||
if (!humans)
|
||||
return 1;
|
||||
if (!zombies || (limit > 0 && elapsed >= limit))
|
||||
return 0;
|
||||
return NONE;
|
||||
}
|
||||
|
||||
static long infection_time_limit_ticks(
|
||||
void)
|
||||
{
|
||||
return game_variant_options_get()->time_limit * 60L * TICKS_PER_SECOND;
|
||||
}
|
||||
|
||||
static void infection_update(
|
||||
void)
|
||||
{
|
||||
struct game_variant_options const *options = game_variant_options_get();
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
boolean present[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long candidates[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long humans = 0;
|
||||
long zombies = 0;
|
||||
long count = 0;
|
||||
long index;
|
||||
long now = game_time_get();
|
||||
|
||||
if (infection.slayer.update)
|
||||
infection.slayer.update();
|
||||
if (network_game_distributed_client() || infection.state.phase == _distributed_infection_finished)
|
||||
return;
|
||||
csmemset(present, 0, sizeof(present));
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = (struct player_datum *)data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(iterator.datum_index);
|
||||
struct unit_datum *unit;
|
||||
|
||||
if (player->quit_out_of_game || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
continue;
|
||||
present[slot] = TRUE;
|
||||
if (infection.participant[slot] != iterator.datum_index)
|
||||
infection_player_added(iterator.datum_index);
|
||||
infection_reconcile_player(iterator.datum_index);
|
||||
if (infection.state.players[slot].role == _distributed_infection_role_human)
|
||||
humans++;
|
||||
else
|
||||
zombies++;
|
||||
/* (the first zombies are chosen of the living: a full map can leave
|
||||
players waiting to spawn) */
|
||||
unit = player->unit_index != NONE ? unit_try_and_get(player->unit_index) : NULL;
|
||||
if (unit && !TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
candidates[count++] = iterator.datum_index;
|
||||
}
|
||||
for (index = 0; index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
{
|
||||
if (!present[index] && infection.participant[index] != NONE)
|
||||
{
|
||||
infection_delete_skull(index);
|
||||
infection.participant[index] = NONE;
|
||||
infection.equipped_unit[index] = NONE;
|
||||
infection.killed_unit[index] = NONE;
|
||||
csmemset(&infection.state.players[index], 0, sizeof(infection.state.players[index]));
|
||||
infection.state.revision++;
|
||||
}
|
||||
}
|
||||
if (infection.missing_skull)
|
||||
{
|
||||
platform_log("infection: no skull to give (the map has no Oddball ball), the round ends");
|
||||
infection_finish(NONE);
|
||||
return;
|
||||
}
|
||||
if (infection.state.phase == _distributed_infection_active)
|
||||
{
|
||||
long result = infection_round_result(humans, zombies, now - infection.state.phase_tick,
|
||||
infection_time_limit_ticks());
|
||||
|
||||
if (result != NONE)
|
||||
{
|
||||
platform_log("infection: result %ld, %ld humans, %ld zombies", result, humans, zombies);
|
||||
infection_finish(result == 2 ? NONE : result);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (count < 2)
|
||||
{
|
||||
if (infection.state.phase != _distributed_infection_waiting)
|
||||
infection.state.revision++;
|
||||
infection.state.phase = _distributed_infection_waiting;
|
||||
infection.state.phase_tick = now;
|
||||
return;
|
||||
}
|
||||
if (infection.state.phase == _distributed_infection_waiting)
|
||||
{
|
||||
infection.state.phase = _distributed_infection_countdown;
|
||||
infection.state.phase_tick = now;
|
||||
infection.state.revision++;
|
||||
platform_log("infection: countdown, %ld players", count);
|
||||
}
|
||||
if (now - infection.state.phase_tick < options->infection_countdown * TICKS_PER_SECOND)
|
||||
return;
|
||||
infection.state.phase = _distributed_infection_active;
|
||||
infection.state.phase_tick = now;
|
||||
/* the first zombies, drawn without repeats, leaving a human */
|
||||
for (index = 0; index < MIN(count - 1, options->infection_initial_zombies); index++)
|
||||
{
|
||||
long pick = index + local_random_range(0, (short)(count - index));
|
||||
long chosen = candidates[pick];
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(chosen);
|
||||
|
||||
candidates[pick] = candidates[index];
|
||||
candidates[index] = chosen;
|
||||
infection.state.players[slot].role = _distributed_infection_role_zombie;
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection_reconcile_player(chosen);
|
||||
infection_equip(chosen);
|
||||
}
|
||||
infection.state.revision++;
|
||||
platform_log("infection: active, %ld players, %ld zombies", count,
|
||||
MIN(count - 1, (long)options->infection_initial_zombies));
|
||||
}
|
||||
|
||||
long infection_remaining_ticks(
|
||||
void)
|
||||
{
|
||||
long limit = infection_time_limit_ticks();
|
||||
|
||||
return infection.state.phase == _distributed_infection_active ?
|
||||
MAX(0, limit - (game_time_get() - infection.state.phase_tick)) : limit;
|
||||
}
|
||||
|
||||
static boolean infection_initialize_for_new_map(
|
||||
void)
|
||||
{
|
||||
struct game_variant *variant = game_engine_get_variant();
|
||||
|
||||
csmemset(&infection.state, 0, sizeof(infection.state));
|
||||
csmemset(infection.participant, 0xFF, sizeof(infection.participant));
|
||||
csmemset(infection.equipped_unit, 0xFF, sizeof(infection.equipped_unit));
|
||||
csmemset(infection.killed_unit, 0xFF, sizeof(infection.killed_unit));
|
||||
csmemset(infection.skull, 0xFF, sizeof(infection.skull));
|
||||
csmemset(infection.shield_unit, 0xFF, sizeof(infection.shield_unit));
|
||||
infection.state.winner = NONE;
|
||||
infection.state.game_number = network_game_get_game() ? network_game_get_number_of_games_played() : 0;
|
||||
infection.missing_skull = get_ball_definition_index() == NONE;
|
||||
infection.equipping = FALSE;
|
||||
/* (everyone respawns; the variant's traits give zombies no infinite
|
||||
grenades nor camouflage) */
|
||||
variant->universal_variant.lives = 0;
|
||||
variant->universal_variant.odd_man_out = FALSE;
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_infinite_grenades_bit, FALSE);
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_always_invisible_bit, FALSE);
|
||||
return infection.slayer.initialize_for_new_map ? infection.slayer.initialize_for_new_map() : TRUE;
|
||||
}
|
||||
|
||||
/* a skull is picked up only as it is given; a zombie picks up nothing else
|
||||
(and readying the skull it holds asks this too) */
|
||||
static boolean infection_allow_pick_up(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
short slot;
|
||||
|
||||
if (infection.equipping)
|
||||
return TRUE;
|
||||
if (infection_weapon_is_skull(weapon_index))
|
||||
{
|
||||
if (infection_unit_is_zombie(unit_index))
|
||||
{
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
if (unit_get(unit_index)->unit.weapon_object_indices[slot] == weapon_index)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return !infection_unit_is_zombie(unit_index);
|
||||
}
|
||||
|
||||
static boolean infection_picking_up(
|
||||
long weapon_index,
|
||||
long player_index)
|
||||
{
|
||||
(void)weapon_index;
|
||||
(void)player_index;
|
||||
return infection.equipping;
|
||||
}
|
||||
|
||||
/* a skull dropped (its zombie killed, or forced out of a hand): given again
|
||||
on the next tick, if its zombie lives */
|
||||
static void infection_weapon_dropped(
|
||||
long weapon_index)
|
||||
{
|
||||
long slot;
|
||||
|
||||
if (network_game_distributed_client() || infection.equipping)
|
||||
return;
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.skull[slot] == weapon_index)
|
||||
{
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void infection_player_update_each_tick(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
|
||||
infection_reconcile_player(player_index);
|
||||
if (network_game_distributed_client())
|
||||
return;
|
||||
/* (a dead zombie's skull deleted once its unit's death has dropped it) */
|
||||
if (player->quit_out_of_game || player->unit_index == NONE ||
|
||||
TEST_FLAG(unit_get(player->unit_index)->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
infection_delete_skull(DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index));
|
||||
}
|
||||
else
|
||||
{
|
||||
infection_equip(player_index);
|
||||
}
|
||||
}
|
||||
|
||||
static long infection_get_player_score(
|
||||
long player_index,
|
||||
enum get_score_type score_type)
|
||||
{
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
long slot;
|
||||
long score = 0;
|
||||
|
||||
if (!role)
|
||||
return 0;
|
||||
if (score_type != _get_score_team)
|
||||
return role->score;
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.state.players[slot].role == role->role)
|
||||
score += infection.state.players[slot].score;
|
||||
}
|
||||
return score;
|
||||
}
|
||||
|
||||
static wchar_t *infection_format_player_score(
|
||||
long player_index,
|
||||
wchar_t *text)
|
||||
{
|
||||
usprintf(text, L"%ld", infection_get_player_score(player_index, _get_score_individual));
|
||||
return text;
|
||||
}
|
||||
|
||||
/* (a team's score, whatever its name says) */
|
||||
static wchar_t *infection_format_team_score(
|
||||
long team_index,
|
||||
wchar_t *text)
|
||||
{
|
||||
usprintf(text, L"%ld", game_engine_get_team_score(team_index));
|
||||
return text;
|
||||
}
|
||||
|
||||
static long infection_did_player_win(
|
||||
long player_index)
|
||||
{
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
|
||||
if (infection.state.winner == NONE || !role)
|
||||
return NONE;
|
||||
return (role->role == _distributed_infection_role_zombie ? 1 : 0) == infection.state.winner;
|
||||
}
|
||||
|
||||
struct game_engine *infection_engine_get(
|
||||
struct game_engine const *slayer)
|
||||
{
|
||||
infection.slayer = *slayer;
|
||||
infection.engine = *slayer;
|
||||
infection.engine.initialize_for_new_map = infection_initialize_for_new_map;
|
||||
infection.engine.player_added = infection_player_added;
|
||||
infection.engine.player_update_each_tick = infection_player_update_each_tick;
|
||||
infection.engine.prespawn_player_update = infection_reconcile_player;
|
||||
infection.engine.update = infection_update;
|
||||
infection.engine.allow_pick_up = infection_allow_pick_up;
|
||||
infection.engine.picking_up = infection_picking_up;
|
||||
infection.engine.weapon_dropped = infection_weapon_dropped;
|
||||
infection.engine.player_killed_player = infection_player_killed_player;
|
||||
infection.engine.get_player_score = infection_get_player_score;
|
||||
infection.engine.format_player_score = infection_format_player_score;
|
||||
infection.engine.format_team_name = infection_format_team_score;
|
||||
infection.engine.format_message = NULL;
|
||||
infection.engine.did_player_win = infection_did_player_win;
|
||||
return &infection.engine;
|
||||
}
|
||||
|
||||
/* ---- the state the host sends */
|
||||
|
||||
/* a state a client may take: of this game, no older than its own, every
|
||||
value in range */
|
||||
static boolean infection_state_valid(
|
||||
struct distributed_infection_state const *state,
|
||||
long game_number,
|
||||
long revision)
|
||||
{
|
||||
short index;
|
||||
|
||||
if (state->game_number != game_number || state->revision < revision || state->revision < 0 ||
|
||||
state->phase < _distributed_infection_waiting || state->phase > _distributed_infection_finished ||
|
||||
state->phase_tick < 0 || state->winner < NONE || state->winner > 1 ||
|
||||
(state->phase != _distributed_infection_finished && state->winner != NONE))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
for (index = 0; index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
{
|
||||
struct distributed_infection_player const *player = &state->players[index];
|
||||
|
||||
if (player->role > _distributed_infection_role_zombie || player->score < 0 ||
|
||||
player->score > INFECTION_MAXIMUM_SCORE || (player->role && !player->identity) ||
|
||||
player->reserved[0] || player->reserved[1] || player->reserved[2])
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
long infection_write_network_state(
|
||||
byte *buffer,
|
||||
long size)
|
||||
{
|
||||
if (size < (long)sizeof(infection.state))
|
||||
return 0;
|
||||
csmemcpy(buffer, &infection.state, sizeof(infection.state));
|
||||
return sizeof(infection.state);
|
||||
}
|
||||
|
||||
boolean infection_read_network_state(
|
||||
byte const *buffer,
|
||||
long size,
|
||||
boolean first)
|
||||
{
|
||||
struct distributed_infection_state state;
|
||||
struct data_iterator iterator;
|
||||
|
||||
if (!network_game_distributed_client() || size != (long)sizeof(state))
|
||||
return FALSE;
|
||||
csmemcpy(&state, buffer, sizeof(state));
|
||||
if (!infection_state_valid(&state, network_game_get_number_of_games_played(), first ? 0 : infection.state.revision))
|
||||
return FALSE;
|
||||
infection.state = state;
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while (data_iterator_next(&iterator))
|
||||
infection_reconcile_player(iterator.datum_index);
|
||||
return TRUE;
|
||||
}
|
||||
Loaded 100 of 306 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user