Skip to content

Commit

Permalink
Add /ess usermap cache sub-command
Browse files Browse the repository at this point in the history
Allows to view the number of known UUIDs as
well as name to UUID pairs.
  • Loading branch information
JRoy authored and mdcfe committed Aug 5, 2023
1 parent 19d6db0 commit b781c1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ public void generateUidCache() {
}
}

uuids.put(uuid, config.getLong("timestamps.logout", 0L));
uuids.put(uuid, time);
nameToUuidMap.put(name, uuid);
}
} catch (IllegalArgumentException | IndexOutOfBoundsException ignored) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ private void runUserMap(final CommandSource sender, final String[] args) {
}
ess.getLogger().info("Found " + total + " orphaned userdata files.");
});
} else if (args[1].equalsIgnoreCase("cache")) {
sender.sendMessage(tl("usermapKnown", ess.getUsers().getAllUserUUIDs().size(), ess.getUsers().getNameCache().size()));
} else {
try {
final UUID uuid = UUID.fromString(args[1]);
Expand Down
1 change: 1 addition & 0 deletions Essentials/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ userIsAwaySelfWithMessage=\u00a77You are now AFK.
userIsNotAwaySelf=\u00a77You are no longer AFK.
userJailed=\u00a76You have been jailed\!
usermapEntry=\u00a7c{0} \u00a76is mapped to \u00a7c{1}\u00a76.
usermapKnown=\u00a76There are \u00a7c{0} \u00a76known users to the user cache with \u00a7c{1} \u00a76name to UUID pairs.
usermapPurge=\u00a76Checking for files in userdata that are not mapped, results will be logged to console. Destructive Mode: {0}
usermapSize=\u00a76Current cached users in user map is \u00a7c{0}\u00a76/\u00a7c{1}\u00a76/\u00a7c{2}\u00a76.
userUnknown=\u00a74Warning\: The user ''\u00a7c{0}\u00a74'' has never joined this server.
Expand Down

0 comments on commit b781c1e

Please sign in to comment.