New clients can't find the Master Client?

Options
We have a strange problem:

We are developing an FPS game and when 2 players are in a room, we select the one with the better connection (lowest ping) to be the new master by calling
PhotonNetwork.SetMasterClient(PhotonNetwork.player);

However, if this new master is not the original master (the creator of the room), when a new client connects, it still gets the original creator as the master client. So, basically this happens:

- Player 1 connects to the room, is creator and master.
- Player 2 connects to the room, just a client.
- At some point in the game, we compare their pings and find out that the Player 2 has a better connection. We select Player 2 as the new master.

- Player 1 Debug.Log(PhotonNetwork.masterClient): Player 2
- Player 2 Debug.Log(PhotonNetwork.masterClient): Player 2

- Player 3 connects to the room, just a client.
- Player 1 Debug.Log(PhotonNetwork.masterClient): Player 2
- Player 2 Debug.Log(PhotonNetwork.masterClient): Player 2
- Player 3 Debug.Log(PhotonNetwork.masterClient): Player 1 (WHAT???)

How does this happen? How can we fix this?

Comments

  • Tobias
    Options
    This is done via a simple event and that's not buffered and neither does the server recognize the changed master client at the moment.
    The server will soon define the Master Client and be able to switch it for all clients (and itself) by request of clients.
    Changing the Master Client is not encouraged at the moment. Sorry.
  • dontonka
    Options
    Hello oguzkonya,

    I'm also doing an FPS, any reason why you would do this? I'm not sure to see the benefits of having the master the one that has the best ping with the server except if it execute more transaction with the server that impact the gameplay. Maybe I'm missing something, I'm curious :).

    Cheers,
    Don T.