[PR #589] [MERGED] Online mode: players named in commands are their accounts #2658

Closed
opened 2026-11-02 15:58:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/589
Author: @ludovic111
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: feat/server-online-profiles


📝 Commits (2)

  • ae22d5d Online mode: players named in commands are their accounts
  • 09c039c Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

11 files changed (+282 additions, -53 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+72 -28)
📝 crates/horizon-client/src/game/lan.rs (+1 -0)
📝 crates/horizon-server-files/Cargo.toml (+3 -1)
📝 crates/horizon-server-files/src/lib.rs (+5 -3)
➕ crates/horizon-server-files/src/profiles.rs (+100 -0)
📝 crates/horizon-server/src/config.rs (+1 -1)
📝 crates/horizon-server/src/init.rs (+25 -11)
📝 crates/horizon-server/src/lists.rs (+23 -4)
📝 crates/horizon-server/src/main.rs (+2 -1)
📝 tools/test_online_mode_parity.py (+49 -4)

📄 Description

Stacked on #587. An online-mode server knows players by their account's UUID. Before this PR, op, whitelist add, ban and pardon stored the offline UUID for any player who wasn't connected, so a player whitelisted that way couldn't join.

Server (horizon-client --dedicated)
A name now resolves the way vanilla's CachedUserNameToIdResolver resolves it:

  • a player on the server;
  • otherwise a player seen since the start. This cache is in memory only; vanilla also writes usercache.json;
  • otherwise the services' profiles/getByName endpoint, found through the discovery document. The name is sent in lower case, as vanilla sends it.

A name with no account replies "That player does not exist" and logs vanilla's warning Couldn't find profile with name: …. Offline servers keep the offline profiles. kick now only looks for players on the server.

horizon-server while the server is stopped

  • op, whitelist add and the players init adds go through the same lookup (horizon-server-files::profiles).
  • deop and whitelist remove take the entry already on the list, so they need no lookup.
  • New init --offline / HORIZON_ONLINE=false to turn online mode off.
  • init's note now only warns about offline servers.
  • The server.toml comment no longer says online mode is unsupported.

Harness
A sixth login, run on vanilla's server and on Horizon's:

  • whitelist add tester for the player who joined earlier needs no lookup, and the player gets in;
  • whitelist add Nobody is looked up through the mock, refused, and logged.

Result: 43 checks ok. The mock serves getByName at the same path as Mojang's discovery document.

Checks
fmt, workspace clippy and workspace tests pass. The online_mode harness passes. The other four server harnesses pass on the merged branches.

🤖 Generated with Claude Code


🔄 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/589 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/server-online-profiles` --- ### 📝 Commits (2) - [`ae22d5d`](https://github.com/horizon-rust/horizon/commit/ae22d5dd960c930f0fefc42b337d9c066e4af1be) Online mode: players named in commands are their accounts - [`09c039c`](https://github.com/horizon-rust/horizon/commit/09c039c423296d40cd2531d504f11775dee51935) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **11 files changed** (+282 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+72 -28) 📝 `crates/horizon-client/src/game/lan.rs` (+1 -0) 📝 `crates/horizon-server-files/Cargo.toml` (+3 -1) 📝 `crates/horizon-server-files/src/lib.rs` (+5 -3) ➕ `crates/horizon-server-files/src/profiles.rs` (+100 -0) 📝 `crates/horizon-server/src/config.rs` (+1 -1) 📝 `crates/horizon-server/src/init.rs` (+25 -11) 📝 `crates/horizon-server/src/lists.rs` (+23 -4) 📝 `crates/horizon-server/src/main.rs` (+2 -1) 📝 `tools/test_online_mode_parity.py` (+49 -4) </details> ### 📄 Description Stacked on #587. An online-mode server knows players by their account's UUID. Before this PR, `op`, `whitelist add`, `ban` and `pardon` stored the offline UUID for any player who wasn't connected, so a player whitelisted that way couldn't join. **Server (`horizon-client --dedicated`)** A name now resolves the way vanilla's `CachedUserNameToIdResolver` resolves it: - a player on the server; - otherwise a player seen since the start. This cache is in memory only; vanilla also writes `usercache.json`; - otherwise the services' `profiles/getByName` endpoint, found through the discovery document. The name is sent in lower case, as vanilla sends it. A name with no account replies "That player does not exist" and logs vanilla's warning `Couldn't find profile with name: …`. Offline servers keep the offline profiles. `kick` now only looks for players on the server. **horizon-server while the server is stopped** - `op`, `whitelist add` and the players `init` adds go through the same lookup (`horizon-server-files::profiles`). - `deop` and `whitelist remove` take the entry already on the list, so they need no lookup. - New `init --offline` / `HORIZON_ONLINE=false` to turn online mode off. - init's note now only warns about offline servers. - The `server.toml` comment no longer says online mode is unsupported. **Harness** A sixth login, run on vanilla's server and on Horizon's: - `whitelist add tester` for the player who joined earlier needs no lookup, and the player gets in; - `whitelist add Nobody` is looked up through the mock, refused, and logged. Result: 43 checks ok. The mock serves `getByName` at the same path as Mojang's discovery document. **Checks** fmt, workspace clippy and workspace tests pass. The online_mode harness passes. The other four server harnesses pass on the merged branches. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:00 +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#2658
No description provided.