3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

Should fix any ClosedConnection output

Dieser Commit ist enthalten in:
Myles 2016-03-02 20:19:47 +00:00
Ursprung 785f0664da
Commit e8cc25baad
2 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -8,6 +8,7 @@ import us.myles.ViaVersion.ConnectionInfo;
import us.myles.ViaVersion.transformers.IncomingTransformer;
import us.myles.ViaVersion.util.PacketUtil;
import java.nio.channels.ClosedChannelException;
import java.util.List;
public class ViaDecodeHandler extends ByteToMessageDecoder {
@ -44,10 +45,12 @@ public class ViaDecodeHandler extends ByteToMessageDecoder {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (!(cause.getCause().getCause() instanceof CancelException)) {
if (!(cause.getCause() instanceof CancelException)) {
if (!(cause instanceof CancelException)) {
System.out.println("throwing");
if (!(cause.getCause().getCause() instanceof CancelException)
&& !(cause.getCause().getCause() instanceof ClosedChannelException)) {
if (!(cause.getCause() instanceof CancelException)
&& !(cause.getCause() instanceof ClosedChannelException)) {
if (!(cause instanceof CancelException)
&& !(cause instanceof ClosedChannelException)) {
if (cause instanceof Exception)
throw (Exception) cause;
}

Datei anzeigen

@ -10,6 +10,7 @@ import us.myles.ViaVersion.util.PacketUtil;
import us.myles.ViaVersion.util.ReflectionUtil;
import java.lang.reflect.Constructor;
import java.nio.channels.ClosedChannelException;
public class ViaEncodeHandler extends MessageToByteEncoder {
private final ConnectionInfo info;
@ -71,10 +72,12 @@ public class ViaEncodeHandler extends MessageToByteEncoder {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (!(cause.getCause().getCause() instanceof CancelException)) {
if (!(cause.getCause() instanceof CancelException)) {
if (!(cause instanceof CancelException)) {
System.out.println("throwing");
if (!(cause.getCause().getCause() instanceof CancelException)
&& !(cause.getCause().getCause() instanceof ClosedChannelException)) {
if (!(cause.getCause() instanceof CancelException)
&& !(cause.getCause() instanceof ClosedChannelException)) {
if (!(cause instanceof CancelException)
&& !(cause instanceof ClosedChannelException)) {
if (cause instanceof Exception)
throw (Exception) cause;
}