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,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);
|
||||
|
Loading…
Reference in New Issue
Block a user