ModernUO/Projects/UOContent/Misc
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
..
Gifts/Winter2004 fix: Cleans up FindItems and removes allocations (#1516) 2023-09-28 22:20:36 -07:00
AccountPrompt.cs fix: Fixes structured logging (#1043) 2022-06-05 01:00:22 -07:00
AdminFirewall.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
Animations.cs Removes literal variables (#257) 2020-09-18 18:41:26 -07:00
AOS.cs feat: Adds ability groups, DOT abilities, and combat abilities (#1264) 2022-11-23 12:33:27 -08:00
AttackMessage.cs fix: Fixes crafter deserialize, cleans up bandages, and codegens misc items (#1350) 2023-02-25 00:54:12 -08:00
AutoRestart.cs feat: Adds auto archiving (#794) 2021-09-25 17:22:05 -07:00
Broadcasts.cs Fixes exiting/crash handling/ctrl+c (#237) 2020-09-12 00:05:38 -07:00
BuffIcons.cs fix: Fixes TimeSpan rounding issues (#1610) 2023-11-22 18:03:56 -08:00
CharacterCreation.cs fix: Fix compiling (#1617) 2023-11-25 23:41:09 -08:00
Cleanup.cs fix: Fixes structured logging (#1043) 2022-06-05 01:00:22 -07:00
ClientVerification.cs fix: Fixes TimeSpan rounding issues (#1610) 2023-11-22 18:03:56 -08:00
CrashGuard.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
DispellableAttribute.cs Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
DispellableFieldAttribute.cs Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
DoorGenerator.cs fix: Refactors getting static tiles to use enumerators (#1611) 2023-11-26 09:39:46 -08:00
Email.cs fix(core): Caches DateTime.NowUtc (#548) 2021-03-13 01:32:04 -08:00
Emitter.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
FoodDecay.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
Geometry.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
Guild.cs fix: Overhauls champion titles & codegen champion system (#1430) 2023-07-27 21:44:06 -07:00
HardwareInfo.cs fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
InhumanSpeech.cs feat: Customize expansion and set maps on first boot (#1425) 2023-07-31 20:46:49 -07:00
Keywords.cs fix: Overhauls murder system (#1419) 2023-07-15 22:42:49 -07:00
LanguageStatistics.cs fix: Fixes provocation for pre-pub 16 (#1335) 2023-02-07 23:33:45 -08:00
LightCycle.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
LoginStats.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
Loot.cs Cleanup & Fixes for .NET 5 (#309) 2020-11-15 10:03:50 -08:00
LootPack.cs fix: Cleans up string substring (#1018) 2022-05-14 16:56:03 -07:00
MessageHelper.cs fix: Codegens rares and solen items (#1371) 2023-03-11 19:25:48 -08:00
MondainsLegacy.cs Fixes dupe exception (#258) 2020-09-19 15:46:07 -07:00
NameList.cs fix: Cleans up murder system (#1428) 2023-07-16 00:04:30 -07:00
NameVerification.cs fix(core): Optimizes strings / .NET 5 compatibility changes (#354) 2020-12-20 23:21:55 -08:00
Notoriety.cs fix: Fixes young healing each other (#1345) 2023-02-21 18:15:57 -08:00
PacketThrottles.cs fix: Fixes speech throttle (#1387) 2023-04-05 09:21:44 -07:00
Paperdoll.cs fix(core): Converts remaining player packets (#374) 2020-12-30 16:09:51 -08:00
Poison.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
ProfanityProtection.cs fix(core): Tightens the network stack (#479) 2021-02-07 23:30:56 -08:00
ProfessionInfo.cs fix: Fixes missing ordinal string comparisons arguments. (#1431) 2023-07-23 20:12:38 -07:00
Profile.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
RaceDefinitions.cs fix: Updates races to properly support gargoyle equipment. (#744) 2021-08-29 00:43:55 -07:00
RegenRates.cs fix: Fixes poison field duration, cleans up skill calculations and poison calculations (#1582) 2023-11-04 12:32:54 -07:00
RenameRequests.cs fix(core): Optimizes strings / .NET 5 compatibility changes (#354) 2020-12-20 23:21:55 -08:00
ResourceInfo.cs fix: Codegens BOD rewards. (#1361) 2023-03-06 19:01:14 -08:00
SerializationExt.cs fix: Fix the namespace for serialization ext (#1566) 2023-10-25 20:34:11 -07:00
ServerAccess.cs fix: Reverts GetAccount to use IAccount. Adds IAccount to serialization. (#1565) 2023-10-25 19:17:57 -07:00
ServerList.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
ShardPoller.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
ShrinkTable.cs fix: Fixes provocation for pre-pub 16 (#1335) 2023-02-07 23:33:45 -08:00
StaminaSystem.cs fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528) 2023-10-01 22:10:47 -07:00
Titles.cs fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528) 2023-10-01 22:10:47 -07:00
ToggleItem.cs Removes literal variables (#257) 2020-09-18 18:41:26 -07:00
TreasureMapProtection.cs cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
ValidationQueue.cs Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
Weather.cs feat: Moves TcpServer to another thread. Rewrites Firewall (#1660) 2024-01-20 14:25:12 -08:00
WelcomeTimer.cs Removes UOAM vendors. (#241) 2020-09-12 11:56:52 -07:00