Updated Utils.HasBanExpired to use new Ban fields
This commit is contained in:
parent
3989f0e21a
commit
26a5b00567
1 changed files with 1 additions and 4 deletions
|
|
@ -672,10 +672,7 @@ 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);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(ban.Expiration) && (expirationExists) && (DateTime.UtcNow >= exp))
|
||||
if (!string.IsNullOrWhiteSpace(ban.Expiration) && (ban.ExpirationDateTime != null) && (DateTime.UtcNow >= ban.ExpirationDateTime))
|
||||
{
|
||||
if (byName)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue