summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-09-03 15:29:44 +0100
committerElgarL <ElgarL@palmergames.com>2011-09-03 15:29:44 +0100
commite2024ca2b63112cbb343812e4d4354c98245e03b (patch)
treed8a85f269ef6d8f4621342237538af0cfa94a25c /EssentialsGroupManager
parent80491513a2ba82889d95dd246bfd0482a519e276 (diff)
downloadEssentials-e2024ca2b63112cbb343812e4d4354c98245e03b.tar
Essentials-e2024ca2b63112cbb343812e4d4354c98245e03b.tar.gz
Essentials-e2024ca2b63112cbb343812e4d4354c98245e03b.tar.lz
Essentials-e2024ca2b63112cbb343812e4d4354c98245e03b.tar.xz
Essentials-e2024ca2b63112cbb343812e4d4354c98245e03b.zip
- Invalid groups assigned to players in users.yml will no longer cause
a crash. GM will now set them to the default group instead.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java12
-rw-r--r--[-rwxr-xr-x]EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java4
3 files changed, 11 insertions, 8 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 86f6e521f..401d762f1 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -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>'. \ No newline at end of file
+ - 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. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index f7e797f36..e0a29f509 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -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();
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index 1331a92ad..ae68e03cc 100755..100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -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 {