Hello everyone.
I'm trying to implement just a simple function that deletes the master player in playfab.
The problem that I am facing at the moment is that whenever I run this method in Unity, the following message appears (and the function is not executed properly):
Opps Something went wrong: /CloudScript/ExecuteFunction: Cloud script function MainFunction returned value that was too large
This is the code that I'm using for calling the function
PlayFabCloudScriptAPI.ExecuteFunction(new ExecuteFunctionRequest() { Entity = new PlayFab.CloudScriptModels.EntityKey() { Id = PlayFabSettings.staticPlayer.EntityId, //Get this from when you logged in, Type = PlayFabSettings.staticPlayer.EntityType, //Get this from when you logged in }, FunctionName = "MainFunction", //This should be the name of your Azure Function that you created. FunctionParameter = new { MasterID = localPlayer_PlayfabID }, //This is the data that you would want to pass into your function. GeneratePlayStreamEvent = false //Set this to true if you would like this call to show up in PlayStream }, (ExecuteFunctionResult result) => { if (result.FunctionResultTooLarge ?? false) { Debug.Log("This can happen if you exceed the limit that can be returned from an Azure Function, See PlayFab Limits Page for details."); return; } Debug.Log($"The {result.FunctionName} function took {result.ExecutionTimeMilliseconds} to complete"); Debug.Log($"Result: {result.FunctionResult.ToString()}"); }, (PlayFabError error) => { Debug.Log($"Opps Something went wrong: {error.GenerateErrorReport()}"); });
And this is the Azure function:
[FunctionName("MainFunction")] public static async Task<OkResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", "delete", Route = null)] HttpRequest req, ILogger log) { var request = new DeleteMasterPlayerAccountRequest() { PlayFabId = req.Query["MasterID"] }; var taskRequest = await PlayFabAdminAPI.DeleteMasterPlayerAccountAsync(request, null, null); var stringResult = taskRequest.Result.ToString(); string responseMessage = string.IsNullOrEmpty(stringResult) ? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response." : $"Hello, user. This HTTP triggered function executed successfully."; return new OkResult(); }
I've been trying to find a reason as to why Unity says that the returned value was too large. Even when I'm putting a simple method such as a HelloWorld method, it still says the same thing.