[PR #102] [MERGED] SMP 0.11.0: first-join welcome, daily reward, AFK out of the sleep count, a command rate limit #109

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mods/pull/102
Author: @ludovic111
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-presence


📝 Commits (10+)

  • b9bd159 SMP: places (spawn, homes, warps, /tpa) and /rules
  • 26079e7 SMP places: hook points API 16, and the proof waits for each answer
  • 0eb6ca7 SMP places: hook points API 18 (main took 16 and 17)
  • 1ec378a SMP places: hook points API 21 (main's mod screens took 18 to 20)
  • 63f2fa9 SMP places: pinned to horizon main with #4610 (API 21)
  • ec056f9 SMP: land claims (/claim, /trust) on the block hooks
  • 803907a SMP: keep water, fire, pistons, explosions, buckets and blows out of claims (hooks 22)
  • b0e3d98 SMP claims: pinned to horizon#4739's head (API 22)
  • aaf6cce SMP claims: pinned to horizon main with #4739 (API 22)
  • 4364dbf Merge remote-tracking branch 'origin/main' into feat/smp-places

📊 Changes

20 files changed (+3374 additions, -44 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+63 -6)
📝 native/smp/compatibility.json (+2 -2)
➕ native/smp/mixins/smp/attack_entity.rs (+10 -0)
➕ native/smp/mixins/smp/block_spread.rs (+14 -0)
➕ native/smp/mixins/smp/destroy_block.rs (+4 -0)
➕ native/smp/mixins/smp/explosion_detonate.rs (+8 -0)
➕ native/smp/mixins/smp/fill_bucket.rs (+4 -0)
📝 native/smp/mixins/smp/glue.rs (+466 -12)
📝 native/smp/mixins/smp/horizon-mixin.toml (+109 -3)
➕ native/smp/mixins/smp/piston_move.rs (+24 -0)
➕ native/smp/mixins/smp/right_click_block.rs (+4 -0)
➕ native/smp/mixins/smp/smp_board.rs (+439 -0)
➕ native/smp/mixins/smp/smp_claims.rs (+688 -0)
📝 native/smp/mixins/smp/smp_economy.rs (+41 -7)
➕ native/smp/mixins/smp/smp_places.rs (+784 -0)
➕ native/smp/mixins/smp/smp_presence.rs (+382 -0)
📝 native/smp/proof.py (+322 -12)
📝 native/smp/src/lib.rs (+8 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on the polish PR (#101), on #97, on #72. Uses horizon-rust/horizon#5268's native_sleep_ignored and
players' yaw/pitch.

What

SMP 0.11.0, a new presence module, looked at once a second (never per tick), all in config.json's presence:

  • First join: everyone hears "{player} joined for the first time: welcome!" (first_join, empty for none);
    the newcomer reads welcome and the rules. Existing players aren't welcomed when this version first runs: the
    economy's accounts seed presence.json.
  • Daily reward: daily_reward coins (50; 0 turns it off) once a UTC day for being on, logged in audit.log as
    daily_reward like every other economy change.
  • AFK: no move, no turn and no command for afk_minutes (5), or /afk: the player is out of the sleep count
    (players_sleeping_percentage) until they move, turn or run a command; told so (afk_announce tells everyone).
  • Anti-spam: at most spam_commands (8) SMP commands in spam_seconds (5) a player ("Slow down: ..."),
    operators of level 3 aside. Covers the economy commands.

Proof

native.py proof smp: both players see the welcome and the rules on their first join; new presence step: Steve
/afk, night, Alex alone in bed, and the night passes (Steve awake but AFK doesn't hold it); Steve moves: "You are
back."; 9 commands at once: "Slow down: at most 8 commands every 5 s.". After the restart with daily_reward 7, Alex
gets "Daily reward: 7 coins.", her balance and the audit log show it, and she isn't welcomed again. The whole proof result: below.

cargo test: 46 pass; 4 new (first join once, the reward once a day and at midnight, AFK and back by a move or a
command, the command limit).

Cost with 58 bots: in a comment with #97's A/B runs.

🤖 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-mods/pull/102 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/smp-presence` --- ### 📝 Commits (10+) - [`b9bd159`](https://github.com/horizon-rust/horizon-mods/commit/b9bd159dcf76e7e61daac2d4891c20f3612101d1) SMP: places (spawn, homes, warps, /tpa) and /rules - [`26079e7`](https://github.com/horizon-rust/horizon-mods/commit/26079e71ed96ba45f596491777182be1168c5abf) SMP places: hook points API 16, and the proof waits for each answer - [`0eb6ca7`](https://github.com/horizon-rust/horizon-mods/commit/0eb6ca75c36e4fd8a2019844ac151f5bbea7a52b) SMP places: hook points API 18 (main took 16 and 17) - [`1ec378a`](https://github.com/horizon-rust/horizon-mods/commit/1ec378ac96d3f03dd1950d06c447f37b191c2927) SMP places: hook points API 21 (main's mod screens took 18 to 20) - [`63f2fa9`](https://github.com/horizon-rust/horizon-mods/commit/63f2fa9f0169d3470c9cf4bc66043d3b54042b37) SMP places: pinned to horizon main with #4610 (API 21) - [`ec056f9`](https://github.com/horizon-rust/horizon-mods/commit/ec056f9f0291c847b5e76e1bf849c21934fabb31) SMP: land claims (/claim, /trust) on the block hooks - [`803907a`](https://github.com/horizon-rust/horizon-mods/commit/803907aaa5225d3cbe8d990e0b9eb804a8e7dda5) SMP: keep water, fire, pistons, explosions, buckets and blows out of claims (hooks 22) - [`b0e3d98`](https://github.com/horizon-rust/horizon-mods/commit/b0e3d98b52194545ebafbcedc0d8d9ecd3c1002b) SMP claims: pinned to horizon#4739's head (API 22) - [`aaf6cce`](https://github.com/horizon-rust/horizon-mods/commit/aaf6ccefcc8f2983c47a8433b03e9c42b13f5a52) SMP claims: pinned to horizon main with #4739 (API 22) - [`4364dbf`](https://github.com/horizon-rust/horizon-mods/commit/4364dbfba3036c7a6d4327b8010b56f68c9fe9aa) Merge remote-tracking branch 'origin/main' into feat/smp-places ### 📊 Changes **20 files changed** (+3374 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+63 -6) 📝 `native/smp/compatibility.json` (+2 -2) ➕ `native/smp/mixins/smp/attack_entity.rs` (+10 -0) ➕ `native/smp/mixins/smp/block_spread.rs` (+14 -0) ➕ `native/smp/mixins/smp/destroy_block.rs` (+4 -0) ➕ `native/smp/mixins/smp/explosion_detonate.rs` (+8 -0) ➕ `native/smp/mixins/smp/fill_bucket.rs` (+4 -0) 📝 `native/smp/mixins/smp/glue.rs` (+466 -12) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+109 -3) ➕ `native/smp/mixins/smp/piston_move.rs` (+24 -0) ➕ `native/smp/mixins/smp/right_click_block.rs` (+4 -0) ➕ `native/smp/mixins/smp/smp_board.rs` (+439 -0) ➕ `native/smp/mixins/smp/smp_claims.rs` (+688 -0) 📝 `native/smp/mixins/smp/smp_economy.rs` (+41 -7) ➕ `native/smp/mixins/smp/smp_places.rs` (+784 -0) ➕ `native/smp/mixins/smp/smp_presence.rs` (+382 -0) 📝 `native/smp/proof.py` (+322 -12) 📝 `native/smp/src/lib.rs` (+8 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on the polish PR (#101), on #97, on #72. Uses horizon-rust/horizon#5268's `native_sleep_ignored` and players' `yaw`/`pitch`. ## What SMP 0.11.0, a new `presence` module, looked at once a second (never per tick), all in `config.json`'s `presence`: - **First join**: everyone hears "`{player}` joined for the first time: welcome!" (`first_join`, empty for none); the newcomer reads `welcome` and the rules. Existing players aren't welcomed when this version first runs: the economy's accounts seed `presence.json`. - **Daily reward**: `daily_reward` coins (50; 0 turns it off) once a UTC day for being on, logged in `audit.log` as `daily_reward` like every other economy change. - **AFK**: no move, no turn and no command for `afk_minutes` (5), or `/afk`: the player is out of the sleep count (`players_sleeping_percentage`) until they move, turn or run a command; told so (`afk_announce` tells everyone). - **Anti-spam**: at most `spam_commands` (8) SMP commands in `spam_seconds` (5) a player ("Slow down: ..."), operators of level 3 aside. Covers the economy commands. ## Proof `native.py proof smp`: both players see the welcome and the rules on their first join; new `presence` step: Steve `/afk`, night, Alex alone in bed, and the night passes (Steve awake but AFK doesn't hold it); Steve moves: "You are back."; 9 commands at once: "Slow down: at most 8 commands every 5 s.". After the restart with `daily_reward` 7, Alex gets "Daily reward: 7 coins.", her balance and the audit log show it, and she isn't welcomed again. The whole proof result: below. `cargo test`: 46 pass; 4 new (first join once, the reward once a day and at midnight, AFK and back by a move or a command, the command limit). Cost with 58 bots: in a comment with #97's A/B runs. 🤖 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 04:03:17 +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-mods#109
No description provided.