How to make all clients to be disconnected when MC leave the room or disconnect from photon?

Hello @JohnTube How are you?

I 've got many great answers from you. Thank you.
I changed my plan and now I've got a new question.

I have one master client which has a game script for the normal clients.
The normal clients have a normal client-side script.
And the master client creates the room.
So if there is no room created by a master client, the client's can't see any created room.
And also, if the master client leaves the room, the other clients should be disconnected.
But they don't disconnect.
Is there any solution? I think there is no method for destroying the room... But I think there are many solutions for this :)
Please kindly give me a help. Thanks

Comments

  • Hi @sweetmei25,

    First, I need to clarify something:

    And the master client creates the room.
    Master Client exists only inside rooms.
    There is no Master Client outside of rooms.

    And also, if the master client leaves the room, the other clients should be disconnected.
    But they don't disconnect.
    Is there any solution?
    Yes, when the other clients detect a Master Client switch they leave the room. There is a callback for Master Client switch.

    I think there is no method for destroying the room..
    Rooms are automatically cleaned up by Photon Server when they are empty and EmptyRoomTTL expires.

    However, if you want rooms to not be joinable anymore you could:

    1. close the room; set IsOpen = false
    2. optionally hide them from random matchmaking: IsVisible = false
  • Hi @JohnTube

    Yes, if one client inside the room disconnected, the other clients should be disconnected.
    Is there any solution?
Sign In or Register to comment.