diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/UserMap.java | 14 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index 467c2693b..f6b75c3a5 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -47,7 +47,7 @@ public class UserMap extends CacheLoader<String, User> implements IConf continue; } final String name = string.substring(0, string.length() - 4); - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); } } }); @@ -55,14 +55,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf public boolean userExists(final String name) { - return keys.contains(name.toLowerCase(Locale.ENGLISH)); + return keys.contains(Util.sanitizeFileName(name)); } public User getUser(final String name) { try { - return users.get(name.toLowerCase(Locale.ENGLISH)); + return users.get(Util.sanitizeFileName(name)); } catch (ExecutionException ex) { @@ -81,14 +81,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf { if (player.getName().equalsIgnoreCase(name)) { - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); return new User(player, ess); } } final File userFile = getUserFile(name); if (userFile.exists()) { - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); return new User(new OfflinePlayer(name, ess), ess); } throw new Exception("User not found!"); @@ -102,8 +102,8 @@ public class UserMap extends CacheLoader<String, User> implements IConf public void removeUser(final String name) { - keys.remove(name.toLowerCase(Locale.ENGLISH)); - users.invalidate(name.toLowerCase(Locale.ENGLISH)); + keys.remove(Util.sanitizeFileName(name)); + users.invalidate(Util.sanitizeFileName(name)); } public Set<String> getAllUniqueUsers() diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 5f73f84c2..672f1c6ca 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -112,7 +112,7 @@ public class Commandbalancetop extends EssentialsCommand final User user = ess.getUserMap().getUser(u); if (user != null) { - balances.put(u, user.getMoney()); + balances.put(user.getDisplayName(), user.getMoney()); } } |