- authme reloaded update
   * LowerCase PlayerNames
This commit is contained in:
Jascha Starke 2012-07-14 21:18:30 +02:00
parent 677664d529
commit 50f022e1fb
7 changed files with 21 additions and 14 deletions

View file

@ -12,7 +12,7 @@ Dependencies for optional integrations
* [WorldGuard](https://github.com/sk89q/worldguard) * [WorldGuard](https://github.com/sk89q/worldguard)
* [WorldEdit](https://github.com/sk89q/worldedit) * [WorldEdit](https://github.com/sk89q/worldedit)
* [xAuth](http://dev.bukkit.org/server-mods/xauth/) * [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/) * [Multiverse-Core](http://dev.bukkit.org/server-mods/multiverse-core/)
---- ----

View file

@ -1,6 +1,6 @@
name: LimitedCreative name: LimitedCreative
main: de.jaschastarke.minecraft.limitedcreative.Core main: de.jaschastarke.minecraft.limitedcreative.Core
version: 1.2.3-beta version: 1.2.5
softdepend: [WorldGuard, WorldEdit, MultiInv] softdepend: [WorldGuard, WorldEdit, MultiInv]
dev-url: http://dev.bukkit.org/server-mods/limited-creative/ dev-url: http://dev.bukkit.org/server-mods/limited-creative/
commands: commands:

10
pom.xml
View file

@ -3,7 +3,7 @@
<groupId>de.jaschastarke</groupId> <groupId>de.jaschastarke</groupId>
<artifactId>LimitedCreative</artifactId> <artifactId>LimitedCreative</artifactId>
<name>LimitedCreative</name> <name>LimitedCreative</name>
<version>1.2.3</version> <version>1.2.5</version>
<url>https://github.com/possi/LimitedCreative</url> <url>https://github.com/possi/LimitedCreative</url>
<scm> <scm>
<connection>scm:git:git://github.com/possi/LimitedCreative.git</connection> <connection>scm:git:git://github.com/possi/LimitedCreative.git</connection>
@ -58,8 +58,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version> <version>2.0.2</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -68,12 +68,12 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.2.5-R1.0</version> <version>1.2.5-R4.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sk89q</groupId> <groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId> <artifactId>worldguard</artifactId>
<version>5.5.2</version> <version>5.5.4-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>uk.org.whoami</groupId> <groupId>uk.org.whoami</groupId>

View file

@ -25,12 +25,12 @@ import de.jaschastarke.minecraft.limitedcreative.Core;
public class AuthMe implements CommunicationBridge { public class AuthMe implements CommunicationBridge {
public static boolean isLoggedIn(Player player) { 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); Core.debug("AuthMe: "+player.getName()+": logged in: "+li);
return li; return li;
} }
public static boolean isLoggedInComplete(Player player) { 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); Core.debug("AuthMe: "+player.getName()+": logged in complete: "+li);
return li; return li;
} }

View file

@ -54,6 +54,7 @@ public class Configuration {
REMOVEPICKUP("limit.remove_pickup", false), REMOVEPICKUP("limit.remove_pickup", false),
PERMISSIONS("permissions.enabled", false), PERMISSIONS("permissions.enabled", false),
PERM_KEEPINVENTORY("permissions.keepinventory", false), PERM_KEEPINVENTORY("permissions.keepinventory", false),
PERM_WEPIF("permissions.wepif", true),
DEBUG("debug", false); DEBUG("debug", false);
private String key; private String key;
@ -154,6 +155,9 @@ public class Configuration {
public boolean getPermissionToKeepInventory() { public boolean getPermissionToKeepInventory() {
return this.getPermissionsEnabled() && this.getBoolean(Option.PERM_KEEPINVENTORY); return this.getPermissionsEnabled() && this.getBoolean(Option.PERM_KEEPINVENTORY);
} }
public boolean getWEPIFEnabled() {
return this.getBoolean(Option.PERM_WEPIF);
}
public boolean getRegionOptional() { public boolean getRegionOptional() {
return this.getBoolean(Option.REGION_OPTIONAL); return this.getBoolean(Option.REGION_OPTIONAL);
} }

View file

@ -418,11 +418,12 @@ public class LCPlayer {
getPlayer().setGameMode(region_gamemode); 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"); Core.debug(getName()+": leaving creative area");
// 1. the region doesn't allow "the other gamemode" // 1. the region doesn't allow "the other gamemode"
// 2. but the player is in that mode // 2. but the player is in that mode
// 3. and the player isn't global (permanent) 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 // result: change him back to default mode
if (checkSwitchFlight(area_event)) { if (checkSwitchFlight(area_event)) {
storeActiveRegionGameMode(null); storeActiveRegionGameMode(null);

View file

@ -31,9 +31,11 @@ public class Permissions {
public Permissions(JavaPlugin plugin) { public Permissions(JavaPlugin plugin) {
this.plugin = plugin; this.plugin = plugin;
try { try {
if (Core.plugin.config.getWEPIFEnabled()) {
// because worldedit may be not loaded as plugin, just as library, we check that way // 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()); Class.forName("com.sk89q.wepif.PermissionsResolverManager", false, plugin.getClass().getClassLoader());
pif = new PermissionsBridge(plugin); pif = new PermissionsBridge(plugin);
}
} catch (ClassNotFoundException e) {} } catch (ClassNotFoundException e) {}
} }