1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Check if channel is open before injecting (#547)

* Check if channel is open before injecting

Some forks like FlameCord have integrated anti-bot features to block connections early. 

By default, Floodgate runs anyways, which not only makes bot attacks affect the server when Floodgate is instaled, but also generate an exception. 

This fixes the issue.

* Add note about why it's added

---------

Co-authored-by: Tim203 <mctim203@gmail.com>
This commit is contained in:
LinsaFTW
2024-09-29 07:32:56 -03:00
committed by GitHub
parent 3db8e5931f
commit 0360721d9c

View File

@@ -91,6 +91,10 @@ public final class BungeeInjector extends CommonPlatformInjector {
ChannelInitializer<Channel> wrapper = new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel channel) {
// Check if the channel is open, see #547
if (!channel.isOpen()) {
return;
}
ReflectionUtils.invoke(original, initChannelMethod, channel);
channel.pipeline().addBefore(
PipelineUtils.FRAME_DECODER, BUNGEE_INIT,