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

Change detection method for duplicate players online.

This commit is contained in:
Tux 2013-12-15 11:30:08 -05:00
parent 6e179f96cf
commit fa93d67e1b

View File

@ -302,10 +302,12 @@ public final class RedisBungee extends Plugin implements Listener {
if (pool != null) {
Jedis rsc = pool.getResource();
try {
if (rsc.hexists("player:" + event.getConnection().getName(), "server")) {
for (String server : configuration.getLinkedServers()) {
if (rsc.sismember("server:" + server + ":usersOnline", event.getConnection().getName())) {
event.setCancelled(true);
event.setCancelReason("You are already logged on to this server.");
}
}
} finally {
pool.returnResource(rsc);
}