Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shanwer committed Feb 17, 2025
2 parents cc97750 + 778c081 commit 058e8ba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import net.md_5.bungee.netty.LengthPrependerAndCompressor;
import net.md_5.bungee.protocol.packet.LoginSuccess;
import net.md_5.bungee.protocol.packet.SetCompression;

Expand All @@ -40,8 +41,9 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
// Fixes https://github.com/GeyserMC/Geyser/issues/4281
// The server may send a LoginDisconnect packet after compression is set.
if (!compressionDisabled) {
if (ctx.pipeline().get("compress") != null) {
ctx.pipeline().remove("compress");
LengthPrependerAndCompressor compressor = ctx.pipeline().get(LengthPrependerAndCompressor.class);
if (compressor.isCompress()) {
compressor.setCompress(false);
compressionDisabled = true;
}
if (ctx.pipeline().get("decompress") != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ protected void initializeLocalChannel0(GeyserBootstrap bootstrap) throws Excepti
throw new UnsupportedOperationException("Geyser does not currently support multiple listeners with injection! " +
"Please reach out to us on our Discord at https://discord.gg/GeyserMC so we can hear feedback on your setup.");
}

// TODO remove
try {
ProxyServer.class.getMethod("unsafe");
} catch (NoSuchMethodException e) {
throw new UnsupportedOperationException("You're using an outdated version of BungeeCord - please update. Thank you!");
}

ListenerInfo listenerInfo = proxy.getConfig().getListeners().stream().findFirst().orElseThrow(IllegalStateException::new);

Class<? extends ProxyServer> proxyClass = proxy.getClass();
Expand Down Expand Up @@ -138,7 +146,7 @@ protected void initChannel(@NonNull Channel ch) throws Exception {
if (channelInitializer == null) {
// Proxy has finished initializing; we can safely grab this variable without fear of plugins modifying it
// (Older versions of ViaVersion replace this to inject)
channelInitializer = PipelineUtils.SERVER_CHILD;
channelInitializer = proxy.unsafe().getFrontendChannelInitializer().getChannelInitializer();
}
initChannel.invoke(channelInitializer, ch);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ public boolean isConnected() {
return false;
}

@Override
public boolean isTransferred() {
return false;
}

@Override
public CompletableFuture<byte[]> retrieveCookie(String s) {
throw new UnsupportedOperationException();
}

@Override
public CompletableFuture<byte[]> sendData(String s, byte[] bytes) {
throw new UnsupportedOperationException();
}

@Override
public Unsafe unsafe() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void packetReceived(Session session, Packet packet) {
@Override
public void packetError(PacketErrorEvent event) {
geyser.getLogger().warning(GeyserLocale.getLocaleStringLog("geyser.network.downstream_error",
(event.getPacketClass() != null ? "(" + event.getPacketClass().getSimpleName() + ")" : "") +
(event.getPacketClass() != null ? "(" + event.getPacketClass().getSimpleName() + ") " : "") +
event.getCause().getMessage())
);
if (geyser.getConfig().isDebugMode())
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protocol-codec = "3.0.0.Beta6-20250212.131009-3"
raknet = "1.0.0.CR3-20250128.101054-17"
mcauthlib = "e5b0bcc"
minecraftauth = "4.1.1"
mcprotocollib = "1.21.4-20250121.131208-18"
mcprotocollib = "1.21.4-20250216.154737-20"
adventure = "4.14.0"
adventure-platform = "4.3.0"
junit = "5.9.2"
Expand All @@ -31,7 +31,7 @@ cloud = "2.0.0-rc.2"
cloud-minecraft = "2.0.0-beta.9"
cloud-minecraft-modded = "2.0.0-beta.10"
commodore = "2.2"
bungeecord = "a7c6ede"
bungeecord = "1.21-R0.1-20250215.224541-54"
velocity = "3.3.0-SNAPSHOT"
viaproxy = "3.3.2-SNAPSHOT"
fabric-loader = "0.16.9"
Expand Down Expand Up @@ -117,7 +117,7 @@ neoforge-minecraft = { group = "net.neoforged", name = "neoforge", version.ref =

adapters-spigot = { group = "org.geysermc.geyser.adapters", name = "spigot-all", version.ref = "adapters" }
adapters-paper = { group = "org.geysermc.geyser.adapters", name = "paper-all", version.ref = "adapters" }
bungeecord-proxy = { group = "com.github.SpigotMC.BungeeCord", name = "bungeecord-proxy", version.ref = "bungeecord" }
bungeecord-proxy = { group = "net.md-5", name = "bungeecord-proxy", version.ref = "bungeecord" }
checker-qual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerframework" }
commodore = { group = "me.lucko", name = "commodore", version.ref = "commodore" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
Expand Down

0 comments on commit 058e8ba

Please sign in to comment.