- Invalid groups assigned to players in users.yml will no longer cause

a crash. GM will now set them to the default group instead.
This commit is contained in:
ElgarL 2011-09-03 15:29:44 +01:00
parent 80491513a2
commit e2024ca2b6
3 changed files with 11 additions and 8 deletions

View File

@ -4,4 +4,5 @@ v 1.1:
- Fixed users being able to use 'manuadd' to add users to higher groups than their own.
- Added SuperPerms support so GM will update and provide the permissions to plugins which only support Bukkit Perms.
- Added more helpful output to errors on argument lengths.
- GroupManager will now attempt to select the default world when using commands instead of failing and telling you to use '/manselect <world>'.
- GroupManager will now attempt to select the default world when using commands instead of failing and telling you to use '/manselect <world>'.
- Invalid groups assigned to players in users.yml will no longer cause a crash. GM will now set them to the default group instead.

View File

@ -54,6 +54,10 @@ public class GroupManager extends JavaPlugin {
private GMLoggerHandler ch;
public static BukkitPermissions BukkitPermissions;
public static final Logger logger = Logger.getLogger(GroupManager.class.getName());
//PERMISSIONS FOR COMMAND BEING LOADED
OverloadedWorldHolder dataHolder = null;
AnjoPermissionsHandler permissionHandler = null;
@Override
public void onDisable() {
@ -222,8 +226,8 @@ public class GroupManager extends JavaPlugin {
}
//PERMISSIONS FOR COMMAND BEING LOADED
OverloadedWorldHolder dataHolder = null;
AnjoPermissionsHandler permissionHandler = null;
dataHolder = null;
permissionHandler = null;
if (senderPlayer != null) {
dataHolder = worldsHolder.getWorldData(senderPlayer);
@ -1623,10 +1627,6 @@ public class GroupManager extends JavaPlugin {
* Sets up the default world for use.
*/
private boolean setDefaultWorldHandler(CommandSender sender) {
//PERMISSIONS FOR COMMAND BEING LOADED
OverloadedWorldHolder dataHolder = null;
AnjoPermissionsHandler permissionHandler = null;
dataHolder = worldsHolder.getWorldData(worldsHolder.getDefaultWorld().getName());
permissionHandler = dataHolder.getPermissionsHandler();

View File

@ -630,7 +630,9 @@ public class WorldDataHolder {
if (thisUserNode.get("group") != null) {
Group hisGroup = ph.getGroup(thisUserNode.get("group").toString());
if (hisGroup == null) {
throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName());
GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "'.");
hisGroup = ph.defaultGroup;
//throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName());
}
thisUser.setGroup(hisGroup);
} else {