Interface ConnectionHandler

All Known Implementing Classes:
AssetEditorPacketHandler, AuthenticationPacketHandler, GamePacketHandler, GenericConnectionPacketHandler, GenericPacketHandler, HandshakeHandler, InitialPacketHandler, PacketHandler, PasswordPacketHandler, PendingStreamConnectionHandler, SetupPacketHandler, VoiceStreamHandler

public interface ConnectionHandler
Interface for a connection-level packet handler that transports can invoke. Implemented by PacketHandler in CoreServer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    closed(NetworkChannel networkChannel)
    Called when the affiliated network channel has been closed.
    void
    Called to handle the given incoming packet.
    void
    Called to log that this handler's connection has been closed.
    void
    Called when this handler is registered on a connection, potentially replacing an old handler.
    void
    Called when this handler is unregistered from a connection, potentially being replaced by a new handler.
  • Method Details

    • handle

      void handle(@Nonnull ToServerPacket packet)
      Called to handle the given incoming packet.
      Parameters:
      packet - The packet to be handled
    • closed

      void closed(@Nullable NetworkChannel networkChannel)
      Called when the affiliated network channel has been closed.
      Parameters:
      networkChannel - The network channel that was closed, or null if unknown
    • logCloseMessage

      void logCloseMessage()
      Called to log that this handler's connection has been closed.
    • registered

      void registered(@Nullable ConnectionHandler oldHandler)
      Called when this handler is registered on a connection, potentially replacing an old handler.
      Parameters:
      oldHandler - The previous handler, or null if this is the first handler
    • unregistered

      void unregistered(@Nullable ConnectionHandler newHandler)
      Called when this handler is unregistered from a connection, potentially being replaced by a new handler.
      Parameters:
      newHandler - The new handler replacing this one, or null