mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-18 17:53:00 +01:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into tridentsxbows
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.gmail.nossr50.database;
|
||||
|
||||
import com.gmail.nossr50.api.exceptions.InvalidSkillException;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.database.DatabaseType;
|
||||
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.player.MMODataSnapshot;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerData;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -17,15 +17,13 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface DatabaseManager {
|
||||
// One month in milliseconds
|
||||
long PURGE_TIME = 2630000000L * Config.getInstance().getOldUsersCutoff();
|
||||
// During convertUsers, how often to output a status
|
||||
int progressInterval = 200;
|
||||
|
||||
/**
|
||||
* Purge users with 0 power level from the database.
|
||||
*/
|
||||
void purgePowerlessUsers();
|
||||
int purgePowerlessUsers();
|
||||
|
||||
/**
|
||||
* Purge users who haven't logged on in over a certain time frame from the database.
|
||||
@@ -87,11 +85,11 @@ public interface DatabaseManager {
|
||||
|
||||
/**
|
||||
* Add a new user to the database.
|
||||
*
|
||||
* @param playerName The name of the player to be added to the database
|
||||
* @param playerName The name of the player to be added to the database
|
||||
* @param uuid The uuid of the player to be added to the database
|
||||
* @return
|
||||
*/
|
||||
void newUser(String playerName, UUID uuid);
|
||||
@NotNull PlayerProfile newUser(String playerName, UUID uuid);
|
||||
|
||||
@NotNull PlayerProfile newUser(@NotNull Player player);
|
||||
|
||||
@@ -104,13 +102,9 @@ public interface DatabaseManager {
|
||||
*/
|
||||
@NotNull PlayerProfile loadPlayerProfile(@NotNull String playerName);
|
||||
|
||||
/**
|
||||
* Load a player from the database.
|
||||
*
|
||||
* @param uuid The uuid of the player to load from the database
|
||||
* @return The player's data, or an unloaded PlayerProfile if not found
|
||||
*/
|
||||
@NotNull PlayerProfile loadPlayerProfile(@NotNull UUID uuid, @Nullable String playerName);
|
||||
@NotNull PlayerProfile loadPlayerProfile(@NotNull OfflinePlayer offlinePlayer);
|
||||
|
||||
@NotNull PlayerProfile loadPlayerProfile(@NotNull UUID uuid);
|
||||
|
||||
/**
|
||||
* Get all users currently stored in the database.
|
||||
|
||||
Reference in New Issue
Block a user