question

icolino avatar image
icolino asked

How can I be sure that player will have its data, imediately after login if I am using playstreamevent?

Hi, I am using cloudscript to start the player with some default data.

But it seems that data is sometimes there and sometimes it isn't there on player login success.

I get the result back from a callback to get the data to the device.

But the result is there most of the time, sometimes it is null.

Could be that the event player_added_title is sometimes to slow so that my login passes through but the event still hasn't happened?

Player DataTitle Datadata
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Hi @Icolino,

Looks like you’ve set up a rule triggered by the player_added_title event that will run a Cloud Script function to set some default data for the player, and you were trying to get the default data of that player in the OnLoginSuccess callback from the client, is that right? If that’s the case, there are many possible reasons for that:

  1. The player_added_title event delayed, however, it should be generated in real-time in most cases.
  2. The Cloud Script function wasn’t completed when you request the default data for that player.
  3. The Cloud Script completed, however, the data of that player wasn’t fully updated in the backend server.

Will you be able to retrieve that data after few retries?

2 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.

icolino avatar image icolino commented ·

Hi, thanks for a fast answer.

Those 3 were my guesses as well.

Andl yes I am able to retrieve the data after a few tries, mostly after a second try. I was just thinking if I am doing it correctly and should I be worried if there are too many calls to the playfab when I repeat the data retrieval to my game?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan icolino commented ·

Hi,

Yes, you should control the frequencies of those calls, Exponential backoff (for instance, retries after 1s, 2s, 4s, 8s, ...)is a great way to avoid hitting the request rate.

0 Likes 0 ·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

I have this same issue, too

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.