question

gustavo-1 avatar image
gustavo-1 asked

Playstream Rule setup using PlaystreamEventModels

Hi all, I am trying to setup a play stream rule, that will trigger with session_ending.

The link highlighted bellow takes me to a page full of useful play stream events, but its not very clear how to implement them in the rules.

I have tried a bunch of different combinations on the Custom event name field, "session_ended" "Playfab.com.session_ended" and some others ( like using the title id ).

I understand you can call WritePlayerEvent from the client, but the documentations makes it seems like I can use playfabs events (https://api.playfab.com/playstream/events)

to trigger cloud script functions in the rules.

Is this functionality working as intended?

I don't see how if this only works with WritePlayerEvent, why not just ExecuteCloudScript from the client?

Cheers for your time,

Gustavo

tpnqt.png (15.2 KiB)
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

·
JayZuo avatar image
JayZuo answered

You can use PlayFab built-in events, but only the events listed under Standard. For custom event, you must use WritePlayerEvent, other methods are not supported for now. "session_ended" is an entity event which is not supported. For more info, please see this answer: https://community.playfab.com/answers/27705/view.html.

And ExecuteCloudScript can be used to trigger rules. But in this situation, you will need to set triggering event to com.playfab.player_executed_cloudscript and call the ExecuteCloudScript API with the GeneratePlayStreamEvent set to true.

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.

Andy avatar image Andy ♦♦ commented ·

One thing worth pointing out is that setting an action on cloud script that in turn executes a cloud script function is a bad idea (other rule actions are okay). You'd trigger an infinite loop and get your title shut down for using excessively high amounts of cloud script resources. Usually, there's not much reason to set a rule to respond to cloud script events, as you can just do whatever needs to be done in the original cloud script call.

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.