mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
fix(flooding): do not show mute icon if mute is due to flooding
This commit is contained in:
parent
bd9b3b41f3
commit
db32682fbc
@ -43,7 +43,7 @@ public class MuteCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.mute(duration);
|
habbo.mute(duration, false);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new RoomUserIgnoredComposer(habbo, RoomUserIgnoredComposer.MUTED).compose()); //: RoomUserIgnoredComposer.UNIGNORED
|
habbo.getHabboInfo().getCurrentRoom().sendComposer(new RoomUserIgnoredComposer(habbo, RoomUserIgnoredComposer.MUTED).compose()); //: RoomUserIgnoredComposer.UNIGNORED
|
||||||
|
@ -158,7 +158,7 @@ public class ModToolSanctions {
|
|||||||
switch (sanctionLevelItem.sanctionType) {
|
switch (sanctionLevelItem.sanctionType) {
|
||||||
case "ALERT": habbo.alert(reason); break;
|
case "ALERT": habbo.alert(reason); break;
|
||||||
case "BAN": Emulator.getGameEnvironment().getModToolManager().ban(habboId, self, reason, sanctionLevelItem.sanctionHourLength, ModToolBanType.ACCOUNT, cfhTopic); break;
|
case "BAN": Emulator.getGameEnvironment().getModToolManager().ban(habboId, self, reason, sanctionLevelItem.sanctionHourLength, ModToolBanType.ACCOUNT, cfhTopic); break;
|
||||||
case "MUTE": habbo.mute(muteDurationSeconds == 0 ? 3600 : muteDurationSeconds); break;
|
case "MUTE": habbo.mute(muteDurationSeconds == 0 ? 3600 : muteDurationSeconds, false); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public class WordFilter {
|
|||||||
foundShit = true;
|
foundShit = true;
|
||||||
|
|
||||||
if (habbo != null && word.muteTime > 0) {
|
if (habbo != null && word.muteTime > 0) {
|
||||||
habbo.mute(word.muteTime);
|
habbo.mute(word.muteTime, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2971,7 +2971,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
habbo.getHabboStats().mutedCount++;
|
habbo.getHabboStats().mutedCount++;
|
||||||
timeOut += (timeOut * (int) Math.ceil(Math.pow(habbo.getHabboStats().mutedCount, 2)));
|
timeOut += (timeOut * (int) Math.ceil(Math.pow(habbo.getHabboStats().mutedCount, 2)));
|
||||||
habbo.getHabboStats().chatCounter = 0;
|
habbo.getHabboStats().chatCounter = 0;
|
||||||
habbo.mute(timeOut);
|
habbo.mute(timeOut, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void talk(Habbo habbo, RoomChatMessage roomChatMessage, RoomChatType chatType) {
|
public void talk(Habbo habbo, RoomChatMessage roomChatMessage, RoomChatType chatType) {
|
||||||
|
@ -210,7 +210,7 @@ public class RoomChatMessage implements Runnable, ISerialize, Loggable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.habbo.mute(Emulator.getConfig().getInt("hotel.wordfilter.automute"));
|
this.habbo.mute(Emulator.getConfig().getInt("hotel.wordfilter.automute"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.message = "";
|
this.message = "";
|
||||||
|
@ -378,14 +378,14 @@ public class Habbo implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mute(int seconds) {
|
public void mute(int seconds, boolean isFlood) {
|
||||||
if (!this.hasPermission("acc_no_mute")) {
|
if (!this.hasPermission("acc_no_mute")) {
|
||||||
int remaining = this.habboStats.addMuteTime(seconds);
|
int remaining = this.habboStats.addMuteTime(seconds);
|
||||||
this.client.sendResponse(new FloodCounterComposer(remaining));
|
this.client.sendResponse(new FloodCounterComposer(remaining));
|
||||||
this.client.sendResponse(new MutedWhisperComposer(remaining));
|
this.client.sendResponse(new MutedWhisperComposer(remaining));
|
||||||
|
|
||||||
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
|
||||||
if (room != null) {
|
if (room != null && !isFlood) {
|
||||||
room.sendComposer(new RoomUserIgnoredComposer(this, RoomUserIgnoredComposer.MUTED).compose());
|
room.sendComposer(new RoomUserIgnoredComposer(this, RoomUserIgnoredComposer.MUTED).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ public class SecureLoginEvent extends MessageHandler {
|
|||||||
} else if (item.isMuted && item.muteDuration > Emulator.getIntUnixTimestamp()) {
|
} else if (item.isMuted && item.muteDuration > Emulator.getIntUnixTimestamp()) {
|
||||||
Date muteDuration = new Date((long) item.muteDuration * 1000);
|
Date muteDuration = new Date((long) item.muteDuration * 1000);
|
||||||
long diff = muteDuration.getTime() - Emulator.getDate().getTime();
|
long diff = muteDuration.getTime() - Emulator.getDate().getTime();
|
||||||
habbo.mute(Math.toIntExact(diff));
|
habbo.mute(Math.toIntExact(diff), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class ModToolIssueDefaultSanctionEvent extends MessageHandler {
|
|||||||
} else if (defaultSanction.muteLength > 0) {
|
} else if (defaultSanction.muteLength > 0) {
|
||||||
|
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
target.mute(defaultSanction.muteLength * 86400);
|
target.mute(defaultSanction.muteLength * 86400, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class ModToolSanctionMuteEvent extends MessageHandler {
|
|||||||
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
|
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
habbo.mute(60 * 60);
|
habbo.mute(60 * 60, false);
|
||||||
habbo.alert(message);
|
habbo.alert(message);
|
||||||
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
|
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class MuteUser extends RCONMessage<MuteUser.JSON> {
|
|||||||
if (json.duration == 0) {
|
if (json.duration == 0) {
|
||||||
habbo.unMute();
|
habbo.unMute();
|
||||||
} else {
|
} else {
|
||||||
habbo.mute(json.duration);
|
habbo.mute(json.duration, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET mute_end_timestamp = ? WHERE user_id = ? LIMIT 1")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET mute_end_timestamp = ? WHERE user_id = ? LIMIT 1")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user