Temporarily disable traffic handler, improve chunk viewers set

This commit is contained in:
themode 2021-03-21 12:02:23 +01:00
parent cd75740e41
commit 2028009685
2 changed files with 4 additions and 3 deletions

View File

@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.ConcurrentHashMap;
// TODO light data & API
@ -72,7 +72,7 @@ public abstract class Chunk implements Viewable, DataContainer {
private boolean readOnly;
protected volatile boolean loaded = true;
protected final Set<Player> viewers = new CopyOnWriteArraySet<>();
protected final Set<Player> viewers = ConcurrentHashMap.newKeySet();
private final Set<Player> unmodifiableViewers = Collections.unmodifiableSet(viewers);
// Path finding

View File

@ -167,7 +167,8 @@ public final class NettyServer {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(TRAFFIC_LIMITER_HANDLER_NAME, globalTrafficHandler);
// TODO enable when properly implemented (dynamic limit based on the number of clients)
//pipeline.addLast(TRAFFIC_LIMITER_HANDLER_NAME, globalTrafficHandler);
// First check should verify if the packet is a legacy ping (from 1.6 version and earlier)
// Removed from the pipeline later in LegacyPingHandler if unnecessary (>1.6)