Fixed tabbing in Utils.HasBanExpired
This commit is contained in:
parent
3ec7cb1d09
commit
b0d9407f52
1 changed files with 15 additions and 16 deletions
|
|
@ -672,25 +672,24 @@ namespace TShockAPI
|
|||
/// <returns>bool - True if the ban has expired.</returns>
|
||||
public bool HasBanExpired(Ban ban, bool byName = false)
|
||||
{
|
||||
DateTime exp;
|
||||
bool expirationExists = DateTime.TryParse(ban.Expiration, out exp);
|
||||
DateTime exp;
|
||||
bool expirationExists = DateTime.TryParse(ban.Expiration, out exp);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(ban.Expiration) && (expirationExists) &&
|
||||
(DateTime.UtcNow >= exp))
|
||||
{
|
||||
if (byName)
|
||||
{
|
||||
TShock.Bans.RemoveBan(ban.Name, true, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
TShock.Bans.RemoveBan(ban.IP, false, false, false);
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(ban.Expiration) && (expirationExists) && (DateTime.UtcNow >= exp))
|
||||
{
|
||||
if (byName)
|
||||
{
|
||||
TShock.Bans.RemoveBan(ban.Name, true, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
TShock.Bans.RemoveBan(ban.IP, false, false, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue