Closing a room

Options
Hi, in my game currently when the master client leaves, the room that was created by him is still there. I have tried passing over the master client to another player, but so far have no been satisfied with the results.

I am wondering how you would close a room? Something like:



Is there anything like this?

Comments

  • micahlg
    Options
    Ugh, I'm sorry. It won't let me edit my post. Here's the code I am asking if there's something like it:

    void OnPhotonPlayerDisconnected(PhotonPlayer player)
    {
    if(player.isMasterClient)
    {
    PhotonNetwork.CloseRoom(); //closes current room
    }
    }
  • vadim
    Options
    Room is closed after all players leave the room.
    Broadcast RPC from master going to leave to all clients asking them to leave also.
    Or handle master change event on every client and leave.
  • micahlg
    Options
    So something like going through a loop of the players in the room and disconnecting them when the master client leaves?