I have a player configured in one of the studio's title. The player info here consists of the following :
- Inventory Items along with their custom data which is set
- Player data(including read only and internal data)
- Display name and avatar image url
- Statistics
- Virtual Currency
I need to clone this entire player info and have two scenarios :
- Cloning data in same studio but to a different title
- Cloning data to a different studio
I am aware we need to make multiple API calls here to achieve this.
But the question is
- can this be done in cloudscript? If not, then how can it be done using external server? Any suggestions/links to guide me ?
- And considering the above player info,Is that feasible enough and can all these be cloned to a different title/studio?
Answer by Sarah Zhang · Aug 04, 2020 at 08:35 AM
>> can this be done in cloudscript? If not, then how can it be done using external server?
Technically speaking, CloudScript can access all Server API sets. But PlayFab designs CloudScript for server-side logic, not for administrative purposes. CloudScript also has some usage limits, such as CloudScript execution time cannot exceed 10s, CloudScript execution API requests cannot exceed 25 APIs per time, etc.
So we don’t suggest to do such administrative operations in the CloudScript. You can do it in the administrator tools or external servers.
>> Any suggestions/links to guide me ? And considering the above player info, Is that feasible enough and can all these be cloned to a different title/studio?
All in all, it’s more feasible to clone the player info between different titles in the same studio. The clone between different studios would be less feasible. If you have the requirement that migrating all player account from one studio to another studio, we would suggest you consider contacting the PlayFab engineering team for the solutions.
For migrating the Player’s Virtual Currency, inventory items. These two titles need to have the same Catalogs and Currency types. So you can use this PlayFabCLI tool to call a series of Admin APIs to migrate them. The last update of this tool is a few years ago, so you may need to modify part of the code yourself to make it work fine.
Due to the Player Master Account Id(PlayFabId) is corresponding to the game studio. When title A and title B are in the same studio, the player who have logged in the title A can directly log in to the title B using the same PlayFabId. All the Master Player Account Info would be shared. So you needn’t register the new accounts for them. You can use the same PlayFabId to target the one player’s two title account Ids.
In the administrative tools or the external server, you can cache the secret keys and other settings of two titles, use two instances to do the “get” operation from title A and do the “update” operation to title B migrate player info. You may need to use the following API.
Call GetPlayerCombinedInfo, etc. for Player’s Title A account.
Call GrantItemsToUsers, AddUserVirtualCurrency, UpdateUserData, UpdateUserInternalData, UpdateUserTitleDisplayName, UpdateAvatarUrl, etc. for Player’s Title B account.
I want to have reviews for each catalog item? 1 Answer
Is there any way to backup player data? 1 Answer
how to get a contact email Verification Status 1 Answer
PayPal Return Link Parameters and HTML5 Implementation 1 Answer
Where to store what data? - UserData, CharacterData, PlayerStatistics 2 Answers