Really suppress the initial connection stuff

This commit is contained in:
Andrew Steinborn
2020-06-23 08:32:47 -04:00
parent e9cc390abd
commit 0684e08f67
2 changed files with 9 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ import com.velocitypowered.natives.encryption.VelocityCipher;
import com.velocitypowered.natives.encryption.VelocityCipherFactory; import com.velocitypowered.natives.encryption.VelocityCipherFactory;
import com.velocitypowered.natives.util.Natives; import com.velocitypowered.natives.util.Natives;
import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.VelocityServer;
import com.velocitypowered.proxy.connection.client.InitialInboundConnection;
import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.MinecraftPacket;
import com.velocitypowered.proxy.protocol.StateRegistry; import com.velocitypowered.proxy.protocol.StateRegistry;
import com.velocitypowered.proxy.protocol.netty.MinecraftCipherDecoder; import com.velocitypowered.proxy.protocol.netty.MinecraftCipherDecoder;
@@ -90,7 +91,8 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
sessionHandler.disconnected(); sessionHandler.disconnected();
} }
if (association != null && !knownDisconnect) { if (association != null && !knownDisconnect
&& !(association instanceof InitialInboundConnection)) {
logger.info("{} has disconnected", association); logger.info("{} has disconnected", association);
} }
} }

View File

@@ -13,7 +13,8 @@ import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
class InitialInboundConnection implements InboundConnection, MinecraftConnectionAssociation { public final class InitialInboundConnection implements InboundConnection,
MinecraftConnectionAssociation {
private static final Logger logger = LogManager.getLogger(InitialInboundConnection.class); private static final Logger logger = LogManager.getLogger(InitialInboundConnection.class);
@@ -53,6 +54,10 @@ class InitialInboundConnection implements InboundConnection, MinecraftConnection
return "[initial connection] " + connection.getRemoteAddress().toString(); return "[initial connection] " + connection.getRemoteAddress().toString();
} }
/**
* Disconnects the connection from the server.
* @param reason the reason for disconnecting
*/
public void disconnect(Component reason) { public void disconnect(Component reason) {
logger.info("{} has disconnected: {}", this, logger.info("{} has disconnected: {}", this,
LegacyComponentSerializer.legacy().serialize(reason)); LegacyComponentSerializer.legacy().serialize(reason));