java.lang.Object
com.ordwen.odailyquests.quests.player.progression.ProgressionLoader
com.ordwen.odailyquests.quests.player.progression.storage.sql.LoadProgressionSQL

public class LoadProgressionSQL extends ProgressionLoader
Loads a player's quest progression from an SQL database.

This loader queries the stored player metadata (timestamp, achieved quests, rerolls), then either restores the saved quests and their progression or regenerates a new set when no valid data is found or when the stored data is outdated.

The SQL work is executed asynchronously after a configurable delay to avoid blocking the server thread during login bursts or heavy IO.

  • Constructor Details

    • LoadProgressionSQL

      public LoadProgressionSQL(SQLManager sqlManager)
      Creates a new SQL-based progression loader.
      Parameters:
      sqlManager - the SQL manager used to get database connections and execute queries
  • Method Details

    • loadProgression

      public void loadProgression(String playerName, Map<String,PlayerQuests> activeQuests, boolean sendStatusMessage)
      Loads a player's progression from the SQL database.

      The loading is scheduled asynchronously after the configured delay. If the player is no longer online when the task runs, the loading is aborted.

      If no valid stored data is found, new quests are generated for the player.

      Parameters:
      playerName - the player's name
      activeQuests - the current active quests map to populate/update
      sendStatusMessage - whether a status message should be sent to the player (when supported by the loader flow)