Skip to content

Commit d973c06

Browse files
committed
🧵 Make some fields volatile in PlayerConnectionImpl
1 parent c53ea5b commit d973c06

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

core/src/main/java/net/transferproxy/network/connection/PlayerConnectionImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ public class PlayerConnectionImpl extends SimpleChannelInboundHandler<Serverboun
6666
private static final Logger LOGGER = LoggerFactory.getLogger(PlayerConnectionImpl.class);
6767

6868
private final Channel channel;
69-
private PacketProviderGroup packetProviderGroup;
69+
private volatile PacketProviderGroup packetProviderGroup;
7070

71-
private ConnectionState state = ConnectionState.HANDSHAKE;
72-
private int protocol;
73-
private String hostname;
74-
private int hostPort;
71+
private volatile ConnectionState state = ConnectionState.HANDSHAKE;
72+
private volatile int protocol;
73+
private volatile String hostname;
74+
private volatile int hostPort;
7575

7676
// This is the field that must be volatile and not the entries
7777
private volatile Map<String, CompletableFuture<byte[]>> pendingCookies;
7878

7979
private String name;
8080
private UUID uuid;
8181
private ClientInformation information;
82-
private boolean fromTransfer;
82+
private volatile boolean fromTransfer;
8383
private String brand;
8484

8585
public PlayerConnectionImpl(final @NotNull Channel channel) {

0 commit comments

Comments
 (0)