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

playerTokens IEnumerable<string>

Exceptions

ArgumentNullException

playerTokens is null.

Properties

Count

The number of banned tokens.

public int Count { get; }

Property Value

int

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

playerToken string

Returns

bool

IsBanned(string)

True when the player holding playerToken may not join.

public bool IsBanned(string playerToken)

Parameters

playerToken string

Returns

bool

Unban(string)

Lifts a ban; true if the token was banned.

public bool Unban(string playerToken)

Parameters

playerToken string

Returns

bool