PrettyDeltaTime() public static method

public static PrettyDeltaTime ( System.TimeSpan span, string rough = "" ) : string
span System.TimeSpan
rough string
return string
Ejemplo n.º 1
0
        public override string ToString()
        {
            var isSilent = SilentReason ? " silent " : "";

            if (Ip)
            {
                if (Perm)
                {
                    return($"Permanently ipbanned {Victim} with the{isSilent}reason {Reason}");
                }
                else
                {
                    return($"Ipbanned {Victim} for {Tools.PrettyDeltaTime(Duration)} with the{isSilent}reason {Reason}");
                }
            }
            else
            {
                if (Perm)
                {
                    return($"Permanently banned {Victim} with the{isSilent}reason {Reason}");
                }
                else
                {
                    return($"Banned {Victim} for {Tools.PrettyDeltaTime(Duration)} with the{isSilent}reason {Reason}");
                }
            }
        }
Ejemplo n.º 2
0
        public HasVictimBuilder IncreaseDuration(TimeSpan baseDuration, int count, string reason)
        {
            switch (count)
            {
            case 1:
                _baseHasVictim.Reason   = $"{Tools.PrettyDeltaTime(baseDuration)} for {reason}";
                _baseHasVictim.Duration = baseDuration;
                break;

            case 2:
                var duration = TimeSpan.FromSeconds(baseDuration.TotalSeconds * 2);
                _baseHasVictim.Reason =
                    $"{Tools.PrettyDeltaTime(duration)} for {reason}; your time has doubled. Future sanctions will not be explicitly justified.";;
                _baseHasVictim.Duration = duration;
                break;

            default:
                _baseHasVictim.Duration = TimeSpan.FromSeconds(baseDuration.TotalSeconds * Math.Pow(2, count - 1));
                break;
            }
            return(this);
        }
Ejemplo n.º 3
0
 public override string ToString()
 {
     return($"Muted {Victim} for {Tools.PrettyDeltaTime(Duration)}");
 }