Edit

Share via


MultiplayerService.GetSessionsAsync Method

Definition

Overloads

GetSessionsAsync(MultiplayerGetSessionsRequest)

Retrieve a list of sessions with various filters. You can use this method to filter sessions for a single Xbox User ID, a collection of Xbox User IDs, or for a keyword.

GetSessionsAsync(String, String, String, String, MultiplayerSessionVisibility, UInt32, Boolean, Boolean, Boolean, UInt32)

Retrieve a list of sessions with various filters

GetSessionsAsync(MultiplayerGetSessionsRequest)

Retrieve a list of sessions with various filters. You can use this method to filter sessions for a single Xbox User ID, a collection of Xbox User IDs, or for a keyword.

[Windows.Foundation.Metadata.Overload("GetSessionsAsync2")]
public Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>> GetSessionsAsync (Microsoft.Xbox.Services.Multiplayer.MultiplayerGetSessionsRequest getSessionsRequest);
abstract member GetSessionsAsync : Microsoft.Xbox.Services.Multiplayer.MultiplayerGetSessionsRequest -> Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>>
override this.GetSessionsAsync : Microsoft.Xbox.Services.Multiplayer.MultiplayerGetSessionsRequest -> Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>>
Public Function GetSessionsAsync (getSessionsRequest As MultiplayerGetSessionsRequest) As IAsyncOperation(Of IVectorView(Of MultiplayerSessionStates))

Parameters

getSessionsRequest
MultiplayerGetSessionsRequest

An object that defines the search filters for retrieveing a collection of discoverable sessions.

Returns

Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<MultiplayerSessionStates>>

Returns an IAsyncOperation<TResult> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperation<TResult>.Completed property. When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperation<TResult>.GetResults method.

The result is a collection of SessionStates objects where each object contains metadata about one session.

Implements

Microsoft.Xbox.Services.Multiplayer.__IMultiplayerServicePublicNonVirtuals.GetSessionsAsync(Microsoft.Xbox.Services.Multiplayer.MultiplayerGetSessionsRequest)
Attributes
Windows.Foundation.Metadata.OverloadAttribute

Remarks

You can use this method to filter sessions for a collection of Xbox User IDs.

Calls V102 GET /serviceconfigs/{scid}/sessions or /serviceconfigs/{scid}/sessiontemplates/{session-template-name}/sessions

Applies to

GetSessionsAsync(String, String, String, String, MultiplayerSessionVisibility, UInt32, Boolean, Boolean, Boolean, UInt32)

Retrieve a list of sessions with various filters

[Windows.Foundation.Metadata.Deprecated("Call GetSessionsAsync(MultiplayerGetSessionsRequest^) instead", Windows.Foundation.Metadata.DeprecationType.Deprecate, 0)]
[Windows.Foundation.Metadata.Overload("GetSessionsAsync1")]
public Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>> GetSessionsAsync (string serviceConfigurationId, string sessionTemplateNameFilter, string xboxUserIdFilter, string keywordFilter, Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionVisibility visibilityFilter, uint contractVersionFilter, bool includePrivateSessions, bool includeReservations, bool includeInactiveSessions, uint maxItems);
abstract member GetSessionsAsync : string * string * string * string * Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionVisibility * uint32 * bool * bool * bool * uint32 -> Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>>
override this.GetSessionsAsync : string * string * string * string * Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionVisibility * uint32 * bool * bool * bool * uint32 -> Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionStates>>
Public Function GetSessionsAsync (serviceConfigurationId As String, sessionTemplateNameFilter As String, xboxUserIdFilter As String, keywordFilter As String, visibilityFilter As MultiplayerSessionVisibility, contractVersionFilter As UInteger, includePrivateSessions As Boolean, includeReservations As Boolean, includeInactiveSessions As Boolean, maxItems As UInteger) As IAsyncOperation(Of IVectorView(Of MultiplayerSessionStates))

Parameters

serviceConfigurationId
String

The service configuration id that contains the sessions.

sessionTemplateNameFilter
String

(Optional) The name of the template for the multiplayer session to filter on.

xboxUserIdFilter
String

(Optional) An Xbox user ID to use for filtering results to sessions for that user. You must specify either xboxUserIdFilter or keywordFilter.

keywordFilter
String

(Optional) A keyword to use for filtering results to sessions with that keyword. You must specify either xboxUserIdFilter or keywordFilter.

visibilityFilter
MultiplayerSessionVisibility

An enumeration value specifying the visibilty to use for filtering results.

contractVersionFilter
UInt32

A value specifying the major version, or less, of the contract to use for filtering results. Set to 0 to ignore the contract version.

includePrivateSessions
Boolean

True to include private sessions in the results, and false otherwise.

includeReservations
Boolean

True to include sessions that the user has not accepted in the results, and false otherwise. For a setting of true, xboxUserIdFilter must be specified.

includeInactiveSessions
Boolean

True to include inactive sessions in the results, and false otherwise. For a setting of true, xboxUserIdFilter must be specified.

maxItems
UInt32

The maximum number of sessions to return.

Returns

Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<MultiplayerSessionStates>>

Returns an IAsyncOperation<TResult> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperation<TResult>.Completed property. When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperation<TResult>.GetResults method.

The result is a collection of SessionStates objects where each object contains metadata about one session.

Implements

Microsoft.Xbox.Services.Multiplayer.__IMultiplayerServicePublicNonVirtuals.GetSessionsAsync(System.String,System.String,System.String,System.String,Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionVisibility,System.UInt32,System.Boolean,System.Boolean,System.Boolean,System.UInt32)
Attributes
Windows.Foundation.Metadata.DeprecatedAttribute Windows.Foundation.Metadata.OverloadAttribute

Remarks

Calls V105 GET /serviceconfigs/{scid}/sessions or /serviceconfigs/{scid}/sessiontemplates/{session-template-name}/sessions

Applies to