Skip to content

Commit 4e71a19

Browse files
committed
build: 1.21.5-rc1
1 parent fc45217 commit 4e71a19

12 files changed

Lines changed: 304 additions & 797 deletions

File tree

bungee/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ configurations {
2828
}
2929

3030
dependencies {
31-
implementation 'bungee:BungeeCord:1888'
31+
implementation 'bungee:BungeeCord:1923'
3232
// implementation "net.md-5:bungeecord-proxy:1.+"
3333
// compileOnly 'org.projectlombok:lombok:1.18.24' // for bungeecord sources
3434

bungee/src/main/java/com/ishland/raknetify/bungee/connection/RakNetBungeeConnectionUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void postInitChannel(Channel channel, boolean isClientSide) {
8181
if (channel.config() instanceof RakNet.Config) {
8282
channel.pipeline().replace(PipelineUtils.TIMEOUT_HANDLER, PipelineUtils.TIMEOUT_HANDLER, new ChannelDuplexHandler()); // no-op
8383
channel.pipeline().replace(PipelineUtils.FRAME_DECODER, PipelineUtils.FRAME_DECODER, new ChannelDuplexHandler()); // no-op
84-
channel.pipeline().replace(PipelineUtils.FRAME_PREPENDER, PipelineUtils.FRAME_PREPENDER, new ChannelDuplexHandler()); // no-op
84+
channel.pipeline().addBefore(PipelineUtils.FRAME_PREPENDER_AND_COMPRESS, StripFrameHandler.NAME, StripFrameHandler.INSTANCE); // no-op
8585
if (channel.pipeline().get(HAProxyMessageDecoder.class) != null)
8686
channel.pipeline().remove(HAProxyMessageDecoder.class);
8787
channel.pipeline().addBefore(PipelineUtils.BOSS_HANDLER, RakNetBungeeClientChannelEventListener.NAME, new RakNetBungeeClientChannelEventListener());
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* This file is a part of the Raknetify project, licensed under MIT.
3+
*
4+
* Copyright (c) 2022-2023 ishland
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package com.ishland.raknetify.bungee.connection;
26+
27+
import io.netty.buffer.ByteBuf;
28+
import io.netty.channel.ChannelHandler;
29+
import io.netty.channel.ChannelHandlerContext;
30+
import io.netty.channel.ChannelOutboundHandlerAdapter;
31+
import io.netty.channel.ChannelPromise;
32+
import net.md_5.bungee.protocol.DefinedPacket;
33+
34+
@ChannelHandler.Sharable
35+
public class StripFrameHandler extends ChannelOutboundHandlerAdapter {
36+
37+
public static final String NAME = "raknetify-bungee-strip-frame";
38+
39+
public static final StripFrameHandler INSTANCE = new StripFrameHandler();
40+
41+
private StripFrameHandler() {
42+
}
43+
44+
@Override
45+
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
46+
if (msg instanceof ByteBuf buf) {
47+
DefinedPacket.readVarInt(buf);
48+
ctx.write(buf.slice(), promise);
49+
return;
50+
}
51+
super.write(ctx, msg, promise);
52+
}
53+
54+
}

0 commit comments

Comments
 (0)