question

Choi Yan Lok avatar image
Choi Yan Lok asked

Is FunctionParameter of player_executed_cloudscript not recorded in event history?

Whenever a player called an executeCloudsciprtRequest, it creates an event called player_executed_cloudscript. It seems like the function result is recorded in the event.

However, it seems like the FunctionParameter (sent by the player in the execute request) is not recorded. Is there a way to also store the function parameter alongside with the result in the player_executed_cloudscript event?

Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

No, the FunctionParameter property is not recorded in the player_executed_cloudscript event . However, you can log the function parameters in the functions results, for instance, like this:

handlers.helloWorld = function(args,context){
    log.info("Function Parameters: " + JSON.stringify(args));
    log.info("hello world");
}

The parameters will then be recorded in the player_executed_cloudscript event:

…

"CloudScriptExecutionResult": {
    "FunctionName": "helloWorld",
    "Revision": 180,
    "Logs": [
      {
        "Message": "Function Parameters: {\"p1\":1,\"p2\":2}",
        "Level": "Info"
      },
      {
        "Message": "hello world",
        "Level": "Info"
      }
],

…

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Choi Yan Lok avatar image Choi Yan Lok commented ·

Thank you for your detailed answer. I originally thought the log is only returned to the client, glad I could use it for storing the params.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.