Fixed dinerperms groups and bridge detection.

Dieser Commit ist enthalten in:
zml2008 2011-08-16 14:05:33 -07:00
Ursprung 151b4c0fa1
Commit 3f0da63b01
3 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -60,7 +60,7 @@ public class DinnerPermsResolver implements PermissionsResolver {
String perm = permAttach.getPermission(); String perm = permAttach.getPermission();
if (!perm.startsWith(GROUP_PREFIX)) if (!perm.startsWith(GROUP_PREFIX))
continue; continue;
groupNames.add(perm.substring(perm.indexOf(GROUP_PREFIX), perm.length())); groupNames.add(perm.substring(GROUP_PREFIX.length(), perm.length()));
} }
return groupNames.toArray(new String[groupNames.size()]); return groupNames.toArray(new String[groupNames.size()]);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.bukkit.migration; package com.sk89q.bukkit.migration;
import org.bukkit.Bukkit;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -43,7 +44,7 @@ public class NijiPermissionsResolver implements PermissionsResolver {
if (plugin == null) { if (plugin == null) {
throw new MissingPluginException(); throw new MissingPluginException();
} }
if (!checkRealNijiPerms(plugin, ignoreBridges)) if (!checkRealNijiPerms(ignoreBridges))
throw new MissingPluginException(); throw new MissingPluginException();
try { try {
@ -130,12 +131,12 @@ public class NijiPermissionsResolver implements PermissionsResolver {
private static final long serialVersionUID = 7044832912491608706L; private static final long serialVersionUID = 7044832912491608706L;
} }
public static boolean checkRealNijiPerms(Plugin plugin, boolean ignoreBridges) { public static boolean checkRealNijiPerms(boolean ignoreBridges) {
if (!ignoreBridges) if (!ignoreBridges)
return true; return true;
PluginCommand permsCommand = plugin.getServer().getPluginCommand("permissions"); PluginCommand permsCommand = Bukkit.getServer().getPluginCommand("permissions");
if (permsCommand == null) if (permsCommand == null)
return false; return false;
return !permsCommand.getPlugin().getDescription().getName().equals("Permissions"); return permsCommand.getPlugin().getDescription().getName().equals("Permissions");
} }
} }

Datei anzeigen

@ -45,7 +45,7 @@ public class PermissionsResolverServerListener extends ServerListener {
if (plugin instanceof PermissionsProvider) { if (plugin instanceof PermissionsProvider) {
manager.setPluginPermissionsResolver(plugin); manager.setPluginPermissionsResolver(plugin);
} else if (name.equalsIgnoreCase("Permissions") && } else if (name.equalsIgnoreCase("Permissions") &&
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges)) { NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges)) {
manager.findResolver(); manager.findResolver();
manager.load(); manager.load();
} }
@ -63,7 +63,7 @@ public class PermissionsResolverServerListener extends ServerListener {
if (plugin instanceof PermissionsProvider if (plugin instanceof PermissionsProvider
|| (name.equalsIgnoreCase("Permissions") && || (name.equalsIgnoreCase("Permissions") &&
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges))) { NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges))) {
manager.findResolver(); manager.findResolver();
manager.load(); manager.load();
} }