From b95400e81047401f615dd834584ced0274c45bb0 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 28 Jun 2015 07:08:39 -0400 Subject: [PATCH] Fix logging in Looks like player "online" entries need to have stricter validation. I'll probably implement this with Lua. --- .../redisbungee/RedisBungeeListener.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java index b780387..e44692f 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeListener.java @@ -94,14 +94,14 @@ public class RedisBungeeListener implements Listener { } } - String online = jedis.hget("player:" + event.getConnection().getUniqueId().toString(), "online"); - - if (online != null && online.equals("0")) { - event.setCancelled(true); - // TODO: Make it accept a BaseComponent[] like everything else. - event.setCancelReason(TextComponent.toLegacyText(ALREADY_LOGGED_IN)); - event.completeIntent(plugin); - return null; + for (String s : plugin.getServerIds()) { + if (jedis.sismember("proxy:" + s + ":usersOnline", s)) { + event.setCancelled(true); + // TODO: Make it accept a BaseComponent[] like everything else. + event.setCancelReason(TextComponent.toLegacyText(ALREADY_LOGGED_IN)); + event.completeIntent(plugin); + return null; + } } Map playerData = new HashMap<>(4);