Class VelocityProxy

java.lang.Object
de.rexlcloud.proxy.velocity.VelocityProxy

public class VelocityProxy extends Object
The rexlCloud plugin for Velocity proxies, installed by the cloud on every proxy. It registers the cloud's servers with Velocity, sends joining players to a fallback server, shows the MOTD from the cloud and adds the /cloud commands.

Other plugins use the cloud through RexlCloudApi.getInstance() (or getRexlCloudApi()); declare a dependency on rexlcloud_proxy so it is initialized first.

  • Constructor Summary

    Constructors
    Constructor
    Description
    VelocityProxy(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger)
    Internal: created by Velocity.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.incendo.cloud.velocity.VelocityCommandManager<com.velocitypowered.api.command.CommandSource>
    The command manager of the /cloud commands.
    The plugin instance.
    org.slf4j.Logger
    The plugin's logger.
    de.rexlcloud.proxy.velocity.listener.Login
    Internal: the fallback servers players are sent to.
    The cloud API, null until the first connection to the wrapper.
    com.velocitypowered.api.proxy.ProxyServer
    The Velocity proxy.
    Name of this proxy in the cloud, e.g.
    de.rexlcloud.core.network.WrapperReconnect
    Internal: connects again when the connection to the wrapper breaks.
    Internal: the secret this run proves itself with to the wrapper.
    void
    Internal: opens the connection to the wrapper.
    void
    onProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event)
    Internal: starts the plugin.
    void
    onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event)
    Internal: tells the wrapper the proxy is stopping.
    void
    The cloud API, null until the first connection to the wrapper.
    void
    Disconnects all players and shuts the proxy down.
    void
    writePacket(de.rexlcloud.core.network.PacketContainer packetContainer)
    Internal: sends a packet to the wrapper.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VelocityProxy

      @Inject public VelocityProxy(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger)
      Internal: created by Velocity.
  • Method Details

    • onProxyInitialization

      public void onProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event)
      Internal: starts the plugin.
    • writePacket

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

      public void onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event)
      Internal: tells the wrapper the proxy is stopping.
    • initServerClient

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

      public void shutdownServer()
      Disconnects all players and shuts the proxy down.
    • getInstance

      public static VelocityProxy getInstance()
      The plugin instance.
    • getWrapperReconnect

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

      public com.velocitypowered.api.proxy.ProxyServer getServer()
      The Velocity proxy.
    • getLogger

      public org.slf4j.Logger getLogger()
      The plugin's logger.
    • 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.velocity.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.velocity.VelocityCommandManager<com.velocitypowered.api.command.CommandSource> getCommandManager()
      The command manager of the /cloud commands.