Interface InjectorAddon<C>


public interface InjectorAddon<C>
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    onChannelClosed(C channel)
    Called when the channel has been closed.
    void
    onInject(C channel, boolean toServer)
    Called when injecting a specific channel (every client that is connected to the server has his own channel).
    void
    onRemoveInject(C channel)
    Called when Floodgate is removing the injection from the server.
    boolean
    If the Injector should call onInject(C, boolean)
  • Method Details

    • onInject

      void onInject(C channel, boolean toServer)
      Called when injecting a specific channel (every client that is connected to the server has his own channel). Internally used for the Floodgate debugger and data handler but can also be used for third party things.
      Parameters:
      channel - the channel that the injector is injecting
      toServer - if the connection is between a proxy and a server
    • onChannelClosed

      default void onChannelClosed(C channel)
      Called when the channel has been closed. Note that this method will be called for every closed connection (if it is injected), so it'll also run this method for closed connections between a server and the proxy (when Floodgate is running on a proxy).
      Parameters:
      channel - the channel that the injector injected
    • onRemoveInject

      void onRemoveInject(C channel)
      Called when Floodgate is removing the injection from the server. The addon should remove his traces otherwise it is likely that an error will popup after the server is injected again.
      Parameters:
      channel - the channel that the injector injected
    • shouldInject

      boolean shouldInject()
      If the Injector should call onInject(C, boolean)
      Returns:
      true if it should, false otherwise