Skip to content

Commit

Permalink
performance tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
AoElite committed Dec 28, 2023
1 parent 8ab62c4 commit 953ebf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/ac/grim/grimac/player/GrimPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
Expand All @@ -67,7 +68,7 @@ public class GrimPlayer implements GrimUser {
// Determining player ping
// The difference between keepalive and transactions is that keepalive is async while transactions are sync
public final Queue<Pair<Short, Long>> transactionsSent = new ConcurrentLinkedQueue<>();
public final List<Short> didWeSendThatTrans = Collections.synchronizedList(new ArrayList<>());
public final Set<Short> didWeSendThatTrans = ConcurrentHashMap.newKeySet();
private final AtomicInteger transactionIDCounter = new AtomicInteger(0);
public AtomicInteger lastTransactionSent = new AtomicInteger(0);
public AtomicInteger lastTransactionReceived = new AtomicInteger(0);
Expand Down

0 comments on commit 953ebf4

Please sign in to comment.