Room Properties

carmine
carmine ✭✭
This is what I'm trying to do: Player creates a room and is in a lobby where they can change maxplayers, and other custom properties (like map, etc.)

- If the player creates the room with maxPlayers = 16.
- Then changes it with PhotonNetwork.room.maxPlayers = 8;

When someone else does a RoomList it is still showing as 16.

Am I doing something wrong or forgetting to call something?

-Carmine

Comments

  • Very good question. Hopefully I'm not hijacking your thread with this, but I'd like to extend your question a little bit: Which properties in a room are local, which are synchronized between clients in a room?
  • The room list in the lobby will be updated but might take a moment to do so. We send those updates with a low frequency to avoid overhead. We also only send this, when you are in the lobby on the master (not in a room).
    Client side, the room listing is automated, so you can't do anything wrong with that.

    As for properties:
    We now added a list to name properties which should be sent to the lobby and go into the room listing. Aside from the well known properties, you can name some props, that should be available to users looking for a room.
    This is an upcoming change in v1.9. Currently, all custom properties are sent to the lobby (which might become too much).

    Aside from those you forward to the lobby, properties are room- or even actor-bound. I think I now implemented those to be always broadcast (in room), so all changes will be sent to other players (in room) and applied locally. This is done with "regular" speed (roundtrip time plus a bit).
  • Tobias wrote:
    The room list in the lobby will be updated but might take a moment to do so. We send those updates with a low frequency to avoid overhead. We also only send this, when you are in the lobby on the master (not in a room).
    Client side, the room listing is automated, so you can't do anything wrong with that.

    As for properties:
    We now added a list to name properties which should be sent to the lobby and go into the room listing. Aside from the well known properties, you can name some props, that should be available to users looking for a room.
    This is an upcoming change in v1.9. Currently, all custom properties are sent to the lobby (which might become too much).

    Aside from those you forward to the lobby, properties are room- or even actor-bound. I think I now implemented those to be always broadcast (in room), so all changes will be sent to other players (in room) and applied locally. This is done with "regular" speed (roundtrip time plus a bit).

    Tobias,

    In my scenario
    Player 1 - Not in any rooms. Calling RoomList (looking for something fun to join)

    Player 2 - Has made a room. Changes maxPlayers.

    Player 1 (outside of the room or any room for that matter) is not seeing the maxPlayers change. How long is "a moment". Do I need to call something else besides "RoomList"

    When is 1.9 coming out? It seems like it might solve some of my problems.. thanks!
    -Carmine
  • Between 3 and 10 seconds. Depends on lag and luck :)
    I guess v1.9 comes this week or next.
  • Tobias wrote:
    Between 3 and 10 seconds. Depends on lag and luck :)
    I guess v1.9 comes this week or next.

    Hey Tobias. Thanks for the quick reply, but I'm just not seeing it (I am seeing when rooms are created and lost) but the property changes just aren't coming up. To be sure.

    Player one is doing the following

    OnGUI()
    {
    Room[] roomList = ... get room list
    foreach(Room room in roomList)
    {
    display it...
    }
    {

    Player 2 (in the room is doing the following)
    Calls just this one line of code.
    PhotonNetwork.room.maxPlayers = 8;


    That's the proper way to change the players while in a room and the proper way to get a room list?

    -Carmine
  • I FIGURED IT OUT!!

    After a good nap, I realized:
    I had PhotonNetwork.isMessageQueueRunning = false after joining a room.
    Originally I had players go straight into the game but now I'm inserting this pre-game config/lobby.

    Sorry to have taken up so much of your time.

    -Carmine
  • OH!
    That's a good reason why it's not working! :lol:
    Good to read it's working...