> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblMultiplayerManagerGameSessionSetSynchronizedProperties

> XblMultiplayerManagerGameSessionSetSynchronizedProperties

# XblMultiplayerManagerGameSessionSetSynchronizedProperties

Sets the value of a custom property for the game session, using `XblMultiplayerSessionWriteMode::SynchronizedUpdate`.

## Syntax

```cpp theme={null}
HRESULT XblMultiplayerManagerGameSessionSetSynchronizedProperties(  
         const char* name,  
         const char* valueJson,  
         void* context  
)  
```

### Parameters

*name*   \_In\_z\_\
Type: char\*

The name of the custom property to set.

*valueJson*   \_In\_z\_\
Type: char\*

The value to assign to the property, as a JSON string.

*context*   \_In\_opt\_\
Type: void\*

Optional. The application-defined data to correlate the [XblMultiplayerEvent](/reference/live/xsapi-c/multiplayer_manager_c/structs/xblmultiplayerevent) to the initiating call.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

This function sets the value, represented as a JSON string, of a custom property for the game session. Custom properties can be changed at any time. If custom properties are shared between devices, or may be updated by several devices at the same time, use this function to ensure atomicity and resolve any conflicts between devices while changing the values of those cusotm properties. If a custom property isn't shared across devices, use the [XblMultiplayerManagerGameSessionSetProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetproperties) function instead to change the value of that custom property. <br />The service may reject the request to change the custom property if a race condition occurs due to a conflict. If the request is rejected, the service returns `HTTP_E_STATUS_PRECOND_FAILED`. If a conflict occurs, re-evaluate the need to change the custom property and, if needed, call this function again to re-submit the request.  <br />The result of this function is delivered as a multiplayer event with an event type set to `XblMultiplayerEventType::SessionSynchronizedPropertyWriteCompleted`. You can call [XblMultiplayerManagerDoWork](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerdowork) to retrieve multiplayer events.

## Requirements

**Header:** multiplayer\_manager\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[multiplayer\_manager\_c](/reference/live/xsapi-c/multiplayer_manager_c/multiplayer_manager_c_members)\
[XblMultiplayerManagerGameSessionSetSynchronizedHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetsynchronizedhost)\
[XblMultiplayerEvent](/reference/live/xsapi-c/multiplayer_manager_c/structs/xblmultiplayerevent)


## Related topics

- [XblMultiplayerManagerGameSessionSetSynchronizedHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetsynchronizedhost.md)
- [XblMultiplayerManagerGameSessionSetProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetproperties.md)
- [XblMultiplayerManagerGameSessionPropertiesJson](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionpropertiesjson.md)
- [XblMultiplayerManagerJoinGame](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerjoingame.md)
- [Multiplayer Manager API overview](/services/xbox-services/multiplayer/mpm/concepts/live-multiplayer-manager-api-overview.md)
