Skip to content

Commit b781c1e

Browse files
JRoymdcfe
authored andcommitted
Add /ess usermap cache sub-command
Allows to view the number of known UUIDs as well as name to UUID pairs.
1 parent 19d6db0 commit b781c1e

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ public void generateUidCache() {
963963
}
964964
}
965965

966-
uuids.put(uuid, config.getLong("timestamps.logout", 0L));
966+
uuids.put(uuid, time);
967967
nameToUuidMap.put(name, uuid);
968968
}
969969
} catch (IllegalArgumentException | IndexOutOfBoundsException ignored) {

Essentials/src/main/java/com/earth2me/essentials/commands/Commandessentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ private void runUserMap(final CommandSource sender, final String[] args) {
700700
}
701701
ess.getLogger().info("Found " + total + " orphaned userdata files.");
702702
});
703+
} else if (args[1].equalsIgnoreCase("cache")) {
704+
sender.sendMessage(tl("usermapKnown", ess.getUsers().getAllUserUUIDs().size(), ess.getUsers().getNameCache().size()));
703705
} else {
704706
try {
705707
final UUID uuid = UUID.fromString(args[1]);

Essentials/src/main/resources/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,7 @@ userIsAwaySelfWithMessage=\u00a77You are now AFK.
14621462
userIsNotAwaySelf=\u00a77You are no longer AFK.
14631463
userJailed=\u00a76You have been jailed\!
14641464
usermapEntry=\u00a7c{0} \u00a76is mapped to \u00a7c{1}\u00a76.
1465+
usermapKnown=\u00a76There are \u00a7c{0} \u00a76known users to the user cache with \u00a7c{1} \u00a76name to UUID pairs.
14651466
usermapPurge=\u00a76Checking for files in userdata that are not mapped, results will be logged to console. Destructive Mode: {0}
14661467
usermapSize=\u00a76Current cached users in user map is \u00a7c{0}\u00a76/\u00a7c{1}\u00a76/\u00a7c{2}\u00a76.
14671468
userUnknown=\u00a74Warning\: The user ''\u00a7c{0}\u00a74'' has never joined this server.

0 commit comments

Comments
 (0)