80 lines
3 KiB
Markdown
80 lines
3 KiB
Markdown
# NETfishing Dedicated Server
|
|
|
|
This repository packages the headless NETfishing server produced by the main
|
|
game project. Gameplay and networking code remain in the `netfishing`
|
|
repository so clients and servers use the same protocol implementation.
|
|
|
|
## Stage a build
|
|
|
|
Export the `Linux Dedicated Server` preset from the game project, then stage
|
|
its executable and PCK:
|
|
|
|
```sh
|
|
./scripts/stage-build.sh ../netfishing/builds/vX.Y.Z-alpha/server-linux-x86_64
|
|
```
|
|
|
|
The staged binaries under `dist/` are release inputs and are intentionally not
|
|
tracked by Git.
|
|
|
|
Create a deterministic native archive after staging:
|
|
|
|
```sh
|
|
./scripts/package-native.sh X.Y.Z-alpha
|
|
```
|
|
|
|
## Run natively
|
|
|
|
Copy `dist/NETfishingServer.x86_64` and `dist/NETfishingServer.pck` into the
|
|
same directory, make the executable runnable, and start it with a persistent
|
|
data directory:
|
|
|
|
```sh
|
|
./NETfishingServer.x86_64 \
|
|
-- \
|
|
--config=/etc/netfishing-server.cfg \
|
|
--data-dir=/var/lib/netfishing-server
|
|
```
|
|
|
|
Copy `config/server.cfg.example` to `/etc/netfishing-server.cfg` and adjust the
|
|
room name, UDP port, player limit, and public-listing preference. Forward the
|
|
configured UDP port through the host firewall and router when accepting
|
|
Internet players.
|
|
|
|
The data directory contains the server identity and moderation state. Keep it
|
|
persistent and back it up; replacing it changes the server fingerprint shown
|
|
to returning players.
|
|
|
|
Configuration is applied in this order: config file, environment variables,
|
|
then command-line overrides. Supported command-line options are `--name`,
|
|
`--bind`, `--port`, `--max-players`, `--data-dir`, `--discovery-url`,
|
|
`--public`, and `--private`. Value options use `--option=value`. Keep the first
|
|
standalone `--` shown above; it separates Godot engine flags from server flags.
|
|
|
|
Public listing requires the discovery URL and a publicly reachable ENet UDP
|
|
port. Discovery makes a server findable but does not relay gameplay traffic.
|
|
|
|
For a systemd installation, create a dedicated `netfishing` system user, place
|
|
the two staged build files in `/opt/netfishing-server`, install the sample
|
|
configuration and environment files under `/etc`, and copy
|
|
`systemd/netfishing-server.service` to the system unit directory. The service
|
|
expects `/var/lib/netfishing-server` to be writable by that user.
|
|
|
|
## Run with Docker Compose
|
|
|
|
```sh
|
|
./scripts/stage-build.sh ../netfishing/builds/vX.Y.Z-alpha/server-linux-x86_64
|
|
docker compose build
|
|
docker compose up -d
|
|
```
|
|
|
|
Set values such as `NETFISHING_SERVER_NAME`, `NETFISHING_SERVER_PORT`,
|
|
`NETFISHING_SERVER_MAX_PLAYERS`, and `NETFISHING_SERVER_PUBLIC` in a local
|
|
`.env` file. The Compose service runs without Linux capabilities, uses a
|
|
read-only root filesystem, and stores persistent state in a named volume.
|
|
|
|
## Steam distribution
|
|
|
|
Publish the server as a separate Steam Tool AppID/depot linked to the base
|
|
game. Replace the placeholders in copies of the files under `steam/`, then use
|
|
SteamCMD to upload the staged `dist/` directory. Keep the example files free of
|
|
private Steam credentials.
|