3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-25 07:40:13 +01:00

Batch handshake and server login/ping packets

Dieser Commit ist enthalten in:
Andrew Steinborn 2019-07-29 05:25:29 -04:00
Ursprung d65e371038
Commit 1da51b8ffb
2 geänderte Dateien mit 7 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -150,11 +150,12 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
handshake.setServerAddress(registeredServer.getServerInfo().getAddress().getHostString()); handshake.setServerAddress(registeredServer.getServerInfo().getAddress().getHostString());
} }
handshake.setPort(registeredServer.getServerInfo().getAddress().getPort()); handshake.setPort(registeredServer.getServerInfo().getAddress().getPort());
mc.write(handshake); mc.delayedWrite(handshake);
mc.setProtocolVersion(protocolVersion); mc.setProtocolVersion(protocolVersion);
mc.setState(StateRegistry.LOGIN); mc.setState(StateRegistry.LOGIN);
mc.write(new ServerLogin(proxyPlayer.getUsername())); mc.delayedWrite(new ServerLogin(proxyPlayer.getUsername()));
mc.flush();
} }
public @Nullable MinecraftConnection getConnection() { public @Nullable MinecraftConnection getConnection() {

Datei anzeigen

@ -34,10 +34,12 @@ public class PingSessionHandler implements MinecraftSessionHandler {
handshake.setServerAddress(server.getServerInfo().getAddress().getHostString()); handshake.setServerAddress(server.getServerInfo().getAddress().getHostString());
handshake.setPort(server.getServerInfo().getAddress().getPort()); handshake.setPort(server.getServerInfo().getAddress().getPort());
handshake.setProtocolVersion(ProtocolVersion.MINIMUM_VERSION); handshake.setProtocolVersion(ProtocolVersion.MINIMUM_VERSION);
connection.write(handshake); connection.delayedWrite(handshake);
connection.setState(StateRegistry.STATUS); connection.setState(StateRegistry.STATUS);
connection.write(StatusRequest.INSTANCE); connection.delayedWrite(StatusRequest.INSTANCE);
connection.flush();
} }
@Override @Override