Class BungeeProxy

java.lang.Object
net.md_5.bungee.api.plugin.Plugin
de.rexlcloud.proxy.bungee.BungeeProxy

public class BungeeProxy extends net.md_5.bungee.api.plugin.Plugin
The rexlCloud plugin for BungeeCord proxies, installed by the cloud on every proxy. It registers the cloud's servers with BungeeCord, sends joining players to a fallback server, shows the MOTD from the cloud and adds the /cloud commands. BungeeCord only supports legacy forwarding (forwardingMode LEGACY on the master).

Other plugins use the cloud through RexlCloudApi.getInstance() (or getRexlCloudApi()); add depends: [rexlCloudProxy] to their bungee.yml.

  • Constructor Details

    • BungeeProxy

      public BungeeProxy()
  • Method Details

    • onEnable

      public void onEnable()
      Internal: starts the plugin.
      Overrides:
      onEnable in class net.md_5.bungee.api.plugin.Plugin
    • onDisable

      public void onDisable()
      Internal: tells the wrapper the proxy is stopping.
      Overrides:
      onDisable in class net.md_5.bungee.api.plugin.Plugin
    • writePacket

      public void writePacket(de.rexlcloud.core.network.PacketContainer packetContainer)
      Internal: sends a packet to the wrapper.
    • initServerClient

      public void initServerClient()
      Internal: opens the connection to the wrapper.
    • registerShutdownHook

      public void registerShutdownHook(Callable<Void> callable)
      Runs the task (at most 30 seconds) before the cloud shuts the proxy down.
    • unregisterShutdownHook

      public void unregisterShutdownHook(Callable<Void> callable)
      Removes a task added with registerShutdownHook(Callable).
    • shutdownServer

      public void shutdownServer()
      Runs the shutdown hooks, disconnects all players and shuts the proxy down.
    • getInstance

      public static BungeeProxy getInstance()
    • getShutdownHooks

      public List<Callable<Void>> getShutdownHooks()
    • getWrapperReconnect

      public de.rexlcloud.core.network.WrapperReconnect getWrapperReconnect()
      Internal: connects again when the connection to the wrapper breaks.
    • getServer

      public net.md_5.bungee.api.ProxyServer getServer()
      The BungeeCord proxy.
    • getServerName

      public String getServerName()
      Name of this proxy in the cloud, e.g. Proxy-1.
    • getWrapperToken

      public String getWrapperToken()
      Internal: the secret this run proves itself with to the wrapper.
    • getLogin

      public de.rexlcloud.proxy.bungee.listener.Login getLogin()
      Internal: the fallback servers players are sent to.
    • getRexlCloudApi

      public RexlCloudApi getRexlCloudApi()
      The cloud API, null until the first connection to the wrapper.
    • setRexlCloudApi

      public void setRexlCloudApi(RexlCloudApi rexlCloudApi)
      The cloud API, null until the first connection to the wrapper.
    • getCommandManager

      public org.incendo.cloud.bungee.BungeeCommandManager<net.md_5.bungee.api.CommandSender> getCommandManager()
      The command manager of the /cloud commands.