In my game, a player can block other players and the PlayFabIds of the blocked players are stored in his ReadOnlyData. The player can also unblock blocked players if he wants. But I don't know how to remove a certain PlayFabId from ReadOnlyData because it is one big string.
For example, how can I remove the PlayFabId 57440D2996790D06 from this ReadOnlyData key/value pair in CloudScript?
Key:
BlockedPlayers
Value(blocked PlayFabIds):
57440D2996790D06,88440D2996790D06,99440D2996790D06
I get the key/value pair like this in CloudScript:
var friendid = args.FriendId; // it is: 57440D2996790D06 var key = "BlockedPlayers"; var blockedplayers = server.GetUserReadOnlyData({PlayFabId: currentPlayerId, Keys: "BlockedPlayers"}); if (blockedplayers.Error == null) { if ((blockedplayers.Data.hasOwnProperty(key)) && (blockedplayers.Data[key].Value != "") && (blockedplayers.Data[key].Value != null)) { var jsondata = blockedplayers.Data[key].Value;