Merge branch 'fix-remove-rights' into 'dev'

ejectUserFurni on remove room rights

See merge request morningstar/Arcturus-Community!491
This commit is contained in:
Harmonic 2022-03-06 21:48:41 +00:00
commit 8d525ff60b

View File

@ -3974,6 +3974,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
if (habbo != null) { if (habbo != null) {
this.ejectUserFurni(habbo.getHabboInfo().getId());
habbo.getRoomUnit().setRightsLevel(RoomRightLevels.NONE); habbo.getRoomUnit().setRightsLevel(RoomRightLevels.NONE);
habbo.getRoomUnit().removeStatus(RoomUnitStatus.FLAT_CONTROL); habbo.getRoomUnit().removeStatus(RoomUnitStatus.FLAT_CONTROL);
this.refreshRightsForHabbo(habbo); this.refreshRightsForHabbo(habbo);
@ -3981,6 +3982,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
public void removeAllRights() { public void removeAllRights() {
for (int userId : rights.toArray()) {
this.ejectUserFurni(userId);
}
this.rights.clear(); this.rights.clear();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ?")) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ?")) {