Photon SetCustomProperties not working for previously connected players

Hi

I have some problem while using SetCustomProperties

The code is like below:

Hashtable playerCountryCode = new Hashtable() { { "CountryCode", "HK" } };
PhotonNetwork.player.SetCustomProperties(playerCountryCode);
PhotonNetwork.JoinRoom(roomName);

3 players connected.

Player1 (First Joined): shows all player's country code properly.
Player2 (Joined secondly): shows Player2 and Player3's country code.
Player3 (Last joined): shows only Player3's country code.

I would like to solve this problem. Please help me to get all player's name correctly for all players. Look forward to hearing from you

Here is the attachment
https://pasteboard.co/HZzrtgA.png

Best Answers

  • sweetmei25
    Answer ✓
    did it myself
  • sweetmei25
    Answer ✓
    ok i will
    Anyway it was strange.
    I just deleted all code and implemented a new code.and it worked.
    I really dont know the reason.
    But i updated the PUN with the latest version.
    I think this solved the problem. but not sure, sorry

Answers

  • This is PUN Classic?

    Do you update the view/display, when new players join? Player 1 should get a callback, when player 2 and 3 join. Each should contain the custom property that each client set before joining the room.
  • Hi.
    Yes, it's PUN Classic.
    Please help me what's wrong... :(
  • What does view/display mean, I have a little knowledge, please let me know...
  • I'm not 100% sure, but looks like your code up there is to remember the country code that is lastly saved.
  • sweetmei25
    Answer ✓
    did it myself
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @sweetmei25,

    It's good that you solved this on your own but it would be better if you shared your solution with others so they can benefit from it in the future.
  • sweetmei25
    Answer ✓
    ok i will
    Anyway it was strange.
    I just deleted all code and implemented a new code.and it worked.
    I really dont know the reason.
    But i updated the PUN with the latest version.
    I think this solved the problem. but not sure, sorry