Hello, I try sending json data as function parameter to save player data in bulk. However, after I send request to save data and the call is successful, nothing is saved at all. I tried it in Game Manager and it work fine but doesn't work when run on Unity. Here is my client code
public void SavePlayerData(){ PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest() { FunctionName = "SavePlayerData", FunctionParameter = new {dataToSave = playerData.DataToJson ()}, GeneratePlayStreamEvent = true }, result => { string log = result.Logs[0].Message; print(log); print("save data complete"); }, OnRequestFailure); } public string DataToJson() { JObject jsonData = new JObject(); jsonData["name"] = "myName"; return jsonData.ToString(); }
Here is my server code
handlers.SavePlayerData = function(args, context) { var dataToSave = args.dataToSave; //as JSON log.debug(dataToSave); var request = server.UpdateUserData({PlayFabId: currentPlayerId, Data: dataToSave}); }