mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Made ignore staff optional, active by default
This commit is contained in:
parent
60a63e4832
commit
b638e04737
@ -605,10 +605,10 @@ public class HabboStats implements Runnable {
|
|||||||
|
|
||||||
public void ignoreUser(GameClient gameClient, int userId) {
|
public void ignoreUser(GameClient gameClient, int userId) {
|
||||||
Habbo target = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo target = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
if (!Emulator.getConfig().getBoolean("hotel.ignore.staffs")) {
|
||||||
if (target.getHabboInfo().getRank().getId() >= gameClient.getHabbo().getHabboInfo().getRank().getId()) {
|
if (target.getHabboInfo().getRank().getId() >= gameClient.getHabbo().getHabboInfo().getRank().getId()) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("generic.error.higher_rank"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("generic.error.higher_rank"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (!this.userIgnored(userId)) {
|
if (!this.userIgnored(userId)) {
|
||||||
this.ignoredUsers.add(userId);
|
this.ignoredUsers.add(userId);
|
||||||
|
|
||||||
@ -623,6 +623,20 @@ public class HabboStats implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!this.userIgnored(userId)) {
|
||||||
|
this.ignoredUsers.add(userId);
|
||||||
|
|
||||||
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
|
||||||
|
PreparedStatement statement = connection.prepareStatement("INSERT INTO users_ignored (user_id, target_id) VALUES (?, ?)")) {
|
||||||
|
statement.setInt(1, this.habboInfo.getId());
|
||||||
|
statement.setInt(2, userId);
|
||||||
|
statement.execute();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
LOGGER.error("Caught SQL exception", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void unignoreUser(int userId) {
|
public void unignoreUser(int userId) {
|
||||||
if (this.userIgnored(userId)) {
|
if (this.userIgnored(userId)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user