Serverside helper that periodically POSTs the active server state to a remote HTTPS endpoint by reading a simple JSON config. The request body matches the required schema and always includes a bearer token for authentication.
- Java 25 codebase (recommended: Eclipse Temurin 25) with Maven build.
- JSON-driven configuration (
config/statistics.json). - Scheduled HTTPS POST every 5 minutes (configurable, never stops when a call fails).
- Graceful logging whenever the endpoint cannot be reached.
- Pluggable
ServerMetricsProviderso you can wire real Hytale server data without touching the HTTP layer.
- Install dependencies – Java 25 is required (recommended: Eclipse Temurin 25). Use the included Maven wrapper (
./mvnw/mvnw.cmd) so you don't need Maven installed globally.- Make sure
java -versionshows Java 25 (or setJAVA_HOMEto your Temurin 25 installation).
- Make sure
- Konfigurieren – kopiere
config/statistics.jsonund trage deine Basis-API-URL ein (z.B.https://api.hytl.de/api/v1/), deinen Token (ohneBearer) und deinevanityUrl. POST geht anendpoint + "server-api/telemetry", Ping anendpoint + "ping". Timeouts und Intervall sind hardcoded. - Provide metrics – implement
HytaleServerAdapter(or a customServerMetricsProvider) so the reporter knows how to read live player counts, slot limits, version, and enabled plugins from your server runtime. - Bootstrap the plugin – instantiate
StatisticsPluginwith the config path and your adapter, then callstart()during server startup. Remember toclose()it when the server stops.
After cloning, you can build the project via:
./mvnw -B test
./mvnw -B package
| Key | Description |
|---|---|
endpoint |
Basis-API-URL (z.B. https://api.hytl.de/api/v1/). Telemetry: endpoint + "server-api/telemetry", Ping: endpoint + "ping". |
bearerToken |
Token (ohne Bearer ). Den Token bekommst du hier: https://hytalecommunity.de/serverliste/meineserver/ |
vanityUrl |
Teil nach /server/ (Beispiel: https://hytalecommunity.de/server/<vanityUrl>). Erlaubt: a-z0-9, Länge 3–32. Wird trim().toLowerCase() gesendet. |
./mvnw -B clean test
Artifacts are generated under target/ (JAR + sources JAR).
The produced JAR has a Main-Class and can be started directly:
java -jar target/hytalede-statistics-plugin-1.0.0.jar config/statistics.local.json
./mvnw -q exec:java@server -Dexec.args="config/statistics.local.json"
{
"vanityUrl": "myserver123",
"version": "1.0.0",
"playersOnline": 0,
"maxPlayers": 0,
"latencyMs": 0
}Optional (enabled via config):
sendPlayerList: sends"players": [{"uuid": "...", "name": "...", "joined": "2026-01-19T13:45:00Z"}]sendPluginList: sends"plugins": [{"name": "ExamplePlugin", "version": "1.2.3"}]
The scheduler always keeps running even if previous attempts fail; failures only log a warning when the API host cannot be reached.