geforkt von Mirrors/Velocity
Pipeline util name clarity. Remove unneeded handlers.
Dieser Commit ist enthalten in:
Ursprung
dc540ae776
Commit
d89a4c4807
@ -34,7 +34,7 @@ public class VelocityServer {
|
|||||||
.childHandler(new ChannelInitializer<Channel>() {
|
.childHandler(new ChannelInitializer<Channel>() {
|
||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel ch) throws Exception {
|
protected void initChannel(Channel ch) throws Exception {
|
||||||
MinecraftPipelineUtils.strapPipelineForServer(ch);
|
MinecraftPipelineUtils.strapPipelineForProxy(ch);
|
||||||
|
|
||||||
MinecraftConnection connection = new MinecraftConnection(ch);
|
MinecraftConnection connection = new MinecraftConnection(ch);
|
||||||
connection.setState(StateRegistry.HANDSHAKE);
|
connection.setState(StateRegistry.HANDSHAKE);
|
||||||
|
@ -27,7 +27,7 @@ public class ServerConnection {
|
|||||||
.handler(new ChannelInitializer<Channel>() {
|
.handler(new ChannelInitializer<Channel>() {
|
||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel ch) throws Exception {
|
protected void initChannel(Channel ch) throws Exception {
|
||||||
MinecraftPipelineUtils.strapPipelineForProxy(ch);
|
MinecraftPipelineUtils.strapPipelineForBackend(ch);
|
||||||
|
|
||||||
MinecraftConnection connection = new MinecraftConnection(ch);
|
MinecraftConnection connection = new MinecraftConnection(ch);
|
||||||
connection.setState(StateRegistry.HANDSHAKE);
|
connection.setState(StateRegistry.HANDSHAKE);
|
||||||
|
@ -7,7 +7,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class MinecraftPipelineUtils {
|
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("read-timeout", new ReadTimeoutHandler(30, TimeUnit.SECONDS));
|
||||||
ch.pipeline().addLast("legacy-ping-decode", new LegacyPingDecoder());
|
ch.pipeline().addLast("legacy-ping-decode", new LegacyPingDecoder());
|
||||||
ch.pipeline().addLast("frame-decoder", new MinecraftVarintFrameDecoder());
|
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));
|
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("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("frame-decoder", new MinecraftVarintFrameDecoder());
|
||||||
ch.pipeline().addLast("legacy-ping-encode", LegacyPingEncoder.INSTANCE);
|
|
||||||
ch.pipeline().addLast("frame-encoder", MinecraftVarintLengthEncoder.INSTANCE);
|
ch.pipeline().addLast("frame-encoder", MinecraftVarintLengthEncoder.INSTANCE);
|
||||||
ch.pipeline().addLast("minecraft-decoder", new MinecraftDecoder(ProtocolConstants.Direction.TO_CLIENT));
|
ch.pipeline().addLast("minecraft-decoder", new MinecraftDecoder(ProtocolConstants.Direction.TO_CLIENT));
|
||||||
ch.pipeline().addLast("minecraft-encoder", new MinecraftEncoder(ProtocolConstants.Direction.TO_SERVER));
|
ch.pipeline().addLast("minecraft-encoder", new MinecraftEncoder(ProtocolConstants.Direction.TO_SERVER));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren