Klasse StatsDao
java.lang.Object
de.delinkedde.mobarenareborn.stats.StatsDao
Data access for the
arena_stats table: per player and arena the kill count, rounds
played, and the best wave reached.-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic final recordA single leaderboard row. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidCreates the stats table if it does not exist.@NotNull Map<String, PlayerStats> Loads all per-arena stats of a player.voidsave(@NotNull UUID uuid, @NotNull String name, @NotNull PlayerStats stats) Inserts or updates a player's stats for one arena.@NotNull List<StatsDao.TopEntry> topByBestWave(int limit) Queries the best-wave leaderboard across all arenas.
-
Konstruktordetails
-
StatsDao
- Parameter:
database- the database to read from and write to
-
-
Methodendetails
-
createTable
Creates the stats table if it does not exist.- Löst aus:
SQLException- if the statement fails
-
load
@NotNull public @NotNull Map<String,PlayerStats> load(@NotNull @NotNull UUID uuid) throws SQLException Loads all per-arena stats of a player.- Parameter:
uuid- the player's unique id- Gibt zurück:
- a map of arena name to stats; empty if the player has none
- Löst aus:
SQLException- if the query fails
-
save
public void save(@NotNull @NotNull UUID uuid, @NotNull @NotNull String name, @NotNull @NotNull PlayerStats stats) throws SQLException Inserts or updates a player's stats for one arena.- Parameter:
uuid- the player's unique idname- the player's last known name, shown on leaderboardsstats- the stats to persist- Löst aus:
SQLException- if the statement fails
-
topByBestWave
Queries the best-wave leaderboard across all arenas.- Parameter:
limit- the maximum number of entries- Gibt zurück:
- the top entries, best first
- Löst aus:
SQLException- if the query fails
-