question

Deekshith avatar image
Deekshith asked

Clone player info to other title/studio

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?

Player DataCloudScriptPlayer Inventory
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

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

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.