Edit

Share via


MultiplayerService Class

Definition

Handles interactions with an Xbox Live service endpoint on a server.

[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public sealed class MultiplayerService
type MultiplayerService = class
    interface __IMultiplayerServicePublicNonVirtuals
    interface __IMultiplayerServiceProtectedNonVirtuals
Public NotInheritable Class MultiplayerService
Inheritance
MultiplayerService
Attributes
Windows.Foundation.Metadata.MarshalingBehaviorAttribute Windows.Foundation.Metadata.ThreadingAttribute Windows.Foundation.Metadata.VersionAttribute

Properties

MultiplayerSubscriptionsEnabled

Indicates whether multiplayer subscriptions are currently enabled.

Methods

ClearActivityAsync(String)

Clears the user's current activity session for the specified service configuration ID.

ClearSearchHandleAsync(String)

Clears the search handle that is associated with the session.

DisableMultiplayerSubscriptions()

Stops multiplayerservice connectivity via Real Time Activity (RTA).

EnableMultiplayerSubscriptions()

Starts multiplayerservice connectivity via Real Time Activity (RTA), for two purposes:

  1. Subscriptions to changes on specific sessions, using the MultiplayerSession object.
  2. Automatic removal of members from sessions when the collection underlying this multiplayer subscription is broken.

This method does not actually make the connection, but enables the connection, and helps track its lifetime.

GetActivitiesForSocialGroupAsync(String, String, String)

Gets the current activity for a social group of users associated with a user that is designated as the owner of the session.

GetActivitiesForUsersAsync(String, IVectorView<String>)
GetCurrentSessionAsync(MultiplayerSessionReference)

Gets a session object, with all of its attributes, from the server.

GetCurrentSessionByHandleAsync(String)

Gets a session object with all its attributes from the server, given a session handle id. A handle is a service-side pointer to a session. The handleid is a GUID identifier of the handle. Callers will usually get the handleid either from another player's MultiplayerActivityDetails, or from a protocol activation after a user has accepted an invite.

GetSearchHandlesAsync(MultiplayerQuerySearchHandleRequest)

Queries for the all search handles that references the searchable sessions given the specific query. There is no paging or continuation, and the multiplayer service will limit the number of items returned to 100.

GetSearchHandlesAsync(String, String, String, Boolean, String)

Queries for the all search handles that references the searchable sessions given the specific query. There is no paging or continuation, and the multiplayer service will limit the number of items returned to 100. Call GetSearchHandlesAsync(MultiplayerQuerySearchHandleRequest^ ) instead.

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

GetSessionsForUsersFilterAsync(String, String, IVectorView<String>, String, MultiplayerSessionVisibility, UInt32, Boolean, Boolean, Boolean, UInt32)
SendInvitesAsync(MultiplayerSessionReference, IVectorView<String>, UInt32)
SendInvitesAsync(MultiplayerSessionReference, IVectorView<String>, UInt32, String, String)
SetActivityAsync(MultiplayerSessionReference)

Sets the passed session as the user's current activity, which will be displayed in Xbox dashboard user experiences (e.g. friends and gamercard) as associated with the currently running title. If the session is joinable, it may also be displayed as joinable in those user experiences.

SetSearchHandleAsync(MultiplayerSearchHandleRequest)

Creates a search handle associated with the session. The visibility of the session is dependent on its search handle. While you can create an searchable session, it is not queryable and visible to others unless you have the associated search handle committed as well.

SetTransferHandleAsync(MultiplayerSessionReference, MultiplayerSessionReference)

Extends the access rights for the caller from the origin session to the target session. For example, in a title with a lobby session and a game session, the title could put a transfer handle linking the lobby to the game inside the lobby session. Users invited to the lobby can use the handle to join the game session as well. The transfer handle is deleted once the target session is deleted.

TryWriteSessionAsync(MultiplayerSession, MultiplayerSessionWriteMode)

Attempts to write a new or updated multiplayer session to the service. The passed multiplayerSession must have a valid MultiplayerSessionReference set on it. The purpose of this method is to give the caller additional details on the failure or success of the operation.

This method returns a WriteSessionResult instead of throwing an exception, but only in cases where the write failed for a reason that is expected to occur during normal operation.

TryWriteSessionByHandleAsync(MultiplayerSession, MultiplayerSessionWriteMode, String)

Attempts to write a new or updated multiplayer session to the service, using the specified handle to the session.
A handle is a service-side pointer to a session. The handleid is a GUID identifier of the handle. Callers will usually get the handleid either from another player's MultiplayerActivityDetails, or from a protocol activation after a user has accepted an invite. The purpose of this method is to give the caller additional details on the failure or success.

This method returns a WriteSessionResult instead of throwing an exception, but only in cases where the write failed for a reason that is expected to occur during normal operation.

WriteSessionAsync(MultiplayerSession, MultiplayerSessionWriteMode)

Writes a new or updated multiplayer session to the multiplayer service.

WriteSessionByHandleAsync(MultiplayerSession, MultiplayerSessionWriteMode, String)

Writes a new or updated multiplayer session to the service, using the specified handle to the session.
A handle is a service-side pointer to a session. The handleid is a GUID identifier of the handle. Callers will usually get the handleid either from another player's MultiplayerActivityDetails, or from a protocol activation after a user has accepted an invite.

Events

MultiplayerSessionChanged

Registers for multiplayer session change notifications. Event handlers receive MultiplayerSessionChangeEventArgs^.

MultiplayerSubscriptionLost

Notification sent when a multiplayer connectivity via RTA is lost or stopped. Event handlers receive Windows::Networking::Sockets::RealTimeActivityMultiplayerSubscriptionsLostEventArgs^.

Applies to