room does not destroy.

0 votes

I want to create dynamic room so I am calling method WarpClient.GetInstance().CreateRoom() and passing a random name. then in other player I am calling method WarpClient.GetInstance().GetAllRooms() to get this room IDs. now when I close(terminate) both players, and again open 2nd player, even then earlier room created by player1 still shows in list.

I read that dynamic room destroy automatically when everyone in room leaves.

http://appwarp.shephertz.com/game-development-center/basic-concepts/#rooms

Is there any proper way to create dynamic room or I just have to pass random name to create new room and then get newly created room's ID by calling WarpClient.GetInstance().GetAllRooms().?

Thanks in advance.

asked Jul 4, 2014 in App42 Cloud API-BaaS by patel.sagar2611 (34 points)

1 Answer

0 votes
 
Best answer
Dynamic rooms are automatically destroyed if they remain empty for ~60 minutes. Thats why the room is still present for sometime after you re-connect and check getAllRooms.

You can delete the room from the client side as well - by calling the deleteRoom API by passing the room id.

When you call createRoom, the callback (in ZoneRequestListener) is onCreateRoomDone. This contains the response from the server and you will get the room id also in this callback. So you don't neccessarily need to do getAllRooms to know the room id of the newly created room.
answered Jul 7, 2014 by dhruvc (1,099 points)
selected Jul 8, 2014 by patel.sagar2611
Awesome. Thanks a lot !
Thanks for the quick update. So I've noticed that when I set the cleanupTime to 0 I cannot join the room as I am assuming that the room is getting deleted before the first player can even join. Is there anyway to fix this? I would just like to have a setup where I can create a room and it stays open for a certain period of time and automatically closes if nobody joins but if somebody joins then it closes immediately after the last person leaves.
Could you please let us know your scenario why do you want to keep the cleanupTimer to 0? We have given this additional feature in order to give the user flexibility to specify the cleanup time for idle rooms so that he does not have to wait for 60 minutes.
Although In this case, we recommend our on premise solution (AppWarpS2) where users have the full authority to override the functionality himself.

AppWarpS2 link - http://appwarps2.shephertz.com/
I would just like to have a setup where I can create a room and have players join it and then as soon as the last player leaves the room is deleted immediately just as it used to be described in the API documentation.
I would recommend you to use the shortest possible value (say 5 secs) so that when user creates a room and he immediately joins it within 5 secs and when room is idle after all players leave the room, it will wait for 5 secs and room will be deleted.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...