mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-08 16:10:26 +00:00
add config option to restore old kick behavior pre 0.9.0
This commit is contained in:
@@ -58,7 +58,15 @@ public class RedisBungeeBungeeListener extends AbstractRedisBungeeListener<Login
|
||||
if (event.isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
if (api.isPlayerOnline(event.getConnection().getUniqueId())) {
|
||||
if (plugin.getConfiguration().restoreOldKickBehavior()) {
|
||||
for (String s : plugin.getProxiesIds()) {
|
||||
if (unifiedJedis.sismember("proxy:" + s + ":usersOnline", event.getConnection().getUniqueId().toString())) {
|
||||
event.setCancelled(true);
|
||||
event.setCancelReason(plugin.getConfiguration().getMessages().get(RedisBungeeConfiguration.MessageType.ALREADY_LOGGED_IN));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else if (api.isPlayerOnline(event.getConnection().getUniqueId())) {
|
||||
PlayerUtils.setKickedOtherLocation(event.getConnection().getUniqueId().toString(), unifiedJedis);
|
||||
api.kickPlayer(event.getConnection().getUniqueId(), plugin.getConfiguration().getMessages().get(RedisBungeeConfiguration.MessageType.LOGGED_IN_OTHER_LOCATION));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user