OnRoomPropertiesUpdate not triggered on local Photon Loadbalancer

Hello there,
I'm updating one RoomProperty to be sure one specific data is the same for everyone, and update the UI in the "OnRoomPropertiesUpdate" event.

Setting the property like this:
    /// 
/// Sets the Tracer Bonus value
///
public static void SetTracerBonusValue(this Room p_Room, float[] _value) { p_Room.SetCustomProperties(new Hashtable() { { TracerBonusKey, _value } }); }
And managing the event like this:
    /// 
/// Called when a room's custom properties changed
///
public override void OnRoomPropertiesUpdate(ExitGames.Client.Photon.Hashtable propertiesThatChanged) { base.OnRoomPropertiesUpdate(propertiesThatChanged); if (propertiesThatChanged.ContainsKey(PhotonRoomExtension.TracerBonusKey) && TracerBonusGenerator.instance != null) { TracerBonusGenerator.instance.UpdateUI(); } }
This is working fine when connected to the PhotonCloud, or when using Offline mode.

However, the event OnRoomPropertiesUpdate is never triggered when connected to a self-hosted Loadbalancer (currently on my own PC). I checked with some Debug.Logs to be sure the function was not called at all.
Everyting else is working as intended, so the connection to the server is OK. The property is also well setted, as I have another way of updating the UI on specific events.

The UI does something like this:
public void UpdateUI()
    {
        float[] _values = PhotonNetwork.CurrentRoom.GetTracerBonusValue();

        // Do things with the values
    }
Getting the value is this (and get the correct values):
    /// 
/// Gets the Tracer Bonus value
///
public static float[] GetTracerBonusValue(this RoomInfo p_RoomInfo) { object f_tracerBonus; if (p_RoomInfo.CustomProperties.TryGetValue(TracerBonusKey, out f_tracerBonus)) return (float[])f_tracerBonus; return new float[2] { 0f, 0f }; }

Is it a bug in Photon or something I can fix by modifying the local server?

Thanks !

Comments

  • JohnTubeJohnTube mod
    edited July 17
    Hi @Stephane,

    Thank you for choosing Photon and sorry for the inconvenience.

    This behaviour is expected.
    Read about "Important Changes Since v4.0.29.11263".

    If you can't work with this send us an email to [email protected]
  • Hi,

    Thank you for the link!
    I fixed the issue by updating the UI when a client sets the property, when using local server (which is only for playing in events where wifi is bad).
    Everything works fine and the other clients receive the event as usual.
Sign In or Register to comment.