Get Player Details on Login?


#1

Why is it that we have to call GetPlayerProfile() after we’ve called Login?

Why doesn’t the Login function just return the player profile of the logged in player? I think you’re almost always going to want to know the player details after you’ve logged them in so why not just return the player details in the login response? Or provide a flag that when true attaches the details to the login response.

PlayFab has a means of embedding a bunch of different get data calls in the login call. the response has all the details that were requested saving complicated login flow. We could then just make a single login call and be sure that all the data we need is sent back in one go rather than handling errors in each case e.g. in Login() GetPlayerProfile() and GetPlayerProperties()


#2

Hi Antony,

We have split these details up in order to make the Login API call as performant as possible. There are quite a few processes that happen during a Login call and gathering the other Player related data such as the Profile was causing the Login process to take longer than needed, so they were separated into their own API calls.

I would recommend caching the results of the GetPLayerDetails() call locally on the player device to help with the workload, as it’s fairly safe to assume that the Players’ details will not be updated very often.

Hope this helps, thanks.
Steve


#3

Ok,

I can cache some data. But in the situation where the player plays on multiple devices this is not a good enough solution. I have no way to know if the current device was the last device used by the player and so need to update the cached data. Is there some way we could add a last login time to the login response so that I can compare that with this devices cached last login time so i would then know if this devices cache data is good to use or possible out of date?

This applies to more than player details, it also applies to currency, any arbitrary saved cloud data, etc…

Cheers,
Antony.