From 5c846cd8ba38278d3bb27e58e53d8d5cba9f5421 Mon Sep 17 00:00:00 2001 From: Juan Date: Sat, 3 Oct 2026 16:57:40 -0300 Subject: [PATCH] Linux server docs: preset, README-linux, systemd unit --- CMakePresets.json | 13 ++++++ Server/README-linux.md | 80 ++++++++++++++++++++++++++++++++++ contrib/reskate-server.service | 19 ++++++++ 3 files changed, 112 insertions(+) create mode 100644 Server/README-linux.md create mode 100644 contrib/reskate-server.service diff --git a/CMakePresets.json b/CMakePresets.json index fa4b9b9..66b667f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -11,6 +11,15 @@ "VCLibPackagePath": "${sourceDir}/build/no-vcpkg/vcpkg.user" }, "toolset": "v143" + }, + { + "name": "linux-x64", + "displayName": "Linux x64 (dedicated server only)", + "generator": "Unix Makefiles", + "binaryDir": "${sourceDir}/build/linux", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } } ], "buildPresets": [ @@ -18,6 +27,10 @@ "name": "release", "configurePreset": "vs2022-x64", "configuration": "Release" + }, + { + "name": "linux-release", + "configurePreset": "linux-x64" } ] } diff --git a/Server/README-linux.md b/Server/README-linux.md new file mode 100644 index 0000000..98a4c7c --- /dev/null +++ b/Server/README-linux.md @@ -0,0 +1,80 @@ +# ReSkate dedicated server on Linux + +Native x86_64 build. Same lobby protocol as `ReSkateServer.exe`; needs no game install. +Self-update is disabled on Linux (V1) — update by replacing the binary. + +## Requirements + +- 64-bit Linux (tested: CachyOS/Arch, Ubuntu 22.04+ should work). +- `cmake >= 3.24`, `g++ >= 12` (C++20), `libssl-dev` (OpenSSL), `libcurl` headers optional (not needed for V1). +- Steamworks SDK redist beside the binary: `libsteam_api.so` + `steamclient.so` + (Valve proprietary, not in this repo). Anonymous game-server login, same as Windows. + +Arch/CachyOS: + +```sh +sudo pacman -S base-devel cmake openssl +``` + +Ubuntu/Debian: + +```sh +sudo apt install build-essential cmake libssl-dev +``` + +## Build + +```sh +cmake --preset linux-x64 +cmake --build --preset linux-release -j$(nproc) +./build/linux/ReSkateServer +``` + +Binary: `build/linux/ReSkateServer` (ELF, `OUTPUT_NAME ReSkateServer`). + +Portable tests: + +```sh +cmake --preset linux-x64 -DDINGOSDK_BUILD_MULTIPLAYER_TESTS=ON +cmake --build --preset linux-release -j$(nproc) +ctest --test-dir build/linux --output-on-failure +``` + +Expected: 8 passed (`multiplayer_parties`, `server_activity`, `server_speed_check`, +`server_config`, `word_filter`, `multiplayer_bandwidth`, `multiplayer_lanes`, +`multiplayer_prediction`). Windows-only tests (voice, lobbies, UI) stay `WIN32`-gated. + +## Run + +1. Put `ReSkateServer` in its own folder with `libsteam_api.so`, `steamclient.so`. +2. First run writes `ReSkateServer.json`; edit `name` + `admins`, restart. +3. Optional: `world-layers.json` (export on Windows via + `ReSkateServer.exe --export-world-layers "" world-layers.json`), + `Mods//reskate-levels.json` for custom maps. +4. No ports need opening (Steam relay). Optional UDP `27015-27016` (`port`, + `query_port`) for browser ping + faster joins. + +Without `libsteam_api.so` the server exits 1 with: +`Cannot load .../libsteam_api.so. Put libsteam_api.so (Steamworks SDK) next to the server.` + +Full command list: `Server/README.txt` (same on Linux; binary name differs). + +## systemd + +See `contrib/reskate-server.service`. Install: + +```sh +sudo cp contrib/reskate-server.service /etc/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl enable --now reskate-server +``` + +## Notes / limits (V1) + +- `auto_update` / `update` command: `updates_enabled()==false` on Linux. + `check_for_update` reports “self-update is not supported on Linux”. +- `--export-world-layers` needs Windows game + Oodle (`oo2core_9_win64.dll`); + on Linux Oodle blocks throw. Export on Windows, copy the JSON over. +- `content_cache` dir: `%LOCALAPPDATA%` on Windows, `$XDG_CACHE_HOME`/`~/.cache` on Linux. +- Crypto interop verified: OpenSSL `PKCS5_PBKDF2_HMAC(SHA256, 100k)` + + `HMAC-SHA256` matches Windows `BCrypt` (checked against Python `hashlib`). diff --git a/contrib/reskate-server.service b/contrib/reskate-server.service new file mode 100644 index 0000000..744919b --- /dev/null +++ b/contrib/reskate-server.service @@ -0,0 +1,19 @@ +[Unit] +Description=ReSkate dedicated server +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=reskate +WorkingDirectory=/opt/reskate-server +ExecStart=/opt/reskate-server/ReSkateServer +Restart=always +RestartSec=5 +# Server uses restart_for_update internally; V1 Linux has self-update off, +# so any non-zero exit still restarts here. +StandardOutput=append:/opt/reskate-server/ReSkateServer.log +StandardError=inherit + +[Install] +WantedBy=multi-user.target