Fix queries

This commit is contained in:
brenoepic 2022-04-30 02:06:30 -03:00
parent dcb717b118
commit 0a4d934c10
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ public class GiveRespect extends RCONMessage<GiveRespect.JSONGiveRespect> {
habbo.getHabboStats().respectPointsToGive += object.daily_respects; habbo.getHabboStats().respectPointsToGive += object.daily_respects;
habbo.getClient().sendResponse(new UserObjectComposer(habbo)); habbo.getClient().sendResponse(new UserObjectComposer(habbo));
} else { } else {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET respects_given = respects_give + ?, respects_received = respects_received + ?, daily_respect_points = daily_respect_points + ? WHERE user_id = ? LIMIT 1")) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET respects_given = respects_given + ?, respects_received = respects_received + ?, daily_respect_points = daily_respect_points + ? WHERE user_id = ? LIMIT 1")) {
statement.setInt(1, object.respect_received); statement.setInt(1, object.respect_received);
statement.setInt(2, object.respect_given); statement.setInt(2, object.respect_given);
statement.setInt(3, object.daily_respects); statement.setInt(3, object.daily_respects);

View File

@ -22,7 +22,7 @@ class QueryDeleteHabboBadge implements Runnable {
@Override @Override
public void run() { public void run() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM user_badges WHERE users_id = ? AND badge_code = ?")) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM users_badges WHERE user_id = ? AND badge_code = ?")) {
statement.setInt(1, this.habbo.getHabboInfo().getId()); statement.setInt(1, this.habbo.getHabboInfo().getId());
statement.setString(2, this.name); statement.setString(2, this.name);
statement.execute(); statement.execute();