mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-30 01:50:50 +01:00
ejectUserFurni on remove rights
This commit is contained in:
parent
e195a108b1
commit
c7ed4a88c2
@ -3962,7 +3962,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose());
|
this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose());
|
||||||
|
|
||||||
if (this.rights.remove(userId)) {
|
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 = ?")) {
|
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);
|
statement.setInt(1, this.id);
|
||||||
@ -3974,6 +3973,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 +3981,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 = ?")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user