OnPhotonCustomRoomPropertiesChanged is never executed.

Hello friend. I am making a multiplayergame using photon. I need that one array of elements to b as custom property as it uses random sorting. but the function OnPhotonCustomRoomPropertiesChanged is never executed. I am afraid that Setting custon is the problem

for(int i=0; i<cardsid.Length; i++){
       
        ExitGames.Client.Photon.Hashtable  hashid = new ExitGames.Client.Photon.Hashtable();  // only use ExitGames.Client.Photon.Hashtable for Photon


            string  keyid;
            keyid=leter+i.ToString();
            hashid[keyid]=cardsid[i];
            PhotonNetwork.room.SetCustomProperties(hashid);
            Debug.Log ("EFGGGEEEEEEEEEE");
        }

and

public void OnPhotonCustomRoomPropertiesChanged(ExitGames.Client.Photon.Hashtable propertiesThatChanged)
    {
        for(int i=0; i<cardsid.Length; i++){
            string  keyid;
            keyid=leter+i.ToString();
            if(propertiesThatChanged.ContainsKey(keyid)){
                cardsid[i]=(int)propertiesThatChanged[keyid];

            }}
    }

Any help please

Which version of PUN are you using?
Your spelling looks correct, the callback should exist.
Did you have a debug log in OnPhotonCustomRoomPropertiesChanged?
Any error in the console?

I don’t have any error in console.but this if statement dont work It just doesn’t executes. I have put a debug log before it and it works but inside the if condition it doesn’t work
Please take a look at the function that sets properties. is it correct?
each card has it key id in the hashtable. Where is the problem?

I have just fixed the problem deleting return inside the first if statement.in

if (id==1&&playerThatShufflesTheCards==0)
        {  playerThatShufflesTheCards++;
            shuffle ();
            Debug.Log ("setup");
         return;

        }

It was my mistake

Good you found it. And thanks for updating us. :slight_smile: