3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Initializing the handshake registry explicitly is redundant.

Dieser Commit ist enthalten in:
Andrew Steinborn 2019-02-20 21:19:04 -05:00
Ursprung 3c8055019e
Commit c8e3e7ff94
3 geänderte Dateien mit 1 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -93,7 +93,6 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
.addListener((ChannelFutureListener) future -> { .addListener((ChannelFutureListener) future -> {
if (future.isSuccess()) { if (future.isSuccess()) {
connection = new MinecraftConnection(future.channel(), server); connection = new MinecraftConnection(future.channel(), server);
connection.setState(StateRegistry.HANDSHAKE);
connection.setAssociation(VelocityServerConnection.this); connection.setAssociation(VelocityServerConnection.this);
future.channel().pipeline().addLast(HANDLER, connection); future.channel().pipeline().addLast(HANDLER, connection);

Datei anzeigen

@ -48,7 +48,6 @@ public class ServerChannelInitializer extends ChannelInitializer<Channel> {
.addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.CLIENTBOUND)); .addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.CLIENTBOUND));
final MinecraftConnection connection = new MinecraftConnection(ch, this.server); final MinecraftConnection connection = new MinecraftConnection(ch, this.server);
connection.setState(StateRegistry.HANDSHAKE);
connection.setSessionHandler(new HandshakeSessionHandler(connection, this.server)); connection.setSessionHandler(new HandshakeSessionHandler(connection, this.server));
ch.pipeline().addLast(Connections.HANDLER, connection); ch.pipeline().addLast(Connections.HANDLER, connection);

Datei anzeigen

@ -78,9 +78,7 @@ public class VelocityRegisteredServer implements RegisteredServer {
.addLast(MINECRAFT_ENCODER, .addLast(MINECRAFT_ENCODER,
new MinecraftEncoder(ProtocolUtils.Direction.SERVERBOUND)); new MinecraftEncoder(ProtocolUtils.Direction.SERVERBOUND));
MinecraftConnection connection = new MinecraftConnection(ch, server); ch.pipeline().addLast(HANDLER, new MinecraftConnection(ch, server));
connection.setState(StateRegistry.HANDSHAKE);
ch.pipeline().addLast(HANDLER, connection);
} }
}) })
.connect(serverInfo.getAddress()) .connect(serverInfo.getAddress())