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?
Answer by Citrus Yan · Nov 08, 2019 at 05:48 AM
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:
Will you be able to retrieve that data after few retries?
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?
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.