summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-22 23:46:26 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-22 23:46:26 +0000
commit125ea7c701c365c0a903c436ef92577742eaad5f (patch)
tree8d8a38fc8c5d9912e0207d2b12380796a108cff5 /EssentialsGroupManager/src
parent6e03ea7b7deee8923d0c6804c105a3595838af9b (diff)
downloadEssentials-125ea7c701c365c0a903c436ef92577742eaad5f.tar
Essentials-125ea7c701c365c0a903c436ef92577742eaad5f.tar.gz
Essentials-125ea7c701c365c0a903c436ef92577742eaad5f.tar.lz
Essentials-125ea7c701c365c0a903c436ef92577742eaad5f.tar.xz
Essentials-125ea7c701c365c0a903c436ef92577742eaad5f.zip
Fixed infinite loop error on player join.
Optimized code to only update the player logging in instead of all players online.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java12
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java11
3 files changed, 18 insertions, 9 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 6fc20d0b5..b58f520a8 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -109,4 +109,6 @@ v 1.9:
- Fixed text when adding a subgroup to not say the player was moved.
- Update to new Bukkit Event system.
- Update GroupManagerBridge for new event system.
- - Fixed a random null error upon a player portaling. \ No newline at end of file
+ - Fixed a random null error upon a player portaling.
+ - Fixed infinite loop error on player join.
+ - Optimized code to only update the player logging in instead of all players online. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index d41f96b0d..fd66bcfa2 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -114,7 +114,7 @@ public class User extends DataUnit implements Cloneable {
flagAsChanged();
if (GroupManager.isLoaded())
if (!GroupManager.BukkitPermissions.isPlayer_join())
- GroupManager.BukkitPermissions.updateAllPlayers();
+ GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
}
/**
@@ -131,7 +131,7 @@ public class User extends DataUnit implements Cloneable {
flagAsChanged();
if (GroupManager.isLoaded()) {
if (!GroupManager.BukkitPermissions.isPlayer_join())
- GroupManager.BukkitPermissions.updateAllPlayers();
+ GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
// Do we notify of the group change?
String defaultGroupName = getDataSource().getDefaultGroup().getName();
@@ -160,7 +160,7 @@ public class User extends DataUnit implements Cloneable {
flagAsChanged();
if (GroupManager.isLoaded()) {
if (!GroupManager.BukkitPermissions.isPlayer_join())
- GroupManager.BukkitPermissions.updateAllPlayers();
+ GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
}
}
@@ -183,7 +183,7 @@ public class User extends DataUnit implements Cloneable {
flagAsChanged();
if (GroupManager.isLoaded())
if (!GroupManager.BukkitPermissions.isPlayer_join())
- GroupManager.BukkitPermissions.updateAllPlayers();
+ GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
return true;
}
@@ -229,8 +229,8 @@ public class User extends DataUnit implements Cloneable {
}
flagAsChanged();
if (GroupManager.isLoaded()) {
- if (!GroupManager.BukkitPermissions.isPlayer_join())
- GroupManager.BukkitPermissions.updateAllPlayers();
+ //if (!GroupManager.BukkitPermissions.isPlayer_join())
+ // GroupManager.BukkitPermissions.updatePlayer(this.getName());
GroupManagerEventHandler.callEvent(this, Action.USER_INFO_CHANGED);
}
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index e4bb94592..481779c3c 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -122,7 +122,6 @@ public class BukkitPermissions {
registeredPermissions = new LinkedList<Permission>(Bukkit.getPluginManager().getPermissions());
}
-
public void updatePermissions(Player player) {
this.updatePermissions(player, null);
@@ -361,6 +360,14 @@ public class BukkitPermissions {
updatePermissions(player);
}
}
+
+ /**
+ * force Bukkit to update this Players permissions.
+ */
+ public void updatePlayer(Player player) {
+ if (player != null)
+ this.updatePermissions(player, null);
+ }
protected class PlayerEvents implements Listener {
@@ -370,7 +377,7 @@ public class BukkitPermissions {
Player player = event.getPlayer();
// force GM to create the player if they are not already listed.
if (plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) {
- //setPlayer_join(false);
+ setPlayer_join(false);
updatePermissions(event.getPlayer());
}
setPlayer_join(false);