diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-09-03 17:53:34 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-09-03 17:53:34 +0100 |
commit | 2e1c88050222c0be59a290a0b796677483daf066 (patch) | |
tree | cda05ae62ad60475aa99dc6ad6106e6d011a5dbf /EssentialsGroupManager/src/org/anjocaido | |
parent | e3756623a1531241b40084c0aa9a8e4b4e8cda31 (diff) | |
download | Essentials-2e1c88050222c0be59a290a0b796677483daf066.tar Essentials-2e1c88050222c0be59a290a0b796677483daf066.tar.gz Essentials-2e1c88050222c0be59a290a0b796677483daf066.tar.lz Essentials-2e1c88050222c0be59a290a0b796677483daf066.tar.xz Essentials-2e1c88050222c0be59a290a0b796677483daf066.zip |
- Fix for an infinite loop bug with the new Bukkit Perms during a new
user creation.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java | 10 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index f3ea1d0f5..e9bf79aa9 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -104,7 +104,7 @@ public class User extends DataUnit implements Cloneable { public void setGroup(String group) { this.group = group; flagAsChanged(); - if (GroupManager.isLoaded) + if ((GroupManager.isLoaded) && (GroupManager.BukkitPermissions.player_join = false)) GroupManager.BukkitPermissions.updateAllPlayers(); } @@ -118,7 +118,7 @@ public class User extends DataUnit implements Cloneable { group = getDataSource().getGroup(group.getName()); this.group = group.getName(); flagAsChanged(); - if (GroupManager.isLoaded) + if ((GroupManager.isLoaded) && (GroupManager.BukkitPermissions.player_join = false)) GroupManager.BukkitPermissions.updateAllPlayers(); } @@ -133,7 +133,7 @@ public class User extends DataUnit implements Cloneable { removeSubGroup(subGroup); subGroups.add(subGroup.getName()); flagAsChanged(); - if (GroupManager.isLoaded) + if ((GroupManager.isLoaded) && (GroupManager.BukkitPermissions.player_join = false)) GroupManager.BukkitPermissions.updateAllPlayers(); } @@ -153,7 +153,7 @@ public class User extends DataUnit implements Cloneable { try { if (subGroups.remove(subGroup.getName())) { flagAsChanged(); - if (GroupManager.isLoaded) + if ((GroupManager.isLoaded) && (GroupManager.BukkitPermissions.player_join = false)) GroupManager.BukkitPermissions.updateAllPlayers(); return true; } @@ -197,7 +197,7 @@ public class User extends DataUnit implements Cloneable { variables.addVar(key, temp.getVarObject(key)); } flagAsChanged(); - if (GroupManager.isLoaded) + if ((GroupManager.isLoaded) && (GroupManager.BukkitPermissions.player_join = false)) GroupManager.BukkitPermissions.updateAllPlayers(); } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index e396118b4..5df263eb4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -56,6 +56,7 @@ public class BukkitPermissions { protected Plugin plugin;
protected boolean dumpAllPermissions = true;
protected boolean dumpMatchedPermissions = true;
+ public boolean player_join = false;
public BukkitPermissions(Plugin plugin) {
this.plugin = plugin;
@@ -142,7 +143,14 @@ public class BukkitPermissions { @Override
public void onPlayerJoin(PlayerJoinEvent event) {
- updatePermissions(event.getPlayer());
+ player_join = true;
+ Player player = event.getPlayer();
+ //force GM to create the player if they are not already listed.
+ if (GroupManager.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) {
+ player_join = false;
+ updatePermissions(event.getPlayer());
+ } else
+ player_join = false;
}
@Override
|