geforkt von Mirrors/Velocity
Flush consolidation tweaks
Dieser Commit ist enthalten in:
Ursprung
195a506117
Commit
32ef77f954
@ -84,6 +84,8 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel ch) throws Exception {
|
protected void initChannel(Channel ch) throws Exception {
|
||||||
ch.pipeline()
|
ch.pipeline()
|
||||||
|
.addLast(FLUSH_CONSOLIDATION, new FlushConsolidationHandler(
|
||||||
|
DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true))
|
||||||
.addLast(READ_TIMEOUT,
|
.addLast(READ_TIMEOUT,
|
||||||
new ReadTimeoutHandler(server.getConfiguration().getReadTimeout(),
|
new ReadTimeoutHandler(server.getConfiguration().getReadTimeout(),
|
||||||
TimeUnit.MILLISECONDS))
|
TimeUnit.MILLISECONDS))
|
||||||
@ -93,9 +95,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
.addLast(MINECRAFT_DECODER,
|
.addLast(MINECRAFT_DECODER,
|
||||||
new MinecraftDecoder(ProtocolUtils.Direction.CLIENTBOUND))
|
new MinecraftDecoder(ProtocolUtils.Direction.CLIENTBOUND))
|
||||||
.addLast(MINECRAFT_ENCODER,
|
.addLast(MINECRAFT_ENCODER,
|
||||||
new MinecraftEncoder(ProtocolUtils.Direction.SERVERBOUND))
|
new MinecraftEncoder(ProtocolUtils.Direction.SERVERBOUND));
|
||||||
.addLast(FLUSH_CONSOLIDATION, new FlushConsolidationHandler(
|
|
||||||
DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true));
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.connect(registeredServer.getServerInfo().getAddress())
|
.connect(registeredServer.getServerInfo().getAddress())
|
||||||
|
@ -14,7 +14,6 @@ import com.velocitypowered.proxy.VelocityServer;
|
|||||||
import com.velocitypowered.proxy.connection.MinecraftConnection;
|
import com.velocitypowered.proxy.connection.MinecraftConnection;
|
||||||
import com.velocitypowered.proxy.connection.client.HandshakeSessionHandler;
|
import com.velocitypowered.proxy.connection.client.HandshakeSessionHandler;
|
||||||
import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
||||||
import com.velocitypowered.proxy.protocol.StateRegistry;
|
|
||||||
import com.velocitypowered.proxy.protocol.netty.LegacyPingDecoder;
|
import com.velocitypowered.proxy.protocol.netty.LegacyPingDecoder;
|
||||||
import com.velocitypowered.proxy.protocol.netty.LegacyPingEncoder;
|
import com.velocitypowered.proxy.protocol.netty.LegacyPingEncoder;
|
||||||
import com.velocitypowered.proxy.protocol.netty.MinecraftDecoder;
|
import com.velocitypowered.proxy.protocol.netty.MinecraftDecoder;
|
||||||
@ -40,6 +39,8 @@ public class ServerChannelInitializer extends ChannelInitializer<Channel> {
|
|||||||
@Override
|
@Override
|
||||||
protected void initChannel(final Channel ch) {
|
protected void initChannel(final Channel ch) {
|
||||||
ch.pipeline()
|
ch.pipeline()
|
||||||
|
.addLast(FLUSH_CONSOLIDATION, new FlushConsolidationHandler(
|
||||||
|
DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true))
|
||||||
.addLast(READ_TIMEOUT,
|
.addLast(READ_TIMEOUT,
|
||||||
new ReadTimeoutHandler(this.server.getConfiguration().getReadTimeout(),
|
new ReadTimeoutHandler(this.server.getConfiguration().getReadTimeout(),
|
||||||
TimeUnit.MILLISECONDS))
|
TimeUnit.MILLISECONDS))
|
||||||
@ -48,9 +49,7 @@ public class ServerChannelInitializer extends ChannelInitializer<Channel> {
|
|||||||
.addLast(LEGACY_PING_ENCODER, LegacyPingEncoder.INSTANCE)
|
.addLast(LEGACY_PING_ENCODER, LegacyPingEncoder.INSTANCE)
|
||||||
.addLast(FRAME_ENCODER, MinecraftVarintLengthEncoder.INSTANCE)
|
.addLast(FRAME_ENCODER, MinecraftVarintLengthEncoder.INSTANCE)
|
||||||
.addLast(MINECRAFT_DECODER, new MinecraftDecoder(ProtocolUtils.Direction.SERVERBOUND))
|
.addLast(MINECRAFT_DECODER, new MinecraftDecoder(ProtocolUtils.Direction.SERVERBOUND))
|
||||||
.addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.CLIENTBOUND))
|
.addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.CLIENTBOUND));
|
||||||
.addLast(FLUSH_CONSOLIDATION, new FlushConsolidationHandler(
|
|
||||||
DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true));
|
|
||||||
|
|
||||||
final MinecraftConnection connection = new MinecraftConnection(ch, this.server);
|
final MinecraftConnection connection = new MinecraftConnection(ch, this.server);
|
||||||
connection.setSessionHandler(new HandshakeSessionHandler(connection, this.server));
|
connection.setSessionHandler(new HandshakeSessionHandler(connection, this.server));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren