Edit

Share via


MultiplayerSession.SetHostDeviceToken(String) Method

Definition

Sets the device token of the host to use in multiplayer transactions.

public void SetHostDeviceToken (string hostDeviceToken);
abstract member SetHostDeviceToken : string -> unit
override this.SetHostDeviceToken : string -> unit
Public Sub SetHostDeviceToken (hostDeviceToken As String)

Parameters

hostDeviceToken
String

The host device token.

Implements

Microsoft.Xbox.Services.Multiplayer.__IMultiplayerSessionPublicNonVirtuals.SetHostDeviceToken(System.String)

Remarks

The host device token is set in the local cache of the session and written to the multiplayer session directory.

If the system or title calls SetHostDeviceToken and sets peer to host requirements with a call to MultiplayerSession.SetPeerToHostRequirements, the measuring stage of managed initialization assumes that the specified host is the correct host and only measures metrics to that host.

After calling this method, the caller must use MultiplayerService.WriteSessionAsync to write batched local changes to the service.If SetHostDeviceToken is called without calling WriteSessionAsync, it only changes the local session object but does not commit it to the service.

Applies to