#3758: Handle LoginPayloadResponse in UpstreamBridge

This commit is contained in:
Outfluencer 2024-11-19 10:20:17 +01:00 committed by GitHub
parent 81b118a8ba
commit f6b40b1186
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -904,7 +904,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
public CompletableFuture<byte[]> sendData(String channel, byte[] data)
{
Preconditions.checkState( getVersion() >= ProtocolConstants.MINECRAFT_1_13, "LoginPayloads are only supported in 1.13 and above" );
Preconditions.checkState( loginRequest != null, "Cannot send login data for status or legacy connections" );
Preconditions.checkState( ch.getEncodeProtocol() == Protocol.LOGIN, "LoginPayloads are only supported in the login phase" );
CompletableFuture<byte[]> future = new CompletableFuture<>();
final int id;

View File

@ -36,6 +36,7 @@ import net.md_5.bungee.protocol.packet.CookieResponse;
import net.md_5.bungee.protocol.packet.FinishConfiguration;
import net.md_5.bungee.protocol.packet.KeepAlive;
import net.md_5.bungee.protocol.packet.LoginAcknowledged;
import net.md_5.bungee.protocol.packet.LoginPayloadResponse;
import net.md_5.bungee.protocol.packet.PlayerListItem;
import net.md_5.bungee.protocol.packet.PlayerListItemRemove;
import net.md_5.bungee.protocol.packet.PluginMessage;
@ -378,6 +379,12 @@ public class UpstreamBridge extends PacketHandler
con.getPendingConnection().handle( cookieResponse );
}
@Override
public void handle(LoginPayloadResponse loginPayloadResponse) throws Exception
{
con.getPendingConnection().handle( loginPayloadResponse );
}
@Override
public String toString()
{