private void OnBanPlayerRequested(CSteamID instigator, CSteamID playerToBan, uint ipToBan, ref string reason, ref uint duration, ref bool shouldVanillaBan) { UnturnedPlayerBanningEvent @event = new UnturnedPlayerBanningEvent(instigator, playerToBan, ipToBan, reason, duration); Emit(@event); reason = @event.Reason; duration = @event.Duration; shouldVanillaBan = [email protected]; }
private void OnBanPlayerRequested(CSteamID instigator, CSteamID playerToBan, uint ipToBan, ref string reason, ref uint duration, ref bool shouldVanillaBan) // lgtm [cs/too-many-ref-parameters] { var @event = new UnturnedPlayerBanningEvent(instigator, playerToBan, ipToBan, reason, duration) { IsCancelled = !shouldVanillaBan }; Emit(@event); reason = @event.Reason; duration = @event.Duration; shouldVanillaBan = [email protected]; }
private void OnBanPlayerRequested(CSteamID instigator, CSteamID playerToBan, uint ipToBan, ref string reason, ref uint duration, ref bool shouldVanillaBan) // lgtm [cs/too-many-ref-parameters] { var player = GetUnturnedPlayer(PlayerTool.getPlayer(playerToBan)) !; var ipAddressToBan = IPAddress.Parse(ipToBan.ToString()); var @event = new UnturnedPlayerBanningEvent( player, instigator.ToString(), KnownActorTypes.Player, Equals(ipAddressToBan, IPAddress.Any) ? null : ipAddressToBan, reason, TimeSpan.FromSeconds(duration)) { IsCancelled = !shouldVanillaBan }; Emit(@event); reason = @event.Reason ?? ""; duration = (uint)@event.Duration.TotalSeconds; shouldVanillaBan = [email protected]; }