Skip to content

Commit

Permalink
fix: disable packet limit only in dev build
Browse files Browse the repository at this point in the history
  • Loading branch information
IWareQ committed Jan 13, 2025
1 parent 1e0c8b1 commit 62d17fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Unless otherwise specified, any version comparison below is the comparison of se
maintainability of the project.
- Introduced better names for some of the fields in `PlayerAuthInputPacketProcessor`, this improved the readability of
the code.
- Disabled packet limit only in dev build.

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.netty.channel.socket.DatagramChannel;
import io.netty.channel.socket.nio.NioDatagramChannel;
import lombok.extern.slf4j.Slf4j;
import org.allaymc.api.AllayAPI;
import org.allaymc.api.entity.type.EntityTypes;
import org.allaymc.api.eventbus.event.network.ClientConnectEvent;
import org.allaymc.api.i18n.I18n;
Expand Down Expand Up @@ -75,7 +76,7 @@ public void start() {
this.channel = new ServerBootstrap()
.channelFactory(RakChannelFactory.server(datagramChannelClass))
.option(RakChannelOption.RAK_ADVERTISEMENT, pong.toByteBuf())
.option(RakChannelOption.RAK_PACKET_LIMIT, 1000) // This option fixed localhost blocking address
.option(RakChannelOption.RAK_PACKET_LIMIT, AllayAPI.getInstance().isDevBuild() ? Integer.MAX_VALUE : 120) // This option fixed localhost blocking address
.group(eventLoopGroup)
.childHandler(new BedrockServerInitializer() {
@Override
Expand Down

0 comments on commit 62d17fd

Please sign in to comment.