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:
parent
6e179f96cf
commit
fa93d67e1b
@ -302,10 +302,12 @@ public final class RedisBungee extends Plugin implements Listener {
|
|||||||
if (pool != null) {
|
if (pool != null) {
|
||||||
Jedis rsc = pool.getResource();
|
Jedis rsc = pool.getResource();
|
||||||
try {
|
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.setCancelled(true);
|
||||||
event.setCancelReason("You are already logged on to this server.");
|
event.setCancelReason("You are already logged on to this server.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
pool.returnResource(rsc);
|
pool.returnResource(rsc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user