Edit

Share via


MultiplayerSession.SetCurrentUserMemberCustomPropertyJson Method

Definition

Set a custom property on the current user to the specified JSON string The member must first be joined to the session.

public void SetCurrentUserMemberCustomPropertyJson (string name, string valueJson);
abstract member SetCurrentUserMemberCustomPropertyJson : string * string -> unit
override this.SetCurrentUserMemberCustomPropertyJson : string * string -> unit
Public Sub SetCurrentUserMemberCustomPropertyJson (name As String, valueJson As String)

Parameters

name
String

The name of the property to set.

valueJson
String

(Optional) The JSON string value to assign to the property.

Implements

Microsoft.Xbox.Services.Multiplayer.__IMultiplayerSessionPublicNonVirtuals.SetCurrentUserMemberCustomPropertyJson(System.String,System.String)

Remarks

This method is used to store per-member attributes, for example, during creation of a match ticket session. The client calls the method for each session member. For a match ticket session, the method copies attributes from the /members/{index}/properties/custom/matchAttrs field to the /members/{index}/constants/custom/matchmakingResult/playerAttrs field. They are later combined and processed by the matchmaking service when the session is passed to matchmaking in the call to the MatchmakingService.CreateMatchTicketAsync Method during match ticket creation.

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