mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Check for closed immediately before processing a packet
This commit is contained in:
parent
a1d167d5f1
commit
77119316f5
2 changed files with 8 additions and 1 deletions
|
@ -220,7 +220,10 @@ public class GeyserSession implements CommandSender {
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private boolean spawned;
|
private boolean spawned;
|
||||||
private boolean closed;
|
/**
|
||||||
|
* Accessed on the initial Java and Bedrock packet processing threads
|
||||||
|
*/
|
||||||
|
private volatile boolean closed;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private GameMode gameMode = GameMode.SURVIVAL;
|
private GameMode gameMode = GameMode.SURVIVAL;
|
||||||
|
|
|
@ -107,6 +107,10 @@ public class PacketTranslatorRegistry<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private <P extends T> void translate0(GeyserSession session, PacketTranslator<P> translator, P packet) {
|
private <P extends T> void translate0(GeyserSession session, PacketTranslator<P> translator, P packet) {
|
||||||
|
if (session.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
translator.translate(packet, session);
|
translator.translate(packet, session);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
|
|
Loading…
Reference in a new issue