Interface IPayloadContext

All Known Implementing Classes:
ConfigurationPayloadContext, PlayPayloadContext

public interface IPayloadContext
Defines a phase-less payload context that is passed to a handler for a payload that arrives during the connection.
  • Method Details

    • replyHandler

      IReplyHandler replyHandler()
      Returns a handler that can be used to reply to the payload.
      Returns:
      a handler that can be used to reply to the payload
    • packetHandler

      IPacketHandler packetHandler()
      Returns a handler that can be used to have the current listener which received the payload handle another packet immediately.
      Returns:
      a handler that can be used to have the current listener which received the payload handle another packet immediately
    • workHandler

      Returns a handler that can execute tasks on the main thread.
      Returns:
      a handler that can execute tasks on the main thread
    • flow

      PacketFlow flow()
      Returns the flow of the packet.
      Returns:
      the flow of the packet
    • protocol

      ConnectionProtocol protocol()
      Returns the protocol of the connection.
      Returns:
      the protocol of the connection
    • channelHandlerContext

      io.netty.channel.ChannelHandlerContext channelHandlerContext()
      Returns the channel handler context.
      Returns:
      the channel handler context
    • player

      Optional<Player> player()
      Returns the player that acts within this context.
      Returns:
      the player that acts within this context
      Implementation Note:
      This Optional will be filled with the current client side player if the payload was sent by the server, the server will only populate this field if it is not configuring the client.
    • level

      default Optional<Level> level()
      Returns the level acts within this context.
      Returns:
      the level acts within this context
      Implementation Note:
      This Optional will be filled with the current client side level if the payload was sent by the server, the server will only populate this field if it is not configuring the client.