Update config for new timed mute. Update spam mute message.

This commit is contained in:
Aust1n46 2021-04-04 22:06:15 -05:00
parent 54fd1d5384
commit c12c00b784
6 changed files with 25 additions and 17 deletions

View File

@ -59,8 +59,6 @@ MutePlayerPlayer: '&cYou have just been muted in: {channel_color}{channel_name}'
MutePlayerPlayerReason: '&cYou have just been muted in: {channel_color}{channel_name} &4Reason:&c {reason}'
MutePlayerPlayerTime: '&cYou have just been muted in: {channel_color}{channel_name} &cfor {time}'
MutePlayerPlayerTimeReason: '&cYou have just been muted in: {channel_color}{channel_name} &cfor {time} &4Reason:&c {reason}'
MutePlayerSpam: '&cYou have been muted for spamming in: {channel_color}{channel_name}'
MutePlayerSpamTime: '&cYou have been muted for spamming in: {channel_color}{channel_name} &cfor {time}'
MutePlayerSender: '&cMuted player &6{player} &cin: {channel_color}{channel_name}'
MutePlayerSenderReason: '&cMuted player &6{player} &cin: {channel_color}{channel_name} &4Reason:&c {reason}'
MutePlayerSenderTime: '&cMuted player &6{player} &cin: {channel_color}{channel_name} &cfor {time}'
@ -79,6 +77,7 @@ SetChannelAllPlayer: '&cYou have been set into all channels.'
SetChannelAllSender: '&6Set player &c{player} &6into all channels.'
SetChannelPlayerChannelNoPermission: '&cThis player does not have permission for channel: {channel_color}{channel_name}'
SetChannelSender: '&6Set player &c{player} &6into channel: {channel_color}{channel_name}'
SpamMuteReasonText: 'Spamming'
SpamWarning: '&cSlow down your chat! You''re halfway to being muted for spam!'
SpyOff: '&6You are no longer spying.'
SpyOn: '&6You are now spying.'

View File

@ -55,14 +55,17 @@ commandspy:
antispam:
enabled: true
# number of messages to be spam
# Number of messages to be spam
spamnumber: 5
# amount of time in seconds for it to be spam
# Amount of time in seconds for it to be spam
spamtime: 10
# amount of time in minutes for the mute to last, use 0 for untimed mute
mutetime: 10
# Amount of time for the mute to last
# Acceptable units are: d,h,m,s
# Units can be combined, for example: 1d8h30m15s
# Use 0 for untimed mute
mutetime: 10m
# Logging chat and commands to a mysql database
mysql:
@ -179,16 +182,16 @@ venturegui:
mute:
icon: 'REDSTONE_BLOCK'
durability: 0
text: '&cMute {player_name}'
text: '&cMute {player_name} &410m'
permission: 'mute'
command: '/mute {player_name} {channel} 10'
command: '/mute {channel} {player_name} 10m'
slot: 1
unmute:
icon: 'DIAMOND_BLOCK'
durability: 0
text: '&bUnmute {player_name}'
permission: 'mute'
command: '/unmute {player_name} {channel}'
command: '/unmute {channel} {player_name} '
slot: 2
removemessage:
icon: 'DIAMOND_AXE'

View File

@ -33,7 +33,7 @@ public class Mute extends MineverseCommand {
if (sender.hasPermission("venturechat.mute")) {
if (args.length < 2) {
sender.sendMessage(LocalizedMessage.COMMAND_INVALID_ARGUMENTS.toString().replace("{command}", "/mute")
.replace("{args}", "[channel] [player] {time}"));
.replace("{args}", "[channel] [player] {time} {reason}"));
return;
}
if (ChatChannel.isChannel(args[0])) {

View File

@ -33,7 +33,7 @@ public class Muteall extends MineverseCommand {
boolean bungee = false;
for(ChatChannel channel : ChatChannel.getChatChannels()) {
if(channel.isMutable()) {
player.addMute(channel.getName(), 0);
player.addMute(channel.getName());
if(channel.getBungee()) {
bungee = true;
}

View File

@ -311,20 +311,25 @@ public class ChatListener implements Listener {
if (spamcount + 1 >= spamtimeconfig) {
long time = Format.parseTimeStringToMillis(mutedForTime);
if (time > 0) {
mcp.addMute(eventChannel.getName(), dateTime + time);
mcp.addMute(eventChannel.getName(), dateTime + time, LocalizedMessage.SPAM_MUTE_REASON_TEXT.toString());
String timeString = Format.parseTimeStringFromMillis(time);
mcp.getPlayer()
.sendMessage(LocalizedMessage.MUTE_PLAYER_SPAM_TIME.toString()
.sendMessage(LocalizedMessage.MUTE_PLAYER_PLAYER_TIME_REASON.toString()
.replace("{channel_color}", eventChannel.getColor())
.replace("{channel_name}", eventChannel.getName())
.replace("{time}", timeString));
.replace("{time}", timeString)
.replace("{reason}", LocalizedMessage.SPAM_MUTE_REASON_TEXT.toString()));
}
else {
mcp.addMute(eventChannel.getName(), 0);
mcp.addMute(eventChannel.getName(), LocalizedMessage.SPAM_MUTE_REASON_TEXT.toString());
mcp.getPlayer()
.sendMessage(LocalizedMessage.MUTE_PLAYER_SPAM.toString()
.sendMessage(LocalizedMessage.MUTE_PLAYER_PLAYER_REASON.toString()
.replace("{channel_color}", eventChannel.getColor())
.replace("{channel_name}", eventChannel.getName()));
.replace("{channel_name}", eventChannel.getName())
.replace("{reason}", LocalizedMessage.SPAM_MUTE_REASON_TEXT.toString()));
}
if(eventChannel.getBungee()) {
plugin.synchronize(mcp, true);
}
mcp.getSpam().get(eventChannel).set(0, 0L);
mcp.setQuickChat(false);

View File

@ -86,6 +86,7 @@ public enum LocalizedMessage {
SET_CHANNEL_ALL_SENDER("SetChannelAllSender"),
SET_CHANNEL_PLAYER_CHANNEL_NO_PERMISSION("SetChannelPlayerChannelNoPermission"),
SET_CHANNEL_SENDER("SetChannelSender"),
SPAM_MUTE_REASON_TEXT("SpamMuteReasonText"),
SPAM_WARNING("SpamWarning"),
SPY_OFF("SpyOff"),
SPY_ON("SpyOn"),