[PR #7003] [MERGED] Native mods: hide a player from lower-permission players (native_hide_player) #7263

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7003
Author: @rdbtCVS
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: native/hide-player


📝 Commits (1)

  • eacdc5b Native mods: hide a player from lower-permission players (native_hide_player)

📊 Changes

11 files changed (+234 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_entities.rs (+1 -0)
📝 crates/horizon-client/src/game/mod_api_host_generated.rs (+3 -0)
📝 crates/horizon-client/src/game/native_server.rs (+20 -0)
📝 crates/horizon-client/src/lan/entity.rs (+57 -5)
📝 crates/horizon-client/src/lan/guest.rs (+4 -0)
📝 crates/horizon-client/src/lan/hub.rs (+124 -18)
📝 crates/horizon-client/src/mod_api/generated.rs (+3 -4)
📝 crates/horizon-client/src/mod_api/generated_host.rs (+11 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)
➕ tools/native-hook-fragments/hide_player.json (+9 -0)

📄 Description

🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally.

Closes #6996.

A Host helper that lets a native mod hide a player from other players, for a /vanish (the SMP mod in horizon-rust/horizon-mods uses it). native_hide_player(uuid, Some(level)) hides the player from everyone below permission level; None shows them again.

From the next tick, a player below the level:

  • Tab list: loses the hidden player (PlayerInfoRemove), and gets them back when the player is shown again, or when the viewer is made an operator.
  • World: no longer tracks the hidden player in any game mode. broadcast_to_player now also checks the viewer's permission against Probe.hidden, and pairs are rechecked when it changes, the same way a spectator is dropped.
  • Join and leave: doesn't get the hidden player's join message, Tab entry or leave message.

Players at or above the level see everything as before. The setting is kept by UUID, so a player who joins already hidden comes in hidden. It lasts until the mod changes it or the server stops. The helper works inside a player's hook. It returns false on a client and in a world that isn't open to others.

Helper-only fragment: tools/native-hook-fragments/hide_player.json. cargo run -p xtask -- mod-api also regenerated a doc paragraph of projectile_impact in mod_api/generated.rs, which was stale on main (its source doc had changed without a regeneration).

Test: lan::entity::tests::a_hidden_player_is_tracked_only_from_its_level_up.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 26b9c0c9b, 3 min 38 s)

Check Result
Scope ✅ 11 files, +234 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 611 passed (47 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 13 s)
tests: horizon-client, horizon-client-lib ✅ 2057 passed (59 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
mod API up to date ✅ (21 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

🤖 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/7003 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native/hide-player` --- ### 📝 Commits (1) - [`eacdc5b`](https://github.com/horizon-rust/horizon/commit/eacdc5b51924e98b1ba0e3b769c8e572826eeff8) Native mods: hide a player from lower-permission players (native_hide_player) ### 📊 Changes **11 files changed** (+234 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+1 -0) 📝 `crates/horizon-client/src/game/mod_api_host_generated.rs` (+3 -0) 📝 `crates/horizon-client/src/game/native_server.rs` (+20 -0) 📝 `crates/horizon-client/src/lan/entity.rs` (+57 -5) 📝 `crates/horizon-client/src/lan/guest.rs` (+4 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+124 -18) 📝 `crates/horizon-client/src/mod_api/generated.rs` (+3 -4) 📝 `crates/horizon-client/src/mod_api/generated_host.rs` (+11 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) ➕ `tools/native-hook-fragments/hide_player.json` (+9 -0) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. Closes #6996. A Host helper that lets a native mod hide a player from other players, for a `/vanish` (the SMP mod in horizon-rust/horizon-mods uses it). `native_hide_player(uuid, Some(level))` hides the player from everyone below permission `level`; `None` shows them again. From the next tick, a player below the level: - **Tab list**: loses the hidden player (`PlayerInfoRemove`), and gets them back when the player is shown again, or when the viewer is made an operator. - **World**: no longer tracks the hidden player in any game mode. `broadcast_to_player` now also checks the viewer's permission against `Probe.hidden`, and pairs are rechecked when it changes, the same way a spectator is dropped. - **Join and leave**: doesn't get the hidden player's join message, Tab entry or leave message. Players at or above the level see everything as before. The setting is kept by UUID, so a player who joins already hidden comes in hidden. It lasts until the mod changes it or the server stops. The helper works inside a player's hook. It returns false on a client and in a world that isn't open to others. Helper-only fragment: `tools/native-hook-fragments/hide_player.json`. `cargo run -p xtask -- mod-api` also regenerated a doc paragraph of `projectile_impact` in `mod_api/generated.rs`, which was stale on main (its source doc had changed without a regeneration). Test: `lan::entity::tests::a_hidden_player_is_tracked_only_from_its_level_up`. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 26b9c0c9b, 3 min 38 s) | Check | Result | | --- | --- | | Scope | ✅ 11 files, +234 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 611 passed (47 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 13 s) | | tests: horizon-client, horizon-client-lib | ✅ 2057 passed (59 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (21 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | 🤖 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-03 06:36:40 +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#7263
No description provided.