Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Batch handshake and server login/ping packets
Dieser Commit ist enthalten in:
Ursprung
d65e371038
Commit
1da51b8ffb
@ -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() {
|
||||||
|
@ -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
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren