From 780e1c8be593753efe4a4ec6293c70a48d486ba7 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 23 Jun 2020 23:03:19 -0400 Subject: [PATCH] Handle duplicates from server pings gracefully --- .../api/event/command/CommandExecuteEvent.java | 2 +- .../velocitypowered/proxy/connection/MinecraftConnection.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java b/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java index d08a323f6..b899616d1 100644 --- a/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java @@ -62,7 +62,7 @@ public final class CommandExecuteEvent implements ResultedEvent { /** * Represents the result of the {@link CommandExecuteEvent}. */ - public static final class CommandResult implements Result { + public static final class CommandResult implements ResultedEvent.Result { private static final CommandResult ALLOWED = new CommandResult(true, false,null); private static final CommandResult DENIED = new CommandResult(false, false,null); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java index 3b11e48d1..6c8aa5b9f 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java @@ -17,6 +17,7 @@ import com.velocitypowered.natives.encryption.VelocityCipherFactory; import com.velocitypowered.natives.util.Natives; import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.connection.client.InitialInboundConnection; +import com.velocitypowered.proxy.connection.client.StatusSessionHandler; import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.StateRegistry; import com.velocitypowered.proxy.protocol.netty.MinecraftCipherDecoder; @@ -92,7 +93,8 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter { sessionHandler.disconnected(); } - if (association != null && !knownDisconnect) { + if (association != null && !knownDisconnect + && !(sessionHandler instanceof StatusSessionHandler)) { logger.info("{} has disconnected", association); } }