public class PlayerProfileCache
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
PlayerProfileCache.ProfileEntry |
(package private) class |
PlayerProfileCache.Serializer |
Modifier and Type | Field and Description |
---|---|
static java.text.SimpleDateFormat |
dateFormat |
private java.util.LinkedList<com.mojang.authlib.GameProfile> |
gameProfiles |
protected com.google.gson.Gson |
gson |
private MinecraftServer |
mcServer |
private static java.lang.reflect.ParameterizedType |
TYPE |
private java.io.File |
usercacheFile |
private java.util.Map<java.lang.String,PlayerProfileCache.ProfileEntry> |
usernameToProfileEntryMap |
private java.util.Map<java.util.UUID,PlayerProfileCache.ProfileEntry> |
uuidToProfileEntryMap |
Constructor and Description |
---|
PlayerProfileCache(MinecraftServer server,
java.io.File cacheFile) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(com.mojang.authlib.GameProfile gameProfile)
Add an entry to this cache
|
private void |
addEntry(com.mojang.authlib.GameProfile gameProfile,
java.util.Date expirationDate)
Add an entry to this cache
|
private PlayerProfileCache.ProfileEntry |
getByUUID(java.util.UUID uuid)
Get a
PlayerProfileCache.ProfileEntry by UUID |
private java.util.List<PlayerProfileCache.ProfileEntry> |
getEntriesWithLimit(int limitSize) |
private static com.mojang.authlib.GameProfile |
getGameProfile(MinecraftServer server,
java.lang.String username)
Get a GameProfile given the MinecraftServer and the player's username.
|
com.mojang.authlib.GameProfile |
getGameProfileForUsername(java.lang.String username)
Get a player's GameProfile given their username.
|
com.mojang.authlib.GameProfile |
getProfileByUUID(java.util.UUID uuid)
Get a player's
GameProfile given their UUID |
java.lang.String[] |
getUsernames()
Get an array of the usernames that are cached in this cache
|
void |
load()
Load the cached profiles from disk
|
void |
save()
Save the cached profiles to disk
|
public static final java.text.SimpleDateFormat dateFormat
private final java.util.Map<java.lang.String,PlayerProfileCache.ProfileEntry> usernameToProfileEntryMap
private final java.util.Map<java.util.UUID,PlayerProfileCache.ProfileEntry> uuidToProfileEntryMap
private final java.util.LinkedList<com.mojang.authlib.GameProfile> gameProfiles
private final MinecraftServer mcServer
protected final com.google.gson.Gson gson
private final java.io.File usercacheFile
private static final java.lang.reflect.ParameterizedType TYPE
public PlayerProfileCache(MinecraftServer server, java.io.File cacheFile)
private static com.mojang.authlib.GameProfile getGameProfile(MinecraftServer server, java.lang.String username)
public void addEntry(com.mojang.authlib.GameProfile gameProfile)
private void addEntry(com.mojang.authlib.GameProfile gameProfile, java.util.Date expirationDate)
public com.mojang.authlib.GameProfile getGameProfileForUsername(java.lang.String username)
public java.lang.String[] getUsernames()
public com.mojang.authlib.GameProfile getProfileByUUID(java.util.UUID uuid)
GameProfile
given their UUIDprivate PlayerProfileCache.ProfileEntry getByUUID(java.util.UUID uuid)
PlayerProfileCache.ProfileEntry
by UUIDpublic void load()
public void save()
private java.util.List<PlayerProfileCache.ProfileEntry> getEntriesWithLimit(int limitSize)