Class ClientScopeBase<TKey>
Holds clients and baggage.
Inheritance
Inherited Members
Namespace: Microsoft.XboxStudios.ClientManager
Assembly: ClientManager.dll
Syntax
public abstract class ClientScopeBase<TKey> : ICanConnect<TKey>, IEnumerable<TKey>, IEnumerable, IHoldsBaggage<TKey> where TKey : notnull
Type Parameters
Name | Description |
---|---|
TKey | The type of key to use. |
Methods
View SourceConnectAsync(IEnumerable<TKey>, CancellationOptions?)
Connects clients to a game instance.
Declaration
public ValueTask ConnectAsync(IEnumerable<TKey> keys, CancellationOptions? co = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TKey> | keys | The keys to use to fetch clients and attempt connections. |
CancellationOptions? | co | The Microsoft.XboxStudios.Bifrost.CancellationOptions. |
Returns
Type | Description |
---|---|
ValueTask | A Task that represents the asynchronous operation. |
ConnectAsync(TKey, CancellationOptions?)
Connects a client to a game instance.
Declaration
public abstract ValueTask<bool> ConnectAsync(TKey key, CancellationOptions? co = null)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The TKey to use to fetch a client and attempt a connection. |
CancellationOptions? | co | The Microsoft.XboxStudios.Bifrost.CancellationOptions. |
Returns
Type | Description |
---|---|
ValueTask<bool> | A value indicating whether connection was successful or not. |
GetAllBaggage<TBaggage>()
Gets the baggage of a specified type from all active clients.
Declaration
public virtual IEnumerable<KeyValuePair<TKey, TBaggage>> GetAllBaggage<TBaggage>()
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<TKey, TBaggage>> | An enumeration of keys and associated baggage. |
Type Parameters
Name | Description |
---|---|
TBaggage | The type of the baggage. |
Exceptions
Type | Condition |
---|---|
BaggageNullException | Thrown if the registered baggage factory returned null. |
MissingBaggageFactoryException | Thrown if the baggage factory of the requested baggage is not registered. |
GetBaggage<TBaggage>(TKey)
Gets the baggage associated with a key.
Declaration
public abstract TBaggage GetBaggage<TBaggage>(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The TKey to use to fetch a baggage. |
Returns
Type | Description |
---|---|
TBaggage | The baggage or null if no connection exists. |
Type Parameters
Name | Description |
---|---|
TBaggage | The type of the baggage. |
Exceptions
Type | Condition |
---|---|
BaggageNullException | Thrown if the registered baggage factory returned null. |
MissingBaggageFactoryException | Thrown if the baggage factory of the requested baggage is not registered. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public abstract IEnumerator<TKey> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<TKey> | An enumerator that can be used to iterate through the collection. |