Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 07:40:13 +01:00
Flush queued packets to the client in case we can't write
Dieser Commit ist enthalten in:
Ursprung
3eeea8e8f8
Commit
8725178d6d
@ -274,9 +274,15 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writabilityChanged() {
|
public void writabilityChanged() {
|
||||||
|
boolean writable = player.getConnection().getChannel().isWritable();
|
||||||
|
|
||||||
|
if (!writable) {
|
||||||
|
// We might have packets queued for the server, so flush them now to free up memory.
|
||||||
|
player.getConnection().flush();
|
||||||
|
}
|
||||||
|
|
||||||
VelocityServerConnection serverConn = player.getConnectedServer();
|
VelocityServerConnection serverConn = player.getConnectedServer();
|
||||||
if (serverConn != null) {
|
if (serverConn != null) {
|
||||||
boolean writable = player.getConnection().getChannel().isWritable();
|
|
||||||
MinecraftConnection smc = serverConn.getConnection();
|
MinecraftConnection smc = serverConn.getConnection();
|
||||||
if (smc != null) {
|
if (smc != null) {
|
||||||
smc.setAutoReading(writable);
|
smc.setAutoReading(writable);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren