This should probably be two questions, but:
My code sends a custom event via Client.WritePlayerEvent().
This event has a Rule attached to trigger a CloudScript hander.
I am unsure of what the data is in the handler's context.playStreamEvent is, exactly, and where it comes from.
So question 1:
Is context.playStreamEvent the exact object that is returned from the Client.WritePlayerEvent()?
That is, the exact JSON Dict I see in PlayStream Event History?
That object appears to be mirrored in the "TriggeringEventData" key of the resulting CloudScript execution, also as seen in the PlayStream Event History, but missing the "CustomTags" and "Reserved" keys.
Question 2:
To what Playstreameventmodel does a custom event conform to?
There are many models defined, but I could not find documentation for a "custom" or "generic" case.
Example usage (Unity API):
PlayFab.PlayFabClientAPI.WritePlayerEvent(WriteClientPlayerEventRequest)
The PlayStreamData look like:
{ "EventName": "My_Event_That_Triggers_A_Rule", "EventNamespace": "title.0000", "Source": "0000", "EntityType": "player", "TitleId": "0000", "EventId": "goghohgds8hrgsf5", "EntityId": "dsljhds89gsdhogsd", "SourceType": "GameClient", "Timestamp": "2017-09-14T18:55:17.5004227Z", "History": [], "CustomTags": null, "Reserved": null, "body_key_0": "body_value_0", "body_key_1": "body_value_1", "body_key_2": "body_value_2", "body_key_3": "body_value_3", "body_key_4": "body_value_4", }
In the CloudScript handler's context.playStreamEvent, where do I find this data?
For instance, would
context.playStreamEvent.EventName = "My_Event_That_Triggers_A_Rule"?
and
context.playStreamEvent.body_key_4 = "body_value_4"?
many thanks,
-heathcarlisle