OnRoomOptionsChange?

Options
Are there callbacks to check if the current room options have changed, e.g. MaxPlayers, IsOpen, PlayerCount? If not, are there plans to implement this? Seems kind of dumb to check them every update.

Apologies if I've missed something blatantly obvious.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @OldPilgrim,

    Thank you for choosing Photon!

    Did you try IInRoomCallbacks.OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) callback?
    the Hashtable's keys would be of type byte and their codes can be found in GamePropertyKey class constants.
  • OldPilgrim
    Options
    @JohnTube thanks for this! Might I suggest that you guys add an else clause similar to below, so that it works in offline mode as well :)

    (beginning line 161 in Room.cs)
            if (!this.isOffline)
            {
                this.LoadBalancingClient.OpSetPropertiesOfRoom(new Hashtable() { { GamePropertyKey.MaxPlayers, value } });
            }
            else
            {
                this.LoadBalancingClient.InRoomCallbackTargets.OnRoomPropertiesUpdate(new Hashtable() { { GamePropertyKey.MaxPlayers, value } });
            }