summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2012-04-26 10:42:48 +0200
committersnowleo <schneeleo@gmail.com>2012-04-26 10:42:48 +0200
commit3a60191a9dce4e7551661ed91c2a2836f6b95327 (patch)
tree58bd089323db8a4e8875e35145f47bedc6e1ba8a
parent95e6db679775d7ecb95ece8192b350f4c87169cb (diff)
parent06247732da564876d97de99aa706fd7e823c0df9 (diff)
downloadEssentials-3a60191a9dce4e7551661ed91c2a2836f6b95327.tar
Essentials-3a60191a9dce4e7551661ed91c2a2836f6b95327.tar.gz
Essentials-3a60191a9dce4e7551661ed91c2a2836f6b95327.tar.lz
Essentials-3a60191a9dce4e7551661ed91c2a2836f6b95327.tar.xz
Essentials-3a60191a9dce4e7551661ed91c2a2836f6b95327.zip
Merge branch 'refs/heads/groupmanager'
-rw-r--r--.classpath1
-rw-r--r--EssentialsGroupBridge/.classpath1
-rw-r--r--EssentialsGroupBridge/.project10
-rw-r--r--EssentialsGroupManager/.classpath2
-rw-r--r--EssentialsGroupManager/src/Changelog.txt5
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java50
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java1
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java9
9 files changed, 69 insertions, 14 deletions
diff --git a/.classpath b/.classpath
index 0683da590..db361119a 100644
--- a/.classpath
+++ b/.classpath
@@ -3,6 +3,5 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/bukkit-0.0.1-SNAPSHOT.jar"/>
- <classpathentry kind="lib" path="lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/Permissions3.jar"/>
</classpath>
diff --git a/EssentialsGroupBridge/.classpath b/EssentialsGroupBridge/.classpath
index 9330eb06e..ebd606dca 100644
--- a/EssentialsGroupBridge/.classpath
+++ b/EssentialsGroupBridge/.classpath
@@ -3,7 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="../lib/bukkit.jar"/>
- <classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/EssentialsGroupManager"/>
<classpathentry kind="lib" path="../lib/Permissions3.jar"/>
<classpathentry kind="output" path="bin"/>
diff --git a/EssentialsGroupBridge/.project b/EssentialsGroupBridge/.project
index 0780b7dbb..2ea0b05e1 100644
--- a/EssentialsGroupBridge/.project
+++ b/EssentialsGroupBridge/.project
@@ -10,6 +10,16 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/GroupBridge.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
diff --git a/EssentialsGroupManager/.classpath b/EssentialsGroupManager/.classpath
index 61f808b2d..bc8106503 100644
--- a/EssentialsGroupManager/.classpath
+++ b/EssentialsGroupManager/.classpath
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
+ <classpathentry kind="lib" path="../lib/bukkit.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index fcdc1ed9d..4a3c232be 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -180,4 +180,7 @@ v 2.0:
- Update all code formatting to use tabs for indentation.
- Stop using our own deprecated methods as we tell others to do.
- Finally remove all deprecated methods.
- - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. \ No newline at end of file
+ - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery.
+ - Prevent null perms getting past the GlobalGroups loader.
+ - Fix forgetting sub groups on a manload.
+ - Allow 'manucheckp' to notify when superperms reports false but it is really negated. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
index 647d729e5..04d9e86be 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
@@ -159,12 +159,14 @@ public class GlobalGroups {
if (element instanceof List) {
try {
for (String node : (List<String>) element) {
- newGroup.addPermission(node);
+ if ((node != null) && !node.isEmpty())
+ newGroup.addPermission(node);
}
} catch (ClassCastException ex) {
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex);
}
} else if (element instanceof String) {
+ if ((element != null) && !((String)element).isEmpty())
newGroup.addPermission((String) element);
} else
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 3da9666c3..5f357641a 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -103,13 +103,20 @@ public class GroupManager extends JavaPlugin {
}
}
- if (WorldEvents != null)
- WorldEvents = null;
+
// Remove all attachments before clearing
if (BukkitPermissions != null) {
BukkitPermissions.removeAllAttachments();
+ }
+
+ if (!restarting) {
+
+ if (WorldEvents != null)
+ WorldEvents = null;
+
BukkitPermissions = null;
+
}
// EXAMPLE: Custom code, here we just output some info so we can check that all is well
@@ -130,6 +137,9 @@ public class GroupManager extends JavaPlugin {
selectedWorlds = new HashMap<CommandSender, String>();
lastError = "";
+ /*
+ * Setup our logger if we are not restarting.
+ */
if (!restarting) {
GroupManager.logger.setUseParentHandlers(false);
ch = new GMLoggerHandler();
@@ -144,11 +154,17 @@ public class GroupManager extends JavaPlugin {
// Load the global groups
globalGroups = new GlobalGroups(this);
+ /*
+ * Configure the worlds holder.
+ */
if (!restarting)
worldsHolder = new WorldsHolder(this);
else
worldsHolder.resetWorldsHolder();
+ /*
+ * This should NEVER happen. No idea why it's still here.
+ */
PluginDescriptionFile pdfFile = this.getDescription();
if (worldsHolder == null) {
GroupManager.logger.severe("Can't enable " + pdfFile.getName() + " version " + pdfFile.getVersion() + ", bad loading!");
@@ -156,13 +172,30 @@ public class GroupManager extends JavaPlugin {
throw new IllegalStateException("An error ocurred while loading GroupManager");
}
- // Set a few defaults (reloads)
+ /*
+ * Prevent our registered events from triggering
+ * updates as we are not fully loaded.
+ */
setLoaded(false);
- // Initialize the world listener and bukkit permissions to handle events.
- WorldEvents = new GMWorldListener(this);
- BukkitPermissions = new BukkitPermissions(this);
+ /*
+ * Initialize the world listener and bukkit permissions
+ * to handle events if this is a fresh start
+ *
+ * else
+ *
+ * Reset bukkit perms.
+ */
+ if (!restarting) {
+ WorldEvents = new GMWorldListener(this);
+ BukkitPermissions = new BukkitPermissions(this);
+ } else {
+ BukkitPermissions.reset();
+ }
+ /*
+ * Start the scheduler for data saving.
+ */
enableScheduler();
/*
@@ -172,6 +205,9 @@ public class GroupManager extends JavaPlugin {
if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) {
GroupManager.logger.severe("Could not schedule superperms Update.");
+ /*
+ * Flag that we are now loaded and should start processing events.
+ */
setLoaded(true);
}
@@ -885,7 +921,7 @@ public class GroupManager extends JavaPlugin {
// superperms
if (targetPlayer != null) {
- sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]));
+ sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]) + ((!targetPlayer.hasPermission(args[1]) && targetPlayer.isPermissionSet(args[1])) ? " (Negated)": ""));
}
return true;
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index a9ab4befa..27a7d9a59 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -62,6 +62,7 @@ public class WorldsHolder {
public void resetWorldsHolder() {
+ worldsData = new HashMap<String, OverloadedWorldHolder>();
mirrorsGroup = new HashMap<String, String>();
mirrorsUser = new HashMap<String, String>();
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index c366b65bf..e8322c391 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -96,12 +96,17 @@ public class BukkitPermissions {
public BukkitPermissions(GroupManager plugin) {
this.plugin = plugin;
- this.collectPermissions();
+ this.reset();
this.registerEvents();
- this.updateAllPlayers();
+
GroupManager.logger.info("Superperms support enabled.");
}
+
+ public void reset() {
+ this.collectPermissions();
+ this.updateAllPlayers();
+ }
private void registerEvents() {