Targets .NET Core 3.0 (#39)
This commit is contained in:
parent
0993c03b70
commit
08bf44af9a
125 changed files with 1473 additions and 14244 deletions
|
|
@ -22,14 +22,16 @@ namespace Server.Accounting
|
|||
PacketHandlers.RegisterThrottler(0xCF, Throttle_Callback);
|
||||
}
|
||||
|
||||
public static bool Throttle_Callback(NetState ns)
|
||||
public static TimeSpan Throttle_Callback(NetState ns)
|
||||
{
|
||||
InvalidAccountAccessLog accessLog = FindAccessLog(ns);
|
||||
|
||||
if (accessLog == null)
|
||||
return true;
|
||||
return TimeSpan.Zero;
|
||||
|
||||
return DateTime.UtcNow >= accessLog.LastAccessTime + ComputeThrottle(accessLog.Counts);
|
||||
DateTime date = DateTime.UtcNow;
|
||||
DateTime access = accessLog.LastAccessTime + ComputeThrottle(accessLog.Counts);
|
||||
return date >= access ? TimeSpan.Zero : date - access;
|
||||
}
|
||||
|
||||
public static InvalidAccountAccessLog FindAccessLog(NetState ns)
|
||||
|
|
@ -126,4 +128,4 @@ namespace Server.Accounting
|
|||
LastAccessTime = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue