mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-27 12:46:05 +01:00
Improve cookie support during login
This commit is contained in:
parent
eda268b481
commit
464ed0184c
@ -40,6 +40,8 @@ import net.md_5.bungee.protocol.Either;
|
||||
import net.md_5.bungee.protocol.PacketWrapper;
|
||||
import net.md_5.bungee.protocol.Protocol;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
import net.md_5.bungee.protocol.packet.CookieRequest;
|
||||
import net.md_5.bungee.protocol.packet.CookieResponse;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionRequest;
|
||||
import net.md_5.bungee.protocol.packet.EntityStatus;
|
||||
import net.md_5.bungee.protocol.packet.GameState;
|
||||
@ -188,6 +190,12 @@ public class ServerConnector extends PacketHandler
|
||||
ch.setCompressionThreshold( setCompression.getThreshold() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(CookieRequest cookieRequest) throws Exception
|
||||
{
|
||||
user.retrieveCookie( cookieRequest.getCookie() ).thenAccept( (cookie) -> ch.write( new CookieResponse( cookieRequest.getCookie(), cookie ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Login login) throws Exception
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ public class UpstreamBridge extends PacketHandler
|
||||
@Override
|
||||
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||
{
|
||||
return con.getServer() != null || packet.packet instanceof PluginMessage;
|
||||
return con.getServer() != null || packet.packet instanceof PluginMessage || packet.packet instanceof CookieResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user