13
0
geforkt von Mirrors/Velocity

Fix bug in ConnectOther message

Credits to @Jay113355 for spotting this
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-04-21 06:23:04 -04:00
Ursprung 24c9fc0ef1
Commit 2b84d35798

Datei anzeigen

@ -15,6 +15,7 @@ import com.velocitypowered.proxy.protocol.util.ByteBufDataOutput;
import com.velocitypowered.proxy.server.VelocityRegisteredServer; import com.velocitypowered.proxy.server.VelocityRegisteredServer;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import java.util.Optional;
import java.util.StringJoiner; import java.util.StringJoiner;
import net.kyori.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
@ -43,8 +44,11 @@ class BungeeCordMessageResponder {
String playerName = in.readUTF(); String playerName = in.readUTF();
String serverName = in.readUTF(); String serverName = in.readUTF();
proxy.getPlayer(playerName).flatMap(player -> proxy.getServer(serverName)) Optional<Player> referencedPlayer = proxy.getPlayer(playerName);
.ifPresent(server -> player.createConnectionRequest(server).fireAndForget()); Optional<RegisteredServer> referencedServer = proxy.getServer(serverName);
if (referencedPlayer.isPresent() && referencedServer.isPresent()) {
referencedPlayer.get().createConnectionRequest(referencedServer.get()).fireAndForget();
}
} }
private void processIp(ByteBufDataInput in) { private void processIp(ByteBufDataInput in) {