Not receiving OnPlayerPropertiesUpdate on Master client

Options
Dimar
Dimar
edited April 2020 in Photon Server
Hi there. I'm developing mobile VR game in Unity and I'm working with Photon for quite a bit so everything was designed and worked fine, until I decided to launch my game on local Photon server. Previously I developed a game to work on Photon Cloud, but tested it on self-hosted server and it worked similarly. However now I need the game to work in local network, but I tested it on cloud till this moment. I thought it will work as same. Here's what I faced:
I store player health in custom properties of the Player. So everything that relies on some player health (for example healthbars and other widgets) is made of MonoBehaviourPunCallbacks and overrides OnPlayerPropertiesUpdate. So on master I change the player health value and set it to custom properties. On other clients I see that change right away. But I dont see it on the Master itself. I could change health of master client or any other client - clients see it, but master don't.
Again this is happening only on local server. If I connect to cloud server, there is not issue at all.

I use:
Unity 2019.3.9f1, PUN plugin 2.16, Photon Server 4.0.29.11263.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Dimar,

    Thank you for choosing Photon!
    "Broadcast Properties Change" option is not available (RoomOptions.BroadcastPropsChangeToAll). The client who calls SetProperties will not receive PropertiesChange event unless CAS is used. CAS is a workaround to have a consistent behaviour between Photon Cloud and Photon Server.

    Source/More Info.
  • Dimar
    Options
    Hi. Thank you. I was looking for this page, but didn't found.
    Thanks, your advice is worked, but only partially. There is a couple of extra points, for anyone who may find this article in the future:
    - CAS is fixed the problem, but only for second and later setting. As said here "first time creating a new property". So I set some default value before the game so IN game I can receive callbacks on value change.
    - It seems that I just can't set property with CAS without the room. But I can do it without CAS. @JohnTube do you know if it is intended or it is a bug? I failed trying to find something about CAS relative to is room exist or not.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Dimar,

    CAS works only with the server and while joined to the room yes.
    Before joining rooms we may allow caching actor properties internally for the local player to be sent when the player joins a room.