Skip to content

Commit

Permalink
Alert shared connections (#29405)
Browse files Browse the repository at this point in the history
* add admin alert for active shared connections

* update wizden config

* review
  • Loading branch information
Chief-Engineer authored and sleepyyapril committed Dec 22, 2024
1 parent ecc7c6b commit d791123
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public void Initialize()
_netMgr.Disconnect += OnDisconnected; // DeltaV - Soft whitelist improvements
_netMgr.AssignUserIdCallback = AssignUserIdCallback;
_plyMgr.PlayerStatusChanged += PlayerStatusChanged;
_plyMgr.PlayerStatusChanged += PlayerStatusChanged;
// Approval-based IP bans disabled because they don't play well with Happy Eyeballs.
// _netMgr.HandleApprovalCallback = HandleApproval;
}
Expand Down
16 changes: 16 additions & 0 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ public static readonly CVarDef<bool>
public static readonly CVarDef<int> SoftMaxPlayers =
CVarDef.Create("game.soft_max_players", 30, CVar.SERVERONLY | CVar.ARCHIVE);

/// <summary>
/// If a player gets denied connection to the server,
/// how long they are forced to wait before attempting to reconnect.
/// </summary>
public static readonly CVarDef<int> GameServerFullReconnectDelay =
CVarDef.Create("game.server_full_reconnect_delay", 30, CVar.SERVERONLY);

/// <summary>
/// Whether or not panic bunker is currently enabled.
/// </summary>
Expand Down Expand Up @@ -960,6 +967,15 @@ public static readonly CVarDef<bool>
public static readonly CVarDef<bool> ServerBanErasePlayer =
CVarDef.Create("admin.server_ban_erase_player", false, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);

/// <summary>
/// Minimum players sharing a connection required to create an alert. -1 to disable the alert.
/// </summary>
/// <remarks>
/// If you set this to 0 or 1 then it will alert on every connection, so probably don't do that.
/// </remarks>
public static readonly CVarDef<int> AdminAlertMinPlayersSharingConnection =
CVarDef.Create("admin.alert.min_players_sharing_connection", -1, CVar.SERVERONLY);

/// <summary>
/// Minimum explosion intensity to create an admin alert message. -1 to disable the alert.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/administration/admin-alerts.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
admin-alert-shared-connection = {$player} is sharing a connection with {$otherCount} connected player(s): {$otherList}

0 comments on commit d791123

Please sign in to comment.