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}' 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}' 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}' 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}' MutePlayerSender: '&cMuted player &6{player} &cin: {channel_color}{channel_name}'
MutePlayerSenderReason: '&cMuted player &6{player} &cin: {channel_color}{channel_name} &4Reason:&c {reason}' 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}' 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.' SetChannelAllSender: '&6Set player &c{player} &6into all channels.'
SetChannelPlayerChannelNoPermission: '&cThis player does not have permission for channel: {channel_color}{channel_name}' SetChannelPlayerChannelNoPermission: '&cThis player does not have permission for channel: {channel_color}{channel_name}'
SetChannelSender: '&6Set player &c{player} &6into 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!' SpamWarning: '&cSlow down your chat! You''re halfway to being muted for spam!'
SpyOff: '&6You are no longer spying.' SpyOff: '&6You are no longer spying.'
SpyOn: '&6You are now spying.' SpyOn: '&6You are now spying.'

View File

@ -55,14 +55,17 @@ commandspy:
antispam: antispam:
enabled: true enabled: true
# number of messages to be spam # Number of messages to be spam
spamnumber: 5 spamnumber: 5
# amount of time in seconds for it to be spam # Amount of time in seconds for it to be spam
spamtime: 10 spamtime: 10
# amount of time in minutes for the mute to last, use 0 for untimed mute # Amount of time for the mute to last
mutetime: 10 # 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 # Logging chat and commands to a mysql database
mysql: mysql:
@ -179,16 +182,16 @@ venturegui:
mute: mute:
icon: 'REDSTONE_BLOCK' icon: 'REDSTONE_BLOCK'
durability: 0 durability: 0
text: '&cMute {player_name}' text: '&cMute {player_name} &410m'
permission: 'mute' permission: 'mute'
command: '/mute {player_name} {channel} 10' command: '/mute {channel} {player_name} 10m'
slot: 1 slot: 1
unmute: unmute:
icon: 'DIAMOND_BLOCK' icon: 'DIAMOND_BLOCK'
durability: 0 durability: 0
text: '&bUnmute {player_name}' text: '&bUnmute {player_name}'
permission: 'mute' permission: 'mute'
command: '/unmute {player_name} {channel}' command: '/unmute {channel} {player_name} '
slot: 2 slot: 2
removemessage: removemessage:
icon: 'DIAMOND_AXE' icon: 'DIAMOND_AXE'

View File

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

View File

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

View File

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

View File

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