Skip to content

Commit f197260

Browse files
Always skip EaglerCraft players
1 parent cbae477 commit f197260

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

common/src/main/java/xyz/jonesdev/sonar/common/InboundHandlerAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import xyz.jonesdev.sonar.common.protocol.SonarPacketEncoder;
3131
import xyz.jonesdev.sonar.common.protocol.SonarPacketRegistry;
3232
import xyz.jonesdev.sonar.common.statistics.GlobalSonarStatistics;
33+
import xyz.jonesdev.sonar.common.util.EaglerUtil;
3334
import xyz.jonesdev.sonar.common.util.GeyserUtil;
3435
import xyz.jonesdev.sonar.common.util.ProtocolUtil;
3536
import xyz.jonesdev.sonar.common.util.exception.QuietDecoderException;
@@ -120,7 +121,8 @@ protected final void handleLogin(final @NotNull ChannelHandlerContext ctx,
120121
}
121122

122123
// Don't continue the verification process if the verification is disabled
123-
if (!Sonar.get0().getAntiBot().shouldVerifyNewPlayers()) {
124+
if (!Sonar.get0().getAntiBot().shouldVerifyNewPlayers()
125+
|| EaglerUtil.isEaglerConnection(ctx.channel())) {
124126
initialLogin(ctx.channel(), inetAddress, initialLoginAction);
125127
return;
126128
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (C) 2025 Sonar Contributors
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package xyz.jonesdev.sonar.common.util;
19+
20+
import io.netty.channel.Channel;
21+
import io.netty.util.AttributeKey;
22+
import lombok.experimental.UtilityClass;
23+
import org.jetbrains.annotations.NotNull;
24+
25+
@UtilityClass
26+
public class EaglerUtil {
27+
// https://github.com/lax1dude/eaglerxserver/blob/main/core/src/main/java/net/lax1dude/eaglercraft/backend/server/adapter/PipelineAttributes.java
28+
public static final AttributeKey<Object> EAGLER_LISTENER_DATA = AttributeKey.valueOf("$eagler0");
29+
public static final AttributeKey<Object> EAGLER_PIPELINE_DATA = AttributeKey.valueOf("$eagler1");
30+
31+
public boolean isEaglerConnection(final @NotNull Channel channel) {
32+
return channel.attr(EAGLER_LISTENER_DATA).get() != null
33+
|| channel.attr(EAGLER_PIPELINE_DATA).get() != null;
34+
}
35+
}

0 commit comments

Comments
 (0)