mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-19 09:07:06 +00:00
Fix compatibility with antibot plugins
This prevents RedisBungee from handling connections that are cancelled by antibots (The priority change is also to prevent the cancellation ignore of antibots)
This commit is contained in:
parent
a006c343a7
commit
4506ea75d6
@ -42,8 +42,12 @@ public class RedisBungeeListener implements Listener {
|
||||
private final RedisBungee plugin;
|
||||
private final List<InetAddress> exemptAddresses;
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler
|
||||
public void onLogin(final LoginEvent event) {
|
||||
if (event.isCancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.registerIntent(plugin);
|
||||
plugin.getProxy().getScheduler().runAsync(plugin, new RedisCallable<Void>(plugin) {
|
||||
@Override
|
||||
@ -132,7 +136,7 @@ public class RedisBungeeListener implements Listener {
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler
|
||||
public void onPing(final ProxyPingEvent event) {
|
||||
if (exemptAddresses.contains(event.getConnection().getAddress().getAddress())) {
|
||||
return;
|
||||
@ -150,6 +154,10 @@ public class RedisBungeeListener implements Listener {
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
@EventHandler
|
||||
public void onPluginMessage(final PluginMessageEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((event.getTag().equals("legacy:redisbungee") || event.getTag().equals("RedisBungee")) && event.getSender() instanceof Server) {
|
||||
final String currentChannel = event.getTag();
|
||||
final byte[] data = Arrays.copyOf(event.getData(), event.getData().length);
|
||||
|
Loading…
Reference in New Issue
Block a user