Skip to content

Persist Explosive Shot cooldown in SQL database - #5345

Open
cyrne1-7208 wants to merge 1 commit into
mcMMO-Dev:masterfrom
cyrne1-7208:fix/sql-cooldown-persistence-and-leaks
Open

cyrne1-7208 wants to merge 1 commit into
mcMMO-Dev:masterfrom
cyrne1-7208:fix/sql-cooldown-persistence-and-leaks

Conversation

@cyrne1-7208

@cyrne1-7208 cyrne1-7208 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Persists the Explosive Shot cooldown (SuperAbilityType.EXPLOSIVE_SHOT) in the SQL database during saveUser().

Previously, SQLDatabaseManager.loadFromResult() loaded cooldowns.archery into skillsDATS as EXPLOSIVE_SHOT, but SQLDatabaseManager.updateCooldowns() omitted the archery column from its UPDATE statement and parameter bindings. As a result, Explosive Shot cooldowns were not persisted across server restarts or reconnects on SQL-backed databases.

Changes

  • In SQLDatabaseManager.java, add archery = ? to the cooldowns UPDATE query and bind profile.getAbilityDATS(SuperAbilityType.EXPLOSIVE_SHOT) in schema/load order.
  • In SQLDatabaseManagerTest.java, add parameterized integration test whenSavingUserShouldPersistExplosiveShotCooldown(DbFlavor) under // Saving cooldowns verifying cooldown preservation across saveUser() and loadPlayerProfile() on both MySQL and MariaDB.

Testing

  • Verified clean compilation with mvn test-compile.
  • mvn test (1,789 non-Docker tests passed).
  • mvn test -Psql-tests -Dtest=SQLDatabaseManagerTest (all 89 MySQL and MariaDB integration tests passed, including the new whenSavingUserShouldPersistExplosiveShotCooldown test on both engines).

In SQLDatabaseManager, cooldowns.archery is mapped to SuperAbilityType.EXPLOSIVE_SHOT
on load, but updateCooldowns() omitted the column from its UPDATE query and parameter
bindings. As a result, Explosive Shot cooldowns were never persisted to SQL.

This change:
- Adds archery to updateCooldowns() and binds profile.getAbilityDATS(SuperAbilityType.EXPLOSIVE_SHOT)
  in schema/load order.
- Adds whenSavingUserShouldPersistExplosiveShotCooldown() parameterized test in SQLDatabaseManagerTest
  to verify cooldown preservation on save and reload across supported SQL databases.

Signed-off-by: Cyrne1_7208 <127477265+cyrne1-7208@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant