Exemple #1
0
        internal void InvokePlayerBanEvent(Player bannedPlayer, Player issuer, ref long duration, ref string reason,
                                           ref bool allow)
        {
            var ev = new PlayerBanEventArgs {
                Allow = allow, BanDuration = duration, Issuer = issuer, Reason = reason, BannedPlayer = bannedPlayer
            };

            PlayerBanEvent?.Invoke(ev);

            duration = ev.BanDuration;
            reason   = ev.Reason;
            allow    = ev.Allow;
        }
Exemple #2
0
        internal static void InvokePlayerBanEvent(Player player, int duration, ref bool allow,
                                                  string reason, Player issuer)
        {
            if (PlayerBanEvent == null)
            {
                return;
            }

            var ev = new PlayerBanEvent
            {
                Issuer       = issuer,
                Duration     = duration,
                Reason       = reason,
                BannedPlayer = player
            };

            PlayerBanEvent.Invoke(ev);

            allow = ev.Allowed;
        }