2024-04-10 07:43:38 +01:00
|
|
|
package cc.fascinated.model.cache;
|
|
|
|
|
2024-04-11 00:15:12 +01:00
|
|
|
import cc.fascinated.model.mojang.MojangProfile;
|
2024-04-10 07:43:38 +01:00
|
|
|
import cc.fascinated.model.player.Cape;
|
|
|
|
import cc.fascinated.model.player.Player;
|
|
|
|
import cc.fascinated.model.player.Skin;
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
|
|
|
import lombok.ToString;
|
|
|
|
import org.springframework.data.redis.core.RedisHash;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A cacheable {@link Player}.
|
|
|
|
*
|
|
|
|
* @author Braydon
|
|
|
|
*/
|
|
|
|
@Setter @Getter
|
|
|
|
@ToString(callSuper = true)
|
|
|
|
@RedisHash(value = "player", timeToLive = 60L * 60L) // 1 hour (in seconds)
|
|
|
|
public final class CachedPlayer extends Player implements Serializable {
|
|
|
|
/**
|
|
|
|
* The unix timestamp of when this
|
|
|
|
* player was cached, -1 if not cached.
|
|
|
|
*/
|
|
|
|
private long cached;
|
|
|
|
|
2024-04-11 00:49:16 +01:00
|
|
|
public CachedPlayer(UUID uniqueId, String username, Skin skin, Cape cape, MojangProfile.ProfileProperty[] rawProperties, long cached) {
|
|
|
|
super(uniqueId, username, skin, cape, rawProperties);
|
2024-04-10 07:43:38 +01:00
|
|
|
this.cached = cached;
|
|
|
|
}
|
|
|
|
}
|