From 0a4d934c10c92f31d7f0237924a116890c38c023 Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Sat, 30 Apr 2022 02:06:30 -0300 Subject: [PATCH] Fix queries --- src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java | 2 +- .../com/eu/habbo/threading/runnables/QueryDeleteHabboBadge.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java b/src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java index 93fe2449..bef769e8 100644 --- a/src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java +++ b/src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java @@ -29,7 +29,7 @@ public class GiveRespect extends RCONMessage { habbo.getHabboStats().respectPointsToGive += object.daily_respects; habbo.getClient().sendResponse(new UserObjectComposer(habbo)); } 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(2, object.respect_given); statement.setInt(3, object.daily_respects); diff --git a/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboBadge.java b/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboBadge.java index 2910fedd..c938f8f3 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboBadge.java +++ b/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboBadge.java @@ -22,7 +22,7 @@ class QueryDeleteHabboBadge implements Runnable { @Override 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.setString(2, this.name); statement.execute();