public static BanEntry AddBan(TimeSpan? lastsFor, string mask, string reason) { Lock.EnterWriteLock(); try { var ban = new BanEntry ( DateTime.Now, lastsFor != null ? DateTime.Now + lastsFor : null, mask, reason ); AuthDBMgr.DatabaseProvider.Save(ban); m_bans.Add(ban); return ban; } finally { Lock.ExitWriteLock(); } }
public static BanEntry AddBan(DateTime? until, string mask, string reason) { Lock.EnterWriteLock(); try { var ban = new BanEntry( DateTime.Now, until, mask, reason ); AuthDBMgr.DatabaseProvider.Save(ban); m_bans.Add(ban); return ban; } finally { Lock.ExitWriteLock(); } }