Seamless backend-restart survival for Velocity: hold players in a limbo during a restart and auto-reconnect them to main
- Java 100%
| .forgejo/workflows | ||
| src/main/java/fr/ekaii/anarchyreconnect | ||
| .gitignore | ||
| build.gradle | ||
| LICENSE | ||
| README.md | ||
| settings.gradle | ||
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
onKickbackstop) parks the player inholdinginstead of disconnecting them. - Logs in while main is down →
onPreConnectreroutes the player toholdinginstead of letting LibreLogin kick them with "no available lobby". - A poll task pings
mainevery few seconds; a volatilemainUpflag is refreshed each tick (so the synchronousPreConnecthandler never blocks on a ping). Whenmainis healthy, everyone inholdingis 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 tomainand this plugin owns the restart path). - Optional: KickRedirect
servers-to-redirect = [holding]with"Server closed"inmessages-to-checkas a first-line redirect (this plugin'sonKickis 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+.