Delta-v/Content.Server/Administration
Julian Giebel 0ba5b81a6a Kick on ban for entire server group (#28649)
* Start work on PostgresNotificationManager
Implement initial version of init and listening code

* Finish implementing PostgresNotificationManager
Implement ban insert trigger

* Implement ignoring notifications if the ban was from the same server

* Address reviews

* Fixes and refactorings

Fix typo in migration SQL

Pull new code in BanManager out into its own partial file.

Unify logic to kick somebody with that when a new ban is placed directly on the server.

New bans are now checked against all parameters (IP, HWID) instead of just user ID.

Extracted SQLite ban matching code into a new class so that it can mostly be re-used by the ban notification code. No copy-paste here.

Database notifications are now not implicitly sent to the main thread, this means basic checks will happen in the thread pool beforehand.

Bans without user ID are now sent to servers. Bans are rate limited to avoid undue work from mass ban imports, beyond the rate limit they are dropped.

Improved error handling and logging for the whole system.

Matching bans against connected players requires knowing their ban exemption flags. These are now cached when the player connects.

ServerBanDef now has exemption flags, again to allow matching full ban details for ban notifications.

Made database notifications a proper struct type to reduce copy pasting a tuple.

Remove copy pasted connection string building code by just... passing the string into the constructor.

Add lock around _notificationHandlers just in case.

Fixed postgres connection wait not being called in a loop and therefore spamming LISTEN commands for every received notification.

Added more error handling and logging to notification listener.

Removed some copy pasting from SQLite database layer too while I was at it because god forbid we expect anybody else to do all the work in this project.

Sorry Julian

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-08-21 16:16:41 +01:00
..
BanList Adds a Pii Flag, Censors Hwid and Ip (#27776) 2024-06-01 18:00:39 +02:00
Commands fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362) 2024-08-11 15:19:51 +01:00
Components Content update for UI prediction (#27214) 2024-05-03 00:15:32 +02:00
Logs Fix admin logs cache caching rounds forever if multiple game servers are ran on the same db (#30687) 2024-08-09 18:55:43 +01:00
Managers Kick on ban for entire server group (#28649) 2024-08-21 16:16:41 +01:00
Notes Improve admin message seen/dismiss state. (#26223) 2024-03-24 00:08:01 +01:00
Systems upstream merge (#1636) 2024-08-18 17:21:07 +00:00
Toolshed Cleans up tag system (#28272) 2024-06-06 21:33:38 +02:00
UI Resolve `'EntitySystem.Get<T>()' is obsolete` in content (#27936) 2024-05-18 13:58:55 +02:00
AdminCommandAttribute.cs Toolshed (#17895) 2023-08-02 16:09:08 -05:00
AdminPermsChangedEventArgs.cs Un-revert IPlayerManager refactor (#21244) 2023-10-31 19:00:44 +01:00
AdminRank.cs Remove redundant #nullable enable (#4275) 2021-07-16 17:37:09 -07:00
BanPanelEui.cs Fix bad sawmill IPostInjectInit (#23626) 2024-01-26 22:03:20 +01:00
ContentNetworkResourceManager.cs Un-revert IPlayerManager refactor (#21244) 2023-10-31 19:00:44 +01:00
PlayerLocator.cs Random spontaneous cleanup PR (#25131) 2024-02-18 23:02:29 +01:00
PlayerPanelEui.cs Implement a playerpanel (#30238) 2024-08-09 19:04:58 +01:00
QuickDialogSystem.OpenDialog.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-27 23:44:02 +01:00
QuickDialogSystem.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-27 23:44:02 +01:00
ServerApi.Utility.cs Game server admin API (#26880) 2024-04-21 21:58:13 +02:00
ServerApi.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00