mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-13 07:09:51 +01:00
Temporarily disable traffic handler, improve chunk viewers set
This commit is contained in:
parent
cd75740e41
commit
2028009685
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user