13
0
geforkt von Mirrors/Velocity

Really suppress the initial connection stuff

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-06-23 08:32:47 -04:00
Ursprung e9cc390abd
Commit 0684e08f67
2 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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