From 18ed62b09636bd7f2cb75e2a3ead90ac382618cc Mon Sep 17 00:00:00 2001 From: Xephi Date: Sat, 9 Jan 2016 14:45:59 +0100 Subject: [PATCH] Fix #423 --- .../xephi/authme/permission/PlayerPermission.java | 7 ++++++- .../authme/process/login/AsynchronousLogin.java | 15 ++++----------- src/main/resources/plugin.yml | 4 ++++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/java/fr/xephi/authme/permission/PlayerPermission.java b/src/main/java/fr/xephi/authme/permission/PlayerPermission.java index 8eddb8028..f889ce6de 100644 --- a/src/main/java/fr/xephi/authme/permission/PlayerPermission.java +++ b/src/main/java/fr/xephi/authme/permission/PlayerPermission.java @@ -83,7 +83,12 @@ public enum PlayerPermission implements PermissionNode { /** * Permission to use all player (non-admin) commands. */ - PLAYER_ALL("authme.player.*"); + PLAYER_ALL("authme.player.*"), + + /** + * Permission to use to see own other accounts. + */ + SEE_OWN_ACCOUNTS("authme.player.showotheraccounts"); /** * The permission node. diff --git a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java index 9b911da17..564fd89a1 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java @@ -232,8 +232,6 @@ public class AsynchronousLogin { return; } StringBuilder message = new StringBuilder("[AuthMe] "); - // String uuidaccounts = - // "[AuthMe] PlayerNames has %size% links to this UUID : "; int i = 0; for (String account : auths) { i++; @@ -244,18 +242,13 @@ public class AsynchronousLogin { message.append('.'); } } - /* - * TODO: Active uuid system i = 0; for (String account : uuidlist) { - * i++; uuidaccounts = uuidaccounts + account; if (i != auths.size()) { - * uuidaccounts = uuidaccounts + ", "; } else { uuidaccounts = - * uuidaccounts + "."; } } - */ + for (Player player : Utils.getOnlinePlayers()) { - if (plugin.getPermissionsManager().hasPermission(player, PlayerPermission.SEE_OTHER_ACCOUNTS)) { + if (plugin.getPermissionsManager().hasPermission(player, PlayerPermission.SEE_OTHER_ACCOUNTS) + || (player.getName().equals(this.player.getName()) + && plugin.getPermissionsManager().hasPermission(player, PlayerPermission.SEE_OWN_ACCOUNTS))) { player.sendMessage("[AuthMe] The player " + auth.getNickname() + " has " + auths.size() + " accounts"); player.sendMessage(message.toString()); - // player.sendMessage(uuidaccounts.replace("%size%", - // ""+uuidlist.size())); } } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 69e954e36..32f601418 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -141,6 +141,7 @@ permissions: authme.player.seeotheraccounts: true authme.player.unregister: true authme.player.vip: true + authme.player.showownaccounts: true authme.player.bypassantibot: description: Permission node to bypass AntiBot protection. default: false @@ -186,3 +187,6 @@ permissions: authme.player.seeotheraccounts: description: Permission for user to see other accounts. default: false + authme.player.showownaccounts: + description: Permission for user to see own other accounts. + default: false