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 !