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
static io.netty.util.AttributeKey<ConnectionProtocol>
private static float
private float
private float
private io.netty.channel.Channel
private Component
private boolean
private boolean
private boolean
static LazyLoadedValue<io.netty.channel.DefaultEventLoopGroup>
private static org.apache.logging.log4j.Logger
static LazyLoadedValue<io.netty.channel.epoll.EpollEventLoopGroup>
static LazyLoadedValue<io.netty.channel.nio.NioEventLoopGroup>
static org.apache.logging.log4j.Marker
private PacketListener
private Queue<Connection.PacketHolder>
private int
private PacketFlow
static org.apache.logging.log4j.Marker
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 Connection
connectToLocalServer(SocketAddress p_129494_)
static Connection
connectToServer(InetSocketAddress p_178301_, boolean p_178302_)
void
disconnect(Component p_129508_)
private void
doSendPacket(Packet<?> p_178304_, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> p_178305_, ConnectionProtocol p_178306_, ConnectionProtocol p_178307_)
void
exceptionCaught(io.netty.channel.ChannelHandlerContext p_129533_, Throwable p_129534_)
private void
private static <T extends PacketListener>
voidgenericsFtw(Packet<T> p_129518_, PacketListener p_129519_)
float
float
private ConnectionProtocol
void
boolean
boolean
boolean
boolean
void
void
send(Packet<?> p_129515_, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> p_129516_)
private void
sendPacket(Packet<?> p_129521_, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> p_129522_)
void
setEncryptionKey(Cipher p_129496_, Cipher p_129497_)
void
setListener(PacketListener p_129506_)
void
setProtocol(ConnectionProtocol p_129499_)
void
void
setupCompression(int p_129485_, boolean p_182682_)
void
tick()
protected void
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:
- Constant Field Values
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
ROOT_MARKER
public static final org.apache.logging.log4j.Marker ROOT_MARKER -
PACKET_MARKER
public static final org.apache.logging.log4j.Marker PACKET_MARKER -
ATTRIBUTE_PROTOCOL
-
NETWORK_WORKER_GROUP
-
NETWORK_EPOLL_WORKER_GROUP
public static final LazyLoadedValue<io.netty.channel.epoll.EpollEventLoopGroup> NETWORK_EPOLL_WORKER_GROUP -
LOCAL_WORKER_GROUP
-
receiving
-
queue
-
channel
private io.netty.channel.Channel channel -
address
-
packetListener
-
disconnectedReason
-
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 -
activationHandler
-
-
Constructor Details
-
Connection
-
-
Method Details
-
channelActive
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
setProtocol
-
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_) -
setListener
-
send
-
send
-
sendPacket
-
doSendPacket
private void doSendPacket(Packet<?> p_178304_, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> p_178305_, ConnectionProtocol p_178306_, ConnectionProtocol p_178307_) -
getCurrentProtocol
-
flushQueue
private void flushQueue() -
tick
public void tick() -
tickSecond
protected void tickSecond() -
getRemoteAddress
-
disconnect
-
isMemoryConnection
public boolean isMemoryConnection() -
getReceiving
-
getSending
-
connectToServer
-
connectToLocalServer
-
setEncryptionKey
-
isEncrypted
public boolean isEncrypted() -
isConnected
public boolean isConnected() -
isConnecting
public boolean isConnecting() -
getPacketListener
-
getDisconnectedReason
-
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() -
getDirection
-