NetworkMode

public final class NetworkMode

Detects whether RPM is running behind a proxy (Velocity / BungeeCord). In that topology the backend is NOT responsible for client-facing pack delivery — the proxy plugin handles it. RPM still mixes its own plugin pack and uploads it; the proxy fetches and merges as part of the network workflow.

Detection signals (any one of these is sufficient)

  1. Floodgate present, Geyser-Spigot absent — strongest signal for the Bedrock-via-proxy case: Floodgate only makes sense if there's a Geyser somewhere, and if Geyser isn't on this backend, it's on the proxy.
  2. spigot.yml: settings.bungeecord: true — the legacy BungeeCord IP-forwarding switch. Admin had to set it for forwarding to work at all, so seeing it true is a definitive "yes, behind a proxy."
  3. paper-global.yml: proxies.velocity.enabled: true — modern Velocity forwarding flag. Same logic as #2 for Velocity setups.

Why combine signals: signal #1 alone misses Java-only proxy setups where Floodgate isn't installed. Signals #2/#3 catch those. Conversely, signal #1 catches networks that use modern forwarding but where the admin hasn't enabled the corresponding Paper/Spigot config (rare but possible). Combining them gets us near-100% recall with near-zero false positives.

Result is cached after the first check; assumes the proxy topology doesn't change mid-session. Caching is safe across /reload because the static field is re-initialized when the class is reloaded.

Types

Link copied to clipboard
public enum KeySource
Where this backend's key came from.

Properties

Link copied to clipboard
public static volatile NetworkMode.KeySource keySource

Functions

Link copied to clipboard
public static boolean acceptProvisionedKey(String grantedKey)
Accepts a key granted by the proxy, persisting it so provisioning happens exactly once per backend.
Link copied to clipboard
Where the current key came from.
Link copied to clipboard
public static String getNetworkKey()
Resolves the network key that links this backend with its proxy.
Link copied to clipboard
public static boolean isActive()