2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-23 02:28:01 +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");
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<String, String> playerData = new HashMap<>(4);