e8832190d1
The supervisor serves a small HTTP API on 127.0.0.1 (a token in .horizon/api.json, mode 0600, and a Host check): status, logs, console commands, stop and restart. `start` runs the server in the background and returns once the game is up; `restart` and `cmd` wait for it too. A sampler reads the game's tick rate, tick times, players and chunks every second over the existing control endpoint (`--control-socket`), and RAM and CPU from the system. The dedicated loop now records its tick times in the game clock, so `/tick query` reports real numbers on a dedicated server, as it does in single player. The changes to game/dedicated.rs are additive: the log capture for command replies, the tick counter and the control requests (game/dedicated/status.rs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
940 B
TOML
28 lines
940 B
TOML
[package]
|
|
name = "horizon-server"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version = "1.90"
|
|
description = "Host a Horizon server: server.toml, the CLI and the supervisor that runs the game headless (docs/server.md)"
|
|
|
|
[dependencies]
|
|
horizon-server-files = { path = "../horizon-server-files" }
|
|
# The game process's RAM and CPU (the same probes the benchmark reports use).
|
|
horizon-bench = { path = "../horizon-bench" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "1.1"
|
|
# Edits server.toml in place, keeping the owner's comments and order.
|
|
toml_edit = "0.25"
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
# SIGINT/SIGTERM/SIGHUP: stop the game cleanly when the terminal or the service manager asks.
|
|
libc = "0.2"
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Console", "Win32_System_Threading"] }
|
|
|
|
[lints]
|
|
workspace = true
|