Better treat the disconnect flag
This commit is contained in:
@@ -21,7 +21,6 @@ import io.netty.util.concurrent.GenericFutureListener;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Iterator;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.crypto.SecretKey;
|
||||
@@ -59,7 +58,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
private PacketListener packetListener;
|
||||
private IChatBaseComponent n;
|
||||
private boolean o;
|
||||
private AtomicBoolean p = new AtomicBoolean(false); // Akarin
|
||||
private volatile boolean p; // Akarin - add volatile
|
||||
private int q;
|
||||
private int r;
|
||||
private float s;
|
||||
@@ -444,10 +443,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
||||
public void handleDisconnection() {
|
||||
if (this.channel != null && !this.channel.isOpen()) {
|
||||
if (!this.p.compareAndSet(false, true)) { // Akarin
|
||||
if (this.p) {
|
||||
NetworkManager.g.warn("handleDisconnection() called twice");
|
||||
} else {
|
||||
// this.p = true; // Akarin
|
||||
this.p = true;
|
||||
if (this.j() != null) {
|
||||
this.i().a(this.j());
|
||||
} else if (this.i() != null) {
|
||||
|
||||
Reference in New Issue
Block a user