question

Brant Steen avatar image
Brant Steen asked

Automation entity_created

I'm trying to create an automation rule to trigger when the title_player_account gets created for a given title.

Looking through the playstream, it looks like this happens in an entity_created event. However, that is not an option in the automation rules.

Is there some other way to trigger on this event? I'm trying to grab the title_player_account entity id at the time of creation. Other events all seem to only give me the master_player_account id.

untitled-2.png (219.5 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

·
Sarah Zhang avatar image
Sarah Zhang answered

Currently, PlayFab hasn’t supported triggering an action from entity PlayStream Events. The possible workaround is to use “com.playfab.player_created” event type instead of “entity_created”. You can refer to the following code to modify the CloudScript function to return the player’s TitlePlayerId.

handlers.handlePlayerCreatedEvent = function (args, context) {

    var request = { "PlayFabId": currentPlayerId };
    var userAccountInfo = server.GetUserAccountInfo(request);
    var titlePlayerId = userAccountInfo.UserInfo.TitleInfo.TitlePlayerAccount.Id;

    return { titlePlayerId: titlePlayerId };

};
10 |1200

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

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.