From 50f022e1fb89a1b8889711003c257a5e6403c93c Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sat, 14 Jul 2012 21:18:30 +0200 Subject: [PATCH] 1.2.5: - authme reloaded update * LowerCase PlayerNames --- README.md | 4 ++-- plugin.yml | 2 +- pom.xml | 10 +++++----- src/de/jaschastarke/minecraft/integration/AuthMe.java | 4 ++-- .../minecraft/limitedcreative/Configuration.java | 4 ++++ .../minecraft/limitedcreative/LCPlayer.java | 3 ++- src/de/jaschastarke/minecraft/utils/Permissions.java | 8 +++++--- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a2127bf..4af29a4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Dependencies for optional integrations * [WorldGuard](https://github.com/sk89q/worldguard) * [WorldEdit](https://github.com/sk89q/worldedit) * [xAuth](http://dev.bukkit.org/server-mods/xauth/) -* [AuthMe](http://dev.bukkit.org/server-mods/authme-reloaded/) +* [AuthMe](http://dev.bukkit.org/server-mods/authme-reloaded/) ([GitSource](https://github.com/Multiplayer-italia/AuthMe-Reloaded)) * [Multiverse-Core](http://dev.bukkit.org/server-mods/multiverse-core/) ---- @@ -22,4 +22,4 @@ To use Maven packaging For required development snapshots, that aren't found by maven, you have to clone the project and do: $ mvn install -in the directory of the project \ No newline at end of file +in the directory of the project diff --git a/plugin.yml b/plugin.yml index 375f3b7..f358dba 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: LimitedCreative main: de.jaschastarke.minecraft.limitedcreative.Core -version: 1.2.3-beta +version: 1.2.5 softdepend: [WorldGuard, WorldEdit, MultiInv] dev-url: http://dev.bukkit.org/server-mods/limited-creative/ commands: diff --git a/pom.xml b/pom.xml index 231cdf6..1d69880 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ de.jaschastarke LimitedCreative LimitedCreative - 1.2.3 + 1.2.5 https://github.com/possi/LimitedCreative scm:git:git://github.com/possi/LimitedCreative.git @@ -58,8 +58,8 @@ maven-compiler-plugin 2.0.2 - 1.5 - 1.5 + 1.6 + 1.6 @@ -68,12 +68,12 @@ org.bukkit bukkit - 1.2.5-R1.0 + 1.2.5-R4.0 com.sk89q worldguard - 5.5.2 + 5.5.4-SNAPSHOT uk.org.whoami diff --git a/src/de/jaschastarke/minecraft/integration/AuthMe.java b/src/de/jaschastarke/minecraft/integration/AuthMe.java index 4b46a93..d6e2d84 100644 --- a/src/de/jaschastarke/minecraft/integration/AuthMe.java +++ b/src/de/jaschastarke/minecraft/integration/AuthMe.java @@ -25,12 +25,12 @@ import de.jaschastarke.minecraft.limitedcreative.Core; public class AuthMe implements CommunicationBridge { public static boolean isLoggedIn(Player player) { - boolean li = PlayerCache.getInstance().isAuthenticated(player.getName()); + boolean li = PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase()); Core.debug("AuthMe: "+player.getName()+": logged in: "+li); return li; } public static boolean isLoggedInComplete(Player player) { - boolean li = isLoggedIn(player) && LimboCache.getInstance().getLimboPlayer(player.getName()) == null; + boolean li = isLoggedIn(player) && LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase()) == null; Core.debug("AuthMe: "+player.getName()+": logged in complete: "+li); return li; } diff --git a/src/de/jaschastarke/minecraft/limitedcreative/Configuration.java b/src/de/jaschastarke/minecraft/limitedcreative/Configuration.java index 82fc054..2c30456 100644 --- a/src/de/jaschastarke/minecraft/limitedcreative/Configuration.java +++ b/src/de/jaschastarke/minecraft/limitedcreative/Configuration.java @@ -54,6 +54,7 @@ public class Configuration { REMOVEPICKUP("limit.remove_pickup", false), PERMISSIONS("permissions.enabled", false), PERM_KEEPINVENTORY("permissions.keepinventory", false), + PERM_WEPIF("permissions.wepif", true), DEBUG("debug", false); private String key; @@ -154,6 +155,9 @@ public class Configuration { public boolean getPermissionToKeepInventory() { return this.getPermissionsEnabled() && this.getBoolean(Option.PERM_KEEPINVENTORY); } + public boolean getWEPIFEnabled() { + return this.getBoolean(Option.PERM_WEPIF); + } public boolean getRegionOptional() { return this.getBoolean(Option.REGION_OPTIONAL); } diff --git a/src/de/jaschastarke/minecraft/limitedcreative/LCPlayer.java b/src/de/jaschastarke/minecraft/limitedcreative/LCPlayer.java index c13e12a..cc31d8f 100644 --- a/src/de/jaschastarke/minecraft/limitedcreative/LCPlayer.java +++ b/src/de/jaschastarke/minecraft/limitedcreative/LCPlayer.java @@ -418,11 +418,12 @@ public class LCPlayer { getPlayer().setGameMode(region_gamemode); } } - } else if (region_gamemode == null && getPlayer().getGameMode() != DEFAULT_GAMEMODE && !isInPermanentGameMode(CURRENT_GAMEMODE)) { + } else if (region_gamemode == null && getPlayer().getGameMode() != DEFAULT_GAMEMODE && !isInPermanentGameMode(CURRENT_GAMEMODE) && getActiveRegionGameMode() != null) { Core.debug(getName()+": leaving creative area"); // 1. the region doesn't allow "the other gamemode" // 2. but the player is in that mode // 3. and the player isn't global (permanent) in that mode + // 4. and the player isn't temporary in that mode (that means its maybe a world teleport, and the mode changes afterwards) // result: change him back to default mode if (checkSwitchFlight(area_event)) { storeActiveRegionGameMode(null); diff --git a/src/de/jaschastarke/minecraft/utils/Permissions.java b/src/de/jaschastarke/minecraft/utils/Permissions.java index 56bfc62..7aca979 100644 --- a/src/de/jaschastarke/minecraft/utils/Permissions.java +++ b/src/de/jaschastarke/minecraft/utils/Permissions.java @@ -31,9 +31,11 @@ public class Permissions { public Permissions(JavaPlugin plugin) { this.plugin = plugin; try { - // because worldedit may be not loaded as plugin, just as library, we check that way - Class.forName("com.sk89q.wepif.PermissionsResolverManager", false, plugin.getClass().getClassLoader()); - pif = new PermissionsBridge(plugin); + if (Core.plugin.config.getWEPIFEnabled()) { + // because worldedit may be not loaded as plugin, just as library, we check that way + Class.forName("com.sk89q.wepif.PermissionsResolverManager", false, plugin.getClass().getClassLoader()); + pif = new PermissionsBridge(plugin); + } } catch (ClassNotFoundException e) {} }