Package net.minecraft.network
Class Connection
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Packet<?>>
net.minecraft.network.Connection
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
RateKickingConnection
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprivate Consumer
<Connection> private SocketAddress
private static final float
private float
private float
(package private) BandwidthDebugMonitor
private io.netty.channel.Channel
private DisconnectionDetails
private DisconnectionDetails
private boolean
private PacketListener
private boolean
private boolean
private ProtocolInfo
<?> private static final ProtocolInfo
<ServerHandshakePacketListener> static final Supplier
<io.netty.channel.DefaultEventLoopGroup> private static final org.slf4j.Logger
static final Supplier
<io.netty.channel.epoll.EpollEventLoopGroup> static final Supplier
<io.netty.channel.nio.NioEventLoopGroup> private ProtocolInfo
<?> static final org.slf4j.Marker
static final org.slf4j.Marker
static final org.slf4j.Marker
private PacketListener
private final PacketLogger
private final Queue
<Consumer<Connection>> private int
private final PacketFlow
static final org.slf4j.Marker
private boolean
private int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.Channel
channel()
void
channelActive
(io.netty.channel.ChannelHandlerContext p_129525_) void
channelInactive
(io.netty.channel.ChannelHandlerContext p_129527_) protected void
channelRead0
(io.netty.channel.ChannelHandlerContext p_129487_, Packet<?> p_129488_) static void
configureInMemoryPipeline
(io.netty.channel.ChannelPipeline p_298130_, PacketFlow p_298133_) void
configurePacketHandler
(io.netty.channel.ChannelPipeline p_300754_) static void
configureSerialization
(io.netty.channel.ChannelPipeline p_265436_, PacketFlow p_265104_, boolean p_328504_, BandwidthDebugMonitor p_299297_) static io.netty.channel.ChannelFuture
connect
(InetSocketAddress p_290034_, boolean p_290035_, Connection p_290031_) static Connection
connectToLocalServer
(SocketAddress p_129494_) static Connection
connectToServer
(InetSocketAddress p_178301_, boolean p_178302_, LocalSampleLogger p_333468_) private static io.netty.channel.ChannelInboundHandler
createFrameDecoder
(BandwidthDebugMonitor p_329567_, boolean p_335874_) private static io.netty.channel.ChannelOutboundHandler
createFrameEncoder
(boolean p_335200_) void
disconnect
(Component p_129508_) void
disconnect
(DisconnectionDetails p_343980_) private void
doSendPacket
(Packet<?> p_243260_, PacketSendListener p_243290_, boolean p_299937_) void
exceptionCaught
(io.netty.channel.ChannelHandlerContext p_129533_, Throwable p_129534_) private void
flush()
void
private void
private static <T extends PacketListener>
voidgenericsFtw
(Packet<T> p_129518_, PacketListener p_129519_) float
float
ProtocolInfo
<?> getLoggableAddress
(boolean p_298740_) ProtocolInfo
<?> void
private static String
inboundHandlerName
(boolean p_334983_) private <S extends ServerboundPacketListener,
C extends ClientboundPacketListener>
voidinitiateServerboundConnection
(String p_300730_, int p_300598_, ProtocolInfo<S> p_328134_, ProtocolInfo<C> p_329827_, C p_330656_, ClientIntent p_297789_) void
initiateServerboundPlayConnection
(String p_300250_, int p_297906_, ClientLoginPacketListener p_297708_) <S extends ServerboundPacketListener,
C extends ClientboundPacketListener>
voidinitiateServerboundPlayConnection
(String p_332429_, int p_334200_, ProtocolInfo<S> p_332351_, ProtocolInfo<C> p_328002_, C p_329302_, boolean p_331884_) void
initiateServerboundStatusConnection
(String p_297855_, int p_297423_, ClientStatusPacketListener p_300237_) boolean
boolean
boolean
boolean
private static String
outboundHandlerName
(boolean p_334174_) void
runOnceConnected
(Consumer<Connection> p_297681_) void
void
send
(Packet<?> p_243248_, PacketSendListener p_243316_) void
send
(Packet<?> p_298754_, PacketSendListener p_300685_, boolean p_298821_) private void
sendPacket
(Packet<?> p_129521_, PacketSendListener p_243246_, boolean p_299777_) void
setBandwidthLogger
(LocalSampleLogger p_333554_) void
setEncryptionKey
(Cipher p_129496_, Cipher p_129497_) void
setListenerForServerboundHandshake
(PacketListener p_299346_) void
void
setupCompression
(int p_129485_, boolean p_182682_) <T extends PacketListener>
voidsetupInboundProtocol
(ProtocolInfo<T> p_333271_, T p_330962_) void
setupOutboundProtocol
(ProtocolInfo<?> p_329145_) private static void
syncAfterConfigurationChange
(io.netty.channel.ChannelFuture p_330528_) void
tick()
protected void
private void
validateListener
(ProtocolInfo<?> p_336036_, PacketListener p_331542_) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, 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
handlerAdded, handlerRemoved
-
Field Details
-
AVERAGE_PACKETS_SMOOTHING
private static final float AVERAGE_PACKETS_SMOOTHING- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ROOT_MARKER
public static final org.slf4j.Marker ROOT_MARKER -
PACKET_MARKER
public static final org.slf4j.Marker PACKET_MARKER -
PACKET_RECEIVED_MARKER
public static final org.slf4j.Marker PACKET_RECEIVED_MARKER -
PACKET_SENT_MARKER
public static final org.slf4j.Marker PACKET_SENT_MARKER -
NETWORK_WORKER_GROUP
-
NETWORK_EPOLL_WORKER_GROUP
-
LOCAL_WORKER_GROUP
-
INITIAL_PROTOCOL
-
receiving
-
sendLoginDisconnect
private volatile boolean sendLoginDisconnect -
pendingActions
-
channel
private io.netty.channel.Channel channel -
address
-
disconnectListener
-
packetListener
-
disconnectionDetails
-
encrypted
private boolean encrypted -
disconnectionHandled
private boolean disconnectionHandled -
receivedPackets
private int receivedPackets -
sentPackets
private int sentPackets -
averageReceivedPackets
private float averageReceivedPackets -
averageSentPackets
private float averageSentPackets -
tickCount
private int tickCount -
handlingFault
private boolean handlingFault -
delayedDisconnect
-
bandwidthDebugMonitor
-
activationHandler
-
packetLogger
-
outboundProtocol
-
inboundProtocol
-
-
Constructor Details
-
Connection
-
-
Method Details
-
channelActive
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext p_129527_) - Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead0
- Specified by:
channelRead0
in classio.netty.channel.SimpleChannelInboundHandler<Packet<?>>
-
genericsFtw
private static <T extends PacketListener> void genericsFtw(Packet<T> p_129518_, PacketListener p_129519_) -
validateListener
-
syncAfterConfigurationChange
private static void syncAfterConfigurationChange(io.netty.channel.ChannelFuture p_330528_) -
setupInboundProtocol
-
setupOutboundProtocol
-
setListenerForServerboundHandshake
-
initiateServerboundStatusConnection
public void initiateServerboundStatusConnection(String p_297855_, int p_297423_, ClientStatusPacketListener p_300237_) -
initiateServerboundPlayConnection
public void initiateServerboundPlayConnection(String p_300250_, int p_297906_, ClientLoginPacketListener p_297708_) -
initiateServerboundPlayConnection
public <S extends ServerboundPacketListener,C extends ClientboundPacketListener> void initiateServerboundPlayConnection(String p_332429_, int p_334200_, ProtocolInfo<S> p_332351_, ProtocolInfo<C> p_328002_, C p_329302_, boolean p_331884_) -
initiateServerboundConnection
private <S extends ServerboundPacketListener,C extends ClientboundPacketListener> void initiateServerboundConnection(String p_300730_, int p_300598_, ProtocolInfo<S> p_328134_, ProtocolInfo<C> p_329827_, C p_330656_, ClientIntent p_297789_) -
send
-
send
-
send
-
runOnceConnected
-
sendPacket
private void sendPacket(Packet<?> p_129521_, @Nullable PacketSendListener p_243246_, boolean p_299777_) -
doSendPacket
private void doSendPacket(Packet<?> p_243260_, @Nullable PacketSendListener p_243290_, boolean p_299937_) -
flushChannel
public void flushChannel() -
flush
private void flush() -
flushQueue
private void flushQueue() -
tick
public void tick() -
tickSecond
protected void tickSecond() -
getRemoteAddress
-
getLoggableAddress
-
disconnect
-
disconnect
-
isMemoryConnection
public boolean isMemoryConnection() -
getReceiving
-
getSending
-
connectToServer
public static Connection connectToServer(InetSocketAddress p_178301_, boolean p_178302_, @Nullable LocalSampleLogger p_333468_) -
connect
public static io.netty.channel.ChannelFuture connect(InetSocketAddress p_290034_, boolean p_290035_, Connection p_290031_) -
outboundHandlerName
-
inboundHandlerName
-
configurePacketHandler
public void configurePacketHandler(io.netty.channel.ChannelPipeline p_300754_) -
configureSerialization
public static void configureSerialization(io.netty.channel.ChannelPipeline p_265436_, PacketFlow p_265104_, boolean p_328504_, @Nullable BandwidthDebugMonitor p_299297_) -
createFrameEncoder
private static io.netty.channel.ChannelOutboundHandler createFrameEncoder(boolean p_335200_) -
createFrameDecoder
private static io.netty.channel.ChannelInboundHandler createFrameDecoder(@Nullable BandwidthDebugMonitor p_329567_, boolean p_335874_) -
configureInMemoryPipeline
public static void configureInMemoryPipeline(io.netty.channel.ChannelPipeline p_298130_, PacketFlow p_298133_) -
connectToLocalServer
-
setEncryptionKey
-
isEncrypted
public boolean isEncrypted() -
isConnected
public boolean isConnected() -
isConnecting
public boolean isConnecting() -
getPacketListener
-
getDisconnectionDetails
-
setReadOnly
public void setReadOnly() -
setupCompression
public void setupCompression(int p_129485_, boolean p_182682_) -
handleDisconnection
public void handleDisconnection() -
getAverageReceivedPackets
public float getAverageReceivedPackets() -
getAverageSentPackets
public float getAverageSentPackets() -
channel
public io.netty.channel.Channel channel() -
getProtocol
-
getInboundProtocolInfo
-
getOutputboundProtocolInfo
-
setBandwidthLogger
-