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 Summary
Modifier and TypeMethodDescriptionio.netty.channel.ChannelHandlerContext
Returns the channel handler context.flow()
Returns the flow of the packet.level()
Returns the level acts within this context.Returns a handler that can be used to have the current listener which received the payload handle another packet immediately.player()
Returns the player that acts within this context.protocol()
Returns the protocol of the connection.Returns a handler that can be used to reply to the payload.Returns a handler that can execute tasks on the main thread.
-
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
ISynchronizedWorkHandler 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
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
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.
-