Class InMemoryBanList
- Namespace
- Unity.Multiplayer.Core
A thread-safe in-memory IBanList; tokens compare ordinally.
public sealed class InMemoryBanList : IBanList
- Inheritance
-
InMemoryBanList
- Implements
- Inherited Members
Constructors
InMemoryBanList()
An empty list.
public InMemoryBanList()
InMemoryBanList(IEnumerable<string>)
A list holding the given tokens.
public InMemoryBanList(IEnumerable<string> playerTokens)
Parameters
playerTokensIEnumerable<string>
Exceptions
- ArgumentNullException
playerTokensis null.
Properties
Count
The number of banned tokens.
public int Count { get; }
Property Value
Methods
Ban(string)
Bans a token; true if it was not already banned. Null or empty tokens are ignored.
public bool Ban(string playerToken)
Parameters
playerTokenstring
Returns
IsBanned(string)
True when the player holding playerToken may not join.
public bool IsBanned(string playerToken)
Parameters
playerTokenstring
Returns
Unban(string)
Lifts a ban; true if the token was banned.
public bool Unban(string playerToken)
Parameters
playerTokenstring