mirror of
https://github.com/PaperMC/Velocity.git
synced 2025-02-23 15:49:19 +08:00
Batch handshake and server login/ping packets
This commit is contained in:
parent
d65e371038
commit
1da51b8ffb
@ -150,11 +150,12 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
||||
handshake.setServerAddress(registeredServer.getServerInfo().getAddress().getHostString());
|
||||
}
|
||||
handshake.setPort(registeredServer.getServerInfo().getAddress().getPort());
|
||||
mc.write(handshake);
|
||||
mc.delayedWrite(handshake);
|
||||
|
||||
mc.setProtocolVersion(protocolVersion);
|
||||
mc.setState(StateRegistry.LOGIN);
|
||||
mc.write(new ServerLogin(proxyPlayer.getUsername()));
|
||||
mc.delayedWrite(new ServerLogin(proxyPlayer.getUsername()));
|
||||
mc.flush();
|
||||
}
|
||||
|
||||
public @Nullable MinecraftConnection getConnection() {
|
||||
|
@ -34,10 +34,12 @@ public class PingSessionHandler implements MinecraftSessionHandler {
|
||||
handshake.setServerAddress(server.getServerInfo().getAddress().getHostString());
|
||||
handshake.setPort(server.getServerInfo().getAddress().getPort());
|
||||
handshake.setProtocolVersion(ProtocolVersion.MINIMUM_VERSION);
|
||||
connection.write(handshake);
|
||||
connection.delayedWrite(handshake);
|
||||
|
||||
connection.setState(StateRegistry.STATUS);
|
||||
connection.write(StatusRequest.INSTANCE);
|
||||
connection.delayedWrite(StatusRequest.INSTANCE);
|
||||
|
||||
connection.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user