Skip to content

Commit 470f4c1

Browse files
committed
Constant user file casing.
1 parent 3b35763 commit 470f4c1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Essentials/src/com/earth2me/essentials/Essentials.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,10 @@ public User getUser(final Player base)
667667

668668
if (user == null)
669669
{
670+
if (getSettings().isDebug())
671+
{
672+
LOGGER.log(Level.INFO, "Constructing new userfile from base player " + base.getName());
673+
}
670674
user = new User(base, this);
671675
}
672676
else

Essentials/src/com/earth2me/essentials/UserMap.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public User getUser(final String name)
6464
{
6565
try
6666
{
67-
return users.get(name);
67+
String sanitizedName = StringUtil.sanitizeFileName(name);
68+
return users.get(sanitizedName);
6869
}
6970
catch (ExecutionException ex)
7071
{
@@ -104,7 +105,7 @@ public User load(final String name) throws Exception
104105
if (userFile.exists())
105106
{
106107
keys.add(sanitizedName);
107-
return new User(new OfflinePlayer(name, ess), ess);
108+
return new User(new OfflinePlayer(sanitizedName, ess), ess);
108109
}
109110
throw new Exception("User not found!");
110111
}

0 commit comments

Comments
 (0)