I want to do the following when a player logs:
-Add items and a default user data (if logging in for the first time)
-Get the account info
-Get user data
-Get inventory of player
I need all of these as we show user's display name in lobby (received in account info), some basic stats like level & xp (stored in userdata), and his equipped items in a 3d scene.
In another topic, it was suggested to use playstream events to add default items and user data, but I don't think that approach would work for me, since my client APİ calls and cloudscript function called by playstream event would not be synchronous.
What I got so far:
1) When login is successful, call a single cloudscript function from client. The function initializes inventory & basic data if it is first login(not sure how to check this in cloudscript). Then, it calls server API functions to get account info, user data and inventory, then returns them to the client in a single response. Not sure how to accomplish this part in cloudscript, though.
2) After a successful login, call a single cloudscript function that only initialized inventory & basic data if it is the first login. Then, use client API to get other necessary data from Playfab. Would making 3 simultaneous client API calls be a problem?
What would be the best approach here?