Class LoadProgressionSQL
java.lang.Object
com.ordwen.odailyquests.quests.player.progression.ProgressionLoader
com.ordwen.odailyquests.quests.player.progression.storage.sql.LoadProgressionSQL
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ordwen.odailyquests.quests.player.progression.ProgressionLoader
ProgressionLoader.StoredPlayerProgression -
Field Summary
Fields inherited from class com.ordwen.odailyquests.quests.player.progression.ProgressionLoader
CONFIG_CHANGE, NEW_QUESTS -
Constructor Summary
ConstructorsConstructorDescriptionLoadProgressionSQL(SQLManager sqlManager) Creates a new SQL-based progression loader. -
Method Summary
Modifier and TypeMethodDescriptionvoidloadProgression(String playerName, Map<String, PlayerQuests> activeQuests, boolean sendStatusMessage) Loads a player's progression from the SQL database.Methods inherited from class com.ordwen.odailyquests.quests.player.progression.ProgressionLoader
error, handleMissingQuests, handleNewPlayer, handlePlayerDisconnected, isSelectedRequiredInvalid, registerLoadedPlayerQuests, requiredAmountIsZero, requiredAmountNotEqual, sendQuestStatusMessage
-
Constructor Details
-
LoadProgressionSQL
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 nameactiveQuests- the current active quests map to populate/updatesendStatusMessage- whether a status message should be sent to the player (when supported by the loader flow)
-