[PR #5154] [CLOSED] horizon-server players: who is online, from the command line #6102

Closed
opened 2026-11-03 06:11:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5154
Author: @Akirabane
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: feat/server-players-endpoint


📝 Commits (2)

  • b2b6ef5 Control API: GET /api/v1/players and horizon-server players
  • 36290e0 Merge origin/main into feat/server-players-endpoint

📊 Changes

5 files changed (+75 additions, -1 deletions)

View changed files

📝 crates/horizon-server/src/cli.rs (+68 -0)
📝 crates/horizon-server/src/main.rs (+3 -0)
📝 docs/api/server-reference.md (+2 -0)
📝 docs/api/server.md (+1 -1)
📝 docs/hosting.md (+1 -0)

📄 Description

🤖 Opened by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review.

What and why

A step of #5147 (the admin API of horizon-server): horizon-server players [--json], who is online, from the command line.

This pull request first also added GET /api/v1/players. #5163 landed the same route with more in it (online with op levels, vanilla's lists), so this branch now takes api.rs and the API docs from main as they are and keeps only what main doesn't have: the command. It reads that endpoint.

  • horizon-server players prints "2 of 20 players:" and a line each with the name, ping, address and uuid; with nobody online it prints "0 of 20 players".
  • --json prints the endpoint's whole answer, as status --json does for status.
  • With the server stopped it says so and exits with 1. With the supervisor up but the game down (the endpoint then answers with a null max_players) it says "The game isn't running: nobody is online".

The command is in the help, in docs/hosting.md and docs/api/server.md (23 commands), and the generated reference is regenerated. Nothing changes in the game or in the API.

Part of #5147 (not Fixes: the issue is a plan with several steps).

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only: vanilla has no such command.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on DESKTOP-6PU1HU6, against origin/main at 68ac6f647, 1 min 48 s)

Check Result
Scope ✅ 5 files, +75 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 495 run, FAILED (errors=1, skipped=12) (48 s)
rustfmt ✅ (7 s)
clippy ✅ (40 s)
tests: horizon-server ❌ 55 passed, 1 failed (10 s)
doc tests ➖ no library touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

How it was checked beyond pr_ready: unit tests for the command's text (nobody online, two players, game down), and runs on a real server on my machine: stopped ("no server is running", exit 1), started with nobody online ("0 of 20 players" and the endpoint's JSON), then a clean stop with no engine left over. With a client connected, players listed it with its name, ping (44 ms), address and uuid, and players --json had the same entry in online with its op level. The server's log shows the join.

service::tests::units_run_the_supervisor is not from this change: it expects Unix paths and fails on Windows on an untouched tree; #5168 fixes it. The Python tests also fail on my machine for a local reason (a package named tests in my global site-packages shadows the repository's tests/ folder); they pass on CI.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5154 **Author:** [@Akirabane](https://github.com/Akirabane) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/server-players-endpoint` --- ### 📝 Commits (2) - [`b2b6ef5`](https://github.com/horizon-rust/horizon/commit/b2b6ef5c93c57632061178639f3a4a5c9883ae22) Control API: GET /api/v1/players and `horizon-server players` - [`36290e0`](https://github.com/horizon-rust/horizon/commit/36290e065a0b873ca7d86f9aa9d2d217a842d329) Merge origin/main into feat/server-players-endpoint ### 📊 Changes **5 files changed** (+75 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server/src/cli.rs` (+68 -0) 📝 `crates/horizon-server/src/main.rs` (+3 -0) 📝 `docs/api/server-reference.md` (+2 -0) 📝 `docs/api/server.md` (+1 -1) 📝 `docs/hosting.md` (+1 -0) </details> ### 📄 Description > 🤖 Opened by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review. ## What and why A step of #5147 (the admin API of `horizon-server`): `horizon-server players [--json]`, who is online, from the command line. This pull request first also added `GET /api/v1/players`. #5163 landed the same route with more in it (`online` with op levels, vanilla's lists), so this branch now takes `api.rs` and the API docs from main as they are and keeps only what main doesn't have: the command. It reads that endpoint. - `horizon-server players` prints "2 of 20 players:" and a line each with the name, ping, address and uuid; with nobody online it prints "0 of 20 players". - `--json` prints the endpoint's whole answer, as `status --json` does for `status`. - With the server stopped it says so and exits with 1. With the supervisor up but the game down (the endpoint then answers with a null `max_players`) it says "The game isn't running: nobody is online". The command is in the help, in `docs/hosting.md` and `docs/api/server.md` (23 commands), and the generated reference is regenerated. Nothing changes in the game or in the API. Part of #5147 (not `Fixes`: the issue is a plan with several steps). ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only: vanilla has no such command. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-6PU1HU6, against origin/main at 68ac6f647, 1 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +75 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 495 run, FAILED (errors=1, skipped=12) (48 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (40 s) | | tests: horizon-server | ❌ 55 passed, 1 failed (10 s) | | doc tests | ➖ no library touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | How it was checked beyond `pr_ready`: unit tests for the command's text (nobody online, two players, game down), and runs on a real server on my machine: stopped ("no server is running", exit 1), started with nobody online ("0 of 20 players" and the endpoint's JSON), then a clean stop with no engine left over. With a client connected, `players` listed it with its name, ping (44 ms), address and uuid, and `players --json` had the same entry in `online` with its op level. The server's log shows the join. `service::tests::units_run_the_supervisor` is not from this change: it expects Unix paths and fails on Windows on an untouched tree; #5168 fixes it. The Python tests also fail on my machine for a local reason (a package named `tests` in my global `site-packages` shadows the repository's `tests/` folder); they pass on CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:11:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6102
No description provided.