Beispiel #1
0
        /// <summary>
        ///     Discern whether a user has exceeded command-querying limit
        /// </summary>
        /// <returns>true: user timeout</returns>
        public bool GetTimeout()
        {
            bool doTimeout = false;

            if (Attempts.Equals(4))
            {
                if (Seen.AddMinutes(1) < DateTime.UtcNow)
                {
                    Attempts = 0; // if so, reset their attempts to 0
                }
                else
                {
                    doTimeout = true; // if not, timeout is true
                }
            }
            else if (Access > 1)
            // if user isn't admin/op, increment their attempts
            {
                Attempts++;
            }

            return(doTimeout);
        }