Delete a room after given time

0 votes
hi,
There is one use case where admin can create a private room and invite a users to play in that room.
here admin can set a time limit for that particular room after time limit reached it will automatically destroy even users are still in the room.
so how can I achieve that?
 
asked Feb 12, 2018 in Discuss & suggest API by mkc110891 (16 points)

1 Answer

+1 vote

Hi,

Using AppWarp S2, you can achieve this feature as it allows you to customise the server side code as well. AppWarp2 is on-premise solution where you get the server side SDK as well as Client side SDK. You can create your own server project using our SDK and customise the server as per your requirement. If you are already using AppWarpS2 then in the Room Adapter class you can write your logic to delete room after specified time using the delteRoom API.

Let me know if you have any further query, I will be happy to help.

Thanks.

answered Feb 13, 2018 by rajeev.etc (1,660 points)
Thanks for the replay.

Yes, I am using AppWarp s2 I want to know that when admin create a private room(dynamic room) at that time he/she can give a time?
If yes and let say, admin, give 6 hr so after 6 hr that room will be destroyed even if there are users in that room.
And one more thing between those 6 hrs, if there is no user for more then 1 hr in room, It will not destroy as well because 6 hr is not completed.
Is this case possible?
Hi,
Can you please reply so we can move further to our game we are stuck here
Thanks
Apologies for delay in response. Could you please let me know how are you creating room? Are you using create room API for it?
we are making a turn based game so we are using createturnroom API for creating room.
In this case, handleCreateRoomRequest adapter method will be called in your Zone adapter class. You can assign a life time for this room here which you can start decreasing in timer metgod and you can delete this room after this life time becomes zero.
ok but if there is no player in that room for more then 1 hour it will be destroyed.
so how to prevent this case?
As you are using  AppWarpS2, you can change the default clean up time for room from 1 hour to whatever is required as per the game requirement.
You just have add an extra key "CleanUpTime" in your AppConfig.json file and provide the value in milli seconds after which you want your room to be deleted if empty continuously.
Ok great. Thanks Rajeev for your quick response.
Hi rajeev now we can successfully remove a room from zone.
Is there any call back function when ever room is deleted from zone?
Like when we delete room from client side using DeleteRoom(room_id), then we are getting the callback on onRoomDestroyed().
The same notification callback will be called in this case as well.
Hi Rajeev, I am not getting the callback. Do I need to enable something from zone side?
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
...