Files
ClubPenguinServer/MareSynchronosServer/MareSynchronosServices/Authentication/FailedAuthorization.cs
rootdarkarchon f9e4fd4f2d minor refactoring
2022-08-22 14:24:47 +02:00

24 lines
546 B
C#

namespace MareSynchronosServices.Authentication;
public class FailedAuthorization : IDisposable
{
private int failedAttempts = 1;
public int FailedAttempts => failedAttempts;
public Task ResetTask { get; set; }
public CancellationTokenSource? ResetCts { get; set; }
public void Dispose()
{
try
{
ResetCts?.Cancel();
ResetCts?.Dispose();
}
catch { }
}
public void IncreaseFailedAttempts()
{
Interlocked.Increment(ref failedAttempts);
}
}