Skip to content

Commit

Permalink
make setDay method reset time to current time
Browse files Browse the repository at this point in the history
  • Loading branch information
NONPLAYT committed Jan 2, 2025
1 parent b93d54b commit ab196e9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ public void handleReward(Player player, int day) {

public void setDay(Player player, int day) {
UUID uuid = player.getUniqueId();
long currentTime = System.currentTimeMillis() / 1000L;
try (Connection conn = dbManager.dbSource.getConnection()) {
String query = "UPDATE `data` SET next_day = ? WHERE uuid = ?";
String query = "UPDATE `data` SET next_day = ?, next_time = ? WHERE uuid = ?";
try (PreparedStatement stmt = conn.prepareStatement(query)) {
stmt.setInt(1, day);
stmt.setString(2, uuid.toString());
stmt.setLong(2, currentTime);
stmt.setString(3, uuid.toString());
stmt.executeUpdate();
}
} catch (SQLException e) {
Expand Down

0 comments on commit ab196e9

Please sign in to comment.