forked from GeyserMC/Geyser
Ignore all downstream packet errors (#693)
* Ignore all downstream packet errors Instead of kicking the client off because of an error, we simply display a logger warning and suppress the error. * If debug mode, print stacktrace
This commit is contained in:
parent
64e3204611
commit
b8a3009c9d
2 changed files with 9 additions and 1 deletions
|
@ -105,7 +105,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.steveice10</groupId>
|
<groupId>com.github.steveice10</groupId>
|
||||||
<artifactId>packetlib</artifactId>
|
<artifactId>packetlib</artifactId>
|
||||||
<version>1.5-SNAPSHOT</version>
|
<version>1.6-SNAPSHOT</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
|
|
|
@ -366,6 +366,14 @@ public class GeyserSession implements CommandSender {
|
||||||
PacketTranslatorRegistry.JAVA_TRANSLATOR.translate(event.getPacket().getClass(), event.getPacket(), GeyserSession.this);
|
PacketTranslatorRegistry.JAVA_TRANSLATOR.translate(event.getPacket().getClass(), event.getPacket(), GeyserSession.this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void packetError(PacketErrorEvent event) {
|
||||||
|
connector.getLogger().warning("Downstream packet error! " + event.getCause().getMessage());
|
||||||
|
if (connector.getConfig().isDebugMode())
|
||||||
|
event.getCause().printStackTrace();
|
||||||
|
event.setSuppress(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
downstream.getSession().connect();
|
downstream.getSession().connect();
|
||||||
|
|
Loading…
Reference in a new issue