Пример #1
0
 public Kick(SocketHandler.SocketConnection connection, User admin, string reason)
 {
     Kicked      = connection.User;
     Admin       = admin;
     Reason      = reason;
     IPAddresses = new List <string>()
     {
         connection.IPAddress
     };
 }
Пример #2
0
 public static Kick GetKick(SocketHandler.SocketConnection connection)
 {
     foreach (var kick in PriorKickedUsers)
     {
         if (kick.Match(connection))
         {
             return(kick);
         }
     }
     return(null);
 }
Пример #3
0
        public bool Match(SocketHandler.SocketConnection user)
        {
            if (!Program.Options.Perm_Block_Kicked_Users)
            {
                return(false);
            }

            if (user.User.AccountName == Kicked.AccountName)
            {
                if (!IPAddresses.Contains(user.IPAddress))
                {
                    IPAddresses.Add(user.IPAddress);
                }
                return(true);
            }
            foreach (var ip in IPAddresses)
            {
                if (ip == user.IPAddress || ip == user.IPEnd.Address.ToString())
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
 public AdminMessage(SocketHandler.SocketConnection connection, string content) : this(connection.User.AccountName, connection.Authentication, content)
 {
 }