Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 23:30:26 +01:00
Fix pinging being "delayed" on 1.7
Dieser Commit ist enthalten in:
Ursprung
079b352c97
Commit
85d88d59d3
@ -209,8 +209,10 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
*/
|
*/
|
||||||
public void closeWith(Object msg) {
|
public void closeWith(Object msg) {
|
||||||
if (channel.isActive()) {
|
if (channel.isActive()) {
|
||||||
if (channel.eventLoop().inEventLoop()
|
boolean is1Point8 = this.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_8) >= 0;
|
||||||
&& this.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_8) >= 0) {
|
boolean isLegacyPing = this.getState() == StateRegistry.HANDSHAKE
|
||||||
|
|| this.getState() == StateRegistry.STATUS;
|
||||||
|
if (channel.eventLoop().inEventLoop() && (is1Point8 || isLegacyPing)) {
|
||||||
knownDisconnect = true;
|
knownDisconnect = true;
|
||||||
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
||||||
} else {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren