Klasse StatsDao

java.lang.Object
de.delinkedde.mobarenareborn.stats.StatsDao

public final class StatsDao extends Object
Data access for the arena_stats table: per player and arena the kill count, rounds played, and the best wave reached.
  • Konstruktordetails

    • StatsDao

      public StatsDao(@NotNull @NotNull Database database)
      Parameter:
      database - the database to read from and write to
  • Methodendetails

    • createTable

      public void createTable() throws SQLException
      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 id
      name - the player's last known name, shown on leaderboards
      stats - the stats to persist
      Löst aus:
      SQLException - if the statement fails
    • topByBestWave

      @NotNull public @NotNull List<StatsDao.TopEntry> topByBestWave(int limit) throws SQLException
      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