Throttle people trying to connect to a full server. (#20972)
* Throttle people trying to connect to a full server. To reduce spam/load on the server and connection logs table. Players are forced to wait 30 seconds after getting denied for "server full", before they can try connecting again. This code is an absolute nightmare mess. I tried to re-use the existing code for the redial timer but god everything here sucks so much. Requires https://github.com/space-wizards/RobustToolbox/pull/4487 * Use new NetDisconnectMessage API instead. * Add admin.bypass_max_players CVar. Just something to help with debugging the player cap on dev, I don't expect this to ever be disabled on real servers.
This commit is contained in:
committed by
GitHub
parent
3cb1c585c5
commit
0ecc5e8c96
@@ -260,6 +260,13 @@ namespace Content.Shared.CCVar
|
||||
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>
|
||||
@@ -852,6 +859,13 @@ namespace Content.Shared.CCVar
|
||||
public static readonly CVarDef<float> AdminAfkTime =
|
||||
CVarDef.Create("admin.afk_time", 600f, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// If true, admins are able to connect even if
|
||||
/// <see cref="SoftMaxPlayers"/> would otherwise block regular players.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> AdminBypassMaxPlayers =
|
||||
CVarDef.Create("admin.bypass_max_players", true, CVar.SERVERONLY);
|
||||
|
||||
/*
|
||||
* Explosions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user