diff --git a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs index 585e244773..86d15bf8d8 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs @@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Player using System.Reflection; using API.Features; + using CommandSystem; /// /// Contains all information before banning a player from the server. @@ -23,12 +24,13 @@ public class BanningEventArgs : KickingEventArgs /// /// The ban target. /// The ban issuer. + /// The ban command sender. /// The ban seconds duration. /// The ban reason. /// The ban full message. /// Indicates whether the event can be executed or not. - public BanningEventArgs(Player target, Player issuer, long duration, string reason, string fullMessage, bool isAllowed = true) - : base(target, issuer, reason, fullMessage, isAllowed) + public BanningEventArgs(Player target, Player issuer, ICommandSender commandSender, long duration, string reason, string fullMessage, bool isAllowed = true) + : base(target, issuer, commandSender, reason, fullMessage, isAllowed) { Duration = duration; } diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs index 036b2aa4c2..cfa2864b85 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs @@ -10,7 +10,7 @@ namespace Exiled.Events.EventArgs.Player using System.Reflection; using API.Features; - + using CommandSystem; using Interfaces; /// @@ -32,6 +32,9 @@ public class KickingEventArgs : IPlayerEvent, IDeniableEvent /// /// /// + /// + /// + /// /// /// /// @@ -41,10 +44,11 @@ public class KickingEventArgs : IPlayerEvent, IDeniableEvent /// /// /// - public KickingEventArgs(Player target, Player issuer, string reason, string fullMessage, bool isAllowed = true) + public KickingEventArgs(Player target, Player issuer, ICommandSender commandSender, string reason, string fullMessage, bool isAllowed = true) { Target = target; Player = issuer ?? Server.Host; + CommandSender = commandSender; Reason = reason; startkickmessage = fullMessage; IsAllowed = isAllowed; @@ -114,6 +118,11 @@ public Player Player } } + /// + /// Gets the command sender. + /// + public ICommandSender CommandSender { get; } + /// /// Logs the kick, anti-backdoor protection from malicious plugins. /// diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs b/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs index 271d22ffe5..573c2bd820 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs @@ -46,16 +46,24 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable