Hi,
I don't really understand why this error occurs:
"Level": "Error", "Message": "PlayFab API request error", "Data": { "api": "/Server/WritePlayerEvent", "request": { "PlayFabId": "691A5BXXXXXXXXX", "EventName": "Add_Missing_Char_Data", "body": [ { "CharacterId": "482XXXXXXXXXXX", "CharacterName": "Test", "CharacterType": "Server" }, { "CharacterId": "90C4XXXXXXXXXX", "CharacterName": "SubbaKerl", "CharacterType": "Server" } ] }, "result": null, "apiError": { "code": 400, "status": "BadRequest", "retryAfterSeconds": null, "error": "InvalidParams", "errorCode": 1000, "errorMessage": "Invalid input parameters", "errorHash": null, "errorDetails": { "EventName": [ "The EventName field is required." ], "PlayFabId": [ "The PlayFabId field is required." ] } } } } ], "ExecutionTimeSeconds": 0.0554118, "ProcessorTimeSeconds": 0.00329, "MemoryConsumedBytes": 42792, "APIRequestsIssued": 3, "HttpRequestsIssued": 0, "Error": { "Error": "CloudScriptAPIRequestError", "Message": "The script called a PlayFab API, which returned an error. See the Error logs for details.", "StackTrace": "Error\n at Object.server_request (Script:181:24)\n at Object.server.WritePlayerEvent (Script:636:73)\n at handlers.XXXXX (50758-.CloudScript.js:316:20)\n at Object.invokeFunction (Script:117:33)"
What I am trying to achieve is to write a custom player event from within a cloudscript. As you can see above, the request provides an "EventName" as well as a "PlayFabId". Still it gives an error that "The EventName field is required." and "The PlayFabId field is required.".
Could it be possible that this has something to do with the fact that I am trying to write a custom player event withtin an action that was already called due to another custom event?
If so, why? And why does it give me this strange error?
My code to call the event looks as follows:
server.WritePlayerEvent({ PlayFabId: context.playerProfile.PlayerId, EventName: "Add_Missing_Char_Data", body: chars });
P.S.: I anonymized the Char and PlayFab IDs in the script above. The PlayFabId as well as the Event Name is correct and exist.
Thanks in advance.
Best