3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Pipeline util name clarity. Remove unneeded handlers.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-07-25 20:50:23 -04:00
Ursprung dc540ae776
Commit d89a4c4807
3 geänderte Dateien mit 4 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -34,7 +34,7 @@ public class VelocityServer {
.childHandler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
MinecraftPipelineUtils.strapPipelineForServer(ch);
MinecraftPipelineUtils.strapPipelineForProxy(ch);
MinecraftConnection connection = new MinecraftConnection(ch);
connection.setState(StateRegistry.HANDSHAKE);

Datei anzeigen

@ -27,7 +27,7 @@ public class ServerConnection {
.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
MinecraftPipelineUtils.strapPipelineForProxy(ch);
MinecraftPipelineUtils.strapPipelineForBackend(ch);
MinecraftConnection connection = new MinecraftConnection(ch);
connection.setState(StateRegistry.HANDSHAKE);

Datei anzeigen

@ -7,7 +7,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler;
import java.util.concurrent.TimeUnit;
public class MinecraftPipelineUtils {
public static void strapPipelineForServer(Channel ch) {
public static void strapPipelineForProxy(Channel ch) {
ch.pipeline().addLast("read-timeout", new ReadTimeoutHandler(30, TimeUnit.SECONDS));
ch.pipeline().addLast("legacy-ping-decode", new LegacyPingDecoder());
ch.pipeline().addLast("frame-decoder", new MinecraftVarintFrameDecoder());
@ -17,11 +17,9 @@ public class MinecraftPipelineUtils {
ch.pipeline().addLast("minecraft-encoder", new MinecraftEncoder(ProtocolConstants.Direction.TO_CLIENT));
}
public static void strapPipelineForProxy(Channel ch) {
public static void strapPipelineForBackend(Channel ch) {
ch.pipeline().addLast("read-timeout", new ReadTimeoutHandler(30, TimeUnit.SECONDS));
ch.pipeline().addLast("legacy-ping-decode", new LegacyPingDecoder());
ch.pipeline().addLast("frame-decoder", new MinecraftVarintFrameDecoder());
ch.pipeline().addLast("legacy-ping-encode", LegacyPingEncoder.INSTANCE);
ch.pipeline().addLast("frame-encoder", MinecraftVarintLengthEncoder.INSTANCE);
ch.pipeline().addLast("minecraft-decoder", new MinecraftDecoder(ProtocolConstants.Direction.TO_CLIENT));
ch.pipeline().addLast("minecraft-encoder", new MinecraftEncoder(ProtocolConstants.Direction.TO_SERVER));