ModernUO/Projects/UOContent/Engines
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
..
Advanced Search feat: Adds AdvancedSearch (XmlFind) (#1649) 2023-12-28 18:55:47 -08:00
Bulk Orders fix: Fixes serialization and dirty tracking conveniences (#1627) 2023-12-03 15:55:31 -08:00
CannedEvil fix: Fixes serialization and dirty tracking conveniences (#1627) 2023-12-03 15:55:31 -08:00
Chat fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
ConPVP fix: Fixes serialization and dirty tracking conveniences (#1627) 2023-12-03 15:55:31 -08:00
Craft fix: Refactors getting static tiles to use enumerators (#1611) 2023-11-26 09:39:46 -08:00
Doom fix: Fixes serialization and dirty tracking conveniences (#1627) 2023-12-03 15:55:31 -08:00
Ethics fix: Changes Map.Sector.Items to link list. (#1547) 2023-10-16 20:51:02 -07:00
Events fix(core): Caches DateTime.NowUtc (#548) 2021-03-13 01:32:04 -08:00
Factions fix: Removes GetObjectsInRange and fixes boat planks closing (#1579) 2023-11-03 13:45:18 -07:00
Harvest fix: Use built-in RNG (#1599) 2023-11-17 17:45:18 -08:00
Help feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
Khaldun fix: Fixes map iterators for Items (#1564) 2023-10-26 17:49:15 -07:00
ML Quests fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
Party fix: Fixes sending packets and sidesteps a major issue with stackalloc and PGO in .NET 8 (#1607) 2023-11-21 12:18:20 -08:00
Pathing fix: Refactors getting static tiles to use enumerators (#1611) 2023-11-26 09:39:46 -08:00
Plants fix: Cleans up FindItems and removes allocations (#1516) 2023-09-28 22:20:36 -07:00
Player Murder System fix: Fixes extension method refactors causing crash (#1529) 2023-10-02 22:24:16 -07:00
Quests fix: Fixes sending packets and sidesteps a major issue with stackalloc and PGO in .NET 8 (#1607) 2023-11-21 12:18:20 -08:00
Spawners fix: Refactors getting static tiles to use enumerators (#1611) 2023-11-26 09:39:46 -08:00
Stealables fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528) 2023-10-01 22:10:47 -07:00
Treasures of Tokuno fix: Codegens ToT and replaces persistence with config (#1524) 2023-09-30 02:09:28 -07:00
UltimaStore fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
Veteran Rewards fix: Adds GetClients to map iterators (#1574) 2023-10-30 18:49:00 -07:00
Virtues fix: Fixes extension method refactors causing crash (#1529) 2023-10-02 22:24:16 -07:00