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
|
||||
private boolean spawned;
|
||||
private boolean closed;
|
||||
/**
|
||||
* Accessed on the initial Java and Bedrock packet processing threads
|
||||
*/
|
||||
private volatile boolean closed;
|
||||
|
||||
@Setter
|
||||
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) {
|
||||
if (session.isClosed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
translator.translate(packet, session);
|
||||
} catch (Throwable ex) {
|
||||
|
|
Loading…
Reference in a new issue