Fix loading users with only numerals in their names to be seen as

strings.
This commit is contained in:
ElgarL 2012-06-24 13:10:22 +01:00
parent 656f25dc97
commit 51d61e7a91
2 changed files with 10 additions and 3 deletions

View file

@ -184,4 +184,5 @@ v 2.0:
- Prevent null perms getting past the GlobalGroups loader.
- Fix forgetting sub groups on a manload.
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
- Only output a Data update message if something has changed.
- Only output a Data update message if something has changed.
- Fix loading users with only numerals in their names to be seen as strings.

View file

@ -775,20 +775,26 @@ public class WorldDataHolder {
Iterator<String> usersItr = allUsersNode.keySet().iterator();
String usersKey;
Object node;
Integer userCount = 0;
while (usersItr.hasNext()) {
try {
userCount++;
// Attempt to fetch the next user name.
usersKey = usersItr.next();
node = usersItr.next();
if (node instanceof Integer)
usersKey = Integer.toString((Integer)node);
else
usersKey = node.toString();
} catch (Exception ex) {
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
}
Map<String, Object> thisUserNode = null;
try {
thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
thisUserNode = (Map<String, Object>) allUsersNode.get(node);
} catch (Exception ex) {
throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath());
}