Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Add limited flush consolidation, if the remote server supports it.
Dieser Commit ist enthalten in:
Ursprung
ba8629ca0e
Commit
3eeea8e8f8
@ -124,6 +124,13 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
|
||||
if (sessionHandler != null) {
|
||||
sessionHandler.readCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
if (ctx.channel().isActive()) {
|
||||
|
@ -70,6 +70,10 @@ public interface MinecraftSessionHandler {
|
||||
|
||||
}
|
||||
|
||||
default void readCompleted() {
|
||||
|
||||
}
|
||||
|
||||
default boolean handle(AvailableCommands commands) {
|
||||
return false;
|
||||
}
|
||||
|
@ -168,12 +168,17 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
||||
if (packet instanceof PluginMessage) {
|
||||
((PluginMessage) packet).retain();
|
||||
}
|
||||
playerConnection.write(packet);
|
||||
playerConnection.delayedWrite(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUnknown(ByteBuf buf) {
|
||||
playerConnection.write(buf.retain());
|
||||
playerConnection.delayedWrite(buf.retain());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCompleted() {
|
||||
playerConnection.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren