Automated whitelists (#23985)
* Beginnings of making the breadmemes jobs easier * stuff * stuff pt. 2 * Stuff pt.3 * Stuff I forgot last time * Basic whitelist Only people that are added to the whitelist with the addwhitelist command will be able to join. I call this the "legacy" whitelist * Remove always deny condition in favor of just breaking if playtime check fails * Change default whitelist Default whitelist is now the "legacy" whitelist. * localization * Admin check * minor spelling change * Fix build * Whitelist message * Fix vars not being datafield and spelling mistakes * Minor spelling mistake * Change config for salamander * Reviews and stuff * Add summaries * Fix whitelists * Forgot to add a datafield * Fixing stuff I guess * Reuse admin remarks to reduce load when connecting. * Update log messages to be verbose instead of debug * Reviews * whoops * Explain a bit more how whitelist checking works * Apply CE's review * Append Membership to Blacklist and Whitelist conditions * Fix review comments * Uncapitalize playerConnectionWhitelist, add to ignored client prototypes * Make note count field work * Fix cvar for thingy --------- Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
41
Content.Server/Connection/Whitelist/WhitelistCondition.cs
Normal file
41
Content.Server/Connection/Whitelist/WhitelistCondition.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Server.Connection.Whitelist;
|
||||
|
||||
/// <summary>
|
||||
/// This class is used to determine if a player should be allowed to join the server.
|
||||
/// It is used in <see cref="PlayerConnectionWhitelistPrototype"/>
|
||||
/// </summary>
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
[MeansImplicitUse]
|
||||
public abstract partial class WhitelistCondition
|
||||
{
|
||||
/// <summary>
|
||||
/// What action should be taken if this condition is met?
|
||||
/// Defaults to <see cref="ConditionAction.Next"/>.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ConditionAction Action { get; set; } = ConditionAction.Next;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines what action should be taken if a condition is met.
|
||||
/// </summary>
|
||||
public enum ConditionAction
|
||||
{
|
||||
/// <summary>
|
||||
/// The player is allowed to join, and the next conditions will be skipped.
|
||||
/// </summary>
|
||||
Allow,
|
||||
/// <summary>
|
||||
/// The player is denied to join, and the next conditions will be skipped.
|
||||
/// </summary>
|
||||
Deny,
|
||||
/// <summary>
|
||||
/// The next condition should be checked.
|
||||
/// </summary>
|
||||
Next
|
||||
}
|
||||
Reference in New Issue
Block a user