User can no longer ignore staffs

This commit is contained in:
Swirny 2020-05-19 14:26:45 +02:00 committed by Mike
parent 1afca5c0a0
commit 60a63e4832
2 changed files with 22 additions and 11 deletions

View File

@ -9,3 +9,7 @@ ALTER TABLE `permissions` ADD `cmd_softkick` ENUM('0', '1') NOT NULL DEFAULT '0'
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.keys.cmd_softkick', 'softkick');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softkick_not_found', '%user% not found');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softkick_error_self', 'You can not softkick yourself!');
-- Rank ignoring
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('generic.error.higher_rank', 'You can\'t ignore this user.');
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.ignore.staffs', '0');

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.users;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.achievements.Achievement;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.achievements.TalentTrackType;
@ -602,7 +603,12 @@ public class HabboStats implements Runnable {
return 0;
}
public void ignoreUser(int userId) {
public void ignoreUser(GameClient gameClient, int userId) {
Habbo target = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (target.getHabboInfo().getRank().getId() >= gameClient.getHabbo().getHabboInfo().getRank().getId()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("generic.error.higher_rank"), RoomChatMessageBubbles.ALERT);
}
else {
if (!this.userIgnored(userId)) {
this.ignoredUsers.add(userId);
@ -616,6 +622,7 @@ public class HabboStats implements Runnable {
}
}
}
}
public void unignoreUser(int userId) {
if (this.userIgnored(userId)) {