diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 10:42:18 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 10:42:18 +0000 |
commit | 58daa86b79ecff927c478fa22fb02b84f5594b4c (patch) | |
tree | 52cb47a25bc03f0ad35c2c05734a01252959766a | |
parent | 78ce69528fc346f670f28086496241714f98f8a3 (diff) | |
download | Essentials-58daa86b79ecff927c478fa22fb02b84f5594b4c.tar Essentials-58daa86b79ecff927c478fa22fb02b84f5594b4c.tar.gz Essentials-58daa86b79ecff927c478fa22fb02b84f5594b4c.tar.lz Essentials-58daa86b79ecff927c478fa22fb02b84f5594b4c.tar.xz Essentials-58daa86b79ecff927c478fa22fb02b84f5594b4c.zip |
Using default group for users with unknown group.
Ignore double users.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1460 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 9b9b03d71..ac26138c4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -335,7 +335,7 @@ public class WorldDataHolder { Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey); Group thisGrp = ph.createGroup(groupKey); if (thisGrp == null) { - throw new IllegalArgumentException("I think this user was declared more than once: " + groupKey); + throw new IllegalArgumentException("I think this group was declared more than once: " + groupKey); } if (thisGroupNode.get("default") == null) { thisGroupNode.put("default", false); @@ -408,7 +408,8 @@ public class WorldDataHolder { Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey); User thisUser = ph.createUser(usersKey); if (thisUser == null) { - throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey); + GroupManager.logger.warning("I think this user was declared more than once: " + usersKey); + continue; } if (thisUserNode.get("permissions") == null) { thisUserNode.put("permissions", new ArrayList<String>()); @@ -434,8 +435,9 @@ public class WorldDataHolder { if (thisUserNode.get("group") != null) { Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); if (hisGroup == null) { - throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); - } + GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); + thisUser.setGroup(ph.defaultGroup); + } thisUser.setGroup(hisGroup); } else { thisUser.setGroup(ph.defaultGroup); |