question

An Tran avatar image
An Tran asked

How to sync Player Key Value Data from Playfab with photon customization?,

Hi everyone, I'm currently stucking at syncing player customization stored from Playfab player data to Photon when instantiate with other players. In the room, I will instantiate the player and have them see and interact with each other before actually entering to the gameplay. I allow players to change their appearance and update each body parts key value to playfab before instantiate into the room, but when instantiate to the room all of the players in the room appearance will have the same customize appearance to the local player. Currently, I haven't used any code with the setcustom properties from photon yet, only the playfab get request data and update it to the player. Can I have some advices on how to sync customize appearance from playfab player key values data with Photon so that it will sync and show correctly each player customization when instantiate?

Player DataphotondataPlayer InventoryCharacter Data
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

·
Seth Du avatar image
Seth Du answered

There are 2 basic ways to do get customization data from players.

  • When players are connected, the server calls PlayFab API to get Player Data and then broadcast customization data to other players.
  • The server broadcasts the player ID when they are connected, and the client call PlayFab Client API to get Player Data when receives the player ID.
2 comments
10 |1200

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

An Tran avatar image An Tran commented ·

Hi @SethDu,

Thank you so much for your response. I have already called the PlayFab APi to get the player data, and it will have that same customize for all other players as well. May I ask you how can i broadcast customization data to other players?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ An Tran commented ·

This "broadcast" function is not PlayFab feature, and you need to write your own method in the server build. Since you are using Photon, you may find dedicated support from Photon Community.

I am not sure if it can help, but you can refer to this external thread on java - What is the most appropriate way to write a multiplayer server? - Stack Overflow

0 Likes 0 ·

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.