Package crow.game.codec.netty
Class NettyWrappedContext
java.lang.Object
crow.game.codec.netty.NettyWrappedContext
- All Implemented Interfaces:
Context
Implementation of
Context which wraps an upper-level context and sets the Context.Source to the given value and sets the underlying object to an instance
of ChannelHandlerContext.-
Nested Class Summary
Nested classes/interfaces inherited from interface crow.game.codec.Context
Context.Source -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Contextprotected final io.netty.channel.ChannelHandlerContextprotected final Context.Source -
Constructor Summary
ConstructorsConstructorDescriptionNettyWrappedContext(Context.Source src, Context context, io.netty.channel.ChannelHandlerContext nettyContext) -
Method Summary
Modifier and TypeMethodDescriptionList<PacketHandler<?>>lookupPacketHandler(int prefix) List<PacketHandler<?>>lookupPacketHandler(Class<?> clz) intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface crow.game.codec.Context
matchesPacketVersion
-
Field Details
-
context
-
nettyContext
protected final io.netty.channel.ChannelHandlerContext nettyContext -
source
-
-
Constructor Details
-
NettyWrappedContext
public NettyWrappedContext(Context.Source src, Context context, io.netty.channel.ChannelHandlerContext nettyContext)
-
-
Method Details
-
supportedProtocolVersion
public int supportedProtocolVersion()- Specified by:
supportedProtocolVersionin interfaceContext- Returns:
- the current RO protocol version as an integer.
-
lookupPacketHandler
- Specified by:
lookupPacketHandlerin interfaceContext
-
lookupPacketHandler
- Specified by:
lookupPacketHandlerin interfaceContext
-
underlyingObject
- Specified by:
underlyingObjectin interfaceContext- Returns:
- the underlying object, usually a Netty connection object.
-
callingSource
- Specified by:
callingSourcein interfaceContext- Returns:
- the location of the codec workflow this context was built in.
-