Master client switch

Options
Hi,
In case the master-client disconnects and someone else becomes the new master-client, how can he get reference variables to the transferred scene-objects?

Comments

  • Tobias
    Options
    That client will already know the scene objects (every client does). The new master client is automatically owner and can send updates.
    There is no list of game objects that switched control recently, sorry. I think you can go through all PhotonViews and check if they are scene objects.
  • paskuniak
    Options
    Hi Tobias,

    So let's say "I" become the new master-client. How can I send updates (eg. change its position) without a reference variable?
    And if there's no other way, how can I get a list of all the PhotonViews?
  • Tobias
    Options
    If a PhotonView observes a script, PUN will call OnPhotonSerializeView() automatically. You don't have to know which ones are yours - PUN does know.
    If you don't use that, then you could ask Unity for a list of PhotonViews and check each.