diff --git a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/internal/PubSubListener.java b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/internal/PubSubListener.java index c8e0fd4..83c624c 100644 --- a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/internal/PubSubListener.java +++ b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/internal/PubSubListener.java @@ -21,7 +21,6 @@ public class PubSubListener implements Runnable { @Override public void run() { - boolean broken = false; try (Jedis rsc = plugin.requestJedis()) { try { @@ -42,16 +41,11 @@ public class PubSubListener implements Runnable { - redis.clients.jedis.exceptions.JedisConnectionException: JedisPubSub was not subscribed to a Jedis instance */ } - broken = true; } } catch (JedisConnectionException e) { plugin.logWarn("PubSub error, attempting to recover in 5 secs."); plugin.executeAsyncAfter(this, TimeUnit.SECONDS, 5); } - - if (broken) { - run(); - } } public void addChannel(String... channel) { diff --git a/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeCommandSender.java b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeCommandSender.java new file mode 100644 index 0000000..c675eae --- /dev/null +++ b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeCommandSender.java @@ -0,0 +1,74 @@ +package com.imaginarycode.minecraft.redisbungee; + +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.chat.BaseComponent; + +import java.util.Collection; +import java.util.Collections; + +public class RedisBungeeCommandSender implements CommandSender { + private static final RedisBungeeCommandSender singleton; + + static { + singleton = new RedisBungeeCommandSender(); + } + + public static RedisBungeeCommandSender getSingleton() { + return singleton; + } + + @Override + public String getName() { + return "RedisBungee"; + } + + @Override + public void sendMessage(String s) { + + } + + @Override + public void sendMessages(String... strings) { + + } + + @Override + public void sendMessage(BaseComponent... baseComponents) { + + } + + @Override + public void sendMessage(BaseComponent baseComponent) { + + } + + @Override + public Collection getGroups() { + return null; + } + + @Override + public void addGroups(String... strings) { + + } + + @Override + public void removeGroups(String... strings) { + + } + + @Override + public boolean hasPermission(String s) { + return true; + } + + @Override + public void setPermission(String s, boolean b) { + + } + + @Override + public Collection getPermissions() { + return Collections.emptySet(); + } +} diff --git a/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java index ff8f414..797ba98 100644 --- a/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java +++ b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java @@ -13,6 +13,7 @@ import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent; import com.imaginarycode.minecraft.redisbungee.internal.RedisUtil; import com.imaginarycode.minecraft.redisbungee.internal.util.RedisCallable; import net.md_5.bungee.api.AbstractReconnectHandler; +import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.Server; @@ -254,7 +255,7 @@ public class RedisBungeeListener extends AbstractRedisBungeeListener