Destroying rooms

alexanderrico
edited May 2011 in Photon Server
We're using photon socket server for a multiplayer game built in unity.
We are currently doing some tests: The clients are connecting to the server and sending a join operation to a room (game) called "match".
We're using three clients and all the messages, operations and events are working well, but when the last client leaves, the room doesn't seem to be "destroyed", and if we try to connect again the communication starts to fail because the last room's instance is still there and we need the room to be created again when the clients send a new join operation, because there's some properties that need to be initialized.
My questions are, does the rooms get destroyed after the last client leaves? is there a timeout for this purpose when the room has 0 actors? is there a way to destroy the room if the actor count is 0?

Thanks.

Comments

  • Maybe one of your clients got closed before it disconnected?
    If your client does not disconnect (crash, client close, whatever reason), the server has to timeout the client. The timeout depends on the Rountrip Time but you can set a maximum timeout in the PhotonServer.config. In the SDK this is by default: MaximumTimeout="30000".

    You can make your client disconnect in OnStop(), which saves some confusion.