Interface Context

All Known Implementing Classes:
HA0Context, LoginContext, NettyWrappedContext, RootContext

public interface Context
Context wraps the calling context when performing packet logic.

It allows packet handlers to query details about the running system that may change based on the given client, the network type, whether we are encoding or decoding the packet.

  • Method Details

    • supportedProtocolVersion

      int supportedProtocolVersion()
      Returns:
      the current RO protocol version as an integer.
    • lookupPacketHandler

      List<PacketHandler<?>> lookupPacketHandler(int prefix)
    • lookupPacketHandler

      List<PacketHandler<?>> lookupPacketHandler(Class<?> clz)
    • underlyingObject

      Object underlyingObject()
      Returns:
      the underlying object, usually a Netty connection object.
    • callingSource

      Context.Source callingSource()
      Returns:
      the location of the codec workflow this context was built in.
    • matchesPacketVersion

      default boolean matchesPacketVersion(PacketRule pr)
    • TODO

      static Context TODO()
      Returns:
      an empty context used for experimentation and stubbing.