mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-10-31 18:48: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:
parent
a986481b0d
commit
b95400e810
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user