RKUpdater
Low-loadorder (-10) plugin that runs before RKClient. Handles server-identity claiming, hash-based auto-update, and the boot-gate every participating plugin waits on.
Dependencies
Private Libs/ jars | RKUpdatePackets.jar — its own protocol packets, deliberately separate from the core RKPackets so a breaking change there can't strand the updater. |
| Shared libs required | None from RKClient's SharedLibs — RKUpdater keeps its own private copy of gson-2.10.1.jar instead, since it has to work standalone before RKClient is even installed. |
The UpdateAware contract
Lives in RKUpdatePackets (not RKUpdater itself, so implementers only need the light packets dependency).
| Method | Called when |
|---|---|
onUpdatesFinished() | RKUpdater confirms no update is needed for this boot. Real init work belongs here, not in onEnable(). |
reportReady() | You call this back once your own init — including any async work — is genuinely complete. |
Register in your own onEnable():
Plugin updaterPlugin = getPluginByName("RKUpdater");
if (updaterPlugin instanceof RKUpdater updater) {
updater.registerPlugin(this);
}
RKUpdater only opens the connection gate once every registered plugin has called reportReady(). Every connection attempt is kicked with a reason until then — no admin bypass.
Update mechanism
No version numbers anywhere — pure SHA-256 hash comparison against the backend's manifest of the Updates/ tree. Grouped by plugin name (Updates/Plugins/<Name>/...) — install and update are the same code path, a missing local file just counts as "needs update."
RKUpdater always updates and restarts on its own group first, alone, before touching any other plugin's group — guarantees it's never applying someone else's update with stale updater code.
Restart is a clean inputcommand("shutdown") (runs normal shutdown hooks) — an external watchdog brings the process back up with the swapped files in place.
Failure handling
| Scenario | Behavior |
|---|---|
| Update port unreachable at boot | Treated as "no updates found" — proceeds to the ready handshake rather than blocking boot. |
| Hash mismatch after download | Retry up to N times, then shut down rather than boot half-updated. |
A registered plugin never calls reportReady() | Shut down — no fail-open timeout, a hung plugin is a real failure. |
Claim-code / server registration
On a fresh, unclaimed server: ClaimRequestPacket/ClaimResponsePacket exchange over the same dedicated update port, before the update check runs. Atomic single-use claim. Writes Plugins/RKUpdater/Settings/registration.json and Plugins/RKClient/Settings/Server.json. Server identities are registered/managed through the backend's /admin dashboard.