question

Alex Ong avatar image
Alex Ong asked

PlayStream Action Execute Entity Cloud Script

I have setup a Rule for Event type playfab.authentication.logged_in, the action is Execute Entity Cloud Script as below screenshot

I also add below code in my CloudScript

handlers.startOfflineQuest = function (args, context)
{
    var playerStatUpdatedEvent = context.playStreamEvent;
    var request = {
        PlayFabId: currentPlayerId,
        Data: {
            "HighSkillContent": "true"
        }
    };
    var playerInternalData = server.UpdateUserInternalData(request);
    log.info('Unlocked HighSkillContent for ' + context.playerProfile.DisplayName);
    return { profile: context.playerProfile };
}

The startOfflineQuest seems like is not executed.

Do anyone have an idea on how to make Execute Entity Cloud Script action execute a cloudscript method.

Thanks!





setloginaction.png (54.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

·
Hernando avatar image
Hernando answered

`playfab.authentication.logged_in` is still in the preview state, and its availability is not guaranteed. We recommend that you set the Event Type to `com.playfab.player_logged_in`, this event can be triggered when a player logs in.

6 comments
10 |1200

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

Alex Ong avatar image Alex Ong commented ·

Thank you for your reply! I will replace that.

How about player.sessions.cklient_focus_changes?

Do you have an idea on how to make Execute Entity Cloud Script action execute a cloudscript method ?

0 Likes 0 ·
Alex Ong avatar image Alex Ong commented ·

I would like to trigger an action for Event type player.sessions.cklient_focus_changes

0 Likes 0 ·
Hernando avatar image Hernando Alex Ong commented ·

player.sessions.cklient_focus_changes should work fine for you, please refer to this link for more information: https://docs.microsoft.com/en-us/gaming/playfab/api-references/events/#session

0 Likes 0 ·
Alex Ong avatar image Alex Ong Hernando commented ·

Thanks for your respond @Hernando. Before your reply, I already found the link you shared and read thru it but I not able to get it working. Do you have a sample on how to do server.UpdateUserInternalData in Execute Entity Cloud Script (not Execute Cloud Script). Thank you.

0 Likes 0 ·
Show more comments
Avlonitis Spyros avatar image Avlonitis Spyros commented ·

Execute Entity Cloud Script is not available when I am trying to create a rule. Has something changed?

Is it ok to use ExecuteCloudScript in order to fire a cloudscript function when a new player is added? And if yes can you provide some context of how to use entity api calls? Thanks.

0 Likes 0 ·
playfab.jpg (127.6 KiB)

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.