From 9bb9102c6a0a461138752bd5b96e3f0e1e843286 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 27 Feb 2014 01:55:04 +0000 Subject: Constant user file casing. --- Essentials/src/com/earth2me/essentials/Essentials.java | 4 ++++ Essentials/src/com/earth2me/essentials/UserMap.java | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 3fe086ad1..1383c65d9 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -667,6 +667,10 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials if (user == null) { + if (getSettings().isDebug()) + { + LOGGER.log(Level.INFO, "Constructing new userfile from base player " + base.getName()); + } user = new User(base, this); } else diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index d1cbea10e..c96dd0343 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -64,7 +64,8 @@ public class UserMap extends CacheLoader implements IConf { try { - return users.get(name); + String sanitizedName = StringUtil.sanitizeFileName(name); + return users.get(sanitizedName); } catch (ExecutionException ex) { @@ -104,7 +105,7 @@ public class UserMap extends CacheLoader implements IConf if (userFile.exists()) { keys.add(sanitizedName); - return new User(new OfflinePlayer(name, ess), ess); + return new User(new OfflinePlayer(sanitizedName, ess), ess); } throw new Exception("User not found!"); } -- cgit v1.2.3