Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 15:20:35 +01:00
Simplify MinecraftConnection release logic.
Dieser Commit ist enthalten in:
Ursprung
6d080db48e
Commit
6eb6c99fa7
@ -102,32 +102,25 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg instanceof MinecraftPacket) {
|
||||
try {
|
||||
if (sessionHandler.beforeHandle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MinecraftPacket pkt = (MinecraftPacket) msg;
|
||||
if (!pkt.handle(sessionHandler)) {
|
||||
sessionHandler.handleGeneric((MinecraftPacket) msg);
|
||||
}
|
||||
} else if (msg instanceof HAProxyMessage) {
|
||||
if (sessionHandler.beforeHandle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
HAProxyMessage proxyMessage = (HAProxyMessage) msg;
|
||||
this.remoteAddress = new InetSocketAddress(proxyMessage.sourceAddress(),
|
||||
proxyMessage.sourcePort());
|
||||
} else if (msg instanceof ByteBuf) {
|
||||
try {
|
||||
if (sessionHandler.beforeHandle()) {
|
||||
return;
|
||||
if (msg instanceof MinecraftPacket) {
|
||||
MinecraftPacket pkt = (MinecraftPacket) msg;
|
||||
if (!pkt.handle(sessionHandler)) {
|
||||
sessionHandler.handleGeneric((MinecraftPacket) msg);
|
||||
}
|
||||
} else if (msg instanceof HAProxyMessage) {
|
||||
HAProxyMessage proxyMessage = (HAProxyMessage) msg;
|
||||
this.remoteAddress = new InetSocketAddress(proxyMessage.sourceAddress(),
|
||||
proxyMessage.sourcePort());
|
||||
} else if (msg instanceof ByteBuf) {
|
||||
sessionHandler.handleUnknown((ByteBuf) msg);
|
||||
} finally {
|
||||
ReferenceCountUtil.release(msg);
|
||||
}
|
||||
} finally {
|
||||
ReferenceCountUtil.release(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren