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 |
DATE_FORMAT |
private java.util.Deque<com.mojang.authlib.GameProfile> |
gameProfiles |
protected com.google.gson.Gson |
gson |
private static boolean |
onlineMode |
private com.mojang.authlib.GameProfileRepository |
profileRepo |
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(com.mojang.authlib.GameProfileRepository profileRepoIn,
java.io.File usercacheFileIn) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(com.mojang.authlib.GameProfile gameProfile) |
private void |
addEntry(com.mojang.authlib.GameProfile gameProfile,
java.util.Date expirationDate) |
private PlayerProfileCache.ProfileEntry |
getByUUID(java.util.UUID uuid) |
private java.util.List<PlayerProfileCache.ProfileEntry> |
getEntriesWithLimit(int limitSize) |
com.mojang.authlib.GameProfile |
getGameProfileForUsername(java.lang.String username) |
com.mojang.authlib.GameProfile |
getProfileByUUID(java.util.UUID uuid) |
java.lang.String[] |
getUsernames() |
private static boolean |
isOnlineMode() |
void |
load() |
private static com.mojang.authlib.GameProfile |
lookupProfile(com.mojang.authlib.GameProfileRepository profileRepoIn,
java.lang.String name) |
void |
save() |
static void |
setOnlineMode(boolean onlineModeIn) |
public static final java.text.SimpleDateFormat DATE_FORMAT
private static boolean onlineMode
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.Deque<com.mojang.authlib.GameProfile> gameProfiles
private final com.mojang.authlib.GameProfileRepository profileRepo
protected final com.google.gson.Gson gson
private final java.io.File usercacheFile
private static final java.lang.reflect.ParameterizedType TYPE
public PlayerProfileCache(com.mojang.authlib.GameProfileRepository profileRepoIn, java.io.File usercacheFileIn)
private static com.mojang.authlib.GameProfile lookupProfile(com.mojang.authlib.GameProfileRepository profileRepoIn, java.lang.String name)
public static void setOnlineMode(boolean onlineModeIn)
private static boolean isOnlineMode()
public void addEntry(com.mojang.authlib.GameProfile gameProfile)
private void addEntry(com.mojang.authlib.GameProfile gameProfile, java.util.Date expirationDate)
@Nullable public com.mojang.authlib.GameProfile getGameProfileForUsername(java.lang.String username)
public java.lang.String[] getUsernames()
@Nullable public com.mojang.authlib.GameProfile getProfileByUUID(java.util.UUID uuid)
private PlayerProfileCache.ProfileEntry getByUUID(java.util.UUID uuid)
public void load()
public void save()
private java.util.List<PlayerProfileCache.ProfileEntry> getEntriesWithLimit(int limitSize)