Class GenericPacketSplitter
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
net.neoforged.neoforge.network.filters.GenericPacketSplitter
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelOutboundHandler,DynamicChannelHandler
@Internal
public class GenericPacketSplitter
extends io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
implements DynamicChannelHandler
A generic packet splitter that can be used to split packets that are too large to be sent in one go.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumprivate static final recordNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate static final GenericPacketSplitter.SizeLimitsprivate static final org.apache.logging.log4j.Loggerprivate final List<byte[]> private static final byteprivate static final byteprivate static final GenericPacketSplitter.SizeLimits -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Packet<?> createPacket(PacketFlow flow, byte[] payload) static intdetermineMaxPayloadSize(int maxPacketSize) protected voidgetRemoteCompatibility(Connection manager) private static voidhandle(SplitPacketPayload payload, IPayloadContext context) booleanisNecessary(Connection manager) static booleanisRemoteCompatible(Connection manager) private voidreceivedPacket(SplitPacketPayload payload, IPayloadContext context) private static voidMethods inherited from class io.netty.handler.codec.MessageToMessageEncoder
acceptOutboundMessage, writeMethods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
compressedSizeLimits
-
uncompressedSizeLimits
-
STATE_FIRST
private static final byte STATE_FIRST- See Also:
-
STATE_LAST
private static final byte STATE_LAST- See Also:
-
CHANNEL_HANDLER_NAME
- See Also:
-
receivedBuffers
-
-
Constructor Details
-
GenericPacketSplitter
public GenericPacketSplitter()
-
-
Method Details
-
register
-
handle
-
encode
-
receivedPacket
-
createPacket
-
isNecessary
- Specified by:
isNecessaryin interfaceDynamicChannelHandler
-
getRemoteCompatibility
-
isRemoteCompatible
-
determineMaxPayloadSize
public static int determineMaxPayloadSize(int maxPacketSize)
-