Expand my Community achievements bar.

When to delete a room?

Avatar

Former Community Member

I want to use automatic room creation and I am not sure when to delete a room. Can you please advice how can I detect that room is no longer needed?(session has ended or something)

The only solution so far I have is to have server-side script which will check room states by timer and delete them if needed.

Best Regards, Aleksey

2 Replies

Avatar

Former Community Member

Hi Aleksey,

I think you're on the right approach here - we recommend you keep a list/DB

of rooms you have created, and periodically (maybe, once per day) cycle

through the rooms and delete them if they aren't active. This would all

happen from your server.

(Raff should chime in here with the call to detect whether a room is

active).

nigel

Avatar

Employee

Yes, currently we don't have a way to automatically delete rooms (but it's in my todo list )

So, there are actually two way to manage room cleaning:

1) as Nigel says, keep track of your rooms and run a "cleanup" task once in a while (or just reuse your already existing rooms).

   The server integration modules provide a getRoomInfo method that will return an error "not-active" if the room is not currently running.

2) You can also "listen" to room activity using the server-to-server notification mechanism. You can "subscribe" to room events (start, stop) and you can delete the room when you receive the room end message.

My suggestion is: if you are using / are thinking of using the notification mechanism for other purposes, hook the room notification in there.

If you don't think you need to use the notification mechanism for other purposes, have a cleanup process doing the "dirty work" and remove it when we add support for auto-delete rooms.