Package net.minecraft.server.players
Class GameProfileCache
java.lang.Object
net.minecraft.server.players.GameProfileCache
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Executor
private final File
private static final int
private static final int
private final com.google.gson.Gson
private static final org.slf4j.Logger
private final AtomicLong
private final com.mojang.authlib.GameProfileRepository
private final Map
<String, GameProfileCache.GameProfileInfo> A map between player usernames andprivate final Map
<UUID, GameProfileCache.GameProfileInfo> A map between andprivate final Map
<String, CompletableFuture<Optional<com.mojang.authlib.GameProfile>>> private static boolean
-
Constructor Summary
ConstructorsConstructorDescriptionGameProfileCache
(com.mojang.authlib.GameProfileRepository profileRepository, File file) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(com.mojang.authlib.GameProfile gameProfile) Add an entry to this cachevoid
private static DateFormat
private static Optional
<com.mojang.authlib.GameProfile> createUnknownProfile
(String profileName) Optional
<com.mojang.authlib.GameProfile> Get a player's GameProfile given their username.Optional
<com.mojang.authlib.GameProfile> CompletableFuture
<Optional<com.mojang.authlib.GameProfile>> private long
private Stream
<GameProfileCache.GameProfileInfo> getTopMRUProfiles
(int limit) load()
private static Optional
<com.mojang.authlib.GameProfile> lookupGameProfile
(com.mojang.authlib.GameProfileRepository profileRepo, String name) private static Optional
<GameProfileCache.GameProfileInfo> readGameProfile
(com.google.gson.JsonElement json, DateFormat dateFormat) private void
safeAdd
(GameProfileCache.GameProfileInfo profile) void
save()
void
setExecutor
(Executor exectutor) static void
setUsesAuthentication
(boolean onlineMode) private static boolean
private static com.google.gson.JsonElement
writeGameProfile
(GameProfileCache.GameProfileInfo profileInfo, DateFormat dateFormat)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
GAMEPROFILES_MRU_LIMIT
private static final int GAMEPROFILES_MRU_LIMIT- See Also:
-
GAMEPROFILES_EXPIRATION_MONTHS
private static final int GAMEPROFILES_EXPIRATION_MONTHS- See Also:
-
usesAuthentication
private static boolean usesAuthentication -
profilesByName
A map between player usernames and -
profilesByUUID
A map between and -
requests
-
profileRepository
private final com.mojang.authlib.GameProfileRepository profileRepository -
gson
private final com.google.gson.Gson gson -
file
-
operationCount
-
executor
-
-
Constructor Details
-
GameProfileCache
-
-
Method Details
-
safeAdd
-
lookupGameProfile
-
createUnknownProfile
-
setUsesAuthentication
public static void setUsesAuthentication(boolean onlineMode) -
usesAuthentication
private static boolean usesAuthentication() -
add
public void add(com.mojang.authlib.GameProfile gameProfile) Add an entry to this cache -
getNextOperation
private long getNextOperation() -
get
Get a player's GameProfile given their username. Mojang's servers will be contacted if the entry is not cached locally. -
getAsync
-
get
- Parameters:
uuid
- Get a player'sGameProfile
given their UUID
-
setExecutor
-
clearExecutor
public void clearExecutor() -
createDateFormat
-
load
-
save
public void save() -
getTopMRUProfiles
-
writeGameProfile
private static com.google.gson.JsonElement writeGameProfile(GameProfileCache.GameProfileInfo profileInfo, DateFormat dateFormat) -
readGameProfile
private static Optional<GameProfileCache.GameProfileInfo> readGameProfile(com.google.gson.JsonElement json, DateFormat dateFormat)
-