summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-09-22 19:18:51 +0100
committerElgarL <ElgarL@palmergames.com>2012-09-22 19:18:51 +0100
commit567d52459b869ee72aaa5b08ef5a37e234fe14a9 (patch)
tree706fc80ed4d480118db44b5db7dd2fc190141e66 /EssentialsGroupManager
parentfd61cd17502eae4097df692063f9e76ea647226c (diff)
downloadEssentials-567d52459b869ee72aaa5b08ef5a37e234fe14a9.tar
Essentials-567d52459b869ee72aaa5b08ef5a37e234fe14a9.tar.gz
Essentials-567d52459b869ee72aaa5b08ef5a37e234fe14a9.tar.lz
Essentials-567d52459b869ee72aaa5b08ef5a37e234fe14a9.tar.xz
Essentials-567d52459b869ee72aaa5b08ef5a37e234fe14a9.zip
- Fix Synchronization on adding subgroups (thanks snowleo).
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java47
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java2
3 files changed, 27 insertions, 26 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 5b409d773..c170b725a 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -196,4 +196,6 @@ v 2.0:
- Fix an error with Logging set to 'OFF' triggering a cast exception.
- No more null errors from corrupt config.yml's.
- Give a better error when a subgroup is null.
- - Include the GM version when logging errors. \ No newline at end of file
+ - Include the GM version when logging errors.
+ - Fix Synchronization on adding subgroups (thanks snowleo).
+ - Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
index ae6ba501b..cf63dd8d7 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
@@ -19,7 +19,6 @@ import org.anjocaido.groupmanager.events.GMGroupEvent;
import org.anjocaido.groupmanager.events.GroupManagerEventHandler;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.Tasks;
-import org.bukkit.configuration.MemorySection;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
@@ -184,22 +183,22 @@ public class GlobalGroups {
} else
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
- // Info nodes
- try {
- element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
- } catch ( Exception ex) {
- throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
- }
-
- if (element != null)
- if (element instanceof MemorySection) {
- Map<String, Object> vars = new HashMap<String, Object>();
- for (String key : ((MemorySection) element).getKeys(false)) {
- vars.put(key, ((MemorySection) element).get(key));
- }
- newGroup.setVariables(vars);
- } else
- throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName);
+// // Info nodes
+// try {
+// element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
+// } catch ( Exception ex) {
+// throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
+// }
+//
+// if (element != null)
+// if (element instanceof MemorySection) {
+// Map<String, Object> vars = new HashMap<String, Object>();
+// for (String key : ((MemorySection) element).getKeys(false)) {
+// vars.put(key, ((MemorySection) element).get(key));
+// }
+// newGroup.setVariables(vars);
+// } else
+// throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName);
// Push a new group
addGroup(newGroup);
@@ -236,13 +235,13 @@ public class GlobalGroups {
Map<String, Object> aGroupMap = new HashMap<String, Object>();
groupsMap.put(group.getName(), aGroupMap);
- // Info nodes
- Map<String, Object> infoMap = new HashMap<String, Object>();
- aGroupMap.put("info", infoMap);
-
- for (String infoKey : group.getVariables().getVarKeyList()) {
- infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
- }
+// // Info nodes
+// Map<String, Object> infoMap = new HashMap<String, Object>();
+// aGroupMap.put("info", infoMap);
+//
+// for (String infoKey : group.getVariables().getVarKeyList()) {
+// infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
+// }
// Permission nodes
aGroupMap.put("permissions", group.getPermissionList());
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index a7e5cdc8b..a829bfa14 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -28,7 +28,7 @@ public class User extends DataUnit implements Cloneable {
*
*/
private String group = null;
- private final List<String> subGroups = Collections.synchronizedList(Collections.<String>emptyList());
+ private final List<String> subGroups = Collections.synchronizedList(new ArrayList<String>());
/**
* This one holds the fields in INFO node. like prefix = 'c' or build =
* false