2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-26 22:18: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,9 +302,11 @@ public final class RedisBungee extends Plugin implements Listener {
if (pool != null) {
Jedis rsc = pool.getResource();
try {
if (rsc.hexists("player:" + event.getConnection().getName(), "server")) {
event.setCancelled(true);
event.setCancelReason("You are already logged on to this 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);