summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-25 23:44:14 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-25 23:44:14 +0000
commit746eb353a2f9ef0b75406d8afc0dc7cef2b7766b (patch)
tree45e41c56832243f71fe22253a1b505d914b3f9fd /EssentialsGroupManager/src/org/anjocaido
parent3708f2b3bba8b071ef947b3d05229df48701541d (diff)
downloadEssentials-746eb353a2f9ef0b75406d8afc0dc7cef2b7766b.tar
Essentials-746eb353a2f9ef0b75406d8afc0dc7cef2b7766b.tar.gz
Essentials-746eb353a2f9ef0b75406d8afc0dc7cef2b7766b.tar.lz
Essentials-746eb353a2f9ef0b75406d8afc0dc7cef2b7766b.tar.xz
Essentials-746eb353a2f9ef0b75406d8afc0dc7cef2b7766b.zip
Fixed an infinite loop error when using '/manudel' on a logged in
player. It caused setDefaultGroup to trigger a bukkit update when no GM User existed yet.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java11
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java2
2 files changed, 11 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index 7a590c412..980b0846c 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -122,6 +122,15 @@ public class User extends DataUnit implements Cloneable {
* the group to set
*/
public void setGroup(Group group) {
+ setGroup(group, true);
+ }
+
+ /**
+ * @param group the group to set
+ * @param updatePerms if we are to trigger a superperms update.
+ *
+ */
+ public void setGroup(Group group, Boolean updatePerms) {
if (!this.getDataSource().groupExists(group.getName())) {
getDataSource().addGroup(group);
}
@@ -129,7 +138,7 @@ public class User extends DataUnit implements Cloneable {
String oldGroup = this.group;
this.group = group.getName();
flagAsChanged();
- if (GroupManager.isLoaded()) {
+ if (GroupManager.isLoaded() && (updatePerms)) {
if (!GroupManager.BukkitPermissions.isPlayer_join())
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index c9c1d2b64..3cbfbd50b 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -245,7 +245,7 @@ public class WorldDataHolder {
return null;
}
User newUser = new User(this, userName);
- newUser.setGroup(groups.getDefaultGroup());
+ newUser.setGroup(groups.getDefaultGroup(), false);
addUser(newUser);
setUsersChanged(true);
return newUser;