3
0
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:
Andrew Steinborn 2019-01-27 22:57:40 -05:00
Ursprung 6d080db48e
Commit 6eb6c99fa7

Datei anzeigen

@ -102,34 +102,27 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
return;
}
if (msg instanceof MinecraftPacket) {
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) {
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;
}
sessionHandler.handleUnknown((ByteBuf) msg);
}
} finally {
ReferenceCountUtil.release(msg);
}
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {