#3823: Add client brand API
This commit is contained in:
@@ -778,6 +778,11 @@ public final class UserConnection implements ProxiedPlayer
|
||||
return this.getPendingConnection().getExtraDataInHandshake();
|
||||
}
|
||||
|
||||
public String getClientBrand()
|
||||
{
|
||||
return getPendingConnection().getClientBrand();
|
||||
}
|
||||
|
||||
public void setCompressionThreshold(int compressionThreshold)
|
||||
{
|
||||
if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 )
|
||||
|
@@ -2,6 +2,7 @@ package net.md_5.bungee.connection;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.gson.Gson;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
@@ -97,6 +98,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
@Getter
|
||||
private PluginMessage brandMessage;
|
||||
@Getter
|
||||
private String clientBrand;
|
||||
@Getter
|
||||
private final Set<String> registeredChannels = new HashSet<>();
|
||||
private State thisState = State.HANDSHAKE;
|
||||
private int loginPayloadId;
|
||||
@@ -849,6 +852,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
} else if ( input.getTag().equals( "MC|Brand" ) || input.getTag().equals( "minecraft:brand" ) )
|
||||
{
|
||||
brandMessage = input;
|
||||
clientBrand = DefinedPacket.readString( Unpooled.wrappedBuffer( input.getData() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user