Expand 'manwhois' to also list a users subgroups.

This commit is contained in:
ElgarL 2012-04-07 11:47:07 +01:00
parent 25bd91eb80
commit 1c0a5c49a5
2 changed files with 12 additions and 1 deletions

View File

@ -166,3 +166,4 @@ v 2.0:
- Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions.
- Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it).
- Remove all permission attachments when performing a manload or restart. - Remove all permission attachments when performing a manload or restart.
- Expand 'manwhois' to also list a users subgroups.

View File

@ -1398,6 +1398,16 @@ public class GroupManager extends JavaPlugin {
// Seems OK // Seems OK
sender.sendMessage(ChatColor.YELLOW + "Name: " + ChatColor.GREEN + auxUser.getName()); sender.sendMessage(ChatColor.YELLOW + "Name: " + ChatColor.GREEN + auxUser.getName());
sender.sendMessage(ChatColor.YELLOW + "Group: " + ChatColor.GREEN + auxUser.getGroup().getName()); sender.sendMessage(ChatColor.YELLOW + "Group: " + ChatColor.GREEN + auxUser.getGroup().getName());
// Compile a list of subgroups
auxString = "";
for (String subGroup : auxUser.subGroupListStringCopy()) {
auxString += subGroup + ", ";
}
if (auxString.lastIndexOf(",") > 0) {
auxString = auxString.substring(0, auxString.lastIndexOf(","));
sender.sendMessage(ChatColor.YELLOW + "subgroups: " + auxString);
}
sender.sendMessage(ChatColor.YELLOW + "Overloaded: " + ChatColor.GREEN + dataHolder.isOverloaded(auxUser.getName())); sender.sendMessage(ChatColor.YELLOW + "Overloaded: " + ChatColor.GREEN + dataHolder.isOverloaded(auxUser.getName()));
auxGroup = dataHolder.surpassOverload(auxUser.getName()).getGroup(); auxGroup = dataHolder.surpassOverload(auxUser.getName()).getGroup();
if (!auxGroup.equals(auxUser.getGroup())) { if (!auxGroup.equals(auxUser.getGroup())) {