Seamless backend-restart survival for Velocity: hold players in a limbo during a restart and auto-reconnect them to main
Find a file
ekaii 2df19a6d12
Some checks failed
release.yml / ci: add release-on-tag (JDK 21) (push) Failing after 0s
release.yml / ci: add release-on-tag (JDK 21) (release) Failing after 0s
ci: add release-on-tag (JDK 21)
2026-07-15 12:49:48 +02:00
.forgejo/workflows ci: add release-on-tag (JDK 21) 2026-07-15 12:49:48 +02:00
src/main/java/fr/ekaii/anarchyreconnect AnarchyReconnect 1.1.0 - seamless backend-restart survival 2026-06-28 18:25:39 +02:00
.gitignore AnarchyReconnect 1.1.0 - seamless backend-restart survival 2026-06-28 18:25:39 +02:00
build.gradle AnarchyReconnect 1.1.0 - seamless backend-restart survival 2026-06-28 18:25:39 +02:00
LICENSE chore: prepare for public release (LICENSE / genericize infra refs) 2026-07-15 01:27:42 +02:00
README.md chore: prepare for public release (LICENSE / genericize infra refs) 2026-07-15 01:27:42 +02:00
settings.gradle AnarchyReconnect 1.1.0 - seamless backend-restart survival 2026-06-28 18:25:39 +02:00

AnarchyReconnect

A small Velocity plugin that makes backend restarts seamless for players: instead of being kicked when the backend (main) goes down, players are held in an always-up limbo and automatically reconnected to main the moment it is healthy again.

Built for your network's stack (Velocity 3.5, Luminol/Folia backend, LibreLogin offline auth, NanoLimbo limbo).

How it works

Normal login is unchanged — first (LibreLogin auth limbo) → main, one hop. A second, always-up NanoLimbo instance named holding is used only while main is down:

  • Already on main when it stops → KickRedirect (or this plugin's onKick backstop) parks the player in holding instead of disconnecting them.
  • Logs in while main is down → onPreConnect reroutes the player to holding instead of letting LibreLogin kick them with "no available lobby".
  • A poll task pings main every few seconds; a volatile mainUp flag is refreshed each tick (so the synchronous PreConnect handler never blocks on a ping). When main is healthy, everyone in holding is sent back to it; while it is down they get a "Server restarting…" action bar.

Server-side prerequisites

  • A NanoLimbo instance registered as a Velocity server named holding (always up).
  • LibreLogin lobby.root = [main], fallback = false (so normal logins go straight to main and this plugin owns the restart path).
  • Optional: KickRedirect servers-to-redirect = [holding] with "Server closed" in messages-to-check as a first-line redirect (this plugin's onKick is a backstop).

Server names are currently hardcoded (main / holding); make them configurable if reused elsewhere.

Build

docker run --rm -v "$PWD":/work -w /work gradle:8.10-jdk21 gradle build --no-daemon
# -> build/libs/anarchyreconnect-<version>.jar

Compiled against velocity-api:3.3-SNAPSHOT (release 17); runs on Velocity 3.x / Java 17+.