mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-30 12:00:34 +08:00
Fixed infinite loop error on player join.
Optimized code to only update the player logging in instead of all players online.
This commit is contained in:
parent
6e03ea7b7d
commit
125ea7c701
@ -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.
|
||||
- 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.
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user