3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-26 16:12:50 +01:00

Do not use classes from io.netty.util.internal

In this case, we don't even need a concurrency-friendly MPSC queue, since this code only ever gets run in the event loop associated to the channel, so a simple `ArrayDeque` is enough for our needs.
Dieser Commit ist enthalten in:
Andrew Steinborn 2024-07-13 21:50:27 -04:00
Ursprung d5e7fa5b84
Commit ebc418f6cc
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -24,7 +24,7 @@ import com.velocitypowered.proxy.protocol.StateRegistry;
import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.util.ReferenceCountUtil; import io.netty.util.ReferenceCountUtil;
import io.netty.util.internal.PlatformDependent; import java.util.ArrayDeque;
import java.util.Queue; import java.util.Queue;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -42,7 +42,7 @@ import org.jetbrains.annotations.NotNull;
public class PlayPacketQueueInboundHandler extends ChannelDuplexHandler { public class PlayPacketQueueInboundHandler extends ChannelDuplexHandler {
private final StateRegistry.PacketRegistry.ProtocolRegistry registry; private final StateRegistry.PacketRegistry.ProtocolRegistry registry;
private final Queue<Object> queue = PlatformDependent.newMpscQueue(); private final Queue<Object> queue = new ArrayDeque<>();
/** /**
* Provides registries for client &amp; server bound packets. * Provides registries for client &amp; server bound packets.

Datei anzeigen

@ -25,7 +25,7 @@ import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise; import io.netty.channel.ChannelPromise;
import io.netty.util.ReferenceCountUtil; import io.netty.util.ReferenceCountUtil;
import io.netty.util.internal.PlatformDependent; import java.util.ArrayDeque;
import java.util.Queue; import java.util.Queue;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -43,7 +43,7 @@ import org.jetbrains.annotations.NotNull;
public class PlayPacketQueueOutboundHandler extends ChannelDuplexHandler { public class PlayPacketQueueOutboundHandler extends ChannelDuplexHandler {
private final StateRegistry.PacketRegistry.ProtocolRegistry registry; private final StateRegistry.PacketRegistry.ProtocolRegistry registry;
private final Queue<MinecraftPacket> queue = PlatformDependent.newMpscQueue(); private final Queue<MinecraftPacket> queue = new ArrayDeque<>();
/** /**
* Provides registries for client &amp; server bound packets. * Provides registries for client &amp; server bound packets.