2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-01 02:58:02 +00:00

Fix logging in

Looks like player "online" entries need to have stricter validation. I'll probably implement this with Lua.
This commit is contained in:
Tux 2015-06-28 07:08:39 -04:00
parent a986481b0d
commit b95400e810

View File

@ -94,14 +94,14 @@ public class RedisBungeeListener implements Listener {
} }
} }
String online = jedis.hget("player:" + event.getConnection().getUniqueId().toString(), "online"); for (String s : plugin.getServerIds()) {
if (jedis.sismember("proxy:" + s + ":usersOnline", s)) {
if (online != null && online.equals("0")) { event.setCancelled(true);
event.setCancelled(true); // TODO: Make it accept a BaseComponent[] like everything else.
// TODO: Make it accept a BaseComponent[] like everything else. event.setCancelReason(TextComponent.toLegacyText(ALREADY_LOGGED_IN));
event.setCancelReason(TextComponent.toLegacyText(ALREADY_LOGGED_IN)); event.completeIntent(plugin);
event.completeIntent(plugin); return null;
return null; }
} }
Map<String, String> playerData = new HashMap<>(4); Map<String, String> playerData = new HashMap<>(4);