Skip to content

Commit

Permalink
Check if channel is open before injecting (GeyserMC#547)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
linsaftw and Tim203 authored Sep 29, 2024
1 parent 3db8e59 commit 0360721
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public void inject() {
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,
Expand Down

0 comments on commit 0360721

Please sign in to comment.