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