Skip to content

Instantly share code, notes, and snippets.

@JoshuaStrunk
Last active July 20, 2016 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshuaStrunk/4b9a771de26a73e4842f8cf5a9a71823 to your computer and use it in GitHub Desktop.
Save JoshuaStrunk/4b9a771de26a73e4842f8cf5a9a71823 to your computer and use it in GitHub Desktop.
/*
The line of code that uses ClientAPI to execute the example cloudscript
This assumes playerData00 is a string defined elsewhere and
allTitleData.Data is a Dictionary<string,object> defined elsewhere
*/
PlayFabClientAPI.ExecuteCloudScript(
new ExecuteCloudScriptRequest(){
FunctionName = "exampleSetTitleData",
FunctionParameter = new //This is a C# Object with an Anonyommous Type see https://msdn.microsoft.com/en-us/library/bb397696.aspx DO NOT USE new object {}
{
Key = playerData00,
Value = allTitleData.Data["titleData00"]
},
RevisionSelection = CloudScriptRevisionOption.Latest
},
result => { //Handle the result from your cloudscript here or don't you do you },
error => {
/*
Handle any errors that resulted from the API call HUGE NOTE THIS DOES
NOT GET CALLED IN THE EVENT OF AN EXPECTION IN YOUR CLOUDSCRIPT
*/
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment