When Calling ILobbyService.UpdatePlayerAsync, or ISession.CurrentPlayer.SetProperties, you can pass a dictionary of PlayerProperty for custom player data. You should review Update Player Data documentation to understand how to create player data, when creating a session, or updating at a later point.
When setting player data, it states the following:
Custom game-specific properties to add, update or remove from the player (e.g. role or skill). To remove an existing property, include it in data but set property object to null. To update the value to null, set the value property of the object to null.
This breaks down to the following lifecycle of player data:
- To Update/Add player data: Any key included in the update payload will overwrite the existing key or create a new one.
- Unchanged keys: Any existing keys omitted from the payload will be left exactly as they are.
- To delete player data: If you want to explicitly remove a data key from the player, you include the key in the update but assign the whole player property object to null.
- To clear player data, but not delete: This is achieved by setting the player property value to null, but maintaining the Player Property Object