diff --git a/Plugins/Mute/Commands/MuteCommand.cs b/Plugins/Mute/Commands/MuteCommand.cs index fc0c2821..bd13c473 100644 --- a/Plugins/Mute/Commands/MuteCommand.cs +++ b/Plugins/Mute/Commands/MuteCommand.cs @@ -34,6 +34,12 @@ public class MuteCommand : Command public override async Task ExecuteAsync(GameEvent gameEvent) { + if (gameEvent.Origin.ClientId == gameEvent.Target.ClientId) + { + gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_SELF_TARGET"]); + return; + } + if (await Plugin.MuteManager.Mute(gameEvent.Owner, gameEvent.Origin, gameEvent.Target, null, gameEvent.Data)) { gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_COMMANDS_MUTE_MUTED"] diff --git a/Plugins/Mute/Commands/TempMuteCommand.cs b/Plugins/Mute/Commands/TempMuteCommand.cs index 6914ad77..6e859d04 100644 --- a/Plugins/Mute/Commands/TempMuteCommand.cs +++ b/Plugins/Mute/Commands/TempMuteCommand.cs @@ -42,6 +42,12 @@ public class TempMuteCommand : Command public override async Task ExecuteAsync(GameEvent gameEvent) { + if (gameEvent.Origin.ClientId == gameEvent.Target.ClientId) + { + gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_SELF_TARGET"]); + return; + } + var match = Regex.Match(gameEvent.Data, TempBanRegex); if (match.Success) { diff --git a/Plugins/Mute/Commands/UnmuteCommand.cs b/Plugins/Mute/Commands/UnmuteCommand.cs index fd0aead2..89f8a291 100644 --- a/Plugins/Mute/Commands/UnmuteCommand.cs +++ b/Plugins/Mute/Commands/UnmuteCommand.cs @@ -34,6 +34,12 @@ public class UnmuteCommand : Command public override async Task ExecuteAsync(GameEvent gameEvent) { + if (gameEvent.Origin.ClientId == gameEvent.Target.ClientId) + { + gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_SELF_TARGET"]); + return; + } + if (await Plugin.MuteManager.Unmute(gameEvent.Owner, gameEvent.Origin, gameEvent.Target, gameEvent.Data)) { gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_COMMANDS_UNMUTE_UNMUTED"] diff --git a/Plugins/Mute/MuteManager.cs b/Plugins/Mute/MuteManager.cs index b3ce355a..0eefa61f 100644 --- a/Plugins/Mute/MuteManager.cs +++ b/Plugins/Mute/MuteManager.cs @@ -98,7 +98,7 @@ public class MuteManager if (clientMuteMeta.MuteState is MuteState.Unmuted && clientMuteMeta.CommandExecuted) return false; if (!target.IsIngame && clientMuteMeta.MuteState is MuteState.Unmuting) return false; - if (clientMuteMeta.MuteState is not MuteState.Unmuting) + if (clientMuteMeta.MuteState is not MuteState.Unmuting || origin.ClientId != 1) { await CreatePenalty(MuteState.Unmuted, origin, target, DateTime.UtcNow, reason); }