ModernUO/Projects/UOContent/Gumps
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
..
Go fix(cleanup): Consolidate the duplicate code in Properties, PropsGump, and PropsConfig (#540) 2021-04-14 22:58:56 -07:00
Guilds fix: Cleans up create guild gump (#1326) 2023-01-31 23:51:01 -08:00
Props fix: Fixes various mobile packets and setting serials (#1618) 2023-11-26 00:42:15 -08:00
AddDoorGump.cs C# 9 Cleanup (#325) 2020-11-27 00:29:21 -08:00
AdminGump.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
BanDurationGump.cs fix: Update LabelTo, SendMessage, etc to Interpolated Strings (#1283) 2022-11-28 19:58:12 -08:00
BaseConfirmGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
BaseGridGump.cs feat: Adds [Spawn command & Gump Grids (#917) 2022-06-30 22:22:51 -07:00
BaseImageTileButtonsGump.cs feat: Adds TextDefinition serialization support. (#1217) 2022-10-30 01:42:48 -07:00
ClientGump.cs feat: Adds KR/EC client versions (No actual support yet). (#1506) 2023-09-18 23:53:18 -07:00
CommentsGump.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
ConfirmBreakCrystalGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
ConfirmHeritageGump.cs Fixes dupe exception (#258) 2020-09-19 15:46:07 -07:00
ConfirmHouseResize.cs cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
ConfirmReleaseGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
HeritageTokenGump.cs fix(core): Removes some uses of Linq (#421) 2021-01-18 21:05:11 -08:00
HonorSelf.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
HouseDemolishGump.cs fix: Fixes bank checks falling to the floor. (#972) 2022-03-26 21:06:46 -07:00
HouseGump.cs fix(core): Optimizes strings / .NET 5 compatibility changes (#354) 2020-12-20 23:21:55 -08:00
HouseGumpAOS.cs fix(core): Caches DateTime.NowUtc (#548) 2021-03-13 01:32:04 -08:00
HouseTransferGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
NoticeGump.cs fix: Adds more null checks for text definition to prevent NPEs (#936) 2022-02-18 11:13:38 -08:00
PetResurrectGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
PlayerVendorGumps.cs fix: Fixes PlayerVendor customizations not working due to constructor issues (#1451) 2023-08-10 19:24:45 -07:00
PolymorphGump.cs C# 9 Cleanup (#325) 2020-11-27 00:29:21 -08:00
ReclaimVendorGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
ResurrectGump.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
RewardGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
RunebookGump.cs fix: Fixes badly formatted files (#878) 2021-12-05 08:56:09 -08:00
SetSecureLevelGump.cs Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
SkillsGump.cs fix(cleanup): Consolidate the duplicate code in Properties, PropsGump, and PropsConfig (#540) 2021-04-14 22:58:56 -07:00
TithingGump.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
ToTAdminGump.cs Cleanup & Fixes for .NET 5 (#309) 2020-11-15 10:03:50 -08:00
VendorInventoryGump.cs cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
VendorRentalGumps.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
ViewHousesGump.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
WarningGump.cs fix: Adds required changes for Advanced Search feature (#1650) 2023-12-28 18:16:58 -08:00
WhoGump.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
YoungGumps.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00