mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-12-23 18:48:02 +00:00
Readd the clone detection.
This commit is contained in:
parent
adf61b7b8d
commit
17ba11a284
@ -302,6 +302,23 @@ public final class RedisBungee extends Plugin implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPreLogin(PreLoginEvent event) {
|
||||
if (pool != null) {
|
||||
Jedis rsc = pool.getResource();
|
||||
try {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerConnect(final PostLoginEvent event) {
|
||||
if (pool != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user