StorageManager

abstract class StorageManager

Manages all storage methods. The same for any type of storage

Constructors

Link copied to clipboard
fun StorageManager()

Functions

Link copied to clipboard
abstract fun bulkSave(bulkData: Map<UUID, PlayerData>)

Save all the player data cache back to the storage.

Link copied to clipboard
abstract fun getPlayerData(uuid: UUID): PlayerData?
Link copied to clipboard
abstract fun loadAllData(): CompletableFuture<List<PlayerData>>

Get all the player data in the storage folder.

Link copied to clipboard
abstract fun loadPlayerData(uuid: UUID): CompletableFuture<PlayerData>

Load PlayerData from the storage. If there is a cached value, it will return that resulting in a very quick computation as opposed to fetching it from the database or file storage. Online players should be cached.

Link copied to clipboard
abstract fun savePlayerData(uuid: UUID, playerData: PlayerData)

Set the PlayerData for a player.

Link copied to clipboard
abstract fun unloadPlayerData(uuid: UUID)

Unload PlayerData from the cache

Properties

Link copied to clipboard
open val gson: Gson

Manages all storage methods. The same for any type of storage

Link copied to clipboard
open val linkedDiscordAccounts: Map<Long, UUID>

A map of . All other data is stored as PlayerData in the playerDataCache, This is just a quick way to perform a lookup of the users linked account.

Link copied to clipboard
abstract val playerDataCache: MutableMap<UUID, PlayerData>

The data cache. This should not be used in most circumstances as the methods allow you to get the data you want in a null safe way.

Link copied to clipboard
abstract val updateTask: BukkitTask

A task that runs every so often to update the cache and save the data back to storage.