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 classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprivate final io.netty.util.AttributeKey<ConnectionProtocol.CodecData<?>>
private static final org.apache.logging.log4j.Logger
private static final int
private static final int
private static final List<byte[]>
private static final byte
private static final byte
-
Constructor Summary
ConstructorDescriptionGenericPacketSplitter
(io.netty.util.AttributeKey<ConnectionProtocol.CodecData<?>> codecKey) GenericPacketSplitter
(Connection connection) -
Method Summary
Modifier and TypeMethodDescriptionprivate static Packet<?>
createPacket
(PacketFlow flow, byte[] payload) static int
determineMaxPayloadSize
(ConnectionProtocol protocol, PacketFlow flow) protected void
private static io.netty.util.AttributeKey<ConnectionProtocol.CodecData<?>>
getProtocolKey
(PacketFlow flow) getRemoteCompatibility
(Connection manager) boolean
isNecessary
(Connection manager) static boolean
isRemoteCompatible
(Connection manager) private static void
receivedPacket
(SplitPacketPayload payload, IPayloadContext context) private static void
Methods inherited from class io.netty.handler.codec.MessageToMessageEncoder
acceptOutboundMessage, write
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MAX_PACKET_SIZE
private static final int MAX_PACKET_SIZE- See Also:
-
MAX_PART_SIZE
private static final int MAX_PART_SIZE -
STATE_FIRST
private static final byte STATE_FIRST- See Also:
-
STATE_LAST
private static final byte STATE_LAST- See Also:
-
codecKey
-
receivedBuffers
-
-
Constructor Details
-
GenericPacketSplitter
-
GenericPacketSplitter
-
-
Method Details
-
register
-
encode
-
receivedPacket
-
createPacket
-
isNecessary
- Specified by:
isNecessary
in interfaceDynamicChannelHandler
-
getRemoteCompatibility
-
isRemoteCompatible
-
determineMaxPayloadSize
-
getProtocolKey
private static io.netty.util.AttributeKey<ConnectionProtocol.CodecData<?>> getProtocolKey(PacketFlow flow)
-