summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-02-27 01:55:04 +0000
committerKHobbits <rob@khobbits.co.uk>2014-02-27 01:55:04 +0000
commit470f4c1b3eb34a2f25be128c8c5637934c838c37 (patch)
tree735a4539f1c3b8df004fa452249133dfad958fe1
parent3b35763fef81fd8df98d0eb0bccbddff894dab27 (diff)
downloadEssentials-470f4c1b3eb34a2f25be128c8c5637934c838c37.tar
Essentials-470f4c1b3eb34a2f25be128c8c5637934c838c37.tar.gz
Essentials-470f4c1b3eb34a2f25be128c8c5637934c838c37.tar.lz
Essentials-470f4c1b3eb34a2f25be128c8c5637934c838c37.tar.xz
Essentials-470f4c1b3eb34a2f25be128c8c5637934c838c37.zip
Constant user file casing.
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/UserMap.java5
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<String, User> 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<String, User> 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!");
}