ModernUO/Projects/Server.Tests/Tests
Kamron Batman 4cd668ef61
feat: Moves TcpServer to another thread. Rewrites Firewall (#1660)
## Breaking Changes
* The Firewall and IP Limiter have been rewritten. Please read the notes carefully!
* `TcpServer.Instances` moved back to `NetState.Instances` - sorry - it was stupid to move it to begin with.

> [!Note]
> Sockets that fail the IP Limiter or Firewall will be immediately and forcibly disconnected.
> This means they will be stuck at "Verifying account..." if it was a real client.

### Summary
- Removes firewall wildcard support.
- Removes `AccessRestrictions`.
- Moves Firewall/IPLimiter to the core.
- Moves `TcpServer` to its own thread.
- Removes the `SocketConnect` and `SocketDisconnect` event sinks.
- Moves `Instances` back to `NetState.Instances`.
- Fixes a long standing bug with bad handling of duplicate listener addresses.

#### Firewall
The firewall has been completely rewritten. There is now an "Admin Firewall" which saves to the config file. Secondarily, there is an internal firewall used exclusively by the TcpServer while processing sockets. The Admin firewall mirrors it's additions/deletions to the internal firewall by adding requests to a queue.

> [!IMPORTANT]  
> **Wildcard firewall entries, such as `X`, `*`, `?` are not allowed.**
> **Ranges in between IP classes or sextets are not allowed.**
> **Please make sure to use one of the following:**
> * IP Address - `192.168.1.1`
> * CIDR - `192.168.1.0/24`
> * Range - `192.168.1.1-192.168.1.100`

#### IP Limiter
The IP Limiter has been completely rewritten. The available configurations are:
```json
"ipLimiter.enable": "True",
"ipLimiter.maxConnectionsPerIP": 10,
"ipLimiter.clearConnectionAttemptsDuration": "00:00:00:10",
"ipLimiter.clearThrottledDuration": "00:00:02:00",
```

The IP Limiter is set up to prevent spamming connections from the same IP. Every time an IP connects, it is added to a connection list. After 10 attempts, the IP is added to the throttle list. To keep the system fast, the connection list is entirely wiped every 10 seconds, and the throttle list is entirely wiped every 2 minutes.
2024-01-20 14:25:12 -08:00
..
Buffers fix: Fixes tests (#1603) 2023-11-19 10:11:04 -08:00
Client fix: Fixes TimeSpan rounding issues (#1610) 2023-11-22 18:03:56 -08:00
Collections fix: Use built-in RNG (#1599) 2023-11-17 17:45:18 -08:00
Geometry fix: Fixes Point3D.Parse (#1305) 2022-12-17 17:06:12 -08:00
Items fix: Updates container searches for non-generic types (#1567) 2023-11-23 09:29:45 -08:00
Localization fix: Fixes localization test (#1046) 2022-06-04 12:09:19 -07:00
Maps feat: Customize expansion and set maps on first boot (#1425) 2023-07-31 20:46:49 -07:00
Network feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
Serialization fix: Fixes JSON TypeConverter so that it can deserialize full name types (#1466) 2023-08-21 21:25:09 -07:00
Text chore: Code Cleanup (#1239) 2022-11-10 22:49:25 -08:00
Timer feat(timers): Adds timer pooling, fixes timer related bugs, and changes timer api (#667) 2021-08-07 14:33:35 -07:00
Utility feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
SerialTests.cs fix: Adds ISpanFormattable support to Serial (#1065) 2022-06-14 18:39:46 -07:00