Cleanup & Fixes for .NET 5 (#309)

- [X] Fixes several bugs
- [X] Updates more ordinal issues
- [X] Cleans up the code a bit
- [X] Turns classes static that should have been
- [X] Changes TcpServer.Instances to a HashSet

Bumps release version
This commit is contained in:
Kamron Batman 2020-11-15 10:03:50 -08:00 • committed by GitHub
parent 4ad8811df2
commit 525cda5413
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
266 changed files with 1348 additions and 1800 deletions

View file

@ -4,11 +4,11 @@ using Server.Network;
namespace Server.Misc
{
public class IPLimiter
public static class IPLimiter
{
public static IPAddress[] Exemptions =
public static readonly IPAddress[] Exemptions =
{
// IPAddress.Parse( "127.0.0.1" ),
IPAddress.Parse( "127.0.0.1" )
};
public static bool Enabled { get; private set; }
@ -31,15 +31,11 @@ namespace Server.Misc
return true;
}
var netStates = TcpServer.Instances;
var count = 0;
for (var i = 0; i < netStates.Count; ++i)
foreach (var ns in TcpServer.Instances)
{
var compState = netStates[i];
if (ourAddress.Equals(compState.Address))
if (ourAddress.Equals(ns.Address))
{
++count;