Fix #156 - Bukkit trying to get client settings.
This commit is contained in:
parent
ec1de0f636
commit
5bfab582df
@ -56,11 +56,17 @@ public class ServerConnector extends PacketHandler
|
|||||||
|
|
||||||
ch.write( BungeeCord.getInstance().registerChannels() );
|
ch.write( BungeeCord.getInstance().registerChannels() );
|
||||||
|
|
||||||
|
// TODO: Race conditions with many connects
|
||||||
Queue<DefinedPacket> packetQueue = ( (BungeeServerInfo) target ).getPacketQueue();
|
Queue<DefinedPacket> packetQueue = ( (BungeeServerInfo) target ).getPacketQueue();
|
||||||
while ( !packetQueue.isEmpty() )
|
while ( !packetQueue.isEmpty() )
|
||||||
{
|
{
|
||||||
ch.write( packetQueue.poll() );
|
ch.write( packetQueue.poll() );
|
||||||
}
|
}
|
||||||
|
if ( user.settings != null )
|
||||||
|
{
|
||||||
|
ch.write( user.settings );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
synchronized ( user.getSwitchMutex() )
|
synchronized ( user.getSwitchMutex() )
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,7 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
private final Object permMutex = new Object();
|
private final Object permMutex = new Object();
|
||||||
@Getter
|
@Getter
|
||||||
private final Object switchMutex = new Object();
|
private final Object switchMutex = new Object();
|
||||||
|
public PacketCCSettings settings;
|
||||||
|
|
||||||
public UserConnection(BungeeCord bungee, Channel channel, PendingConnection pendingConnection, Packet2Handshake handshake, Packet1Login forgeLogin, List<PacketFAPluginMessage> loginMessages)
|
public UserConnection(BungeeCord bungee, Channel channel, PendingConnection pendingConnection, Packet2Handshake handshake, Packet1Login forgeLogin, List<PacketFAPluginMessage> loginMessages)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,7 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
|||||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
import net.md_5.bungee.packet.Packet0KeepAlive;
|
import net.md_5.bungee.packet.Packet0KeepAlive;
|
||||||
import net.md_5.bungee.packet.Packet3Chat;
|
import net.md_5.bungee.packet.Packet3Chat;
|
||||||
|
import net.md_5.bungee.packet.PacketCCSettings;
|
||||||
import net.md_5.bungee.packet.PacketFAPluginMessage;
|
import net.md_5.bungee.packet.PacketFAPluginMessage;
|
||||||
import net.md_5.bungee.packet.PacketHandler;
|
import net.md_5.bungee.packet.PacketHandler;
|
||||||
|
|
||||||
@ -80,6 +81,12 @@ public class UpstreamBridge extends PacketHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(PacketCCSettings settings) throws Exception
|
||||||
|
{
|
||||||
|
con.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
|
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package net.md_5.bungee.packet;
|
||||||
|
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class PacketCCSettings extends DefinedPacket
|
||||||
|
{
|
||||||
|
|
||||||
|
public String locale;
|
||||||
|
public byte viewDistance;
|
||||||
|
public byte chatFlags;
|
||||||
|
public byte difficulty;
|
||||||
|
public boolean showCape;
|
||||||
|
|
||||||
|
public PacketCCSettings(byte[] buf)
|
||||||
|
{
|
||||||
|
super( 0xCC, buf );
|
||||||
|
locale = readUTF();
|
||||||
|
viewDistance = readByte();
|
||||||
|
chatFlags = readByte();
|
||||||
|
difficulty = readByte();
|
||||||
|
showCape = readBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(PacketHandler handler) throws Exception
|
||||||
|
{
|
||||||
|
handler.handle( this );
|
||||||
|
}
|
||||||
|
}
|
@ -48,6 +48,10 @@ public abstract class PacketHandler
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void handle(PacketCCSettings settings) throws Exception
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void handle(PacketCDClientStatus clientStatus) throws Exception
|
public void handle(PacketCDClientStatus clientStatus) throws Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user