From c7ed4a88c246eba8d30b106670201d6bfb13e337 Mon Sep 17 00:00:00 2001 From: brenoepics <59066707+brenoepics@users.noreply.github.com> Date: Sat, 5 Mar 2022 23:17:27 -0300 Subject: [PATCH 1/2] ejectUserFurni on remove rights --- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 5e87ce8e..932f149a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3962,7 +3962,6 @@ public class Room implements Comparable, ISerialize, Runnable { return; this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose()); - if (this.rights.remove(userId)) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ? AND user_id = ?")) { statement.setInt(1, this.id); @@ -3974,6 +3973,7 @@ public class Room implements Comparable, ISerialize, Runnable { } if (habbo != null) { + this.ejectUserFurni(habbo.getHabboInfo().getId()); habbo.getRoomUnit().setRightsLevel(RoomRightLevels.NONE); habbo.getRoomUnit().removeStatus(RoomUnitStatus.FLAT_CONTROL); this.refreshRightsForHabbo(habbo); @@ -3981,6 +3981,10 @@ public class Room implements Comparable, ISerialize, Runnable { } public void removeAllRights() { + for (int userId : rights.toArray()) { + this.ejectUserFurni(userId); + } + this.rights.clear(); try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ?")) { From b28bf5f4ef97ec9b739646acd9f00ebe2b0c3dc5 Mon Sep 17 00:00:00 2001 From: brenoepic Date: Sun, 6 Mar 2022 02:22:05 +0000 Subject: [PATCH 2/2] Update Room.java --- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 932f149a..af82a1ae 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3962,6 +3962,7 @@ public class Room implements Comparable, ISerialize, Runnable { return; this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose()); + if (this.rights.remove(userId)) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ? AND user_id = ?")) { statement.setInt(1, this.id);