Skip to content

Shut the server down when Posse is disabled while it runs - #22

Merged
mgilardi merged 4 commits into
mainfrom
k964-stop-on-disable-b
Dec 2, 2026
Merged

mgilardi merged 4 commits into
mainfrom
k964-stop-on-disable-b

Conversation

@mgilardi

@mgilardi mgilardi commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

D401 (K964). If Posse is disabled while the server runs and the server isn't already stopping, Posse:

  1. asks Paper to shut down,
  2. disconnects everyone straight away with "The server is stopping for a moment. Please come back later.",
  3. logs why, and that a restart brings the rules back.

Step 2 is there because Paper's stop disables every other plugin before it disconnects anyone, and chat runs on its own thread. Without it, players could keep reaching each other after Posse's listeners were gone. Each step runs even if the one before it fails, and nothing escapes onDisable. A normal stop is left alone. If the server can't say whether it's stopping, it's treated as running.

Limits: this can't cover a removed jar, a plugin that never loads, a killed process, or another plugin removing Posse's listeners without disabling it. Off the main thread, kicks aren't possible, so the server's own stop disconnects players a little later.

The test helper gets /mt disable <plugin> (test-only, never shipped).

Tested

  • ./gradlew build: 275 unit tests pass, none skipped. Seven are in DisableGuardTest.
  • disable-guard.js, a new bot suite: 21 of 21 on Paper 26.1.2, 26.2 and 26.3. A normal stop says nothing. Disabled with two players online, the server exits by itself (about 1 s) and both players get Posse's message. The same happens while Posse is paused on a broken config. Afterwards the server restarts and lets a player in.
  • suite.js (startup, pause, joins and everything else): 87 of 87 on each of the three versions, 3 skipped (sign text and anvil renames need a real client; graves need a LanternGraves jar).

Not tested yet

  • /reload itself, an error that makes Paper disable the plugin, a failed shutdown, and a disable from off the main thread.
  • If another plugin cancels the disconnect, that player stays on until Paper's own stop disconnects them.
  • No real game client has seen this version.

Released as 0.11.4, not 0.11.3 (D402).

🤖 Generated with Claude Code

mgilardi and others added 2 commits December 1, 2026 08:14
D401: a disabled plugin's listeners stop working, so home worlds, circles,
chat limits and the join pause would all lift with players still online.
Unless the server is already stopping, Posse now asks Paper to shut down,
disconnects everyone with a plain message, and logs why. It disconnects
everyone itself because Paper's stop disables every other plugin before it
kicks anyone, and chat runs on its own thread, so players could otherwise
still reach each other for that time. The test helper gets /mt disable, and
a new bot suite, disable-guard.js, drives it while running and while paused.

Tested: ./gradlew build, 275 unit tests, none skipped. disable-guard.js 21/21
on Paper 26.1.2.
Not tested: disable-guard.js on 26.2 and 26.3; the full suite.js on any
version (a 26.1.2 run was stopped partway for a test-server hold); /reload
itself, a plugin error, a failed shutdown and a disable off the main thread.

Task: K964
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
suite.js passed 87 of 87 on Paper 26.1.2 with the disable change (3 skipped:
sign text and anvil renames need a real client, graves need a LanternGraves
jar). disable-guard.js and suite.js on 26.2 and 26.3 are still not run.

Task: K964
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgilardi mgilardi added the lead:games Lead session: Head of Games label Dec 2, 2026
disable-guard.js passed 21 of 21 and suite.js 87 of 87 (3 skipped) on Paper
26.1.2 build 74, 26.2 build 135 and 26.3 build 273, each on a throwaway local
server deleted after the run. The changelog heading drops "not released" so
the release only needs the merge and the tag.

Still not tested: /reload itself, a plugin error that disables Posse, a failed
shutdown, an off-thread disable, and a real game client.

Task: K964

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgilardi
mgilardi marked this pull request as ready for review December 2, 2026 03:09
The checks were skipped while it was a draft, and marking it ready does not start them.

Task: K964

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mgilardi
mgilardi merged commit 03137fc into main Dec 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lead:games Lead session: Head of Games

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant